4 * Common definitions for LDNS
8 * a Net::DNS like library for C
10 * (c) NLnet Labs, 2004-2006
12 * See the file LICENSE for the license
19 * The build configuration that is used in the distributed headers,
20 * as detected and determined by the auto configure script.
22 #define LDNS_BUILD_CONFIG_HAVE_SSL @ldns_build_config_have_ssl@
23 #define LDNS_BUILD_CONFIG_HAVE_INTTYPES_H @ldns_build_config_have_inttypes_h@
24 #define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT @ldns_build_config_have_attr_format@
25 #define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED @ldns_build_config_have_attr_unused@
26 #define LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T @ldns_build_config_have_socklen_t@
27 #define LDNS_BUILD_CONFIG_USE_DANE @ldns_build_config_use_dane@
28 #define LDNS_BUILD_CONFIG_HAVE_B32_PTON @ldns_build_config_have_b32_pton@
29 #define LDNS_BUILD_CONFIG_HAVE_B32_NTOP @ldns_build_config_have_b32_ntop@
32 * HAVE_STDBOOL_H is not available when distributed as a library, but no build
33 * configuration variables may be used (like those above) because the header
34 * is sometimes only available when using special compiler flags to enable the
35 * c99 environment. Because we cannot force the usage of this flag, we have to
36 * provide a default type. Below what is suggested by the autoconf manual.
39 /* splint barfs on this construct */
40 #ifndef __bool_true_false_are_defined
41 # ifdef HAVE_STDBOOL_H
48 # define _Bool signed char
54 # define __bool_true_false_are_defined 1
59 #if LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT
60 #define ATTR_FORMAT(archetype, string_index, first_to_check) \
61 __attribute__ ((format (archetype, string_index, first_to_check)))
62 #else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
63 #define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
64 #endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
66 #if defined(__cplusplus)
67 #define ATTR_UNUSED(x)
68 #elif LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED
69 #define ATTR_UNUSED(x) x __attribute__((unused))
70 #else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
71 #define ATTR_UNUSED(x) x
72 #endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
74 #if !LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T
75 typedef int socklen_t;
78 #endif /* LDNS_COMMON_H */