mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
93 lines
2.3 KiB
C
93 lines
2.3 KiB
C
//----------------------------------------------------------------------------//
|
|
// 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
|
|
|
|
//------------------------------------------//
|
|
// Keywords //
|
|
//------------------------------------------//
|
|
|
|
#ifndef __alignof_is_defined
|
|
#define __alignof_is_defined
|
|
#define alignof _Alignof
|
|
#endif
|
|
|
|
#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 //
|
|
//------------------------------------------//
|
|
|
|
#ifndef PACKED
|
|
#define PACKED __attribute__((__packed__))
|
|
#endif
|
|
|
|
#ifndef noreturn
|
|
#define noreturn __attribute__((__noreturn__))
|
|
#endif
|
|
|
|
#ifndef likely
|
|
#define likely(x) (__builtin_expect((x), 1))
|
|
#endif
|
|
|
|
#ifndef unlikely
|
|
#define unlikely(x) (__builtin_expect((x), 0))
|
|
#endif
|
|
|
|
//------------------------------------------//
|
|
// API specific macros //
|
|
//------------------------------------------//
|
|
|
|
#ifndef KALAPI
|
|
# define KALAPI
|
|
#endif
|
|
|
|
//------------------------------------------//
|
|
// End of header //
|
|
//------------------------------------------//
|
|
|
|
#endif
|