base_os.hh

Go to the documentation of this file.
00001 /*
00008  * LEGAL:   COPYRIGHT (C) 2004 JIM E. BROOKS
00009  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00010  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00011  *****************************************************************************/
00012 
00013 #ifndef BASE_OS_HH
00014 #define BASE_OS_HH 1
00015 
00016 // base_os.hh is included early so it should be independent of other base*.hh.
00017 
00018 // --- OS-specific ---
00019 #ifndef _GNU_SOURCE
00020 #define _GNU_SOURCE
00021 #endif
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 // --- ANSI/POSIX/universal header files (base_cc.hh includes C++ standard headers) ---
00031 
00032 
00033 //
00034 
00035 
00036 
00037 
00038 
00039 //------------------------------------------------------------------------------
00040 
00041 namespace base {
00042 
00043 // Autogenerated by makefile into out/base_bits.hh
00044 // #define BASE_INT_BITS
00045 // #define BASE_INT_BYTES
00046 // #define BASE_LONG_BITS
00047 // #define BASE_LONG_BYTES
00048 
00049 // BASE_LITTLE_ENDIAN or BASE_BIG_ENDIAN abstracts compiler differences.
00050 #if BYTE_ORDER == LITTLE_ENDIAN  // gcc
00051 #   define BASE_LITTLE_ENDIAN 1
00052 #elif BYTE_ORDER == BIG_ENDIAN  // gcc
00053 #   define BASE_BIG_ENDIAN 1
00054 #else
00055 #   error "Need to define BASE_LITTLE/BIG_ENDIAN in base_os.hh"
00056 #endif
00057 
00058 // Testing GCC_VERSION is tricky.
00059 //
00060 // Test if gcc is version 4.1 or higher:
00061 // GCC_VERSION >= 40100 // right: 2 digits for minor/micro fields!
00062 // GCC_VERSION >= 41000 // wrong
00063 //
00064 // Test if gcc is below gcc 3.0 requires two conditions:
00065 // GCC_VERSION > 0 && GCC_VERSION < 30000  // right
00066 //
00067 #if defined(__GNUC__)
00068 #   if defined(__GNUC_PATCHLEVEL__)
00069 #       define GCC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
00070 #   else
00071 #       define GCC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100)
00072 #   endif
00073 #else
00074 #   define GCC_VERSION 0
00075 #endif
00076 
00077 // For checking a specific gcc minor version (inappropriate for testing at-least-this-version).
00078 #if defined(__GNUC__) && (GCC_VERSION >= 40000 && GCC_VERSION < 40100)
00079 #define GCC_40  1
00080 #endif
00081 
00082 #if defined(__GNUC__) && (GCC_VERSION >= 40100 && GCC_VERSION < 40200)
00083 #define GCC_41  1
00084 #endif
00085 
00086 #if defined(__GNUC__) && GCC_VERSION < 30400
00087 #error "gcc 3.4 or later is required"
00088 #endif
00089 
00090 #if defined(__GNUC__) && GCC_VERSION < 40000
00091 // Workaround: gcc 3.4 has problems with friends that are nested classes
00092 // and friend class eponyms.
00093 #define private public
00094 #define protected public
00095 #endif
00096 
00097 // Filesystem specific.
00098 #define EXEC_SUFFIX_STR     ""
00099 #define DIRECTORY_CHAR      '/'
00100 #define DIRECTORY_CHAR_STR  "/"
00101 #define GETCWD              getcwd
00102 
00103 } // namespace base
00104 
00105 #endif // BASE_OS_HH
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:06 2007