[SDK] Fix preprocessor usage

Signed-off-by: Quinn Stephens <quinn@osmora.org>
This commit is contained in:
Quinn Stephens 2025-06-12 14:03:21 -04:00
parent 5c52adf492
commit 5f0a5d0588
18 changed files with 42 additions and 14 deletions

View File

@ -18,7 +18,7 @@ Abstract:
#ifndef _STDARG_H #ifndef _STDARG_H
#define _STDARG_H 1 #define _STDARG_H 1
#ifdef __cplusplus #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -29,7 +29,7 @@ typedef __builtin_va_list va_list;
#define va_copy(ap, s) __builtin_va_copy(ap, s) #define va_copy(ap, s) __builtin_va_copy(ap, s)
#define va_end(ap) __builtin_va_end(ap) #define va_end(ap) __builtin_va_end(ap)
#ifdef __cplusplus #if defined(__cplusplus)
} }
#endif #endif

View File

@ -18,7 +18,7 @@ Abstract:
#ifndef _STDDEF_H #ifndef _STDDEF_H
#define _STDDEF_H 1 #define _STDDEF_H 1
#ifdef __cplusplus #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -34,7 +34,7 @@ extern "C" {
#ifndef _SIZE_T_DEFINED #ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED #define _SIZE_T_DEFINED
#ifdef _WIN64 #if defined(_WIN64)
typedef unsigned __int64 size_t; typedef unsigned __int64 size_t;
#else #else
typedef unsigned int size_t; typedef unsigned int size_t;
@ -43,7 +43,7 @@ typedef unsigned int size_t;
#ifndef _PTRDIFF_T_DEFINED #ifndef _PTRDIFF_T_DEFINED
#define _PTRDIFF_T_DEFINED #define _PTRDIFF_T_DEFINED
#ifdef _WIN64 #if defined(_WIN64)
typedef __int64 ptrdiff_t; typedef __int64 ptrdiff_t;
#else #else
typedef long int ptrdiff_t; typedef long int ptrdiff_t;
@ -57,7 +57,7 @@ typedef unsigned short wchar_t;
#define offsetof(type, member) __builtin_offsetof(type, member) #define offsetof(type, member) __builtin_offsetof(type, member)
#ifdef __cplusplus #if defined(__cplusplus)
} }
#endif #endif

View File

@ -20,7 +20,7 @@ Abstract:
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -35,7 +35,7 @@ int strncmp(const char *s1, const char *s2, size_t n);
char *strchr(const char *s, int c); char *strchr(const char *s, int c);
char *strstr(const char *haystack, const char *needle); char *strstr(const char *haystack, const char *needle);
#ifdef __cplusplus #if defined(__cplusplus)
} }
#endif #endif

View File

@ -21,7 +21,7 @@ Abstract:
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -40,7 +40,7 @@ wchar_t *wcscat_s(wchar_t *dest, size_t maxlen, const wchar_t *src);
int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args); int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args);
#ifdef __cplusplus #if defined(__cplusplus)
} }
#endif #endif

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFIBIND_H #ifndef _EFIBIND_H
#define _EFIBIND_H #define _EFIBIND_H
@ -20,7 +22,7 @@ Abstract:
// Calling conventions. // Calling conventions.
// //
#ifndef EFIAPI #ifndef EFIAPI
#if defined(_MSC_EXTENSIONS) #if defined_(MSC_EXTENSIONS)
#define EFIAPI __cdecl #define EFIAPI __cdecl
#elif defined(__clang__) || defined(__GNUC__) #elif defined(__clang__) || defined(__GNUC__)
#define EFIAPI __attribute__((ms_abi)) #define EFIAPI __attribute__((ms_abi))

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFI_H #ifndef _EFI_H
#define _EFI_H #define _EFI_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFIAPI_H #ifndef _EFIAPI_H
#define _EFIAPI_H #define _EFIAPI_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFICON_H #ifndef _EFICON_H
#define _EFICON_H #define _EFICON_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFIDEF_H #ifndef _EFIDEF_H
#define _EFIDEF_H #define _EFIDEF_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFIDEVP_H #ifndef _EFIDEVP_H
#define _EFIDEVP_H #define _EFIDEVP_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFIERR_H #ifndef _EFIERR_H
#define _EFIERR_H #define _EFIERR_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _EFIPROT_H #ifndef _EFIPROT_H
#define _EFIPROT_H #define _EFIPROT_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _GUIDDEF_H #ifndef _GUIDDEF_H
#define _GUIDDEF_H #define _GUIDDEF_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _NT_H #ifndef _NT_H
#define _NT_H #define _NT_H

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _NTDEF_H #ifndef _NTDEF_H
#define _NTDEF_H #define _NTDEF_H
@ -144,7 +146,7 @@ typedef UCHAR BOOLEAN;
// //
// Numeric pointer types. // Numeric pointer types.
// //
#ifdef _WIN64 #if defined(_WIN64)
typedef LONGLONG LONG_PTR; typedef LONGLONG LONG_PTR;
typedef ULONGLONG ULONG_PTR; typedef ULONGLONG ULONG_PTR;
#else #else

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _NTIMAGE_H #ifndef _NTIMAGE_H
#define _NTIMAGE_H #define _NTIMAGE_H

View File

@ -13,10 +13,12 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _NTRTL_H #ifndef _NTRTL_H
#define _NTRTL_H #define _NTRTL_H
#ifdef __cplusplus #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -204,7 +206,7 @@ RtlGUIDFromString (
OUT GUID *Guid OUT GUID *Guid
); );
#ifdef __cplusplus #if defined(__cplusplus)
} }
#endif #endif

View File

@ -13,6 +13,8 @@ Abstract:
--*/ --*/
#pragma once
#ifndef _NTSTATUS_H #ifndef _NTSTATUS_H
#define _NTSTATUS_H #define _NTSTATUS_H