Add EFI_NORETURN for declspec

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Callum Farmer 2023-08-12 12:58:02 +01:00 committed by Nigel Croxon
parent 593e13f670
commit d27431f679
2 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,12 @@ Abstract:
#define ALIGN(x) EFI_ALIGN(x) #define ALIGN(x) EFI_ALIGN(x)
#endif #endif
#ifdef _MSC_EXTENSIONS
#define EFI_NORETURN __declspec(noreturn)
#else
#define EFI_NORETURN __attribute__((noreturn))
#endif
/* Also add a catch-all on __attribute__() for MS compilers */ /* Also add a catch-all on __attribute__() for MS compilers */
#ifdef _MSC_EXTENSIONS #ifdef _MSC_EXTENSIONS
#define __attribute__(x) #define __attribute__(x)

View File

@ -5,6 +5,6 @@
#include "efisetjmp_arch.h" #include "efisetjmp_arch.h"
extern UINTN setjmp(jmp_buf env) __attribute__((returns_twice)); extern UINTN setjmp(jmp_buf env) __attribute__((returns_twice));
extern VOID longjmp(jmp_buf env, UINTN value) __attribute__((noreturn)); extern VOID longjmp(jmp_buf env, UINTN value) EFI_NORETURN;
#endif /* GNU_EFI_SETJMP_H */ #endif /* GNU_EFI_SETJMP_H */