Bump S-nail v14.9.16.ar ("Message of Winter, your hopes shall be crushed"), 2019...
[s-mailx.git] / include / su / code-in.h
blobc7ec072a1322d5677fc1a88c016e9dc27dd6f626
1 /*@ Internal: opposite of code-ou.h.
3 * Copyright (c) 2003 - 2019 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * SPDX-License-Identifier: ISC
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #ifndef su_CODE_H
19 # error su/code-in.h must be included after su/code.h
20 #endif
21 #ifdef su_CODE_IN_H
22 # error su/code-ou.h must be included before including su/code-in.h again
23 #endif
24 #define su_CODE_IN_H
25 /* LANG */
26 #undef C_LANG
27 #undef C_DECL_BEGIN
28 #undef C_DECL_END
29 #define C_LANG su_C_LANG
30 #define C_DECL_BEGIN su_C_DECL_BEGIN
31 #define C_DECL_END su_C_DECL_END
32 #define NSPC_BEGIN su_NSPC_BEGIN
33 #define NSPC_END su_NSPC_END
34 #define NSPC_USE su_NSPC_USE
35 #define NSPC su_NSPC
36 #if defined su_CXX_HEADER || (defined su_SOURCE && !su_C_LANG)
37 # define CLASS_NO_COPY su_CLASS_NO_COPY
38 # define SELFTHIS_RET su_SELFTHIS_RET
39 # define PUB su_PUB
40 # define PRO su_PRO
41 # define PRI su_PRI
42 # define STA su_STA
43 # define VIR su_VIR
44 # define OVR su_OVR
45 # define OVRX su_OVRX
46 #endif
47 #define S su_S
48 #define R su_R
49 #define C su_C
50 #define NIL su_NIL
51 #define SHADOW su_SHADOW
52 #if defined su_HEADER || defined su_CXX_HEADER
53 # ifdef su_SOURCE
54 # define EXPORT su_EXPORT
55 # define EXPORT_DATA su_EXPORT_DATA
56 # define IMPORT su_IMPORT
57 # define IMPORT_DATA su_IMPORT_DATA
58 # endif
59 #elif defined mx_HEADER
60 # ifdef mx_SOURCE
61 # define EXPORT su_EXPORT
62 # define EXPORT_DATA su_EXPORT_DATA
63 # define IMPORT su_IMPORT
64 # define IMPORT_DATA su_IMPORT_DATA
65 # endif
66 #elif defined rf_HEADER
67 # ifdef rf_SOURCE
68 # define EXPORT su_EXPORT
69 # define EXPORT_DATA su_EXPORT_DATA
70 # define IMPORT su_IMPORT
71 # define IMPORT_DATA su_IMPORT_DATA
72 # endif
73 #endif
74 #ifndef EXPORT
75 # define EXPORT su_IMPORT
76 # define EXPORT_DATA su_IMPORT_DATA
77 # define IMPORT su_IMPORT
78 # define IMPORT_DATA su_IMPORT_DATA
79 #endif
80 #define CTA su_CTA
81 #define LCTA su_LCTA
82 #define CTAV su_CTAV
83 #define LCTAV su_LCTAV
84 #define MCTA su_MCTA
85 /* CC */
86 #define INLINE su_INLINE
87 #define SINLINE su_SINLINE
88 #define LIKELY su_LIKELY
89 #define UNLIKELY su_UNLIKELY
90 /* SUPPORT MACROS+ */
91 #undef ABS
92 #undef CLIP
93 #undef IS_POW2
94 #undef MAX
95 #undef MIN
96 #undef ROUND_DOWN
97 #undef ROUND_DOWN2
98 #undef ROUND_UP
99 #undef ROUND_UP2
100 #define ABS su_ABS
101 #define CLIP su_CLIP
102 #define IS_POW2 su_IS_POW2
103 #define MAX su_MAX
104 #define MIN su_MIN
105 #define ROUND_DOWN su_ROUND_DOWN
106 #define ROUND_DOWN2 su_ROUND_DOWN2
107 #define ROUND_UP su_ROUND_UP
108 #define ROUND_UP2 su_ROUND_UP2
109 #define ALIGNOF su_ALIGNOF
110 #define P_ALIGN su_P_ALIGN
111 #define Z_ALIGN_OVER su_Z_ALIGN_OVER
112 #define Z_ALIGN su_Z_ALIGN
113 #define Z_ALIGN_PZ su_Z_ALIGN_PZ
114 /* ASSERT series */
115 #define ASSERT_INJ su_ASSERT_INJ
116 #define ASSERT_INJOR su_ASSERT_INJOR
117 #define ASSERT_NB su_ASSERT_NB
118 #define ASSERT su_ASSERT
119 #define ASSERT_LOC su_ASSERT_LOC
120 #define ASSERT_EXEC su_ASSERT_EXEC
121 #define ASSERT_EXEC_LOC su_ASSERT_EXEC_LOC
122 #define ASSERT_JUMP su_ASSERT_JUMP
123 #define ASSERT_JUMP_LOC su_ASSERT_JUMP_LOC
124 #define ASSERT_RET su_ASSERT_RET
125 #define ASSERT_RET_LOC su_ASSERT_RET_LOC
126 #define ASSERT_RET_VOID su_ASSERT_RET_VOID
127 #define ASSERT_RET_VOID_LOC su_ASSERT_RET_VOID_LOC
128 #define ASSERT_NYD_EXEC su_ASSERT_NYD_EXEC
129 #define ASSERT_NYD_EXEC_LOC su_ASSERT_NYD_EXEC_LOC
130 #define ASSERT_NYD su_ASSERT_NYD
131 #define ASSERT_NYD_LOC su_ASSERT_NYD_LOC
132 #define BITENUM_IS su_BITENUM_IS
133 #define BITENUM_MASK su_BITENUM_MASK
134 #define DBG su_DBG
135 #define NDGB su_NDBG
136 #define DBGOR su_DBGOR
137 #define DVL su_DVL
138 #define NDVL su_NDVL
139 #define DVLOR su_DVLOR
140 #define FIELD_INITN su_FIELD_INITN
141 #define FIELD_INITI su_FIELD_INITI
142 #define FIELD_OFFSETOF su_FIELD_OFFSETOF
143 #define FIELD_RANGEOF su_FIELD_RANGEOF
144 #define FIELD_SIZEOF su_FIELD_SIZEOF
145 #define MT su_MT
146 #define NELEM su_NELEM
147 /* Not-Yet-Dead macros TODO stubs */
148 #undef NYD_IN
149 #undef NYD_OU
150 #undef NYD
151 #undef NYD2_IN
152 #undef NYD2_OU
153 #undef NYD2
154 #define NYD_OU_LABEL su_NYD_OU_LABEL
155 #if defined NDEBUG || (!defined su_HAVE_DEBUG && !defined su_HAVE_DEVEL)
156 /**/
157 #elif defined su_HAVE_DEVEL
158 # define NYD_IN if(1){su_nyd_chirp(1, __FILE__, __LINE__, su_FUN);
159 # define NYD_OU \
160 goto NYD_OU_LABEL;NYD_OU_LABEL:\
161 su_nyd_chirp(2, __FILE__, __LINE__, su_FUN);}else{}
162 # define NYD if(0){}else{su_nyd_chirp(0, __FILE__, __LINE__, su_FUN);}
163 # ifdef NYD2
164 # undef NYD2
165 # define NYD2_IN if(1){su_nyd_chirp(1, __FILE__, __LINE__, su_FUN);
166 # define NYD2_OU \
167 goto NYD_OU_LABEL;NYD_OU_LABEL:\
168 su_nyd_chirp(2, __FILE__, __LINE__, su_FUN);}else{}
169 # define NYD2 if(0){}else{su_nyd_chirp(0, __FILE__, __LINE__, su_FUN);}
170 # endif
171 #else
172 # define NYD_IN do{su_nyd_chirp(1, __FILE__, __LINE__, su_FUN);
173 # define NYD_OU \
174 goto NYD_OU_LABEL;NYD_OU_LABEL:\
175 su_nyd_chirp(2, __FILE__, __LINE__, su_FUN);}while(0)
176 # define NYD do{su_nyd_chirp(0, __FILE__, __LINE__, su_FUN);}while(0)
177 # ifdef NYD2
178 # undef NYD2
179 # define NYD2_IN do{su_nyd_chirp(1, __FILE__, __LINE__, su_FUN);
180 # define NYD2_OU \
181 goto NYD_OU_LABEL;NYD_OU_LABEL:\
182 su_nyd_chirp(2, __FILE__, __LINE__, su_FUN);}while(0)
183 # define NYD2 do{su_nyd_chirp(0, __FILE__, __LINE__, su_FUN);}while(0)
184 # endif
185 #endif
186 /**/
187 #ifndef NYD
188 # define NYD_IN do{
189 # define NYD_OU goto NYD_OU_LABEL;NYD_OU_LABEL:;}while(0)
190 # define NYD do{}while(0)
191 #endif
192 #ifndef NYD2
193 # define NYD2_IN do{
194 # define NYD2_OU goto NYD_OU_LABEL;NYD_OU_LABEL:;}while(0)
195 # define NYD2 do{}while(0)
196 #endif
197 #define P2UZ su_P2UZ
198 #define PCMP su_PCMP
199 /* Translation: may NOT set errno! */
200 #undef _
201 #undef N_
202 #undef V_
203 #ifdef mx_SOURCE
204 # undef A_
205 # define A_(S) S
206 # ifdef mx_HAVE_UISTRINGS
207 # define _(S) S
208 # define N_(S) S
209 # define V_(S) S
210 # else
211 # define _(S) su_empty
212 # define N_(S) ""
213 # define V_(S) su_empty
214 # endif
215 #elif defined su_SOURCE
216 # define _(S) S
217 # define N_(S) S
218 # define V_(S) S
219 #endif
220 #define SMP su_SMP
221 #define UCMP su_UCMP
222 #define UNCONST su_UNCONST
223 #define UNVOLATILE su_UNVOLATILE
224 #define UNALIGN su_UNALIGN
225 #define UNINIT su_UNINIT
226 #define UNINIT_DECL su_UNINIT_DECL
227 #define UNUSED su_UNUSED
228 #define VFIELD_SIZE su_VFIELD_SIZE
229 #define VSTRUCT_SIZEOF su_VSTRUCT_SIZEOF
230 /* POD TYPE SUPPORT (only if !C++) */
231 #if defined su_HEADER ||\
232 ((defined su_SOURCE || defined mx_SOURCE) && su_C_LANG)
233 # define ul su_ul
234 # define ui su_ui
235 # define us su_us
236 # define uc su_uc
237 # define sl su_sl
238 # define si su_si
239 # define ss su_ss
240 # define sc su_sc
241 # define u8 su_u8
242 # define s8 su_s8
243 # define u16 su_u16
244 # define s16 su_s16
245 # define u32 su_u32
246 # define s32 su_s32
247 # define u64 su_u64
248 # define s64 su_s64
249 # define uz su_uz
250 # define sz su_sz
251 # define up su_up
252 # define sp su_sp
253 # define FAL0 su_FAL0
254 # define TRU1 su_TRU1
255 # define TRU2 su_TRU2
256 # define TRUM1 su_TRUM1
257 # define boole su_boole
258 #endif /* su_HEADER || ((su_SOURCE || mx_SOURCE) && su_C_LANG) */
259 #define U8_MAX su_U8_MAX
260 #define S8_MIN su_S8_MIN
261 #define S8_MAX su_S8_MAX
262 #define U16_MAX su_U16_MAX
263 #define S16_MIN su_S16_MIN
264 #define S16_MAX su_S16_MAX
265 #define U32_MAX su_U32_MAX
266 #define S32_MIN su_S32_MIN
267 #define S32_MAX su_S32_MAX
268 #define U64_MAX su_U64_MAX
269 #define S64_MIN su_S64_MIN
270 #define S64_MAX su_S64_MAX
271 #define U64_C su_U64_C
272 #define S64_C su_S64_C
273 #define UZ_MAX su_UZ_MAX
274 #define SZ_MIN su_SZ_MIN
275 #define SZ_MAX su_SZ_MAX
276 #define UZ_BITS su_UZ_BITS
277 /* MEMORY */
278 #define su_ALLOCATE su_MEM_ALLOCATE
279 #define su_ALLOCATE_LOC su_MEM_ALLOCATE_LOC
280 #define su_REALLOCATE su_MEM_REALLOCATE
281 #define su_REALLOCATE_LOC su_MEM_REALLOCATE_LOC
282 #define su_ALLOC su_MEM_ALLOC
283 #define su_ALLOC_LOC su_MEM_ALLOC_LOC
284 #define su_ALLOC_LOCOR su_MEM_ALLOC_LOCOR
285 #define su_ALLOC_N su_MEM_ALLOC_N
286 #define su_ALLOC_N_LOC su_MEM_ALLOC_N_LOC
287 #define su_ALLOC_N_LOCOR su_MEM_ALLOC_N_LOCOR
288 #define su_CALLOC su_MEM_CALLOC
289 #define su_CALLOC_LOC su_MEM_CALLOC_LOC
290 #define su_CALLOC_LOCOR su_MEM_CALLOC_LOCOR
291 #define su_CALLOC_N su_MEM_CALLOC_N
292 #define su_CALLOC_N_LOC su_MEM_CALLOC_N_LOC
293 #define su_CALLOC_N_LOCOR su_MEM_CALLOC_N_LOCOR
294 #define su_REALLOC su_MEM_REALLOC
295 #define su_REALLOC_LOC su_MEM_REALLOC_LOC
296 #define su_REALLOC_LOCOR su_MEM_REALLOC_LOCOR
297 #define su_REALLOC_N su_MEM_REALLOC_N
298 #define su_REALLOC_N_LOC su_MEM_REALLOC_N_LOC
299 #define su_REALLOC_N_LOCOR su_MEM_REALLOC_N_LOCOR
300 #define su_TALLOC su_MEM_TALLOC
301 #define su_TALLOC_LOC su_MEM_TALLOC_LOC
302 #define su_TALLOC_LOCOR su_MEM_TALLOC_LOCOR
303 #define su_TCALLOC su_MEM_TCALLOC
304 #define su_TCALLOC_LOC su_MEM_TCALLOC_LOC
305 #define su_TCALLOC_LOCOR su_MEM_TCALLOC_LOCOR
306 #define su_TREALLOC su_MEM_TREALLOC
307 #define su_TREALLOC_LOC su_MEM_TREALLOC_LOC
308 #define su_TREALLOC_LOCOR su_MEM_TREALLOC_LOCOR
309 #define su_TALLOCF su_MEM_TALLOCF
310 #define su_TALLOCF_LOC su_MEM_TALLOCF_LOC
311 #define su_TALLOCF_LOCOR su_MEM_TALLOCF_LOCOR
312 #define su_TCALLOCF su_MEM_TCALLOCF
313 #define su_TCALLOCF_LOC su_MEM_TCALLOCF_LOC
314 #define su_TCALLOCF_LOCOR su_MEM_TCALLOCF_LOCOR
315 #define su_TREALLOCF su_MEM_TREALLOCF
316 #define su_TREALLOCF_LOC su_MEM_TREALLOCF_LOC
317 #define su_TREALLOCF_LOCOR su_MEM_TREALLOCF_LOCOR
318 #define su_FREE su_MEM_FREE
319 #define su_FREE_LOC su_MEM_FREE_LOC
320 #define su_FREE_LOCOR su_MEM_FREE_LOCOR
321 #if !su_C_LANG
322 # define su_NEW su_MEM_NEW
323 # define su_NEW_LOC su_MEM_NEW_LOC
324 # define su_NEW_LOCOR su_MEM_NEW_LOCOR
325 # define su_CNEW su_MEM_CNEW
326 # define su_CNEW_LOC su_MEM_CNEW_LOC
327 # define su_CNEW_LOCOR su_MEM_CNEW_LOCOR
328 # define su_NEW_HEAP su_MEM_NEW_HEAP
329 # define su_NEW_HEAP_LOC su_MEM_NEW_HEAP_LOC
330 # define su_NEW_HEAP_LOCOR su_MEM_NEW_HEAP_LOCOR
331 # define su_DEL su_MEM_DEL
332 # define su_DEL_LOC su_MEM_DEL_LOC
333 # define su_DEL_LOCOR su_MEM_DEL_LOCOR
334 # define su_DEL_HEAP su_MEM_DEL_HEAP
335 # define su_DEL_HEAP_LOC su_MEM_DEL_HEAP_LOC
336 # define su_DEL_HEAP_LOCOR su_MEM_DEL_HEAP_LOCOR
337 # define su_DEL_PRIVATE su_MEM_DEL_PRIVATE
338 # define su_DEL_PRIVATE_LOC su_MEM_DEL_PRIVATE_LOC
339 # define su_DEL_PRIVATE_LOCOR su_MEM_DEL_PRIVATE_LOCOR
340 # define su_DEL_HEAP_PRIVATE su_MEM_DEL_HEAP_PRIVATE
341 # define su_DEL_HEAP_PRIVATE_LOC su_MEM_DEL_HEAP_PRIVATE_LOC
342 # define su_DEL_HEAP_PRIVATE_LOCOR su_MEM_DEL_HEAP_PRIVATE_LOCOR
343 #endif /* !C_LANG */
344 #ifdef su_MEM_BAG_SELF
345 # ifdef su_HAVE_MEM_BAG_AUTO
346 # define su_AUTO_ALLOC su_MEM_BAG_SELF_AUTO_ALLOC
347 # define su_AUTO_ALLOC_LOC su_MEM_BAG_SELF_AUTO_ALLOC_LOC
348 # define su_AUTO_ALLOC_LOCOR su_MEM_BAG_SELF_AUTO_ALLOC_LOCOR
349 # define su_AUTO_ALLOC_N su_MEM_BAG_SELF_AUTO_ALLOC_N
350 # define su_AUTO_ALLOC_N_LOC su_MEM_BAG_SELF_AUTO_ALLOC_N_LOC
351 # define su_AUTO_ALLOC_N_LOCOR su_MEM_BAG_SELF_AUTO_ALLOC_N_LOCOR
352 # define su_AUTO_CALLOC su_MEM_BAG_SELF_AUTO_CALLOC
353 # define su_AUTO_CALLOC_LOC su_MEM_BAG_SELF_AUTO_CALLOC_LOC
354 # define su_AUTO_CALLOC_LOCOR su_MEM_BAG_SELF_AUTO_CALLOC_LOCOR
355 # define su_AUTO_CALLOC_N su_MEM_BAG_SELF_AUTO_CALLOC_N
356 # define su_AUTO_CALLOC_N_LOC su_MEM_BAG_SELF_AUTO_CALLOC_N_LOC
357 # define su_AUTO_CALLOC_N_LOCOR su_MEM_BAG_SELF_AUTO_CALLOC_N_LOCOR
358 # define su_AUTO_TALLOC su_MEM_BAG_SELF_AUTO_TALLOC
359 # define su_AUTO_TALLOC_LOC su_MEM_BAG_SELF_AUTO_TALLOC_LOC
360 # define su_AUTO_TALLOC_LOCOR su_MEM_BAG_SELF_AUTO_TALLOC_LOCOR
361 # define su_AUTO_TCALLOC su_MEM_BAG_SELF_AUTO_TCALLOC
362 # define su_AUTO_TCALLOC_LOC su_MEM_BAG_SELF_AUTO_TCALLOC_LOC
363 # define su_AUTO_TCALLOC_LOCOR su_MEM_BAG_SELF_AUTO_TCALLOC_LOCOR
364 # endif /* su_HAVE_MEM_BAG_AUTO */
365 # ifdef su_HAVE_MEM_BAG_LOFI
366 # define su_LOFI_ALLOC su_MEM_BAG_SELF_LOFI_ALLOC
367 # define su_LOFI_ALLOC_LOC su_MEM_BAG_SELF_LOFI_ALLOC_LOC
368 # define su_LOFI_ALLOC_LOCOR su_MEM_BAG_SELF_LOFI_ALLOC_LOCOR
369 # define su_LOFI_ALLOC_N su_MEM_BAG_SELF_LOFI_ALLOC_N
370 # define su_LOFI_ALLOC_N_LOC su_MEM_BAG_SELF_LOFI_ALLOC_N_LOC
371 # define su_LOFI_ALLOC_N_LOCOR su_MEM_BAG_SELF_LOFI_ALLOC_N_LOCOR
372 # define su_LOFI_CALLOC su_MEM_BAG_SELF_LOFI_CALLOC
373 # define su_LOFI_CALLOC_LOC su_MEM_BAG_SELF_LOFI_CALLOC_LOC
374 # define su_LOFI_CALLOC_LOCOR su_MEM_BAG_SELF_LOFI_CALLOC_LOCOR
375 # define su_LOFI_CALLOC_N su_MEM_BAG_SELF_LOFI_CALLOC_N
376 # define su_LOFI_CALLOC_N_LOC su_MEM_BAG_SELF_LOFI_CALLOC_N_LOC
377 # define su_LOFI_CALLOC_N_LOCOR su_MEM_BAG_SELF_LOFI_CALLOC_N_LOCOR
378 # define su_LOFI_TALLOC su_MEM_BAG_SELF_LOFI_TALLOC
379 # define su_LOFI_TALLOC_LOC su_MEM_BAG_SELF_LOFI_TALLOC_LOC
380 # define su_LOFI_TALLOC_LOCOR su_MEM_BAG_SELF_LOFI_TALLOC_LOCOR
381 # define su_LOFI_TCALLOC su_MEM_BAG_SELF_LOFI_TCALLOC
382 # define su_LOFI_TCALLOC_LOC su_MEM_BAG_SELF_LOFI_TCALLOC_LOC
383 # define su_LOFI_TCALLOC_LOCOR su_MEM_BAG_SELF_LOFI_TCALLOC_LOCOR
384 # define su_LOFI_FREE su_MEM_BAG_SELF_LOFI_FREE
385 # define su_LOFI_FREE_LOC su_MEM_BAG_SELF_LOFI_FREE_LOC
386 # define su_LOFI_FREE_LOCOR su_MEM_BAG_SELF_LOFI_FREE_LOCOR
387 # endif /* su_HAVE_MEM_BAG_LOFI */
388 #endif /* su_MEM_BAG_SELF */
389 /* s-it-mode */