Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/typedefs is written in an unsupported language. File is not indexed.

0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003 
0004 #ifndef tools_typedefs
0005 #define tools_typedefs
0006 
0007 // Similar to AIDA/v3r3p0/Types.h
0008 
0009 //NOTE : we avoid to have std includes here to be sure
0010 //       that in the below ifdef things come only from the compiler.
0011 
0012 //NOTE : if adding new platform here, look at ./s2int64 too.
0013 
0014 namespace tools {
0015 
0016 #ifdef _MSC_VER
0017 
0018 typedef int int32;
0019 typedef __int64 int64;
0020 inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
0021 inline const char* int64_format() {static const char s_v[] = "%ld";return s_v;}
0022 
0023 typedef unsigned int uint32;
0024 typedef unsigned __int64 uint64;
0025 inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
0026 inline const char* uint64_format() {static const char s_v[] = "%lu";return s_v;}
0027 
0028 #ifdef _WIN64
0029 typedef unsigned long long upointer;
0030 inline const char* upointer_format() {static const char s_v[] = "%llu";return s_v;}
0031 inline const char* upointer_format_x() {static const char s_v[] = "0x%llx";return s_v;}
0032 typedef unsigned long long diff_pointer_t;
0033 #else
0034 typedef unsigned long upointer;
0035 inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
0036 inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
0037 typedef unsigned long diff_pointer_t;
0038 #endif
0039 
0040 #elif defined(__MINGW32__)
0041 
0042 typedef int int32;
0043 typedef long long int64;
0044 inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
0045 inline const char* int64_format() {static const char s_v[] = "%ld";return s_v;}
0046 
0047 typedef unsigned int uint32;
0048 typedef unsigned long long uint64;
0049 inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
0050 inline const char* uint64_format() {static const char s_v[] = "%lu";return s_v;}
0051 
0052 #ifdef __MINGW64__
0053 typedef unsigned long long upointer;
0054 inline const char* upointer_format() {static const char s_v[] = "%llu";return s_v;}
0055 inline const char* upointer_format_x() {static const char s_v[] = "0x%llx";return s_v;}
0056 typedef unsigned long long diff_pointer_t;
0057 #else
0058 typedef unsigned long upointer;
0059 inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
0060 inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
0061 typedef unsigned long diff_pointer_t;
0062 #endif
0063 
0064 #elif defined(_LP64)
0065 
0066 // 64 Bit Platforms
0067 typedef int int32;
0068 typedef long int64;
0069 inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
0070 inline const char* int64_format() {static const char s_v[] = "%ld";return s_v;}
0071 
0072 typedef unsigned int uint32;
0073 typedef unsigned long uint64;
0074 inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
0075 inline const char* uint64_format() {static const char s_v[] = "%lu";return s_v;}
0076 
0077 typedef unsigned long diff_pointer_t;
0078 
0079 typedef unsigned long upointer;
0080 inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
0081 inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
0082 
0083 #else
0084 
0085 // 32-Bit Platforms
0086 typedef int int32;
0087 typedef long long int64;
0088 inline const char* int32_format() {static const char s_v[] = "%d";return s_v;}
0089 inline const char* int64_format() {static const char s_v[] = "%lld";return s_v;}
0090 
0091 typedef unsigned int uint32;
0092 typedef unsigned long long uint64;
0093 inline const char* uint32_format() {static const char s_v[] = "%u";return s_v;}
0094 inline const char* uint64_format() {static const char s_v[] = "%llu";return s_v;}
0095 
0096 typedef unsigned long diff_pointer_t;
0097 
0098 typedef unsigned long upointer;
0099 inline const char* upointer_format() {static const char s_v[] = "%lu";return s_v;}
0100 inline const char* upointer_format_x() {static const char s_v[] = "0x%lx";return s_v;}
0101 
0102 #endif
0103 
0104 typedef unsigned char byte;
0105 
0106 //for ./io :
0107 typedef unsigned char uchar;
0108 typedef short int16;
0109 typedef unsigned short ushort;
0110 typedef unsigned short uint16;
0111 typedef uint32 ref;
0112 
0113 class fits_bit {public:char m_c;}; //for exlib/cfitsio
0114 class csv_time {public:long m_l;}; //for rcsv_ntuple
0115 
0116 typedef unsigned int key_code;
0117 
0118 }
0119 
0120 #endif