2021-06-16 19:54:50 +02:00
|
|
|
#ifndef _STDDEF_H
|
|
|
|
#define _STDDEF_H
|
2013-04-09 01:55:47 +02:00
|
|
|
|
|
|
|
#include <arch/types.h>
|
2022-11-28 11:46:48 +01:00
|
|
|
|
|
|
|
#if !defined(offsetof)
|
|
|
|
#define offsetof(type, member) __builtin_offsetof(type, member)
|
|
|
|
#endif
|
2013-04-09 01:55:47 +02:00
|
|
|
|
2021-06-16 19:46:17 +02:00
|
|
|
#ifndef __WCHAR_TYPE__
|
|
|
|
#define __WCHAR_TYPE__ int
|
|
|
|
#endif
|
|
|
|
#ifndef __cplusplus
|
|
|
|
typedef __WCHAR_TYPE__ wchar_t;
|
|
|
|
#endif
|
|
|
|
|
2013-04-09 01:55:47 +02:00
|
|
|
#ifndef __SIZE_TYPE__
|
|
|
|
#define __SIZE_TYPE__ unsigned long
|
|
|
|
#endif
|
|
|
|
typedef __SIZE_TYPE__ size_t;
|
2013-05-02 23:02:28 +02:00
|
|
|
/* There is a GCC macro for a size_t type, but not
|
|
|
|
* for a ssize_t type. Below construct tricks GCC
|
|
|
|
* into making __SIZE_TYPE__ signed.
|
|
|
|
*/
|
|
|
|
#define unsigned signed
|
|
|
|
typedef __SIZE_TYPE__ ssize_t;
|
|
|
|
#undef unsigned
|
2013-04-09 01:55:47 +02:00
|
|
|
|
2018-08-20 20:47:19 +02:00
|
|
|
#define NSECS_PER_SEC 1000000000
|
2017-08-04 00:58:14 +02:00
|
|
|
#define USECS_PER_SEC 1000000
|
|
|
|
#define MSECS_PER_SEC 1000
|
2018-08-20 20:47:19 +02:00
|
|
|
#define NSECS_PER_MSEC (NSECS_PER_SEC / MSECS_PER_SEC)
|
|
|
|
#define NSECS_PER_USEC (NSECS_PER_SEC / USECS_PER_SEC)
|
2017-08-04 00:58:14 +02:00
|
|
|
#define USECS_PER_MSEC (USECS_PER_SEC / MSECS_PER_SEC)
|
2021-06-16 19:54:50 +02:00
|
|
|
|
|
|
|
#endif
|