From 5b9a58d6801dfea2bb0ac0d1556d729d97a7ae70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sun, 25 Aug 2024 23:09:45 +0200 Subject: [PATCH] Add check to make sure POSIX functions are available in Cygwin. --- include/boost/interprocess/detail/workaround.hpp | 4 ++++ test/Jamfile.v2 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/interprocess/detail/workaround.hpp b/include/boost/interprocess/detail/workaround.hpp index e6793e8..02528ce 100644 --- a/include/boost/interprocess/detail/workaround.hpp +++ b/include/boost/interprocess/detail/workaround.hpp @@ -34,6 +34,10 @@ #else #include + #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 ////////////////////////////////////////////////////// diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 9b530a6..d22a419 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -25,7 +25,7 @@ project : requirements hpux,gcc:"-Wl,+as,mpas" windows,clang:"-lole32 -loleaut32 -lpsapi -ladvapi32" linux:"-lrt" - #cygwin with -std=c++XX does not include POSIX + #cygwin with -std=c++XX does not include POSIX features, so always request them cygwin:_XOPEN_SOURCE=600 ;