2021-04-27 18:33:31 +02:00
|
|
|
#ifndef _STDDEF_H_
|
|
|
|
#define _STDDEF_H_
|
|
|
|
|
|
|
|
typedef __SIZE_TYPE__ size_t;
|
|
|
|
typedef __PTRDIFF_TYPE__ ssize_t;
|
|
|
|
typedef __WCHAR_TYPE__ wchar_t;
|
|
|
|
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
|
|
typedef __PTRDIFF_TYPE__ intptr_t;
|
|
|
|
typedef __SIZE_TYPE__ uintptr_t;
|
|
|
|
|
|
|
|
#ifndef NULL
|
2022-04-15 11:11:49 +02:00
|
|
|
#define NULL ((void*)0)
|
2021-04-27 18:33:31 +02:00
|
|
|
#endif
|
|
|
|
|
2021-06-09 05:17:46 +02:00
|
|
|
#ifdef _BUILD_LIBC
|
2022-05-10 20:58:40 +02:00
|
|
|
|
|
|
|
/* FIXME: Now _FUNC is used in conio only.
|
|
|
|
This should be removed after revrite somme apps who use conio
|
|
|
|
(because these app use pointer dereferencing for conio)
|
|
|
|
*/
|
|
|
|
#define _FUNC(func) (func)
|
|
|
|
|
|
|
|
#define DLLAPI //__attribute__((dllexport)) // Comming soon(tcc not support yet)
|
2021-04-27 18:33:31 +02:00
|
|
|
#else
|
2022-05-10 20:58:40 +02:00
|
|
|
#define _FUNC(func) (*func) // FIXME: this needed for legacy reason (see above)
|
|
|
|
#define DLLAPI __attribute__((dllimport))
|
2021-04-27 18:33:31 +02:00
|
|
|
#endif
|
|
|
|
|
2022-04-15 11:11:49 +02:00
|
|
|
#define offsetof(type, field) ((size_t) & ((type*)0)->field)
|
2021-04-27 18:33:31 +02:00
|
|
|
|
2022-01-12 19:09:37 +01:00
|
|
|
#ifndef __stdcall
|
2022-04-15 11:11:49 +02:00
|
|
|
#define __stdcall __attribute__((stdcall))
|
2022-01-12 19:09:37 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __cdecl
|
2022-04-15 11:11:49 +02:00
|
|
|
#define __cdecl __attribute__((cdecl))
|
2022-01-12 19:09:37 +01:00
|
|
|
#endif
|
|
|
|
|
2022-01-02 13:16:17 +01:00
|
|
|
#endif /* _STDDEF_H_ */
|