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 #define LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T   1
00027 #define LDNS_BUILD_CONFIG_USE_DANE         1
00028 #define LDNS_BUILD_CONFIG_HAVE_B32_PTON    0
00029 #define LDNS_BUILD_CONFIG_HAVE_B32_NTOP    0
00030 
00031 /*
00032  * HAVE_STDBOOL_H is not available when distributed as a library, but no build 
00033  * configuration variables may be used (like those above) because the header
00034  * is sometimes only available when using special compiler flags to enable the
00035  * c99 environment. Because we cannot force the usage of this flag, we have to
00036  * provide a default type. Below what is suggested by the autoconf manual.
00037  */
00038 /*@ignore@*/
00039 /* splint barfs on this construct */
00040 #ifdef HAVE_STDBOOL_H
00041 # include <stdbool.h>
00042 #else
00043 # ifndef HAVE__BOOL
00044 #  ifdef __cplusplus
00045 typedef bool _Bool;
00046 #  else
00047 #   define _Bool signed char
00048 #  endif
00049 # endif
00050 # define bool _Bool
00051 # define false 0
00052 # define true 1
00053 # define __bool_true_false_are_defined 1
00054 #endif
00055 /*@end@*/
00056 
00057 #if LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT
00058 #define ATTR_FORMAT(archetype, string_index, first_to_check) \
00059     __attribute__ ((format (archetype, string_index, first_to_check)))
00060 #else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
00061 #define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
00062 #endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
00063 
00064 #if defined(__cplusplus)
00065 #define ATTR_UNUSED(x)
00066 #elif LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED
00067 #define ATTR_UNUSED(x)  x __attribute__((unused))
00068 #else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
00069 #define ATTR_UNUSED(x)  x
00070 #endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
00071 
00072 #if !LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T
00073 typedef int socklen_t;
00074 #endif
00075 
00076 #endif /* LDNS_COMMON_H */