File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,15 @@ check_function_exists(strlcpy HAVE_STRLCPY)
197
197
check_function_exists (sysconf HAVE_SYSCONF )
198
198
check_function_exists (arc4random HAVE_ARC4RANDOM )
199
199
200
+ if (NOT HAVE_STRLCPY AND NOT HAVE_GETPROGNAME )
201
+ include (FindPkgConfig )
202
+ pkg_check_modules (BSD_OVERLAY libbsd-overlay )
203
+ if (BSD_OVERLAY_FOUND )
204
+ set (HAVE_STRLCPY 1 CACHE INTERNAL "Have function strlcpy" FORCE )
205
+ set (HAVE_GETPROGNAME 1 CACHE INTERNAL "Have function getprogname" FORCE )
206
+ endif ()
207
+ endif ()
208
+
200
209
find_package (Threads REQUIRED )
201
210
202
211
check_include_files ("TargetConditionals.h" HAVE_TARGETCONDITIONALS_H )
Original file line number Diff line number Diff line change @@ -204,6 +204,11 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
204
204
PRIVATE
205
205
-U_GNU_SOURCE )
206
206
endif ()
207
+ if (BSD_OVERLAY_FOUND )
208
+ target_compile_options (dispatch
209
+ PRIVATE
210
+ ${BSD_OVERLAY_CFLAGS} )
211
+ endif ()
207
212
if ("${CMAKE_C_SIMULATE_ID} " STREQUAL "MSVC" )
208
213
target_compile_options (dispatch
209
214
PRIVATE
@@ -225,6 +230,9 @@ else()
225
230
-fblocks
226
231
-momit-leaf-frame-pointer )
227
232
endif ()
233
+ if (BSD_OVERLAY_FOUND )
234
+ target_link_libraries (dispatch PRIVATE ${BSD_OVERLAY_LDFLAGS} )
235
+ endif ()
228
236
if (LibRT_FOUND )
229
237
target_link_libraries (dispatch PRIVATE RT::rt )
230
238
endif ()
Original file line number Diff line number Diff line change @@ -282,10 +282,8 @@ upcast(dispatch_object_t dou)
282
282
#include < linux/sysctl.h>
283
283
#else
284
284
#include < sys/sysctl.h>
285
- #endif /* __ANDROID__ */
286
- #if !defined(__linux__)
287
285
#include < sys/queue.h>
288
- #endif
286
+ #endif /* __ANDROID__ */
289
287
#include < sys/socket.h>
290
288
#include < sys/time.h>
291
289
#include < sys/mman.h>
Original file line number Diff line number Diff line change 33
33
#include "shims/generic_win_stubs.h"
34
34
#endif // defined(_WIN32)
35
35
36
- #if defined(_WIN32 ) || defined(__linux__ )
36
+ #if defined(_WIN32 ) || defined(__ANDROID__ )
37
37
#include "shims/generic_sys_queue.h"
38
38
#endif
39
39
File renamed without changes.
You can’t perform that action at this time.
0 commit comments