diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-28 18:20:31 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-28 18:20:31 +0100 |
| commit | 4a789fd64c44e38ed0c3d9fb597e62afd17a337d (patch) | |
| tree | dff9c68b5adacd7aaf55fcd284f2fdb4ad504f1c /Private/CRT | |
| parent | 87913aa62de0edfcbde9d9fdb938968d1b511a5f (diff) | |
Ongoing effort to reimplement core protocol of EFI into EFIKit.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/CRT')
| -rw-r--r-- | Private/CRT/__cxxkit_defines.h | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/Private/CRT/__cxxkit_defines.h b/Private/CRT/__cxxkit_defines.h index 46110369..9726bf18 100644 --- a/Private/CRT/__cxxkit_defines.h +++ b/Private/CRT/__cxxkit_defines.h @@ -3,7 +3,7 @@ * * hCore * Copyright 2024 Mahrouss Logic, all rights reserved. - * + * * ======================================================== */ @@ -20,69 +20,71 @@ typedef int ssize_t; typedef size_t ptrdiff_t; typedef size_t uintptr_t; -typedef void* voidptr_t; -typedef void* any_t; -typedef char* caddr_t; +typedef void *voidptr_t; +typedef void *any_t; +typedef char *caddr_t; #ifndef NULL #define NULL ((voidptr_t)0) #endif // !null #ifdef __GNUC__ -# include <CRT/__cxxkit_alloca.h> -# define __cxxkit_alloca(sz) __cxxkit_alloca_gcc(sz) +#include <CRT/__cxxkit_alloca.h> +#define __cxxkit_alloca(sz) __cxxkit_alloca_gcc(sz) #elif defined(__HISYS__) -# define __alloca(SZ) __cxxkit_alloca(SZ) +#define __alloca(SZ) __cxxkit_alloca(SZ) -# define __deref(ptr) (*(PTR)) +#define __deref(ptr) (*(PTR)) -# define __libexport __lib(export) -# define __libimport __lib(import) +#define __libexport __lib(export) +#define __libimport __lib(import) #ifdef __cplusplus -# define __init_decl() extern "C" { -# define __fini_decl() }; +#define __init_decl() \ + extern "C" \ + { +#define __fini_decl() \ + } \ + ; #else -# define __init_decl() -# define __fini_decl() +#define __init_decl() +#define __fini_decl() #endif #endif #if __has_builtin(__builtin_alloca) -# define alloca(sz) __builtin_alloca(sz) +#define alloca(sz) __builtin_alloca(sz) #ifdef __alloca -# undef __alloca +#undef __alloca #endif #define __alloca alloca #else -# warning alloca not detected +#warning alloca not detected #endif typedef long long off_t; typedef unsigned long long uoff_t; -typedef union -{ - struct - { - unsigned int mantisa : 23; - unsigned int exponent : 8; - unsigned int sign : 1; - }; - - float f; +typedef union { + struct + { + unsigned int mantissa : 23; + unsigned int exponent : 8; + unsigned int sign : 1; + }; + + float f; } __attribute__((packed)) float_cast_t; -typedef union -{ - struct +typedef union { + struct { - unsigned long int mantisa : 52; - unsigned int exponent : 11; - unsigned int sign : 1; + unsigned long long int mantissa : 52; + unsigned int exponent : 11; + unsigned int sign : 1; }; - + double f; } __attribute__((packed)) double_cast_t; |
