catch_platform.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Created by Phil on 16/8/2013.
  3. * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
  4. *
  5. * Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. *
  8. */
  9. #ifndef TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
  10. #define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
  11. // See e.g.:
  12. // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html
  13. #ifdef __APPLE__
  14. # include <TargetConditionals.h>
  15. # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \
  16. (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1)
  17. # define CATCH_PLATFORM_MAC
  18. # elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1)
  19. # define CATCH_PLATFORM_IPHONE
  20. # endif
  21. #elif defined(linux) || defined(__linux) || defined(__linux__)
  22. # define CATCH_PLATFORM_LINUX
  23. #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
  24. # define CATCH_PLATFORM_WINDOWS
  25. #endif
  26. #endif // TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED