00001 #ifndef FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00002 #define FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #define KARCH_ARCH_80286 200
00043 #define KARCH_ARCH_I386 300
00044 #define KARCH_ARCH_I486 400
00045 #define KARCH_ARCH_PENTIUM 500
00046 #define KARCH_ARCH_PENTIUMPRO 600
00047 #define KARCH_ARCH_PENTIUMII 630
00048 #define KARCH_ARCH_PENTIUMIII 670
00049 #define KARCH_ARCH_PENTIUMIV 700
00050
00051
00052
00053
00054 #define KARCH_ARCH_AMD64 800
00055
00056
00057
00058
00059 #define KARCH_ARCH_ITANIUM 1000
00060
00061
00062 #if defined(linux) || defined(__CYGWIN32__)
00063 #define KARCH_DEV_GNUC __GNUC__
00064 #define KARCH_ENV_UNIX 1
00065 #define KARCH_ENV_POSIX 1
00066
00067 #if defined(linux)
00068 #define KARCH_ENV_LINUX 1
00069 #endif
00070
00071 #if defined(__GNUC__)
00072 #ifndef _GNU_SOURCE
00073 #define _GNU_SOURCE
00074 #endif
00075 #define KARCH_DEV_GNUC __GNUC__
00076
00077
00078 #if defined(__ia64__) && !defined(KARCH_CPU_IA64)
00079 #define KARCH_CPU_IA64 KARCH_ARCH_ITANIUM
00080 #elif defined(__x86_64) && !defined(KARCH_CPU_AMD64)
00081 #define KARCH_CPU_AMD64 KARCH_ARCH_AMD64
00082 #elif !defined(KARCH_CPU_IA32)
00083 #if defined(__pentiumiii__)
00084 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMIII
00085 #elif defined(__pentiumii__)
00086 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMII
00087 #elif defined(__i686__) || defined(__pentiumpro__)
00088 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMPRO
00089 #elif defined(__i586__) || defined(__pentium__) || defined(__k6__)
00090 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00091 #elif defined(__i486__)
00092 #define KARCH_CPU_IA32 KARCH_ARCH_I486
00093 #elif defined(__i386__)
00094 #define KARCH_CPU_IA32 KARCH_ARCH_I386
00095 #else
00096 #define KARCH_CPU_IA32 KARCH_ARCH_I286
00097 #endif
00098 #endif
00099
00100
00101 #if defined(KARCH_CPU_IA64)
00102 #define KARCH_ARCH_IA64 KARCH_CPU_IA64
00103 #define KARCH_ARCH_64 1
00104 #elif defined(KARCH_CPU_AMD64)
00105 #define KARCH_ARCH_AMD64 KARCH_CPU_AMD64
00106 #define KARCH_ARCH_64 1
00107 #elif defined(KARCH_CPU_IA32)
00108 #define KARCH_ARCH_IA32 KARCH_CPU_IA32
00109
00110 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMII)
00111 #define KARCH_CPU_IA32_MMX
00112 #endif
00113 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMIII)
00114 #define KARCH_CPU_IA32_SIMD
00115 #endif
00116 #endif
00117 #else
00118 #error "Compiler not supported"
00119 #endif
00120 #elif defined(_XBOX)
00121 #define KARCH_ENV_WIN 1
00122 #define KARCH_ENV_WIN32 _WIN32
00123 #define KARCH_ENV_XBOX _XBOX
00124 #define KARCH_DEV_MSC _MSC_VER
00125 #define KARCH_ARCH_IA32 _M_IX86
00126 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00127
00128
00129
00130 #elif defined(_WIN32) || defined(_WIN64)
00131 #define KARCH_ENV_WIN 1
00132 #define KARCH_ENV_WIN32 _WIN32
00133 #if defined(_WINNT)
00134 #define KARCH_ENV_WINNT _WINNT
00135 #endif
00136
00137
00138
00139
00140 #if defined _M_IX86
00141 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
00142 #elif defined _M_IA64
00143 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
00144 #elif defined _M_X64
00145 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
00146 #else
00147 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
00148 #endif
00149
00150 #if defined(__MINGW32__)
00151 #define KARCH_ENV_MING32 __MINGW32__
00152 #endif
00153 #if defined(__ICL)
00154 #define KARCH_DEV_INTEL __ICL
00155 #endif
00156 #if defined(_MSC_VER)
00157 #define KARCH_DEV_MSC _MSC_VER
00158 #elif defined(__GNUC__)
00159 #define KARCH_DEV_GNUC __GNUC__
00160 #if !defined(KARCH_CPU_IA32)
00161 #if defined(__pentiumiii__)
00162 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMIII
00163 #elif defined(__pentiumii__)
00164 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMII
00165 #elif defined(__i686__) || defined(__pentiumpro__)
00166 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMPRO
00167 #elif defined(__i586__) || defined(__pentium__) || defined(__k6__)
00168 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00169 #elif defined(__i486__)
00170 #define KARCH_CPU_IA32 KARCH_ARCH_I486
00171 #elif defined(__i386__)
00172 #define KARCH_CPU_IA32 KARCH_ARCH_I386
00173 #else
00174 #define KARCH_CPU_IA32 KARCH_ARCH_I286
00175 #endif
00176 #endif
00177 #if !defined(KARCH_ARCH_IA32)
00178 #define KARCH_ARCH_IA32 KARCH_CPU_IA32
00179 #elif (KARCH_ARCH_IA32 < KARCH_CPU_IA32)
00180 #error "Selected architecture doesn't support selected instruction set"
00181 #endif
00182 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMII)
00183 #define KARCH_CPU_IA32_MMX
00184 #endif
00185 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMIII)
00186 #define KARCH_CPU_IA32_SIMD
00187 #endif
00188 #else
00189 #error "Compiler not supported"
00190 #endif
00191 #if defined(_M_IX86)
00192 #define KARCH_ARCH_IA32 _M_IX86
00193 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMIII // to force a minimum of PENTIUM II
00194 #if !defined(KARCH_CPU_IA32)
00195 #if (KARCH_ARCH_IA32 >= KARCH_ARCH_PENTIUM)
00196 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00197 #else
00198 #define KARCH_CPU_IA32 KARCH_ARCH_IA32
00199 #endif
00200 #endif
00201 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMII)
00202 #define KARCH_CPU_IA32_MMX
00203 #endif
00204 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMIII)
00205 #define KARCH_CPU_IA32_SIMD
00206 #endif
00207 #elif defined(_M_X64)
00208 #define KARCH_ARCH_X64 _M_X64
00209 #define KARCH_CPU_X64 KARCH_ARCH_AMD64
00210 #define KARCH_ENV_WIN64 _WIN64
00211 #define KARCH_ARCH_64 1
00212 #elif defined(_M_IA64)
00213 #define KARCH_ARCH_IA64 _M_IA64
00214 #define KARCH_CPU_IA64 KARCH_ARCH_ITANIUM
00215 #define KARCH_ENV_WIN64 _WIN64
00216 #define KARCH_ARCH_64 1
00217 #else
00218 #error "Architecture not supported"
00219 #endif
00220 #elif defined(__MACH__)
00221
00222 #if defined(__i386__)
00223 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00224 #define KARCH_ARCH_IA32 KARCH_CPU_IA32
00225 #elif defined(__x86_64__)
00226 #define KARCH_ARCH_X64 _M_X64
00227 #define KARCH_ARCH_64 1
00228 #else
00229 #define KARCH_ARCH_POWERPC
00230 #define KARCH_CPU_POWERPC
00231 #endif
00232
00233 #define KARCH_DEV_MACOSX
00234 #define KARCH_DEV_GNUC_MACOSX
00235 #define KARCH_ENV_MACOSX
00236 #define KARCH_DEV_GNUC __GNUC__
00237 #define KARCH_ENV_UNIX 1
00238 #define KARCH_ENV_POSIX 1
00239
00240 #else
00241 #error "Environment not supported"
00242 #endif
00243
00244 #endif // FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00245