Code_TYMPAN  4.4.0
Industrial site acoustic simulation
defines.h
Go to the documentation of this file.
1 #ifndef TY_C_DEFINES
2 #define TY_C_DEFINES
3 
4 /*
5  Initial platform/compiler-related stuff to set.
6  */
7 #define TY_PLATFORM_WIN32 1
8 #define TY_PLATFORM_WIN64 2
9 #define TY_PLATFORM_LINUX 3
10 
11 #define TY_COMPILER_MSVC 1
12 #define TY_COMPILER_GNUC 2
13 
14 #define TY_ARCHITECTURE_32 1
15 #define TY_ARCHITECTURE_64 2
16 
17 /* Finds the compiler type and version.
18  */
19 #if defined(_MSC_VER)
20  #define TY_COMPILER TY_COMPILER_MSVC
21  #define TY_COMP_VER _MSC_VER
22 
23 #elif defined(__GNUC__)
24  #define TY_COMPILER TY_COMPILER_GNUC
25  #define TY_COMP_VER (((__GNUC__)*100) + (__GNUC_MINOR__ * 10) + __GNUC_PATCHLEVEL__)
26 
27 #else
28  #pragma error "No known compiler. Abort! Abort!"
29 
30 #endif
31 
32 /* Finds the current platform */
33 #if defined(_WIN64_) || defined(_WIN64)
34  #define TY_PLATFORM TY_PLATFORM_WIN64
35 
36 #elif defined(__WIN32__) || defined(_WIN32)
37  #define TY_PLATFORM TY_PLATFORM_WIN32
38 
39 #else
40  #define TY_PLATFORM TY_PLATFORM_LINUX
41 #endif
42 
43 /* Find the arch type */
44 #if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || \
45  defined(__ia64__) || defined(__s390__) || defined(__s390x__)
46  #define TY_ARCH_TYPE TY_ARCHITECTURE_64
47 #else
48  #define TY_ARCH_TYPE TY_ARCHITECTURE_32
49 #endif
50 
51 #if TY_ARCH_TYPE == TY_ARCHITECTURE_32
52  #define TY_PRODUCT_PLATFORM_ "32bits"
53 #else
54  #define TY_PRODUCT_PLATFORM_ "64bits"
55 #endif
56 
57 // Integer formats of fixed bit width
58 typedef unsigned char uint8;
59 typedef unsigned short uint16;
60 typedef unsigned int uint32;
61 // define uint64 type
62 #if TY_COMPILER == TY_COMPILER_MSVC
63 typedef unsigned __int64 uint64;
64 #else
65 typedef unsigned long long uint64;
66 #endif
67 
68 #endif // TY_C_DEFINES
unsigned short uint16
Definition: defines.h:59
unsigned int uint32
Definition: defines.h:60
unsigned long long uint64
Definition: defines.h:65
unsigned char uint8
Definition: defines.h:58