Go to the documentation of this file.
22 #ifndef P99_C99_DEFAULT_H_
23 # define P99_C99_DEFAULT_H_
27 #define P00_C99_DEFARG_DOCU(NAME, RET, ...) \
31 P99_MACRO_END(C99_DEFARG_DOCU);
33 P00_C99_DEFARG_DOCU(
strerror,
char*,
int errnum)
35 #define strerror(...) P99_CALL_DEFARG(strerror, 1, __VA_ARGS__)
36 #define strerror_defarg_0() 0
38 P00_C99_DEFARG_DOCU(
calloc,
void*,
size_t rec_num,
size_t rec_size)
44 #define calloc(...) P99_CALL_DEFARG(calloc, 2, __VA_ARGS__)
45 #define calloc_defarg_1() 1u
47 P00_C99_DEFARG_DOCU(
longjmp,
void, jmp_buf env,
int val)
52 # pragma message "warning longjmp defined as a macro, overwriting"
55 # define longjmp(...) P99_CALL_DEFARG(longjmp, 2, __VA_ARGS__)
56 # define longjmp_defarg_1() 1
101 P00_C99_DEFARG_DOCU(
wcstol,
long,
wchar_t const *p00_nptr,
wchar_t **p00_eptr,
int p00_base)
105 #define wcstol(...) P99_CALL_DEFARG(wcstol, 3, __VA_ARGS__)
106 #define wcstol_defarg_1() 0
107 #define wcstol_defarg_2() 0
109 P00_C99_DEFARG_DOCU(
wcstoll,
long long,
wchar_t const *p00_nptr,
wchar_t **p00_eptr,
int p00_base)
114 #define wcstoll(...) P99_CALL_DEFARG(wcstoll, 3, __VA_ARGS__)
115 #define wcstoll_defarg_1() 0
116 #define wcstoll_defarg_2() 0
118 P00_C99_DEFARG_DOCU(
wcstoimax, intmax_t,
wchar_t const *p00_nptr,
wchar_t **p00_eptr,
int p00_base)
122 #define wcstoimax(...) P99_CALL_DEFARG(wcstoimax, 3, __VA_ARGS__)
123 #define wcstoimax_defarg_1() 0
124 #define wcstoimax_defarg_2() 0
126 P00_C99_DEFARG_DOCU(
wcstoul,
unsigned long,
wchar_t const *p00_nptr,
wchar_t **p00_eptr,
int p00_base)
130 #define wcstoul(...) P99_CALL_DEFARG(wcstoul, 3, __VA_ARGS__)
131 #define wcstoul_defarg_1() 0
132 #define wcstoul_defarg_2() 0
134 P00_C99_DEFARG_DOCU(
wcstoull,
unsigned long long,
wchar_t const *p00_nptr,
wchar_t **p00_eptr,
int p00_base)
138 #define wcstoull(...) P99_CALL_DEFARG(wcstoull, 3, __VA_ARGS__)
139 #define wcstoull_defarg_1() 0
140 #define wcstoull_defarg_2() 0
142 P00_C99_DEFARG_DOCU(
wcstoumax,
uintmax_t,
wchar_t const *p00_nptr,
wchar_t **p00_eptr,
int p00_base)
146 #define wcstoumax(...) P99_CALL_DEFARG(wcstoumax, 3, __VA_ARGS__)
147 #define wcstoumax_defarg_1() 0
148 #define wcstoumax_defarg_2() 0
150 P00_C99_DEFARG_DOCU(
wcstof,
float,
wchar_t const *p00_nptr,
wchar_t **p00_eptr)
153 #define wcstof(...) P99_CALL_DEFARG(wcstof, 2, __VA_ARGS__)
154 #define wcstof_defarg_1() 0
156 P00_C99_DEFARG_DOCU(
wcstod,
double,
wchar_t const *p00_nptr,
wchar_t **p00_eptr)
159 #define wcstod(...) P99_CALL_DEFARG(wcstod, 2, __VA_ARGS__)
160 #define wcstod_defarg_1() 0
162 P00_C99_DEFARG_DOCU(
wcstold,
long double,
wchar_t const *p00_nptr,
wchar_t **p00_eptr)
165 #define wcstold(...) P99_CALL_DEFARG(wcstold, 2, __VA_ARGS__)
166 #define wcstold_defarg_1() 0
168 P00_C99_DEFARG_DOCU(
strtol,
long,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
177 #define strtol(...) P99_CALL_DEFARG(strtol, 3, __VA_ARGS__)
178 #define strtol_defarg_1() 0
179 #define strtol_defarg_2() 0
181 P00_C99_DEFARG_DOCU(
strtoll,
long long,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
190 #define strtoll(...) P99_CALL_DEFARG(strtoll, 3, __VA_ARGS__)
191 #define strtoll_defarg_1() 0
192 #define strtoll_defarg_2() 0
194 P00_C99_DEFARG_DOCU(
strtoimax, intmax_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
198 #define strtoimax(...) P99_CALL_DEFARG(strtoimax, 3, __VA_ARGS__)
199 #define strtoimax_defarg_1() 0
200 #define strtoimax_defarg_2() 0
202 P00_C99_DEFARG_DOCU(
strtoul,
unsigned long,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
206 #define strtoul(...) P99_CALL_DEFARG(strtoul, 3, __VA_ARGS__)
207 #define strtoul_defarg_1() 0
208 #define strtoul_defarg_2() 0
210 P00_C99_DEFARG_DOCU(
strtoull,
unsigned long long,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
214 #define strtoull(...) P99_CALL_DEFARG(strtoull, 3, __VA_ARGS__)
215 #define strtoull_defarg_1() 0
216 #define strtoull_defarg_2() 0
218 P00_C99_DEFARG_DOCU(
strtoumax,
uintmax_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
222 #define strtoumax(...) P99_CALL_DEFARG(strtoumax, 3, __VA_ARGS__)
223 #define strtoumax_defarg_1() 0
224 #define strtoumax_defarg_2() 0
226 P00_C99_DEFARG_DOCU(
strtof,
float,
char const *p00_nptr,
char **p00_eptr)
229 #define strtof(...) P99_CALL_DEFARG(strtof, 2, __VA_ARGS__)
230 #define strtof_defarg_1() 0
232 P00_C99_DEFARG_DOCU(
strtod,
double,
char const *p00_nptr,
char **p00_eptr)
235 #define strtod(...) P99_CALL_DEFARG(strtod, 2, __VA_ARGS__)
236 #define strtod_defarg_1() 0
238 P00_C99_DEFARG_DOCU(
strtold,
long double,
char const *p00_nptr,
char **p00_eptr)
241 #define strtold(...) P99_CALL_DEFARG(strtold, 2, __VA_ARGS__)
242 #define strtold_defarg_1() 0
244 #define P00_DECLARE_STRTO(SUFF) \
248 P99_BUILTIN_TYPE(SUFF) \
249 P99_PASTE2(p99_strto, SUFF)(char const *p00_nptr, char **p00_eptr, int p00_base) { \
250 long long p00_ret = (strtoll)(p00_nptr, p00_eptr, p00_base); \
251 if ((p00_ret > P99_BUILTIN_MAX(SUFF) || p00_ret < P99_BUILTIN_MIN(SUFF)) \
252 && (!errno)) errno = ERANGE; \
253 if (p00_ret > P99_BUILTIN_MAX(SUFF)) p00_ret = P99_BUILTIN_MAX(SUFF); \
254 if (p00_ret < P99_BUILTIN_MIN(SUFF)) p00_ret = P99_BUILTIN_MIN(SUFF); \
257 P99_MACRO_END(p99_strto, SUFF)
260 #define P00_DECLARE_STRTOU(SUFF) \
264 P99_BUILTIN_TYPE(SUFF) \
265 P99_PASTE2(p99_strto, SUFF)(char const *p00_nptr, char **p00_eptr, int p00_base) { \
266 unsigned long long p00_ret = (strtoull)(p00_nptr, p00_eptr, p00_base); \
267 if (p00_ret > P99_BUILTIN_MAX(SUFF)) { \
268 if (!errno) errno = ERANGE; \
269 p00_ret = P99_BUILTIN_MAX(SUFF); \
273 P99_MACRO_END(p99_strto, SUFF)
275 #define P00_I_LIST c, hh, , h, t, j, i8, i16, i32, i64
277 P99_SEP(P00_DECLARE_STRTO, P00_I_LIST);
279 #define P00_U_LIST uhh, u, uh, uz, uj, u8, u16, u32, u64
280 P99_SEP(P00_DECLARE_STRTOU, P00_U_LIST);
287 P00_C99_DEFARG_DOCU(
p99_strto,
signed,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
291 #define p99_strto(...) P99_CALL_DEFARG(p99_strto, 3, __VA_ARGS__)
292 #define p99_strto_defarg_1() 0
293 #define p99_strto_defarg_2() 0
296 P00_C99_DEFARG_DOCU(
p99_strtoc,
char,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
300 #define p99_strtoc(...) P99_CALL_DEFARG(p99_strtoc, 3, __VA_ARGS__)
301 #define p99_strtoc_defarg_1() 0
302 #define p99_strtoc_defarg_2() 0
304 P00_C99_DEFARG_DOCU(
p99_strtohh,
signed char,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
308 #define p99_strtohh(...) P99_CALL_DEFARG(p99_strtohh, 3, __VA_ARGS__)
309 #define p99_strtohh_defarg_1() 0
310 #define p99_strtohh_defarg_2() 0
312 P00_C99_DEFARG_DOCU(
p99_strtouhh,
unsigned char,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
316 #define p99_strtouhh(...) P99_CALL_DEFARG(p99_strtouhh, 3, __VA_ARGS__)
317 #define p99_strtouhh_defarg_1() 0
318 #define p99_strtouhh_defarg_2() 0
321 P00_C99_DEFARG_DOCU(
p99_strtoh,
signed short,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
325 #define p99_strtoh(...) P99_CALL_DEFARG(p99_strtoh, 3, __VA_ARGS__)
326 #define p99_strtoh_defarg_1() 0
327 #define p99_strtoh_defarg_2() 0
329 P00_C99_DEFARG_DOCU(
p99_strtouh,
unsigned short,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
333 #define p99_strtouh(...) P99_CALL_DEFARG(p99_strtouh, 3, __VA_ARGS__)
334 #define p99_strtouh_defarg_1() 0
335 #define p99_strtouh_defarg_2() 0
345 P00_C99_DEFARG_DOCU(
p99_strtou, unsinged,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
349 #define p99_strtou(...) P99_CALL_DEFARG(p99_strtou, 3, __VA_ARGS__)
350 #define p99_strtou_defarg_1() 0
351 #define p99_strtou_defarg_2() 0
353 P00_C99_DEFARG_DOCU(
p99_strtoi8, int_least8_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
357 #define p99_strtoi8(...) P99_CALL_DEFARG(p99_strtoi8, 3, __VA_ARGS__)
358 #define p99_strtoi8_defarg_1() 0
359 #define p99_strtoi8_defarg_2() 0
361 P00_C99_DEFARG_DOCU(
p99_strtot,
ptrdiff_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
365 #define p99_strtot(...) P99_CALL_DEFARG(p99_strtot, 3, __VA_ARGS__)
366 #define p99_strtot_defarg_1() 0
367 #define p99_strtot_defarg_2() 0
369 P00_C99_DEFARG_DOCU(
p99_strtouz,
size_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
373 #define p99_strtouz(...) P99_CALL_DEFARG(p99_strtouz, 3, __VA_ARGS__)
374 #define p99_strtouz_defarg_1() 0
375 #define p99_strtouz_defarg_2() 0
378 P00_C99_DEFARG_DOCU(
p99_strtou8, uint_least8_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
382 #define p99_strtou8(...) P99_CALL_DEFARG(p99_strtou8, 3, __VA_ARGS__)
383 #define p99_strtou8_defarg_1() 0
384 #define p99_strtou8_defarg_2() 0
386 P00_C99_DEFARG_DOCU(
p99_strtoi16, int_least16_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
390 #define p99_strtoi16(...) P99_CALL_DEFARG(p99_strtoi16, 3, __VA_ARGS__)
391 #define p99_strtoi16_defarg_1() 0
392 #define p99_strtoi16_defarg_2() 0
395 P00_C99_DEFARG_DOCU(
p99_strtou16, uint_least16_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
399 #define p99_strtou16(...) P99_CALL_DEFARG(p99_strtou16, 3, __VA_ARGS__)
400 #define p99_strtou16_defarg_1() 0
401 #define p99_strtou16_defarg_2() 0
403 P00_C99_DEFARG_DOCU(
p99_strtoi32, int_least32_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
407 #define p99_strtoi32(...) P99_CALL_DEFARG(p99_strtoi32, 3, __VA_ARGS__)
408 #define p99_strtoi32_defarg_1() 0
409 #define p99_strtoi32_defarg_2() 0
412 P00_C99_DEFARG_DOCU(
p99_strtou32, uint_least32_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
416 #define p99_strtou32(...) P99_CALL_DEFARG(p99_strtou32, 3, __VA_ARGS__)
417 #define p99_strtou32_defarg_1() 0
418 #define p99_strtou32_defarg_2() 0
421 P00_C99_DEFARG_DOCU(
p99_strtoi64, int_least64_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
425 #define p99_strtoi64(...) P99_CALL_DEFARG(p99_strtoi64, 3, __VA_ARGS__)
426 #define p99_strtoi64_defarg_1() 0
427 #define p99_strtoi64_defarg_2() 0
430 P00_C99_DEFARG_DOCU(
p99_strtou64, uint_least64_t,
char const *p00_nptr,
char **p00_eptr,
int p00_base)
434 #define p99_strtou64(...) P99_CALL_DEFARG(p99_strtou64, 3, __VA_ARGS__)
435 #define p99_strtou64_defarg_1() 0
436 #define p99_strtou64_defarg_2() 0
439 # define strtoc p99_strtoc
443 # define strtohh p99_strtohh
446 # define strtoh p99_strtoh
449 # define strto p99_strto
452 # define strtot p99_strtot
455 # define strtoj p99_strtoj
459 # define strtouhh p99_strtouhh
462 # define strtouh p99_strtouh
465 # define strtou p99_strtou
468 # define strtouz p99_strtouz
471 # define strtouj p99_strtouj
475 # define strtoi8 p99_strtoi8
478 # define strtoi16 p99_strtoi16
481 # define strtoi32 p99_strtoi32
484 # define strtoi64 p99_strtoi64
488 # define strtou8 p99_strtou8
491 # define strtou16 p99_strtou16
494 # define strtou32 p99_strtou32
497 # define strtou64 p99_strtou64
#define p99_strtou16(...)
Default arguments for C99 function p99_strtou16
Macros for default arguments to functions.
#define p99_strtou(...)
Default arguments for C99 function p99_strtou
#define strerror(...)
Default arguments for C99 function strerror
#define wcstoul(...)
Default arguments for C99 function wcstoul
#define strtoll(...)
Default arguments for C99 function strtoll
#define p99_strtot(...)
Default arguments for C99 function p99_strtot
#define strtol(...)
Default arguments for C99 function strtol
#define p99_strtoi8(...)
Default arguments for C99 function p99_strtoi8
#define calloc(...)
Default arguments for C99 function calloc
#define P99_SEP(MACRO,...)
Apply the macro MACRO to the rest of the argument list.
#define p99_strtohh(...)
Default arguments for C99 function p99_strtohh
#define wcstol(...)
Default arguments for C99 function wcstol
#define wcstoull(...)
Default arguments for C99 function wcstoull
#define wcstoll(...)
Default arguments for C99 function wcstoll
#define strtold(...)
Default arguments for C99 function strtold
#define p99_strtouhh(...)
Default arguments for C99 function p99_strtouhh
#define p99_strtouz(...)
Default arguments for C99 function p99_strtouz
#define p99_strtoh(...)
Default arguments for C99 function p99_strtoh
#define strtoumax(...)
Default arguments for C99 function strtoumax
#define wcstold(...)
Default arguments for C99 function wcstold
#define strtod(...)
Default arguments for C99 function strtod
#define wcstof(...)
Default arguments for C99 function wcstof
#define strtof(...)
Default arguments for C99 function strtof
#define strtoull(...)
Default arguments for C99 function strtoull
#define wcstod(...)
Default arguments for C99 function wcstod
#define p99_strtoi32(...)
Default arguments for C99 function p99_strtoi32
#define p99_strtouh(...)
Default arguments for C99 function p99_strtouh
#define strtoul(...)
Default arguments for C99 function strtoul
#define p99_strtou8(...)
Default arguments for C99 function p99_strtou8
#define longjmp(...)
Default arguments for C99 function longjmp
#define p99_strtou32(...)
Default arguments for C99 function p99_strtou32
#define p99_strtoi16(...)
Default arguments for C99 function p99_strtoi16
#define p99_strtou64(...)
Default arguments for C99 function p99_strtou64
#define strtoimax(...)
Default arguments for C99 function strtoimax
#define p99_strtoc(...)
Default arguments for C99 function p99_strtoc
#define p99_strto(...)
Default arguments for C99 function p99_strto
#define wcstoumax(...)
Default arguments for C99 function wcstoumax
#define p99_strtoi64(...)
Default arguments for C99 function p99_strtoi64
#define wcstoimax(...)
Default arguments for C99 function wcstoimax