ldns  1.9.0
common.h
Go to the documentation of this file.
1
6
14
15#ifndef LDNS_COMMON_H
16#define LDNS_COMMON_H
17
18/*
19 * The build configuration that is used in the distributed headers,
20 * as detected and determined by the auto configure script.
21 */
22#define LDNS_BUILD_CONFIG_HAVE_SSL 1
23#define LDNS_BUILD_CONFIG_HAVE_INTTYPES_H 1
24#define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT 1
25#define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED 1
26#define LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T 1
27#define LDNS_BUILD_CONFIG_USE_DANE 1
28#define LDNS_BUILD_CONFIG_HAVE_B32_PTON 0
29#define LDNS_BUILD_CONFIG_HAVE_B32_NTOP 0
30#define LDNS_BUILD_CONFIG_USE_DSA 1
31#define LDNS_BUILD_CONFIG_USE_ED25519 1
32#define LDNS_BUILD_CONFIG_USE_ED448 1
33
34/*
35 * HAVE_STDBOOL_H is not available when distributed as a library, but no build
36 * configuration variables may be used (like those above) because the header
37 * is sometimes only available when using special compiler flags to enable the
38 * c99 environment. Because we cannot force the usage of this flag, we have to
39 * provide a default type. Below what is suggested by the autoconf manual.
40 */
41/*@ignore@*/
42/* splint barfs on this construct */
43#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
44/* c23 defines bool already and deprecates stdbool.h */
45#define __bool_true_false_are_defined
46#endif
47#ifndef __bool_true_false_are_defined
48# ifdef HAVE_STDBOOL_H
49# include <stdbool.h>
50# else
51# ifndef HAVE__BOOL
52# ifdef __cplusplus
53typedef bool _Bool;
54# else
55# define _Bool signed char
56# endif
57# endif
58# define bool _Bool
59# define false 0
60# define true 1
61# define __bool_true_false_are_defined 1
62# endif
63#endif
64/*@end@*/
65
66#if LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT
67#define ATTR_FORMAT(archetype, string_index, first_to_check) \
68 __attribute__ ((format (archetype, string_index, first_to_check)))
69#else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
70#define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
71#endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
72
73#if defined(__cplusplus)
74#define ATTR_UNUSED(x)
75#elif LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED
76#define ATTR_UNUSED(x) x __attribute__((unused))
77#else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
78#define ATTR_UNUSED(x) x
79#endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
80
81#if !LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T
82typedef int socklen_t;
83#endif
84
85#endif /* LDNS_COMMON_H */
#define _Bool
Definition common.h:55