mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
LibC: Declare ssize_t in a platform-agnostic way
While the compiler provides __SIZE_TYPE__ for declaring size_t, there's unfortunately no __SSIZE_TYPE__ for ssize_t. However, we can trick the preprocessor into doing what we want anyway by doing "#define unsigned signed" before using __SIZE_TYPE__ again.
This commit is contained in:
parent
8ec8304d74
commit
a0d3c03950
2 changed files with 5 additions and 3 deletions
|
@ -40,4 +40,9 @@
|
|||
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
|
||||
/* There is no __SSIZE_TYPE__ but we can trick the preprocessor into defining it for us anyway! */
|
||||
#define unsigned signed
|
||||
typedef __SIZE_TYPE__ ssize_t;
|
||||
#undef unsigned
|
||||
|
||||
#endif
|
||||
|
|
|
@ -45,9 +45,6 @@ typedef int __pid_t;
|
|||
|
||||
typedef int id_t;
|
||||
|
||||
typedef int __ssize_t;
|
||||
#define ssize_t __ssize_t
|
||||
|
||||
typedef __WINT_TYPE__ wint_t;
|
||||
|
||||
typedef uint32_t ino_t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue