Created
June 1, 2014 20:51
-
-
Save nilium/c6872cb8fffc3a4d066a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Subset of config.hh */ | |
#ifndef __SNOW_COMMON__CONFIG_HH__ | |
#define __SNOW_COMMON__CONFIG_HH__ | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wundef" | |
#if defined(__APPLE__) | |
# include <TargetConditionals.h> | |
#endif | |
/* set up some macros for platforms */ | |
#define S_PLATFORM_UNIX (defined(unix) || defined(__unix) || defined(__unix__)) | |
#define S_PLATFORM_APPLE (defined(__APPLE__)) | |
#define S_PLATFORM_WINDOWS (defined(_WIN32) || defined(__MINGW32__)) | |
#define S_PLATFORM_LINUX (defined(__linux__) || defined(linux) || defined(__linux)) | |
#define S_PLATFORM_MAC (S_PLATFORM_APPLE && TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)) | |
#define S_PLATFORM_IOS (S_PLATFORM_APPLE && TARGET_OS_IPHONE) | |
#define S_PLATFORM_IOS_SIM (S_PLATFORM_APPLE && TARGET_IPHONE_SIMULATOR) | |
#define S_PLATFORM_QNX (defined(__QNX__)) | |
#define S_PLATFORM_ANDROID (defined(__ANDROID__)) | |
/* architectures */ | |
#define S_ARCH_ARM (__arm__) | |
#define S_ARCH_ARM_NEON (S_ARCH_ARM && __ARM_NEON__) | |
#define S_ARCH_ARM_7 (S_ARCH_ARM && __ARM_ARCH_7A__) | |
#define S_ARCH_x86_64 (__x86_64__ || __x86_64 || __amd64__ || __amd64 || _M_X64) | |
#define S_ARCH_x86 (__i386 || __i386__ || i386 || _M_IX86 || _X86_ || __i486__ || __i586 || __i686__) | |
#define S_ARCH_PPC (__powerpc || __powerpc__ || __POWERPC__ || __ppc__ || _M_PPC) | |
#if S_PLATFORM_TOUCHPAD | |
# include <PDL.h> | |
#endif | |
#ifndef S_EXPORT | |
# if S_PLATFORM_WINDOWS && !defined(__GNUC__) | |
# ifdef S_BUILD_SHARED_LIB | |
# define S_EXPORT __declspec(dllexport) | |
# else | |
# define S_EXPORT __declspec(dllimport) | |
# endif | |
# elif S_PLATFORM_WINDOWS | |
# ifdef S_BUILD_SHARED_LIB | |
# define S_EXPORT __attribute__((dllexport)) | |
# else | |
# define S_EXPORT __attribute__((dllimport)) | |
# endif | |
# else | |
# define S_EXPORT __attribute__((visibility("default"))) | |
# endif | |
#endif | |
#ifndef S_HIDDEN | |
# if S_PLATFORM_WINDOWS && !defined(__GNUC__) | |
# define S_HIDDEN | |
# else | |
# define S_HIDDEN __attribute__((visibility("hidden"))) | |
# endif | |
#endif | |
#pragma GCC diagnostic pop | |
#endif /* !defined __SNOW_COMMON__CONFIG_HH__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment