| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

# Kernel.h

Go to the documentation of this file.

    00001 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/Kernel.h,v 1.15 2006/05/02 13:03:03 hmd Exp $
    00002 #ifndef GAUDIKERNEL_KERNEL_H
    00003 #define GAUDIKERNEL_KERNEL_H
    00004
    00005 // Some pragmas to avoid warnings in VisualC
    00006 #ifdef _WIN32
    00007   // Disable warning C4786: identifier was truncated to '255' characters in the debug information
    00008   #pragma warning ( disable : 4786 )
    00009   // Disable warning C4291: no matching operator delete found; memory will not be freed if initialization throws an exception
    00010   #pragma warning ( disable : 4291 )
    00011   // Disable warning C4250: inheritance via dominance
    00012   #pragma warning ( disable : 4250 )
    00013 #endif
    00014
    00015
    00016 // Large integer definition depends of the platform
    00017 #ifdef _WIN32
    00018 #ifndef NO_LONGLONG_TYPEDEF
    00019   typedef __int64 longlong;
    00020   typedef unsigned __int64 ulonglong;
    00021 #endif
    00022
    00023   #ifndef LONGLONG_MAX
    00024     #define LONGLONG_MAX 0x7FFFFFFFFFFFFFFFLL
    00025   #endif
    00026   #ifndef LONGLONG_MIN
    00027     #define LONGLONG_MIN 0x8000000000000000LL
    00028   #endif
    00029
    00030   #ifndef ULONGLONG_MAX
    00031     #define ULONGLONG_MAX 0xFFFFFFFFFFFFFFFFLL
    00032   #endif
    00033   #ifndef ULONGLONG_MIN
    00034     #define ULONGLONG_MIN 0x0000000000000000LL
    00035   #endif
    00036 #elif defined(__linux) || defined(__APPLE__)
    00037 #ifndef NO_LONGLONG_TYPEDEF
    00038   typedef long long int longlong;
    00039   typedef unsigned long long int ulonglong;
    00040 #endif
    00041
    00042   #ifndef LONGLONG_MAX
    00043     #define LONGLONG_MAX 0x7FFFFFFFFFFFFFFFLL
    00044   #endif
    00045   #ifndef LONGLONG_MIN
    00046     #define LONGLONG_MIN 0x8000000000000000LL
    00047   #endif
    00048
    00049   #ifndef ULONGLONG_MAX
    00050     #define ULONGLONG_MAX 0xfFFFFFFFFFFFFFFFLL
    00051   #endif
    00052   #ifndef ULONGLONG_MIN
    00053     #define ULONGLONG_MIN 0x0000000000000000LL
    00054   #endif
    00055 #else
    00056   // This will not really work !!
    00057   struct __longlong { public: long __data[2]; };
    00058   typedef __longlong longlong;
    00059   typedef __longlong ulonglong;
    00060   static const __longlong LONGLONG_MAX = {0x7FFFFFFF, 0xFFFFFFFF};
    00061   static const __longlong LONGLONG_MIN = {0x80000000, 0x00000000};
    00062   static const __ulonglong ULONGLONG_MAX = {0xFFFFFFFF, 0xFFFFFFFF};
    00063   static const __ulonglong ULONGLONG_MIN = {0x00000000, 0x00000000};
    00064 #endif    // linux
    00065
    00066 #ifdef _WIN32
    00067   #define TEMPLATE_SPECIALIZATION template <>
    00068 #elif defined(__linux) || defined(__APPLE__)
    00069   #define TEMPLATE_SPECIALIZATION
    00070 #endif
    00071
    00072 // ---------------------------------- Symbol visibility macros (begin)
    00073 // Enabled on in Gaudi v21 mode
    00074 #if !defined(GAUDI_V20_COMPAT) || defined(G21_HIDE_SYMBOLS)
    00075 // These macros will allow selection on exported symbols
    00076 // taken from http://gcc.gnu.org/wiki/Visibility
    00077 #if __GNUC__ >= 4 && ! defined(__CINT__)
    00078 #  define GAUDI_HASCLASSVISIBILITY
    00079 #endif
    00080
    00081 #ifdef _WIN32
    00082 /*
    00083 #  define GAUDI_IMPORT __declspec(dllimport)
    00084 #  define GAUDI_EXPORT __declspec(dllexport)
    00085 #  define GAUDI_LOCAL
    00086 */
    00087 // The symbol visibility is disabled on Win32 because it is not possible to
    00088 // make coexists the gcc and VC ways.
    00089 #    define GAUDI_IMPORT
    00090 #    define GAUDI_EXPORT
    00091 #    define GAUDI_LOCAL
    00092 #else
    00093 #  if defined(GAUDI_HASCLASSVISIBILITY)
    00094 #    define GAUDI_IMPORT __attribute__((visibility("default")))
    00095 #    define GAUDI_EXPORT __attribute__((visibility("default")))
    00096 #    define GAUDI_LOCAL  __attribute__((visibility("hidden")))
    00097 #  else
    00098 #    define GAUDI_IMPORT
    00099 #    define GAUDI_EXPORT
    00100 #    define GAUDI_LOCAL
    00101 #  endif
    00102 #endif
    00103
    00104 // Define GAUDI_API for DLL builds
    00105 #ifdef GAUDI_LINKER_LIBRARY
    00106 #define GAUDI_API GAUDI_EXPORT
    00107 #else
    00108 #define GAUDI_API GAUDI_IMPORT
    00109 #endif
    00110 #else
    00111 // Dummy definitions for the backward compatibility mode.
    00112 #define GAUDI_API
    00113 #define GAUDI_IMPORT
    00114 #define GAUDI_EXPORT
    00115 #define GAUDI_LOCAL
    00116 #endif // GAUDI_V20_COMPAT
    00117 // ---------------------------------- Symbol visibility macros (end)
    00118
    00119
    00120 // -------------- LIKELY/UNLIKELY macros (begin)
    00121 // Use compiler hinting to improve branch prediction for linux
    00122 #ifdef __GNUC__
    00123 #  define LIKELY(x)       __builtin_expect((x),1)
    00124 #  define UNLIKELY(x)     __builtin_expect((x),0)
    00125 #else
    00126 #  define LIKELY(x)       x
    00127 #  define UNLIKELY(x)     x
    00128 #endif
    00129 // -------------- LIKELY/UNLIKELY macros (end)
    00130
    00131 #endif  // GAUDIKERNEL_KERNEL_H

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines