From 673ec550f5688b920a264e69efb1915031cb5796 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 1 Mar 2017 15:58:57 +0000 Subject: [PATCH] Moved definition of _BSD_SOURCE earlier --- include/internal/catch_compiler_capabilities.h | 4 ++++ include/internal/catch_timer.hpp | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index 16417b52..735d3d4b 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -81,6 +81,10 @@ # define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS # endif +// 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 + #endif // __CYGWIN__ //////////////////////////////////////////////////////////////////////////////// diff --git a/include/internal/catch_timer.hpp b/include/internal/catch_timer.hpp index 881d890e..dfb7811f 100644 --- a/include/internal/catch_timer.hpp +++ b/include/internal/catch_timer.hpp @@ -20,13 +20,8 @@ #else -// Required for some versions of Cygwin to declare gettimeofday -// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin -# ifdef __CYGWIN__ -# define _BSD_SOURCE -# endif - #include + #endif namespace Catch {