00001
00008 #ifndef CXXUTILS_SEAL_COMMON_H
00009 #define CXXUTILS_SEAL_COMMON_H
00010
00011
00013 #ifdef _WIN32
00014 #define IOFD_INVALID (void *)-1
00015 #else
00016 #define IOFD_INVALID -1
00017 #endif
00018
00020 #ifdef _WIN32
00021 typedef void *IOFD;
00022 #else
00023 typedef int IOFD;
00024 #endif
00025
00026
00027
00028
00029 #ifdef __linux
00030
00031
00032
00033
00034 #define HAVE_CXX_STDC_HEADERS 1
00035
00036
00037
00038
00039 #define HAVE_POSIX_SIGNALS 1
00040
00041
00042 #define HAVE_POSIX_RT_SIGNALS 1
00043
00044
00045 #define HAVE_STRSIGNAL 1
00046 #define HAVE_STRSIGNAL_DECL 1
00047
00048
00049 #define HAVE_RAISE 1
00050 #define HAVE_RAISE_DECL 1
00051
00052
00053 #define HAVE_SYS_SIGLIST 1
00054
00055
00056
00057
00058 #define HAVE_PROGRAM_INVOCATION_NAME 1
00059
00060
00061
00062
00063
00064 #define PROG_PSTACK "/usr/bin/pstack"
00065
00066
00067 #define PROG_CXXFILT "/usr/bin/c++filt"
00068
00069
00070 #define HAVE_BACKTRACE_SYMBOLS_FD 1
00071
00072
00073
00074
00075 #define HAVE_DLOPEN 1
00076 #define HAVE_DLOPEN_DECL 1
00077
00078
00079 #define HAVE_LINK_H 1
00080
00081
00082 #define HAVE_DLADDR 1
00083 #define HAVE_DLADDR_DECL 1
00084
00085
00086
00087
00088
00089
00090 #define HAVE_ELF_H 1
00091
00092 #endif // __linux
00093
00094
00095
00096 #ifdef __APPLE__
00097
00098
00099 #define HAVE_R_DEBUG 1
00100
00101
00102 #define HAVE_CXX_STDC_HEADERS 1
00103
00104
00105
00106
00107 #define HAVE_POSIX_SIGNALS 1
00108
00109
00110 #define HAVE_STRSIGNAL 1
00111 #define HAVE_STRSIGNAL_DECL 1
00112
00113
00114 #define HAVE_RAISE 1
00115 #define HAVE_RAISE_DECL 1
00116
00117
00118 #define HAVE_SYS_SIGLIST 1
00119
00120
00121
00122
00123 #define PROG_CXXFILT "/usr/bin/c++filt"
00124
00125
00126 #define HAVE_BACKTRACE_SYMBOLS_FD 1
00127
00128
00129
00130
00131 #define HAVE_DLOPEN 1
00132 #define HAVE_DLOPEN_DECL 1
00133
00134
00135 #define HAVE_DLADDR 1
00136 #define HAVE_DLADDR_DECL 1
00137
00138
00139 #define HAVE_MACH_O_DYLD_H 1
00140
00141 #endif // __APPLE__
00142
00143
00144 #if HAVE_LOAD
00145 # define PATH "LIBPATH"
00146 #elif HAVE_DLOPEN
00147 # if defined __APPLE__ && defined __MACH__
00148 # define PATH "DYLD_LIBRARY_PATH"
00149 # else
00150 # define PATH "LD_LIBRARY_PATH"
00151 # endif
00152 #elif HAVE_SHL_LOAD
00153 # define PATH "SHLIB_PATH"
00154 #elif defined _WIN32
00155 # define PATH "PATH"
00156 #else
00157 # define PATH 0
00158 #endif
00159
00160
00161
00162
00163 #if HAVE_CXX_STDC_HEADERS
00164 # define STDC std
00165 #else
00166 # define STDC
00167 #endif
00168
00169
00170
00171
00172 # ifndef _WIN32
00173 # if HAVE_LOADER_H
00174 # include <loader.h>
00175 # endif
00176 # if HAVE_LINK_H
00177 # include <link.h>
00178 # include <limits.h>
00179 # include <sys/stat.h>
00180 # include <unistd.h>
00181 # endif
00182 # if HAVE_SGIDEFS_H // irix n32, 64
00183 # include <sgidefs.h>
00184 # include <objlist.h>
00185 # include <obj_list.h>
00186 # include <obj.h>
00187 # endif
00188 # if HAVE_ELF_H
00189 # include <elf.h>
00190 # endif
00191 # endif // ! _WIN32
00192
00193
00194
00195 #if (defined ABI64 || defined _ABI64 || \
00196 (defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI64)) \
00197 || (defined sparcv9 || defined _sparcv9 \
00198 || defined __sparcv9 || defined __sparcv9__) \
00199 || (defined arch64 || defined _arch64 || \
00200 defined __arch64 || defined __arch64__)
00201 # define ELF_ABI 64
00202 #else
00203 # define ELF_ABI 32
00204 #endif
00205 #ifndef ElfW
00206 # define ElfW(type) ElfW1(Elf,ELF_ABI,type)
00207 # define ElfW1(e,w,t) ElfW2(Elf,w,_##t)
00208 # define ElfW2(e,w,t) e ## w ## t
00209 #endif
00210
00211
00212 #endif // CXXUTILS_SEAL_COMMON_H