00001 /**** 00002 ***** Copyright 2010 Intel Corporation All Rights Reserved. 00003 ***** 00004 ***** The source code, information and material contained herein are owned by Intel Corporation or its suppliers ***** 00005 ***** or licensors, and title to such Material remains with Intel Corporation or its suppliers or licensors. ***** 00006 ***** The Material contains proprietary information of Intel or its suppliers and licensors. The Material is ***** 00007 ***** protected by worldwide copyright laws and treaty provisions. No part of the Material may be used, copied, ***** 00008 ***** reproduced, modified, published, uploaded, posted, transmitted, distributed or disclosed in any way without ***** 00009 ***** Intel's prior express written permission. 00010 ***** 00011 ***** No license under any patent, copyright or other intellectual property rights in the material is granted to ***** 00012 ***** or conferred upon you, either expressly, by implication, inducement, estoppel or otherwise. Any license ***** 00013 ***** under such intellectual property rights must be express and approved by Intel in writing. 00014 ****/ 00015 00016 /**** Copyright Ends ****/ 00017 00018 #ifndef ARBB_CPP_CONFIG_HPP 00019 #define ARBB_CPP_CONFIG_HPP 00020 00021 #define ARBB_SUSPEND_64BIT_Size 0 00022 00023 // Define Platform Environment Flags 00024 // ARBB_PLATFORM_FLAG 00025 // 00026 // Encoding: 00027 // bit 00028 // 0 ~ 7 | 8 ~ 15 | 16 ~ 21 | 22 ~ 23 | 24 ~ 31 00029 // compiler cc ver OS 32/64bit OS ver 00030 // 00031 // version fields are reversed 00032 00033 // Compiler 00034 #define ARBB_GCC_CC 1 00035 #define ARBB_ICC_CC 2 00036 #define ARBB_VC_CC 4 00037 #define ARBB_CC_MASK 0x000000ff 00038 #define ARBB_CC_SHIFT 0 00039 #define ARBB_CC_VER_SHIFT 8 00040 00041 // Operating system 00042 #define ARBB_PF_WIN 1 00043 #define ARBB_PF_LINUX 2 00044 #define ARBB_PF_MAC 4 00045 #define ARBB_PF_OS_MASK 0x003f0000 00046 #define ARBB_PF_SHIFT 16 00047 00048 // 32/64 bits 00049 #define ARBB_PF_32BIT 1 00050 #define ARBB_PF_64BIT 2 00051 #define ARBB_PF_EMT_MASK 0x00c00000 00052 #define ARBB_PF_EMT_SHIFT 22 00053 00054 #ifdef _WIN32 00055 # define ARBB_PF_ENC ARBB_PF_WIN 00056 # if _M_X64 || _M_AMD64 || _M_IA64 00057 # define ARBB_PF_WIDTH ARBB_PF_64BIT 00058 # else 00059 # define ARBB_PF_WIDTH ARBB_PF_32BIT 00060 # endif 00061 # if defined(__INTEL_COMPILER) 00062 # define ARBB_CC_ENC ARBB_ICC_CC 00063 # else 00064 # define ARBB_CC_ENC ARBB_VC_CC 00065 # endif 00066 #elif __linux || __APPLE__ 00067 # if __linux 00068 # define ARBB_PF_ENC ARBB_PF_LINUX 00069 # else 00070 # define ARBB_PF_ENC ARBB_PF_MAC 00071 # endif 00072 # if __amd64 || __x86_64 00073 # define ARBB_PF_WIDTH ARBB_PF_64BIT 00074 # elif __i386__ || i386 || __i486__ 00075 # define ARBB_PF_WIDTH ARBB_PF_32BIT 00076 # else 00077 # error Could not determine target architecture. 00078 # endif 00079 # if defined(__INTEL_COMPILER) 00080 # define ARBB_CC_ENC ARBB_ICC_CC 00081 # elif defined(__GNUC__) 00082 # define ARBB_CC_ENC ARBB_GCC_CC 00083 # else 00084 # error No supported compiler is installed. 00085 # endif 00086 #else 00087 # error This platform is not supported by Intel(R) ArBB. 00088 #endif 00089 00090 #define ARBB_PLATFORM_FLAG ((ARBB_CC_ENC << ARBB_CC_SHIFT) | (ARBB_PF_ENC << ARBB_PF_SHIFT) | (ARBB_PF_WIDTH << ARBB_PF_EMT_SHIFT)) 00091 00092 #define ARBB_IS_GCC_ENV (ARBB_PLATFORM_FLAG & (ARBB_GCC_CC << ARBB_CC_SHIFT)) 00093 #define ARBB_IS_ICC_ENV (ARBB_PLATFORM_FLAG & (ARBB_ICC_CC << ARBB_CC_SHIFT)) 00094 #define ARBB_IS_VC_ENV (ARBB_PLATFORM_FLAG & (ARBB_VC_CC << ARBB_CC_SHIFT)) 00095 #define ARBB_IS_ICC10_ENV (__INTEL_COMPILER >= 1000 && __INTEL_COMPILER <= 1090) 00096 #define ARBB_IS_ICC11_ENV (__INTEL_COMPILER >= 1100 && __INTEL_COMPILER <= 1190) 00097 00098 #define ARBB_IS_32BIT_ENV (ARBB_PLATFORM_FLAG & (ARBB_PF_32BIT << ARBB_PF_EMT_SHIFT)) 00099 #define ARBB_IS_64BIT_ENV (ARBB_PLATFORM_FLAG & (ARBB_PF_64BIT << ARBB_PF_EMT_SHIFT)) 00100 00101 #define ARBB_IS_WIN_ENV (ARBB_PLATFORM_FLAG & (ARBB_PF_WIN << ARBB_PF_SHIFT)) 00102 #define ARBB_IS_LINUX_ENV (ARBB_PLATFORM_FLAG & (ARBB_PF_LINUX << ARBB_PF_SHIFT)) 00103 #define ARBB_IS_MAC_ENV (ARBB_PLATFORM_FLAG & (ARBB_PF_MAC << ARBB_PF_SHIFT)) 00104 00105 // Check compiler versions 00106 00107 #if ARBB_IS_GCC_ENV 00108 # if (__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 2)) 00109 # error The version of the installed GCC is too old. The supported versions are 4.2 and above. 00110 # endif 00111 #elif ARBB_IS_ICC_ENV 00112 # if __INTEL_COMPILER < 1010 && !defined(LRB) 00113 # error The version of the installed ICC is too old. The supported versions are 10.1 and above. 00114 # endif 00115 #elif ARBB_IS_VC_ENV 00116 # if _MSC_VER < 1400 00117 # error The version of the installed Microsoft* Visual Studio* is too old. The supported versions are Visual Studio* 2005 and above. 00118 # endif 00119 #else 00120 # error No supported compiler is installed. 00121 #endif 00122 00123 // define ARBB_DLL_API 00124 #if ARBB_IS_LINUX_ENV || ARBB_IS_MAC_ENV 00125 # if defined(ARBB_DLL_EXPORTS) || defined(_CPPFE_) 00126 # define ARBB_DLL_API __attribute__((visibility("default"))) 00127 # else //dll client 00128 # define ARBB_DLL_API 00129 # endif 00130 #elif ARBB_IS_WIN_ENV //Win DLL 00131 # if defined(ARBB_DLL_EXPORTS) || defined(_CPPFE_) 00132 # define ARBB_DLL_API __declspec(dllexport) 00133 # else //dll client 00134 # define ARBB_DLL_API __declspec(dllimport) 00135 # endif 00136 #else 00137 # error Unsupported environment. 00138 #endif 00139 00140 // define ARBB_CPP_THREAD_LOCAL 00141 #if ARBB_IS_LINUX_ENV 00142 # define ARBB_CPP_THREAD_LOCAL __thread 00143 #elif ARBB_IS_MAC_ENV // __thread is not implemented on Mac OS X so thread-local storage is disabled (see FT-1790) 00144 # define ARBB_CPP_THREAD_LOCAL 00145 #elif ARBB_IS_WIN_ENV 00146 # define ARBB_CPP_THREAD_LOCAL __declspec(thread) 00147 #else 00148 # error Unsupported environment. 00149 #endif 00150 00151 #if ARBB_IS_MAC_ENV 00152 # define ARBB_API_BASED_TLS 1 00153 #endif 00154 00155 // Check if NOMINMAX was defined correctly 00156 #if defined(max) || defined(min) 00157 # if defined(_WINDOWS_) && !defined(NOMINMAX) 00158 # error You must define NOMINMAX when including windows.h if arbb.hpp is included. 00159 # else 00160 # error You must not defined any min or max macros if arbb.hpp is included. 00161 # endif 00162 #endif 00163 00164 #endif // ARBB_CPP_CONFIG_HPP
Copyright © 2010, Intel Corporation. All rights reserved.