[liba] Define ssize_t and offsetof

Change-Id: Icbf546cd09f4e3c3e849f830bb3c60ffa3c13b6c
This commit is contained in:
Romain Goyet
2017-07-30 12:36:01 +02:00
committed by Romain Goyet
parent 750b51dd2f
commit c8e2b0d2be
4 changed files with 25 additions and 8 deletions

View File

@@ -3,10 +3,9 @@
#define NULL 0
/* C99 says that size_t is an unsigned integer type of at least 16 bit.
* Moreover, size_t is the return type of the "sizeof" operator, which is
* defined by the compiler. That's why both GCC and clang define a __SIZE_TYPE__
* macro to let the libc header know about the type used by the compiler. */
typedef __SIZE_TYPE__ size_t;
typedef int ssize_t;
typedef unsigned int size_t;
#define offsetof(st, m) __builtin_offsetof(st, m)
#endif