1 #ifndef stdafx_h_ 2 #define stdafx_h_ 3 4 // stdafx.h : include file for standard system include files, 5 // or project specific include files that are used frequently, but 6 // are changed infrequently 7 // 8 9 // Default to external release. 10 #ifndef SGTL_INTERNAL 11 #define SGTL_INTERNAL 0 12 #endif 13 14 #include <iostream> 15 #include <stdexcept> 16 17 #if defined(WIN32) 18 //#include <tchar.h> 19 20 // define this macro for use in VC++ 21 #if !defined(__LITTLE_ENDIAN__) 22 #define __LITTLE_ENDIAN__ 1 23 #endif // !defined(__LITTLE_ENDIAN__) 24 #endif // defined(WIN32) 25 26 #if defined(Linux) 27 // For Linux systems only, types.h only defines the signed 28 // integer types. This is not professional code. 29 // Update: They are defined in the header files in the more recent version of redhat enterprise gcc. 30 #include <sys/types.h> 31 //typedef unsigned long uint32_t; 32 //typedef unsigned short uint16_t; 33 //typedef unsigned char uint8_t; 34 35 //#define TCHAR char 36 //#define _tmain main 37 38 // give a default endian in case one is not defined on Linux (it should be, though) 39 #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) 40 #define __LITTLE_ENDIAN__ 1 41 #endif // !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) 42 43 #endif // defined(Linux) 44 45 46 #if !defined(Linux) 47 // redefine missing typedefs from stdint.h or syst/types.h 48 49 typedef unsigned long uint32_t; 50 typedef unsigned short uint16_t; 51 typedef unsigned char uint8_t; 52 53 typedef long int32_t; 54 typedef short int16_t; 55 typedef char int8_t; 56 #endif // !defined(Linux) 57 58 #if !defined(TRUE) 59 #define TRUE 1 60 #endif // !defined(TRUE) 61 62 #if !defined(FALSE) 63 #define FALSE 0 64 #endif // !defined(FALSE) 65 66 #endif // stdafx_h_ 67