python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libelf / preprocessor-warnings.patch
blobe04c8ee202a026f0c757518a1da8795909fa2221
1 diff --git a/lib/elf_repl.h b/lib/elf_repl.h
2 index c5cf90f..7e1e8df 100644
3 --- a/lib/elf_repl.h
4 +++ b/lib/elf_repl.h
5 @@ -45,7 +45,7 @@ typedef __libelf_u32_t Elf32_Word;
6 #define ELF32_FSZ_SWORD 4
7 #define ELF32_FSZ_WORD 4
9 -#if __LIBELF64
10 +#if defined(__LIBELF64)
12 typedef __libelf_u64_t Elf64_Addr;
13 typedef __libelf_u16_t Elf64_Half;
14 @@ -93,7 +93,7 @@ typedef struct {
15 Elf32_Half e_shstrndx;
16 } Elf32_Ehdr;
18 -#if __LIBELF64
19 +#if defined(__LIBELF64)
20 typedef struct {
21 unsigned char e_ident[EI_NIDENT];
22 Elf64_Half e_type;
23 @@ -307,7 +307,7 @@ typedef struct {
24 Elf32_Word sh_entsize;
25 } Elf32_Shdr;
27 -#if __LIBELF64
28 +#if defined(__LIBELF64)
29 typedef struct {
30 Elf64_Word sh_name;
31 Elf64_Word sh_type;
32 @@ -434,7 +434,7 @@ typedef struct {
33 Elf32_Half st_shndx;
34 } Elf32_Sym;
36 -#if __LIBELF64
37 +#if defined(__LIBELF64)
38 typedef struct {
39 Elf64_Word st_name;
40 unsigned char st_info;
41 @@ -457,7 +457,7 @@ typedef struct {
42 #define ELF32_ST_TYPE(i) ((i)&0xf)
43 #define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
45 -#if __LIBELF64
46 +#if defined(__LIBELF64)
47 #define ELF64_ST_BIND(i) ((i)>>4)
48 #define ELF64_ST_TYPE(i) ((i)&0xf)
49 #define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
50 @@ -495,7 +495,7 @@ typedef struct {
51 * Macros for manipulating st_other
53 #define ELF32_ST_VISIBILITY(o) ((o)&0x3)
54 -#if __LIBELF64
55 +#if defined(__LIBELF64)
56 #define ELF64_ST_VISIBILITY(o) ((o)&0x3)
57 #endif /* __LIBELF64 */
59 @@ -521,7 +521,7 @@ typedef struct {
60 Elf32_Sword r_addend;
61 } Elf32_Rela;
63 -#if __LIBELF64
64 +#if defined(__LIBELF64)
65 typedef struct {
66 Elf64_Addr r_offset;
67 Elf64_Xword r_info;
68 @@ -541,7 +541,7 @@ typedef struct {
69 #define ELF32_R_TYPE(i) ((unsigned char)(i))
70 #define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
72 -#if __LIBELF64
73 +#if defined(__LIBELF64)
74 #define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
75 #define ELF64_R_TYPE(i) ((i)&0xffffffffL)
76 #define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
77 @@ -556,7 +556,7 @@ typedef struct {
78 Elf32_Word n_type; /* descriptor type */
79 } Elf32_Nhdr;
81 -#if __LIBELF64
82 +#if defined(__LIBELF64)
83 /* Solaris and GNU use this layout. Be compatible. */
84 /* XXX: Latest ELF specs say it's 64-bit!!! */
85 typedef struct {
86 @@ -587,7 +587,7 @@ typedef struct {
87 Elf32_Word p_align;
88 } Elf32_Phdr;
90 -#if __LIBELF64
91 +#if defined(__LIBELF64)
92 typedef struct {
93 Elf64_Word p_type;
94 Elf64_Word p_flags;
95 @@ -654,7 +654,7 @@ typedef struct {
96 } d_un;
97 } Elf32_Dyn;
99 -#if __LIBELF64
100 +#if defined(__LIBELF64)
101 typedef struct {
102 Elf64_Sxword d_tag;
103 union {
104 @@ -798,7 +798,7 @@ typedef struct {
105 Elf32_Half si_flags;
106 } Elf32_Syminfo;
108 -#if __LIBELF64
109 +#if defined(__LIBELF64)
110 typedef struct {
111 Elf64_Half si_boundto;
112 Elf64_Half si_flags;
113 @@ -863,7 +863,7 @@ typedef struct {
115 typedef Elf32_Half Elf32_Versym;
117 -#if __LIBELF64
118 +#if defined(__LIBELF64)
120 typedef struct {
121 Elf64_Half vd_version;
122 @@ -933,7 +933,7 @@ typedef Elf64_Half Elf64_Versym;
124 * Move section
126 -#if __LIBELF64
127 +#if defined(__LIBELF64)
129 typedef struct {
130 Elf32_Lword m_value;
131 @@ -973,7 +973,7 @@ typedef struct {
132 } c_un;
133 } Elf32_Cap;
135 -#if __LIBELF64
136 +#if defined(__LIBELF64)
138 typedef struct {
139 Elf64_Xword c_tag;
140 diff --git a/lib/gelf.h b/lib/gelf.h
141 index 5af0558..98a759c 100644
142 --- a/lib/gelf.h
143 +++ b/lib/gelf.h
144 @@ -22,15 +22,15 @@
145 #ifndef _GELF_H
146 #define _GELF_H
148 -#if __LIBELF_INTERNAL__
149 +#if defined(__LIBELF_INTERNAL__)
150 #include <libelf.h>
151 #else /* __LIBELF_INTERNAL__ */
152 #include <libelf/libelf.h>
153 #endif /* __LIBELF_INTERNAL__ */
155 -#if __LIBELF_NEED_LINK_H
156 +#if defined(__LIBELF_NEED_LINK_H)
157 #include <link.h>
158 -#elif __LIBELF_NEED_SYS_LINK_H
159 +#elif defined(__LIBELF_NEED_SYS_LINK_H)
160 #include <sys/link.h>
161 #endif /* __LIBELF_NEED_LINK_H */
163 @@ -46,7 +46,7 @@ extern "C" {
164 # endif /* __STDC__ || defined(__cplusplus) */
165 #endif /* __P */
167 -#if !__LIBELF64
168 +#if !defined(__LIBELF64)
170 #error "GElf is not supported on this system."
172 @@ -71,7 +71,7 @@ typedef Elf64_Sym GElf_Sym;
174 * Symbol versioning
176 -#if __LIBELF_SYMBOL_VERSIONS
177 +#if defined(__LIBELF_SYMBOL_VERSIONS)
178 typedef Elf64_Verdef GElf_Verdef;
179 typedef Elf64_Verneed GElf_Verneed;
180 typedef Elf64_Verdaux GElf_Verdaux;
181 diff --git a/lib/libelf.h b/lib/libelf.h
182 index 3ebd0f3..788482d 100644
183 --- a/lib/libelf.h
184 +++ b/lib/libelf.h
185 @@ -25,7 +25,7 @@
186 #include <stddef.h> /* for size_t */
187 #include <sys/types.h>
189 -#if __LIBELF_INTERNAL__
190 +#if defined(__LIBELF_INTERNAL__)
191 #include <sys_elf.h>
192 #else /* __LIBELF_INTERNAL__ */
193 #include <libelf/sys_elf.h>
194 @@ -224,7 +224,7 @@ extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
196 extern long elf32_checksum __P((Elf *__elf));
198 -#if __LIBELF64
199 +#if defined(__LIBELF64)
201 * 64-bit ELF functions
202 * Not available on all platforms
203 diff --git a/lib/sys_elf.h.in b/lib/sys_elf.h.in
204 index b71a20d..722051b 100644
205 --- a/lib/sys_elf.h.in
206 +++ b/lib/sys_elf.h.in
207 @@ -68,7 +68,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
208 #ifdef __LIBELF_HEADER_ELF_H
209 # include __LIBELF_HEADER_ELF_H
210 #else /* __LIBELF_HEADER_ELF_H */
211 -# if __LIBELF_INTERNAL__
212 +# if defined(__LIBELF_INTERNAL__)
213 # include <elf_repl.h>
214 # else /* __LIBELF_INTERNAL__ */
215 # include <libelf/elf_repl.h>
216 @@ -92,7 +92,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
217 # define STN_UNDEF 0
218 # endif /* STN_UNDEF */
220 -# if __LIBELF64
221 +# if defined(__LIBELF64)
223 # ifndef ELF64_FSZ_ADDR
224 # define ELF64_FSZ_ADDR 8
225 @@ -116,7 +116,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
226 # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
227 # endif /* ELF64_R_SYM */
229 -# if __LIBELF64_LINUX
230 +# if defined(__LIBELF64_LINUX)
231 typedef __libelf_u64_t Elf64_Addr;
232 typedef __libelf_u16_t Elf64_Half;
233 typedef __libelf_u64_t Elf64_Off;
234 diff --git a/lib/sys_elf.h.w32 b/lib/sys_elf.h.w32
235 index 0f93c55..7360104 100644
236 --- a/lib/sys_elf.h.w32
237 +++ b/lib/sys_elf.h.w32
238 @@ -68,7 +68,7 @@
239 #ifdef __LIBELF_HEADER_ELF_H
240 # include __LIBELF_HEADER_ELF_H
241 #else /* __LIBELF_HEADER_ELF_H */
242 -# if __LIBELF_INTERNAL__
243 +# if defined(__LIBELF_INTERNAL__)
244 # include <elf_repl.h>
245 # else /* __LIBELF_INTERNAL__ */
246 # include <libelf/elf_repl.h>
247 @@ -92,7 +92,7 @@
248 # define STN_UNDEF 0
249 # endif /* STN_UNDEF */
251 -# if __LIBELF64
252 +# if defined(__LIBELF64)
254 # ifndef ELF64_FSZ_ADDR
255 # define ELF64_FSZ_ADDR 8
256 @@ -116,7 +116,7 @@
257 # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
258 # endif /* ELF64_R_SYM */
260 -# if __LIBELF64_LINUX
261 +# if defined(__LIBELF64_LINUX)
262 typedef __libelf_u64_t Elf64_Addr;
263 typedef __libelf_u16_t Elf64_Half;
264 typedef __libelf_u64_t Elf64_Off;