AppConfig.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef APPCONFIG_H
00011 #define APPCONFIG_H
00012 
00013 #define BIG_ENDIAN_BYTE_ORDER 4321
00014 #define LITTLE_ENDIAN_BYTE_ORDER 1234
00015 
00016 #if defined(_MSC_VER)
00017    #define WIN_API
00018    #define EXPORT_SYMBOL __declspec(dllexport)
00019 
00020    #define OPTICKS_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER
00021    #define LONG_SIZE 4
00022    typedef __int16 int16_t;
00023    typedef __int32 int32_t;
00024    typedef __int64 int64_t;
00025    typedef unsigned __int16 uint16_t;
00026    typedef unsigned __int32 uint32_t;
00027    typedef unsigned __int64 uint64_t;
00028    #if defined(_WIN64)
00029       //check for _WIN64 first, since on x64
00030       //both are defined.
00031       #define PTR_SIZE 8
00032       #define BROKEN_INLINE_HINT __declspec(noinline)
00033    #elif defined(_WIN32)
00034       #define PTR_SIZE 4
00035       #define JPEG2000_SUPPORT
00036    #endif
00037    #define CG_SUPPORTED
00038 
00039    //platform defines
00040    #define SLASH std::string("\\")
00041    #define EXE_EXTENSION std::string(".exe")
00042    #define FILENO _fileno
00043    #define LINKAGE __declspec(dllexport)
00044    #define HANDLE_TYPE HANDLE
00045    #define MICRON std::string("µ")
00046    #define DEG_CHAR std::string("°")
00047    #define OPENCOLLADA_SUPPORT
00048 
00049    #define snprintf _snprintf
00050 
00051    #include <stddef.h>
00052    #define DISAMBIGUATE_TEMPLATE
00053    #define HIDE_UNUSED_VARIABLE_WARNING
00054 
00055    #define GL_CALLBACK CALLBACK
00056 #elif defined (__SUNPRO_CC)
00057    #include <sys/isa_defs.h>
00058 
00059    #define UNIX_API
00060    #define SOLARIS
00061    #define EXPORT_SYMBOL 
00062 
00063    #ifdef _BIG_ENDIAN
00064       #define OPTICKS_BYTE_ORDER BIG_ENDIAN_BYTE_ORDER
00065    #else
00066       #define OPTICKS_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER
00067    #endif
00068 
00069    #define PTR_SIZE _POINTER_ALIGNMENT
00070    #define LONG_SIZE _LONG_ALIGNMENT
00071 
00072 
00073    //platform defines
00074    #define O_TEXT 0x0000 
00075    #define O_BINARY 0x0000
00076    #define SLASH std::string("/")
00077    #define EXE_EXTENSION std::string("")
00078    #define FILENO fileno
00079    #define LINKAGE
00080    #define HANDLE_TYPE int
00081    #define MICRON std::string("u")
00082    #define DEG_CHAR std::string("*")
00083 
00084    //allow user to use __stdcall on unix and do the correct thing
00085    #define __stdcall
00086 
00087    #include <sys/int_types.h>
00088    #define DISAMBIGUATE_TEMPLATE
00089    #define HIDE_UNUSED_VARIABLE_WARNING
00090 
00091    #define GL_CALLBACK
00092 #elif defined(__linux__)
00093 #if !defined(__amd64__)
00094 #error "Linux support requires a 64-bit x86 (AMD64) processor"
00095 #endif
00096 
00097 #if !defined(__GNUC__) || __GNUC__ != 4
00098 #error "Linux support requires version 4 of the GNU g++ compiler"
00099 #endif
00100 
00101    #include <stddef.h>
00102    #include <stdlib.h>
00103    #include <sys/types.h>
00104    #include <stdint.h>
00105    #include <stdexcept>
00106 
00107    #include <endian.h>
00108    #define UNIX_API
00109    #define LINUX
00110    #define CG_SUPPORTED
00111    #define EXPORT_SYMBOL 
00112 
00113    #if __BYTE_ORDER == __LITTLE_ENDIAN
00114       #define OPTICKS_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER
00115    #else
00116       #define OPTICKS_BYTE_ORDER BIG_ENDIAN_BYTE_ORDER
00117    #endif
00118 
00119    #define PTR_SIZE __SIZEOF_POINTER__
00120    #define LONG_SIZE __SIZEOF_LONG__
00121 
00122    //platform defines
00123    #define O_TEXT 0x0000 
00124    #define O_BINARY 0x0000
00125    #define SLASH std::string("/")
00126    #define EXE_EXTENSION std::string("")
00127    #define FILENO fileno
00128    #define LINKAGE
00129    #define HANDLE_TYPE int
00130    #define MICRON std::string("u")
00131    #define DEG_CHAR std::string("*")
00132 
00133    //allow user to use __stdcall on unix and do the correct thing
00134    #define __stdcall
00135 
00136    #define DISAMBIGUATE_TEMPLATE template
00137    #define HIDE_UNUSED_VARIABLE_WARNING __attribute__((unused))
00138 
00139    #define GL_CALLBACK
00140 #else
00141    #error Unrecognized build platform
00142 #endif
00143 
00144 #if !defined(BROKEN_INLINE_HINT)
00145 #define BROKEN_INLINE_HINT
00146 #endif
00147 
00148 #define STRING2(x) #x
00149 #define STRING(x) STRING2(x)
00150 
00151 typedef intptr_t word_t;
00152 typedef uintptr_t uword_t;
00153 
00154 #define PI    3.14159265358979323e0  // PI
00155 
00156 #endif

Software Development Kit - Opticks 4.9.0 Build 16218