diff options
-rw-r--r-- | Source/cmSystemTools.cxx | 3 | ||||
-rw-r--r-- | Tests/CTestTestFdSetSize/sleep.c | 14 | ||||
-rw-r--r-- | Tests/RunCMake/CTestTimeout/TestTimeout.c | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/NoCXX20.cmake | 7 |
4 files changed, 18 insertions, 7 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 55b0df8..3de45bc 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1501,8 +1501,7 @@ std::string cmSystemTools::RelativeIfUnder(std::string const& top, bool cmSystemTools::UnsetEnv(const char* value) { # if !defined(HAVE_UNSETENV) - std::string var = cmStrCat(value, '='); - return cmSystemTools::PutEnv(var); + return cmSystemTools::UnPutEnv(value); # else unsetenv(value); return true; diff --git a/Tests/CTestTestFdSetSize/sleep.c b/Tests/CTestTestFdSetSize/sleep.c index 2fb6490..d55cec6 100644 --- a/Tests/CTestTestFdSetSize/sleep.c +++ b/Tests/CTestTestFdSetSize/sleep.c @@ -1,7 +1,11 @@ #if defined(_WIN32) # include <windows.h> -#else +#elif _XOPEN_SOURCE >= 500 || defined(_ALL_SOURCE) # include <unistd.h> +#else +# include <time.h> + +# include <sys/select.h> #endif /* sleeps for 0.1 second */ @@ -9,8 +13,14 @@ int main(int argc, char** argv) { #if defined(_WIN32) Sleep(100); -#else +#elif _XOPEN_SOURCE >= 500 || defined(_ALL_SOURCE) usleep(100 * 1000); +#else + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 100 * 1000; + + select(0, NULL, NULL, NULL, &tv); #endif return 0; } diff --git a/Tests/RunCMake/CTestTimeout/TestTimeout.c b/Tests/RunCMake/CTestTimeout/TestTimeout.c index 5a008a7..0d534fc 100644 --- a/Tests/RunCMake/CTestTimeout/TestTimeout.c +++ b/Tests/RunCMake/CTestTimeout/TestTimeout.c @@ -1,6 +1,7 @@ #if defined(_WIN32) # include <windows.h> #else +# include <sched.h> # include <unistd.h> #endif diff --git a/Tests/RunCMake/CXXModules/NoCXX20.cmake b/Tests/RunCMake/CXXModules/NoCXX20.cmake index d502f7c..b7372e8 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20.cmake +++ b/Tests/RunCMake/CXXModules/NoCXX20.cmake @@ -5,6 +5,7 @@ target_sources(nocxx20 PUBLIC FILE_SET fs TYPE CXX_MODULES FILES sources/module.cxx) -target_compile_features(nocxx20 - PRIVATE - cxx_std_17) +set_target_properties(nocxx20 + PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON) |