00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00019 #ifndef LIBCWD_CONFIG_H
00020 #define LIBCWD_CONFIG_H
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00078 #define CWDEBUG_ALLOC 1
00079
00101 #define CWDEBUG_MAGIC (CWDEBUG_ALLOC && 1)
00102
00129 #define CWDEBUG_LOCATION 1
00130
00181 #define CWDEBUG_LIBBFD (CWDEBUG_LOCATION && 0)
00182
00201 #define CWDEBUG_DEBUG 0
00202
00224 #define CWDEBUG_DEBUGOUTPUT (CWDEBUG_DEBUG && 1)
00225
00244 #define CWDEBUG_DEBUGM (CWDEBUG_ALLOC && CWDEBUG_DEBUG && 0)
00245
00263 #define CWDEBUG_MARKER (CWDEBUG_ALLOC && 1)
00264
00265
00266
00267
00268
00269 #define LIBCWD_DLOPEN_DEFINED
00270 #define LIBCWD_HAVE_PTHREAD
00271
00272 #if CWDEBUG_ALLOC
00273 #define LIBCWD_HAVE___LIBC_MALLOC
00274 #undef LIBCWD_HAVE__LIBC_MALLOC
00275 #if defined(LIBCWD_HAVE___LIBC_MALLOC) || defined(LIBCWD_HAVE__LIBC_MALLOC) || defined(LIBCWD_DLOPEN_DEFINED)
00276 #define LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
00277 #endif
00278 #endif
00279
00280 #if LIBCWD_THREAD_SAFE
00281
00282 #define LIBCWD_DO_MAX 8 // Maximal total number of debug objects in a single application.
00283
00284 #define LIBCWD_DC_MAX 256 // Maximal total number of debug channels in a single application.
00285
00286
00308 #define CWDEBUG_DEBUGT 0
00309 #else // !LIBCWD_THREAD_SAFE
00310 #define LIBCWD_THREAD_SAFE 0
00311 #define CWDEBUG_DEBUGT 0
00312 #endif // !LIBCWD_THREAD_SAFE
00313
00314
00315
00316
00317
00318 #ifdef __cplusplus
00319 namespace libcwd {
00320
00321 static unsigned long const config_signature_header_c =
00322 (
00323 #if CWDEBUG_ALLOC
00324 1|
00325 #endif
00326 #if CWDEBUG_MAGIC
00327 2|
00328 #endif
00329 #if CWDEBUG_LOCATION
00330 4|
00331 #endif
00332 #if CWDEBUG_LIBBFD
00333 8|
00334 #endif
00335 #if CWDEBUG_DEBUG
00336 16|
00337 #endif
00338 #if CWDEBUG_DEBUGM
00339 32|
00340 #endif
00341 #if CWDEBUG_DEBUGT
00342 64|
00343 #endif
00344 #if CWDEBUG_MARKER
00345 128|
00346 #endif
00347 #if CWDEBUG_DEBUGOUTPUT
00348 256|
00349 #endif
00350 (512 * (0 + 128 * (99 + 128 * 40))));
00351
00352 extern unsigned long get_config_signature_lib_c(void) __attribute__((const));
00353 extern void conf_check_failed(void);
00354 extern void version_check_failed(void);
00355
00369 inline
00370 void
00371 check_configuration(void) {
00372 if (get_config_signature_lib_c() != config_signature_header_c)
00373 {
00374 if (get_config_signature_lib_c() / 512 != config_signature_header_c / 512)
00375 version_check_failed();
00376 else
00377 conf_check_failed();
00378 }
00379 }
00380
00381 }
00382 #endif // __cplusplus
00383
00384 #endif // LIBCWD_CONFIG_H