Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

config.h
Go to the documentation of this file.
1 // include/libcwd/timestamp-config.h. Generated from config.h.in by configure.
2 // $Header$
3 //
4 // Copyright (C) 2000 - 2003, by
5 //
6 // Carlo Wood, Run on IRC <carlo@alinoe.com>
7 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
8 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
9 //
10 // This file may be distributed under the terms of the Q Public License
11 // version 1.0 as appearing in the file LICENSE.QPL included in the
12 // packaging of this file.
13 //
14 
19 #ifndef LIBCWD_CONFIG_H
20 #define LIBCWD_CONFIG_H
21 
22 //
23 // DO NOT CHANGE THIS FILE
24 //
25 // The defines in this file are configuration options chosen during
26 // compilation of libcwd. To change these options, run `configure'
27 // with the appropriate commandline options (Use `configure --help'
28 // for more details). In order to be sure that a program is linking
29 // with a library that was compiled with the same header file, call
30 // Debug( check_configuration() ); at the top of main() in your program.
31 //
32 
78 #define CWDEBUG_ALLOC 1
79 
101 #define CWDEBUG_MAGIC (CWDEBUG_ALLOC && 1)
102 
130 #define CWDEBUG_GLIBCXX_DEBUG 0
131 
158 #define CWDEBUG_LOCATION 1
159 
210 #define CWDEBUG_LIBBFD (CWDEBUG_LOCATION && 0)
211 
230 #define CWDEBUG_DEBUG 0
231 
253 #define CWDEBUG_DEBUGOUTPUT (CWDEBUG_DEBUG && 1)
254 
273 #define CWDEBUG_DEBUGM (CWDEBUG_ALLOC && CWDEBUG_DEBUG && 0)
274 
292 #define CWDEBUG_MARKER (CWDEBUG_ALLOC && 1)
293 
294 //
295 // autoconf defines that are needed.
296 //
297 
298 #define LIBCWD_HAVE_PTHREAD
299 
300 #if CWDEBUG_ALLOC
301 #define LIBCWD_HAVE___LIBC_MALLOC
302 #undef LIBCWD_HAVE__LIBC_MALLOC
303 #define LIBCWD_HAVE_DLOPEN
304 #define LIBCWD_HAVE_POSIX_MEMALIGN
305 #define LIBCWD_HAVE_ALIGNED_ALLOC
306 #define LIBCWD_HAVE_MEMALIGN
307 #define LIBCWD_HAVE_VALLOC
308 #if defined(LIBCWD_HAVE___LIBC_MALLOC) || defined(LIBCWD_HAVE__LIBC_MALLOC) || defined(LIBCWD_HAVE_DLOPEN)
309 #define LIBCWD_USE_EXTERNAL_C_LINKAGE_FOR_MALLOC
310 #endif
311 #endif
312 
313 #if LIBCWD_THREAD_SAFE
314 
315 #define LIBCWD_DO_MAX 8 // Maximal total number of debug objects in a single application.
316  // This costs about 640 kb of memory per object! (640 bytes * PTHREAD_THREADS_MAX).
317 #define LIBCWD_DC_MAX 256 // Maximal total number of debug channels in a single application.
318  // Costs 4 kb of memory per channel (exclusive the actual channels).
319 
341 #define CWDEBUG_DEBUGT 0
342 #else // !LIBCWD_THREAD_SAFE
343 #define LIBCWD_THREAD_SAFE 0
344 #define CWDEBUG_DEBUGT 0
345 #endif // !LIBCWD_THREAD_SAFE
346 
347 //
348 // Configuration signature
349 //
350 
351 #ifdef __cplusplus
352 namespace libcwd {
353 
354 static unsigned long const config_signature_header_c =
355  (
356 #if CWDEBUG_ALLOC
357  1|
358 #endif
359 #if CWDEBUG_MAGIC
360  2|
361 #endif
362 #if CWDEBUG_LOCATION
363  4|
364 #endif
365 #if CWDEBUG_LIBBFD
366  8|
367 #endif
368 #if CWDEBUG_DEBUG
369  16|
370 #endif
371 #if CWDEBUG_DEBUGM
372  32|
373 #endif
374 #if CWDEBUG_DEBUGT
375  64|
376 #endif
377 #if CWDEBUG_MARKER
378  128|
379 #endif
380 #if CWDEBUG_DEBUGOUTPUT
381  256|
382 #endif
383  (512 * (1 + 128 * (1 + 128 * 1))));
384 
385 extern unsigned long get_config_signature_lib_c(void) __attribute__((const));
386 extern void conf_check_failed(void);
387 extern void version_check_failed(void);
388 
402 inline
403 void
404 check_configuration(void) {
405  if (get_config_signature_lib_c() != config_signature_header_c)
406  {
407  if (get_config_signature_lib_c() / 512 != config_signature_header_c / 512)
408  version_check_failed();
409  else
410  conf_check_failed();
411  }
412 }
413 
414 } // namespace libcwd
415 #endif // __cplusplus
416 
417 #endif // LIBCWD_CONFIG_H
namespace for libcwd.
Definition: debug.cc:87
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.