Skip to content

Commit 5b9a58d

Browse files
committed
Add check to make sure POSIX functions are available in Cygwin.
1 parent 68c7e80 commit 5b9a58d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/boost/interprocess/detail/workaround.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#else
3535
#include <unistd.h>
3636

37+
#if defined (__CYGWIN__) && (!defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE < 200112L))
38+
#error "Error: Compiling on Cygwin without POSIX is not supported. Please define _XOPEN_SOURCE >= 600 or _POSIX_C_SOURCE >= 200112 when compiling"
39+
#endif
40+
3741
//////////////////////////////////////////////////////
3842
//Check for XSI shared memory objects. They are available in nearly all UNIX platforms
3943
//////////////////////////////////////////////////////

test/Jamfile.v2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ project : requirements
2525
<target-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
2626
<target-os>windows,<toolset>clang:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
2727
<target-os>linux:<linkflags>"-lrt"
28-
#cygwin with -std=c++XX does not include POSIX
28+
#cygwin with -std=c++XX does not include POSIX features, so always request them
2929
<target-os>cygwin:<define>_XOPEN_SOURCE=600
3030
;
3131

0 commit comments

Comments
 (0)