diff options
| author | Phil Nash | 2013-08-16 19:08:39 +0100 |
|---|---|---|
| committer | Phil Nash | 2013-08-16 19:08:39 +0100 |
| commit | 638cf9feb4849bee6fa613f1c0e7545fa899322f (patch) | |
| tree | 46e8b45693f49f0877e3f2fcbfd07705b0366d78 /include/internal | |
| parent | 46118714b123cf4133128d1c3d8f3ec8d821b505 (diff) | |
| download | catch3-638cf9feb4849bee6fa613f1c0e7545fa899322f.tar.gz | |
Separated out catch_platform.h
Diffstat (limited to 'include/internal')
| -rw-r--r-- | include/internal/catch_debugger.hpp | 8 | ||||
| -rw-r--r-- | include/internal/catch_platform.h | 20 | ||||
| -rw-r--r-- | include/internal/catch_timer.h | 4 | ||||
| -rw-r--r-- | include/internal/catch_timer.hpp | 5 |
4 files changed, 27 insertions, 10 deletions
diff --git a/include/internal/catch_debugger.hpp b/include/internal/catch_debugger.hpp index 976d14af..9979dff8 100644 --- a/include/internal/catch_debugger.hpp +++ b/include/internal/catch_debugger.hpp @@ -12,13 +12,7 @@ #include <iostream> -#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -#define CATCH_PLATFORM_MAC -#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED) -#define CATCH_PLATFORM_IPHONE -#elif defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) -#define CATCH_PLATFORM_WINDOWS -#endif +#include "catch_platform.h" #ifdef CATCH_PLATFORM_MAC diff --git a/include/internal/catch_platform.h b/include/internal/catch_platform.h new file mode 100644 index 00000000..0142dc14 --- /dev/null +++ b/include/internal/catch_platform.h @@ -0,0 +1,20 @@ +/* + * Created by Phil on 16/8/2013. + * Copyright 2013 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + */ +#ifndef TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED +#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED + +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +#define CATCH_PLATFORM_MAC +#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +#define CATCH_PLATFORM_IPHONE +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) +#define CATCH_PLATFORM_WINDOWS +#endif + +#endif // TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED diff --git a/include/internal/catch_timer.h b/include/internal/catch_timer.h index ad24883f..015f88bc 100644 --- a/include/internal/catch_timer.h +++ b/include/internal/catch_timer.h @@ -8,7 +8,9 @@ #ifndef TWOBLUECUBES_CATCH_TIMER_H_INCLUDED #define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED -#ifdef WIN32 +#include "catch_platform.h" + +#ifdef CATCH_PLATFORM_WINDOWS typedef unsigned long long uint64_t; #else #include <stdint.h> diff --git a/include/internal/catch_timer.hpp b/include/internal/catch_timer.hpp index 6abbf3a6..6f716b1e 100644 --- a/include/internal/catch_timer.hpp +++ b/include/internal/catch_timer.hpp @@ -7,13 +7,14 @@ */ #include "catch_timer.h" +#include "catch_platform.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc++11-long-long" #endif -#ifdef WIN32 +#ifdef CATCH_PLATFORM_WINDOWS #include <windows.h> #else #include <sys/time.h> @@ -22,7 +23,7 @@ namespace Catch { namespace { -#ifdef WIN32 +#ifdef CATCH_PLATFORM_WINDOWS uint64_t getCurrentTicks() { static uint64_t hz=0, hzo=0; if (!hz) { |