1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00
os-k/kaleid/include/common/kaldefs.h

93 lines
2.3 KiB
C
Raw Normal View History

2019-01-01 13:09:57 +01:00
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Authors: spectral` //
// NeoX //
// //
// Desc: Kaleid general preprocessor constants //
//----------------------------------------------------------------------------//
#ifndef _KALDEFS_H
#define _KALDEFS_H
//------------------------------------------//
// Actual constants //
//------------------------------------------//
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL ((void *)0)
#endif
#ifndef INITOK
#define INITOK ((unsigned int)0xCAFEBABE)
#endif
//------------------------------------------//
2019-01-14 14:31:49 +01:00
// Keywords //
2019-01-01 13:09:57 +01:00
//------------------------------------------//
2019-01-14 14:31:49 +01:00
#ifndef __alignof_is_defined
#define __alignof_is_defined
2019-01-01 20:46:06 +01:00
#define alignof _Alignof
#endif
2019-01-14 14:31:49 +01:00
#ifndef __alignas_is_defined
#define __alignas_is_defined
#define alignas _Alignas
#endif
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined
# define bool _Bool
# define true 1
# define false 0
# ifndef TRUE
# define TRUE 1
# endif
# ifndef FALSE
# define FALSE 0
# endif
#endif
//------------------------------------------//
// Attributes and macros //
//------------------------------------------//
2019-01-01 13:09:57 +01:00
#ifndef PACKED
2019-01-01 17:11:30 +01:00
#define PACKED __attribute__((__packed__))
2019-01-01 13:09:57 +01:00
#endif
#ifndef noreturn
2019-01-01 17:11:30 +01:00
#define noreturn __attribute__((__noreturn__))
2019-01-01 13:09:57 +01:00
#endif
#ifndef likely
#define likely(x) (__builtin_expect((x), 1))
#endif
2019-01-14 14:31:49 +01:00
#ifndef unlikely
2019-01-01 13:09:57 +01:00
#define unlikely(x) (__builtin_expect((x), 0))
#endif
//------------------------------------------//
// API specific macros //
//------------------------------------------//
#ifndef KALAPI
# define KALAPI
#endif
//------------------------------------------//
2019-01-14 14:31:49 +01:00
// End of header //
2019-01-01 13:09:57 +01:00
//------------------------------------------//
#endif