65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Copyright (c) Lewis Baker
|
|
// Licenced under MIT license. See LICENSE.txt for details.
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
#ifndef CPPCORO_CONFIG_HPP_INCLUDED
|
|
#define CPPCORO_CONFIG_HPP_INCLUDED
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// Compiler Detection
|
|
|
|
#if defined(_MSC_VER)
|
|
# define CPPCORO_COMPILER_MSVC _MSC_FULL_VER
|
|
#else
|
|
# define CPPCORO_COMPILER_MSVC 0
|
|
#endif
|
|
|
|
#if defined(__clang__)
|
|
# define CPPCORO_COMPILER_CLANG (__clang_major__ * 10000 + \
|
|
__clang_minor__ * 100 + \
|
|
__clang_patchlevel__)
|
|
#else
|
|
# define CPPCORO_COMPILER_CLANG 0
|
|
#endif
|
|
|
|
#if defined(__GNUC__)
|
|
# define CPPCORO_COMPILER_GCC (__GNUC__ * 10000 + \
|
|
__GNUC_MINOR__ * 100 + \
|
|
__GNUC_PATCHLEVEL__)
|
|
#else
|
|
# define CPPCORO_COMPILER_GCC 0
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// OS Detection
|
|
|
|
/// \def CPPCORO_OS_WINNT
|
|
/// Defined to non-zero if the target platform is a WindowsNT variant.
|
|
/// 0x0500 - Windows 2000
|
|
/// 0x0501 - Windows XP/Server 2003
|
|
/// 0x0502 - Windows XP SP2/Server 2003 SP1
|
|
/// 0x0600 - Windows Vista/Server 2008
|
|
/// 0x0601 - Windows 7
|
|
/// 0x0602 - Windows 8
|
|
/// 0x0603 - Windows 8.1
|
|
/// 0x0A00 - Windows 10
|
|
#if defined(_WIN32_WINNT) || defined(_WIN32)
|
|
# if !defined(_WIN32_WINNT)
|
|
// Default to targeting Windows 10 if not defined.
|
|
# define _WIN32_WINNT 0x0A00
|
|
# endif
|
|
# define CPPCORO_OS_WINNT _WIN32_WINNT
|
|
#else
|
|
# define CPPCORO_OS_WINNT 0
|
|
#endif
|
|
|
|
#if defined(__linux__)
|
|
# define CPPCORO_OS_LINUX 1
|
|
#else
|
|
# define CPPCORO_OS_LINUX 0
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CPU Detection
|
|
|
|
#endif
|