--- CMakeLists.txt.orig	2023-03-02 21:25:25 UTC
+++ CMakeLists.txt
@@ -413,7 +413,7 @@ check_include_file( "fcntl.h" HAVE_FCNTL
 check_include_file( "fenv.h" HAVE_FENV_H )
 check_include_file( "inttypes.h" HAVE_INTTYPES_H )
 check_include_file( "limits.h" HAVE_LIMITS_H )
-if( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
+if( CMAKE_SYSTEM_NAME MATCHES "MidnightBSD" )
   check_include_file( "stdlib.h" HAVE_MALLOC_H )
   check_include_file( "sys/endian.h" HAVE_ENDIAN_H )
 else()
