File: common.h.in

package info (click to toggle)
ldns 1.7.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,416 kB
  • sloc: ansic: 43,318; python: 7,675; sh: 3,642; pascal: 2,351; perl: 2,188; makefile: 1,439; xml: 518
file content (78 lines) | stat: -rw-r--r-- 2,460 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
 * \file common.h
 *
 * Common definitions for LDNS
 */

/**
 * a Net::DNS like library for C
 *
 * (c) NLnet Labs, 2004-2006
 *
 * See the file LICENSE for the license
 */

#ifndef LDNS_COMMON_H
#define LDNS_COMMON_H

/*
 * The build configuration that is used in the distributed headers,
 * as detected and determined by the auto configure script.
 */
#define LDNS_BUILD_CONFIG_HAVE_SSL         @ldns_build_config_have_ssl@
#define LDNS_BUILD_CONFIG_HAVE_INTTYPES_H  @ldns_build_config_have_inttypes_h@
#define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT @ldns_build_config_have_attr_format@
#define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED @ldns_build_config_have_attr_unused@
#define LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T   @ldns_build_config_have_socklen_t@
#define LDNS_BUILD_CONFIG_USE_DANE         @ldns_build_config_use_dane@
#define LDNS_BUILD_CONFIG_HAVE_B32_PTON    @ldns_build_config_have_b32_pton@
#define LDNS_BUILD_CONFIG_HAVE_B32_NTOP    @ldns_build_config_have_b32_ntop@

/*
 * HAVE_STDBOOL_H is not available when distributed as a library, but no build 
 * configuration variables may be used (like those above) because the header
 * is sometimes only available when using special compiler flags to enable the
 * c99 environment. Because we cannot force the usage of this flag, we have to
 * provide a default type. Below what is suggested by the autoconf manual.
 */
/*@ignore@*/
/* splint barfs on this construct */
#ifndef __bool_true_false_are_defined
# ifdef HAVE_STDBOOL_H
#  include <stdbool.h>
# else
#  ifndef HAVE__BOOL
#   ifdef __cplusplus
typedef bool _Bool;
#   else
#    define _Bool signed char
#   endif
#  endif
#  define bool _Bool
#  define false 0
#  define true 1
#  define __bool_true_false_are_defined 1
# endif
#endif
/*@end@*/

#if LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT
#define ATTR_FORMAT(archetype, string_index, first_to_check) \
    __attribute__ ((format (archetype, string_index, first_to_check)))
#else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */
#define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
#endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT */

#if defined(__cplusplus)
#define ATTR_UNUSED(x)
#elif LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED
#define ATTR_UNUSED(x)  x __attribute__((unused))
#else /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */
#define ATTR_UNUSED(x)  x
#endif /* !LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED */

#if !LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T
typedef int socklen_t;
#endif

#endif /* LDNS_COMMON_H */