Skip to content

Commit

Permalink
Add check to make sure POSIX functions are available in Cygwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Aug 25, 2024
1 parent 68c7e80 commit 5b9a58d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/boost/interprocess/detail/workaround.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -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
;

Expand Down

0 comments on commit 5b9a58d

Please sign in to comment.