mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
114 lines
3.3 KiB
C
114 lines
3.3 KiB
C
//----------------------------------------------------------------------------//
|
|
// GNU GPL OS/K //
|
|
// //
|
|
// Desc: Basic preprocessor definitions //
|
|
// //
|
|
// //
|
|
// Copyright © 2018-2019 The OS/K Team //
|
|
// //
|
|
// This file is part of OS/K. //
|
|
// //
|
|
// OS/K is free software: you can redistribute it and/or modify //
|
|
// it under the terms of the GNU General Public License as published by //
|
|
// the Free Software Foundation, either version 3 of the License, or //
|
|
// any later version. //
|
|
// //
|
|
// OS/K is distributed in the hope that it will be useful, //
|
|
// but WITHOUT ANY WARRANTY//without even the implied warranty of //
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
// GNU General Public License for more details. //
|
|
// //
|
|
// You should have received a copy of the GNU General Public License //
|
|
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
|
|
//----------------------------------------------------------------------------//
|
|
|
|
#ifndef _KALBASE_BDEFS_H
|
|
#define _KALDEFS_BDEFS_H
|
|
|
|
//------------------------------------------//
|
|
|
|
#ifndef TRUE
|
|
#define TRUE 1
|
|
#endif
|
|
|
|
#ifndef FALSE
|
|
#define FALSE 0
|
|
#endif
|
|
|
|
#ifndef NULL
|
|
#define NULL 0L
|
|
#endif
|
|
|
|
#ifndef INITOK
|
|
#define INITOK ((unsigned int)0xCAFEBABE)
|
|
#endif
|
|
|
|
//------------------------------------------//
|
|
|
|
#ifndef __BEGIN_DECLS
|
|
#ifdef __cpluplus
|
|
# define __EXTERN_C extern "C"
|
|
# define __BEGIN_DECLS extern "C" {
|
|
# define __END_DECLS }
|
|
#else
|
|
# define __EXTERN_C
|
|
# define __BEGIN_DECLS
|
|
# define __END_DECLS
|
|
#endif
|
|
#endif
|
|
|
|
//------------------------------------------//
|
|
|
|
#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
|
|
|
|
//------------------------------------------//
|
|
|
|
#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
|
|
|
|
#ifndef _STR
|
|
#define _STR(x) #x
|
|
#endif
|
|
|
|
#ifndef _XSTR
|
|
#define _XSTR(x) _STR(x)
|
|
#endif
|
|
|
|
//------------------------------------------//
|
|
|
|
#endif
|