Add check to make sure POSIX functions are available in Cygwin.

This commit is contained in:
Ion Gaztañaga
2024-08-25 23:09:45 +02:00
parent 68c7e80b22
commit 5b9a58d680
2 changed files with 5 additions and 1 deletions

View File

@@ -34,6 +34,10 @@
#else
#include <unistd.h>
#if defined (__CYGWIN__) && (!defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE < 200112L))
#error "Error: Compiling on Cygwin without POSIX is not supported. Please define _XOPEN_SOURCE >= 600 or _POSIX_C_SOURCE >= 200112 when compiling"
#endif
//////////////////////////////////////////////////////
//Check for XSI shared memory objects. They are available in nearly all UNIX platforms
//////////////////////////////////////////////////////

View File

@@ -25,7 +25,7 @@ project : requirements
<target-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
<target-os>windows,<toolset>clang:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<target-os>linux:<linkflags>"-lrt"
#cygwin with -std=c++XX does not include POSIX
#cygwin with -std=c++XX does not include POSIX features, so always request them
<target-os>cygwin:<define>_XOPEN_SOURCE=600
;