From c646b5730596c4ac080b0bd62b5f24da3c4a5eae Mon Sep 17 00:00:00 2001
From: Stephen Hurd <deuce@synchro.net>
Date: Mon, 14 Feb 2022 01:52:13 -0500
Subject: [PATCH] Move defines into CMakeLists.txt

These aren't dynamically detected.
---
 CMakeLists.txt |  3 +++
 xpdevplus.h.in | 11 -----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c27304e..3878adf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,3 +63,6 @@ add_library(xpdevplus STATIC ${SOURCE})
 target_link_libraries(xpdevplus ciolib comio encode hash uifc xpdev)
 target_include_directories(xpdevplus PUBLIC ${XPDevPlus_BINARY_DIR})
 target_compile_options(xpdevplus PUBLIC "SHELL:-include xpdevplus.h")
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+target_compile_options(xpdevplus PUBLIC POSIX_C_SOURCE 200809L _DEFAULT_SOURCE _BSD_SOURCE SPEED_MACROS_ONLY _GNU_SOURCE _FILE_OFFSET_BITS 64)
+endif()
diff --git a/xpdevplus.h.in b/xpdevplus.h.in
index 0afdeeb..f52a451 100644
--- a/xpdevplus.h.in
+++ b/xpdevplus.h.in
@@ -1,17 +1,6 @@
 #ifndef XPDEV_PLUS_H
 #define XPDEV_PLUS_H
 
-#ifdef __linux__
-#define POSIX_C_SOURCE 200809L
-#define _DEFAULT_SOURCE
-#define _BSD_SOURCE
-#define SPEED_MACROS_ONLY 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE 
-#endif
-#define _FILE_OFFSET_BITS 64
-#endif
-
 #cmakedefine WITH_SDL
 #cmakedefine N_CURSES_LIB
 #cmakedefine HAS_INTTYPES_H
-- 
GitLab