common.h

Go to the documentation of this file.
00001 /*
00002  * common.h
00003  *
00004  * Common definitions for LDNS
00005  *
00006  * a Net::DNS like library for C
00007  *
00008  * (c) NLnet Labs, 2004, 2005
00009  *
00010  * See the file LICENSE for the license
00011  */
00012 
00013 #ifndef _LDNS_COMMON_H
00014 #define _LDNS_COMMON_H
00015 
00016 #if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
00017 
00018 #if defined(HAVE_STDBOOL_H)
00019 #include <stdbool.h>
00020 #else
00021 
00022 /*@ignore@*/
00023 /* splint barfs on this construct */
00024 typedef unsigned char bool;
00025 #define bool bool
00026 #define false 0
00027 #define true  1
00028 #define __bool_true_false_are_defined 1
00029 /*@end@*/
00030 
00031 #endif
00032 
00033 #endif
00034 
00035 #ifdef HAVE_ATTR_FORMAT
00036 #define ATTR_FORMAT(archetype, string_index, first_to_check) \
00037     __attribute__ ((format (archetype, string_index, first_to_check)))
00038 #else /* !HAVE_ATTR_FORMAT */
00039 #define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
00040 #endif /* !HAVE_ATTR_FORMAT */
00041 
00042 #if defined(__cplusplus)
00043 #define ATTR_UNUSED(x)
00044 #elif defined(HAVE_ATTR_UNUSED)
00045 #define ATTR_UNUSED(x)  x __attribute__((unused))
00046 #else /* !HAVE_ATTR_UNUSED */
00047 #define ATTR_UNUSED(x)  x
00048 #endif /* !HAVE_ATTR_UNUSED */
00049 
00050 #endif /* !_LDNS_COMMON_H */

Generated on Sat May 5 22:30:00 2007 for ldns by  doxygen 1.5.1