Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Kernel.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_KERNEL_H
2 #define GAUDIKERNEL_KERNEL_H
3 
4 // Some pragmas to avoid warnings in VisualC
5 #ifdef _WIN32
6 // Disable warning C4786: identifier was truncated to '255' characters in the debug information
7 # pragma warning( disable : 4786 )
8 // Disable warning C4291: no matching operator delete found; memory will not be freed if initialization throws an
9 // exception
10 # pragma warning( disable : 4291 )
11 // Disable warning C4250: inheritance via dominance
12 # pragma warning( disable : 4250 )
13 #endif
14 
15 // Large integer definition depends of the platform
16 #ifndef NO_LONGLONG_TYPEDEF
17 typedef long long int longlong;
18 typedef unsigned long long int ulonglong;
19 #endif
20 
21 #ifndef LONGLONG_MAX
22 # define LONGLONG_MAX 0x7FFFFFFFFFFFFFFFLL
23 #endif
24 #ifndef LONGLONG_MIN
25 # define LONGLONG_MIN 0x8000000000000000LL
26 #endif
27 
28 #ifndef ULONGLONG_MAX
29 # define ULONGLONG_MAX 0xfFFFFFFFFFFFFFFFLL
30 #endif
31 #ifndef ULONGLONG_MIN
32 # define ULONGLONG_MIN 0x0000000000000000LL
33 #endif
34 
35 // ---------------------------------- Symbol visibility macros (begin)
36 // Enabled on in Gaudi v21 mode
37 #if !defined( GAUDI_V20_COMPAT ) || defined( G21_HIDE_SYMBOLS )
38 // These macros will allow selection on exported symbols
39 // taken from http://gcc.gnu.org/wiki/Visibility
40 # if __GNUC__ >= 4 && !defined( __CINT__ )
41 # define GAUDI_HASCLASSVISIBILITY
42 # endif
43 
44 # ifdef _WIN32
45 /*
46 # define GAUDI_IMPORT __declspec(dllimport)
47 # define GAUDI_EXPORT __declspec(dllexport)
48 # define GAUDI_LOCAL
49 */
50 // The symbol visibility is disabled on Win32 because it is not possible to
51 // make coexists the gcc and VC ways.
52 # define GAUDI_IMPORT
53 # define GAUDI_EXPORT
54 # define GAUDI_LOCAL
55 # else
56 # if defined( GAUDI_HASCLASSVISIBILITY )
57 # define GAUDI_IMPORT __attribute__( ( visibility( "default" ) ) )
58 # define GAUDI_EXPORT __attribute__( ( visibility( "default" ) ) )
59 # define GAUDI_LOCAL __attribute__( ( visibility( "hidden" ) ) )
60 # else
61 # define GAUDI_IMPORT
62 # define GAUDI_EXPORT
63 # define GAUDI_LOCAL
64 # endif
65 # endif
66 
67 // Define GAUDI_API for DLL builds
68 # ifdef GAUDI_LINKER_LIBRARY
69 # define GAUDI_API GAUDI_EXPORT
70 # else
71 # define GAUDI_API GAUDI_IMPORT
72 # endif
73 #else
74 // Dummy definitions for the backward compatibility mode.
75 # define GAUDI_API
76 # define GAUDI_IMPORT
77 # define GAUDI_EXPORT
78 # define GAUDI_LOCAL
79 #endif // GAUDI_V20_COMPAT
80 // ---------------------------------- Symbol visibility macros (end)
81 
82 // -------------- LIKELY/UNLIKELY macros (begin)
83 // Use compiler hinting to improve branch prediction for linux
84 #ifdef __GNUC__
85 # define LIKELY( x ) __builtin_expect( ( x ), 1 )
86 # define UNLIKELY( x ) __builtin_expect( ( x ), 0 )
87 #else
88 # define LIKELY( x ) x
89 # define UNLIKELY( x ) x
90 #endif
91 // -------------- LIKELY/UNLIKELY macros (end)
92 
93 #endif // GAUDIKERNEL_KERNEL_H
long long int longlong
Definition: Kernel.h:17
unsigned long long int ulonglong
Definition: Kernel.h:18