Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorwimo70832018-09-26 14:48:05 -0600
committerMartin Hořeňovský2018-09-27 20:56:27 +0200
commitf4881f172afa4eab26f2e4bed8c5dfeb010567a5 (patch)
treef0f9875d6bfccc21d74d32023fe4be7871fb8ff8 /include
parentde06340e7d2862bbdb55796f86a2090e915f9c19 (diff)
downloadcatch3-f4881f172afa4eab26f2e4bed8c5dfeb010567a5.tar.gz
prevent cygwin to_string compiler error
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_compiler_capabilities.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h
index 74532c59..aa3e599e 100644
--- a/include/internal/catch_compiler_capabilities.h
+++ b/include/internal/catch_compiler_capabilities.h
@@ -109,7 +109,14 @@
// Required for some versions of Cygwin to declare gettimeofday
// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
# define _BSD_SOURCE
+// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
+// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
+# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
+ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
+
+# endif
#endif // __CYGWIN__
////////////////////////////////////////////////////////////////////////////////