Skip to content

Commit ad71251

Browse files
committed
Changed from _DEFAULT_SOURCE to sys/types.h for macOS support
1 parent e6a40c8 commit ad71251

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ foreach(target libwsv5_static libwsv5_shared)
9595
)
9696

9797
# macOS specific flags for BSD type compatibility
98-
if(APPLE)
99-
target_compile_options(${target} PRIVATE
100-
-D_DEFAULT_SOURCE
101-
)
102-
endif()
98+
#if(APPLE)
99+
# target_compile_options(${target} PRIVATE
100+
# -D_DEFAULT_SOURCE
101+
# )
102+
#endif()
103103
endforeach()
104104

105105
# Optional: Build test program

libwsv5.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
#define _POSIX_C_SOURCE 200809L
1414
#define _DEFAULT_SOURCE
1515

16+
#ifdef __APPLE__
17+
#define _DARWIN_C_SOURCE
18+
#include <sys/types.h>
19+
#endif
20+
1621
#include "libwsv5.h"
1722

1823
#include <stdio.h>

0 commit comments

Comments
 (0)