00001
00004 #ifndef FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00005 #define FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
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
00043
00044
00045 #define KARCH_ARCH_80286 200
00046 #define KARCH_ARCH_I386 300
00047 #define KARCH_ARCH_I486 400
00048 #define KARCH_ARCH_PENTIUM 500
00049 #define KARCH_ARCH_PENTIUMPRO 600
00050 #define KARCH_ARCH_PENTIUMII 630
00051 #define KARCH_ARCH_PENTIUMIII 670
00052 #define KARCH_ARCH_PENTIUMIV 700
00053
00054
00055
00056
00057 #define KARCH_ARCH_AMD64_GENERIC 800
00058
00059
00060
00061
00062 #define KARCH_ARCH_ITANIUM 1000
00063
00064
00065 #if defined(linux) || defined(__CYGWIN32__)
00066 #define KARCH_DEV_GNUC __GNUC__
00067 #define KARCH_ENV_POSIX 1
00068
00069 #if defined(linux)
00070 #define KARCH_ENV_LINUX 1
00071 #endif
00072
00073 #if defined(__GNUC__)
00074 #ifndef _GNU_SOURCE
00075 #define _GNU_SOURCE
00076 #endif
00077 #define KARCH_DEV_GNUC __GNUC__
00078
00079
00080 #if defined(__ia64__) && !defined(KARCH_CPU_IA64)
00081 #define KARCH_CPU_IA64 KARCH_ARCH_ITANIUM
00082 #elif defined(__x86_64) && !defined(KARCH_CPU_AMD64)
00083 #define KARCH_CPU_AMD64 KARCH_ARCH_AMD64_GENERIC
00084 #elif !defined(KARCH_CPU_IA32)
00085 #if defined(__pentiumiii__)
00086 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMIII
00087 #elif defined(__pentiumii__)
00088 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMII
00089 #elif defined(__i686__) || defined(__pentiumpro__)
00090 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMPRO
00091 #elif defined(__i586__) || defined(__pentium__) || defined(__k6__)
00092 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00093 #elif defined(__i486__)
00094 #define KARCH_CPU_IA32 KARCH_ARCH_I486
00095 #elif defined(__i386__)
00096 #define KARCH_CPU_IA32 KARCH_ARCH_I386
00097 #else
00098 #define KARCH_CPU_IA32 KARCH_ARCH_I286
00099 #endif
00100 #endif
00101
00102
00103 #if defined(KARCH_CPU_IA64)
00104 #define KARCH_ARCH_IA64 KARCH_CPU_IA64
00105 #define KARCH_ARCH_64 1
00106 #elif defined(KARCH_CPU_AMD64)
00107 #define KARCH_ARCH_AMD64 KARCH_CPU_AMD64
00108 #define KARCH_ARCH_64 1
00109 #elif defined(KARCH_CPU_IA32)
00110 #define KARCH_ARCH_IA32 KARCH_CPU_IA32
00111
00112 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMII)
00113 #define KARCH_CPU_IA32_MMX
00114 #endif
00115 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMIII)
00116 #define KARCH_CPU_IA32_SIMD
00117 #endif
00118 #endif
00119 #else
00120 #error "Compiler not supported"
00121 #endif
00122 #elif defined(_XBOX)
00123 #define KARCH_ENV_WIN 1
00124 #define KARCH_ENV_WIN32 _WIN32
00125 #define KARCH_ENV_XBOX _XBOX
00126 #define KARCH_DEV_MSC _MSC_VER
00127 #define KARCH_ARCH_IA32 _M_IX86
00128 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00129
00130
00131
00132 #elif defined(_WIN32) || defined(_WIN64)
00133 #define KARCH_ENV_WIN 1
00134 #ifdef KARCH_ENV_WIN32
00135 #undef KARCH_ENV_WIN32
00136 #endif
00137 #define KARCH_ENV_WIN32 _WIN32
00138 #if defined(_WINNT)
00139 #define KARCH_ENV_WINNT _WINNT
00140 #endif
00141
00142 #if defined(__MINGW32__)
00143 #define KARCH_ENV_MING32 __MINGW32__
00144 #endif
00145 #if defined(__ICL)
00146 #define KARCH_DEV_INTEL __ICL
00147 #endif
00148 #if defined(_MSC_VER)
00149 #define KARCH_DEV_MSC _MSC_VER
00150 #elif defined(__GNUC__)
00151 #define KARCH_DEV_GNUC __GNUC__
00152 #if !defined(KARCH_CPU_IA32)
00153 #if defined(__pentiumiii__)
00154 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMIII
00155 #elif defined(__pentiumii__)
00156 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMII
00157 #elif defined(__i686__) || defined(__pentiumpro__)
00158 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMPRO
00159 #elif defined(__i586__) || defined(__pentium__) || defined(__k6__)
00160 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00161 #elif defined(__i486__)
00162 #define KARCH_CPU_IA32 KARCH_ARCH_I486
00163 #elif defined(__i386__)
00164 #define KARCH_CPU_IA32 KARCH_ARCH_I386
00165 #else
00166 #define KARCH_CPU_IA32 KARCH_ARCH_I286
00167 #endif
00168 #endif
00169 #if !defined(KARCH_ARCH_IA32)
00170 #define KARCH_ARCH_IA32 KARCH_CPU_IA32
00171 #elif (KARCH_ARCH_IA32 < KARCH_CPU_IA32)
00172 #error "Selected architecture doesn't support selected instruction set"
00173 #endif
00174 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMII)
00175 #define KARCH_CPU_IA32_MMX
00176 #endif
00177 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMIII)
00178 #define KARCH_CPU_IA32_SIMD
00179 #endif
00180 #else
00181 #error "Compiler not supported"
00182 #endif
00183 #if defined(_M_IX86)
00184 #define KARCH_ARCH_IA32 _M_IX86
00185 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUMIII // to force a minimum of PENTIUM II
00186 #if !defined(KARCH_CPU_IA32)
00187 #if (KARCH_ARCH_IA32 >= KARCH_ARCH_PENTIUM)
00188 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00189 #else
00190 #define KARCH_CPU_IA32 KARCH_ARCH_IA32
00191 #endif
00192 #endif
00193 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMII)
00194 #define KARCH_CPU_IA32_MMX
00195 #endif
00196 #if (KARCH_CPU_IA32 >= KARCH_ARCH_PENTIUMIII)
00197 #define KARCH_CPU_IA32_SIMD
00198 #endif
00199 #elif defined(_M_X64)
00200 #define KARCH_ARCH_X64 _M_X64
00201 #define KARCH_CPU_X64 KARCH_ARCH_AMD64
00202 #define KARCH_ENV_WIN64 _WIN64
00203 #define KARCH_ARCH_64 1
00204 #elif defined(_M_IA64)
00205 #define KARCH_ARCH_IA64 _M_IA64
00206 #define KARCH_CPU_IA64 KARCH_ARCH_ITANIUM
00207 #define KARCH_ENV_WIN64 _WIN64
00208 #define KARCH_ARCH_64 1
00209 #else
00210 #error "Architecture not supported"
00211 #endif
00212
00213 #elif defined(__MACH__)
00214 #if __LP64__ && !defined(__x86_64__)
00215 #define __x86_64__
00216 #endif
00217 #if defined(__i386__)
00218 #define KARCH_CPU_IA32 KARCH_ARCH_PENTIUM
00219 #define KARCH_ARCH_IA32 KARCH_CPU_IA32
00220 #elif defined(__x86_64__)
00221 #define KARCH_ARCH_X64 _M_X64
00222 #define KARCH_ARCH_64 1
00223 #else
00224 #define KARCH_ARCH_POWERPC
00225 #define KARCH_CPU_POWERPC
00226 #endif
00227
00228 #define KARCH_DEV_MACOSX
00229 #define KARCH_DEV_GNUC_MACOSX
00230 #define KARCH_ENV_MACOSX
00231 #define KARCH_DEV_GNUC __GNUC__
00232 #define KARCH_ENV_POSIX 1
00233
00234 #else
00235 #error "Environment not supported"
00236 #endif
00237
00238 #endif // FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00239