common.h

Go to the documentation of this file.
00001 
00015 #ifndef LDNS_COMMON_H
00016 #define LDNS_COMMON_H
00017 
00018 /*
00019  * The build configuration that is used in the distributed headers,
00020  * as detected and determined by the auto configure script.
00021  */
00022 #define LDNS_BUILD_CONFIG_HAVE_SSL         1
00023 #define LDNS_BUILD_CONFIG_HAVE_INTTYPES_H  1
00024 #define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT 1
00025 #define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED 1
00026 
00027 /*
00028  * HAVE_STDBOOL_H is not available when distributed as a library, but no build 
00029  * configuration variables may be used (like those above) because the header
00030  * is sometimes only available when using special compiler flags to enable the
00031  * c99 environment. Because we cannot force the usage of this flag, we have to
00032  * provide a default type. Below what is suggested by the autoconf manual.
00033  */
00034 /*@ignore@*/
00035 /* splint barfs on this construct */
00036 #ifdef HAVE_STDBOOL_H
00037 # include <stdbool.h>
00038 #else
00039 # ifndef HAVE__BOOL
00040 #  ifdef __cplusplus
00041 typedef bool _Bool;
00042 #  else
00043 #   define _Bool signed char
00044 #  endif
00045 # endif
00046 # define bool _Bool
00047 # define false 0
00048 # define true 1
00049 # define __bool_true_false_are_defined 1
00050 #endif
00051 /*@end@*/
00052 
00053 #if LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT
00054 #define ATTR_FORMAT(archetype, string_index, first_to_check) \
00055     __attribute__ ((format (archetype, string_index, first_to_check)))
00056 #else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
00057 #define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
00058 #endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
00059 
00060 #if defined(__cplusplus)
00061 #define ATTR_UNUSED(x)
00062 #elif LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED
00063 #define ATTR_UNUSED(x)  x __attribute__((unused))
00064 #else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
00065 #define ATTR_UNUSED(x)  x
00066 #endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
00067 
00068 #endif /* LDNS_COMMON_H */

Generated on 8 Jun 2012 for ldns by  doxygen 1.6.1