]> begriffs open source - libnonstd/blob - include/internal/ssize_posix.h
Improvements to ssize_t internal files
[libnonstd] / include / internal / ssize_posix.h
1 #ifndef NONSTD_SSIZE_H
2 #define NONSTD_SSIZE_H
3
4 #define _POSIX_C_SOURCE 200112L
5
6 // get ssize_t from POSIX
7 #include <sys/types.h>
8
9 // TODO: the %zd specifier may not be available outside gcc and clang, and
10 // people recommend using %jd and casting argument to intmax_t for greatest
11 // portability.
12 #define PRIdSSIZE "zd"
13
14 // Include the following for SSIZE_MAX.
15 //
16 // Caution: our internal/ssize.h header ought to be included before limits.h
17 // in integral.h or else the include guard in limits.h might stop it from
18 // expanding here in the presence of _POSIX_C_SOURCE.
19 #include <limits.h>
20
21 #undef _POSIX_C_SOURCE
22
23 #endif