--- CMakeLists.txt.orig	2021-09-11 11:39:51.486246000 -0400
+++ CMakeLists.txt	2021-09-11 11:40:10.629689000 -0400
@@ -73,6 +73,8 @@
 		set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_DEFAULT_SOURCE")
 	elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
 		set(FIDO_CFLAGS "${FIDO_CFLAGS} -D__BSD_VISIBLE=1")
+	elseif(CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
+		set(FIDO_CFLAGS "${FIDO_CFLAGS} -D__BSD_VISIBLE=1")
 	endif()
 	set(FIDO_CFLAGS "${FIDO_CFLAGS} -std=c99")
 	set(CMAKE_C_FLAGS "${FIDO_CFLAGS} ${CMAKE_C_FLAGS}")
