intial commit
This commit is contained in:
78
source/mijin/detect.hpp
Normal file
78
source/mijin/detect.hpp
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(MIJIN_DETECT_HPP_INCLUDED)
|
||||
#define MIJIN_DETECT_HPP_INCLUDED 1
|
||||
|
||||
namespace mijin
|
||||
{
|
||||
|
||||
//
|
||||
// public defines
|
||||
//
|
||||
|
||||
#if !defined(__has_include)
|
||||
#define __has_include(x) (false)
|
||||
#endif
|
||||
|
||||
#define MIJIN_OS_UNKNOWN 0
|
||||
#define MIJIN_OS_LINUX 1
|
||||
#define MIJIN_OS_WINDOWS 2
|
||||
#define MIJIN_OS_OSX 3
|
||||
|
||||
#if !defined(MIJIN_TARGET_OS)
|
||||
#if defined(__linux__)
|
||||
#define MIJIN_TARGET_OS MIJIN_OS_LINUX
|
||||
#elif defined(_WIN32)
|
||||
#define MIJIN_TARGET_OS MIJIN_OS_WINDOWS
|
||||
#else // TODO: macos
|
||||
#define MIJIN_TARGET_OS MIJIN_OS_UNKNOWN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MIJIN_COMPILER_UNKNOWN 0
|
||||
#define MIJIN_COMPILER_GCC 1
|
||||
#define MIJIN_COMPILER_CLANG 2
|
||||
#define MIJIN_COMPILER_MSVC 3
|
||||
|
||||
#if !defined(MIJIN_COMPILER)
|
||||
#if defined(__clang__)
|
||||
#define MIJIN_COMPILER MIJIN_COMPILER_CLANG
|
||||
#elif defined(__GNUC__)
|
||||
#define MIJIN_COMPILER MIJIN_COMPILER_GCC
|
||||
#elif defined(_MSC_VER)
|
||||
#define MIJIN_COMPILER MIJIN_COMPILER_MSVC
|
||||
#else
|
||||
#define MIJIN_COMPILER MIJIN_COMPILER_UNKNOWN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MIJIN_STDLIB_UNKNOWN 0
|
||||
#define MIJIN_STDLIB_GLIBC 1
|
||||
|
||||
#if !defined(MIJIN_STDLIB)
|
||||
#if __has_include(<features.h>)
|
||||
#include <features.h>
|
||||
#endif
|
||||
#if defined(__GLIBC__)
|
||||
#define MIJIN_STDLIB MIJIN_STDLIB_GLIBC
|
||||
#else
|
||||
#define MIJIN_STDLIB MIJIN_STDLIB_UNKNOWN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// public constants
|
||||
//
|
||||
|
||||
//
|
||||
// public types
|
||||
//
|
||||
|
||||
//
|
||||
// public functions
|
||||
//
|
||||
|
||||
} // namespace mijin
|
||||
|
||||
#endif // !defined(MIJIN_DETECT_HPP_INCLUDED)
|
||||
Reference in New Issue
Block a user