• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * libxml.h: internal header only used during the compilation of libxml
3  *
4  * See COPYRIGHT for the status of this software
5  *
6  * Author: breese@users.sourceforge.net
7  */
8 
9 #ifndef __XML_LIBXML_H__
10 #define __XML_LIBXML_H__
11 
12 /*
13  * These macros must be defined before including system headers.
14  * Do not add any #include directives above this block.
15  */
16 #ifndef NO_LARGEFILE_SOURCE
17   #ifndef _LARGEFILE_SOURCE
18     #define _LARGEFILE_SOURCE
19   #endif
20   #ifndef _FILE_OFFSET_BITS
21     #define _FILE_OFFSET_BITS 64
22   #endif
23 #endif
24 
25 /*
26  * These files are generated by the build system and contain private
27  * and public build configuration.
28  */
29 #include "config.h"
30 #include <libxml/xmlversion.h>
31 
32 #if __STDC_VERSION__ >= 199901L
33   #define XML_INLINE inline
34 #elif defined(_MSC_VER)
35   #if _MSC_VER >= 1900
36     #define XML_INLINE inline
37   #else
38     #define XML_INLINE _inline
39   #endif
40 #else
41   #define XML_INLINE
42 #endif
43 
44 #if __STDC_VERSION__ >= 199901L || (defined(_MSC_VER) && _MSC_VER >= 1900)
45   #include <stdint.h>
46   #define XML_INTPTR_T intptr_t
47 #else
48   #include <stddef.h>
49   #define XML_INTPTR_T ptrdiff_t
50 #endif
51 
52 #define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
53 #define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
54 
55 #if !defined(_WIN32) && \
56     !defined(__CYGWIN__) && \
57     (defined(__clang__) || \
58      (defined(__GNUC__) && (__GNUC__ >= 4)))
59   #define XML_HIDDEN __attribute__((visibility("hidden")))
60 #else
61   #define XML_HIDDEN
62 #endif
63 
64 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 207 || defined(__clang__)
65   #define ATTRIBUTE_UNUSED __attribute__((unused))
66 #else
67   #define ATTRIBUTE_UNUSED
68 #endif
69 
70 #ifdef HAVE_FUNC_ATTRIBUTE_DESTRUCTOR
71   #define ATTRIBUTE_DESTRUCTOR __attribute__((destructor))
72 #endif
73 
74 #if (defined(__clang__) && __clang_major__ >= 18) || \
75     (defined(__GNUC__) && __GNUC__ >= 15)
76   #define ATTRIBUTE_COUNTED_BY(c) __attribute__((__counted_by__(c)))
77 #else
78   #define ATTRIBUTE_COUNTED_BY(c)
79 #endif
80 
81 #if defined(__clang__) || \
82     (defined(__GNUC__) && (__GNUC__ >= 8) && !defined(__EDG__))
83   #define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg)))
84 #else
85   #define ATTRIBUTE_NO_SANITIZE(arg)
86 #endif
87 
88 #ifdef __clang__
89   #if (!defined(__apple_build_version__) && __clang_major__ >= 12) || \
90       (defined(__apple_build_version__) && __clang_major__ >= 13)
91     #define ATTRIBUTE_NO_SANITIZE_INTEGER \
92       ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") \
93       ATTRIBUTE_NO_SANITIZE("unsigned-shift-base")
94   #else
95     #define ATTRIBUTE_NO_SANITIZE_INTEGER \
96       ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow")
97   #endif
98 #else
99   #define ATTRIBUTE_NO_SANITIZE_INTEGER
100 #endif
101 
102 #endif /* ! __XML_LIBXML_H__ */
103