00001
00008
00009
00010
00011
00012
00013 #ifndef BASE_OS_HH
00014 #define BASE_OS_HH 1
00015
00016
00017
00018
00019 #ifndef _GNU_SOURCE
00020 #define _GNU_SOURCE
00021 #endif
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 namespace base {
00042
00043
00044
00045
00046
00047
00048
00049
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
00059
00060
00061
00062
00063
00064
00065
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
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
00092
00093 #define private public
00094 #define protected public
00095 #endif
00096
00097
00098 #define EXEC_SUFFIX_STR ""
00099 #define DIRECTORY_CHAR '/'
00100 #define DIRECTORY_CHAR_STR "/"
00101 #define GETCWD getcwd
00102
00103 }
00104
00105 #endif // BASE_OS_HH