FBX SDK Reference Guide: arch.h Source File
00001 #ifndef FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00002 #define FBXFILESDK_COMPONENTS_KBASELIB_KARCH_ARCH_H
00003 
00004 /**************************************************************************************
00005 
00006  Copyright © 2001 - 2008 Autodesk, Inc. and/or its licensors.
00007  All Rights Reserved.
00008 
00009  The coded instructions, statements, computer programs, and/or related material 
00010  (collectively the "Data") in these files contain unpublished information 
00011  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00012  Canada and United States of America federal copyright law and by international 
00013  treaties. 
00014  
00015  The Data may not be disclosed or distributed to third parties, in whole or in
00016  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00017 
00018  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00019  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00020  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00021  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00022  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00023  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00024  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00028  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00029  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00030  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00031  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00032  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00033  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00034  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00035  OR DAMAGE. 
00036 
00037 **************************************************************************************/
00038 
00039 /*
00040  *  Intel IA32 Architecture
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  *  AMD x64 Architecture
00053  */
00054 #define KARCH_ARCH_AMD64        800
00055 
00056 /*
00057  *  Intel IA64 Architecture
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         // CPU Determination.
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         // ARCH Determination.
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     //#define KARCH_CPU_IA32_MMX
00128     //#define KARCH_CPU_IA32_SIMD
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 //  #define _WIN32_WINNT    0x0501      // for SetThreadIdealProcessor,TryEnterCriticalSection that does not work on windows 95/98
00137 //  #define WINVER          0x0501
00138 
00139     // Use a newer version of comctl32.dll tooltips for Sketchbook
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