From eb5c0b21c19ec244cc5a22690dfc043d45108507 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Fri, 2 Sep 2022 09:18:15 +0900 Subject: [PATCH] Windows: Use _Noreturn properly --- include/os/windows/spl/sys/debug.h | 5 +++-- lib/libspl/include/os/windows/sys/sysmacros.h | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/os/windows/spl/sys/debug.h b/include/os/windows/spl/sys/debug.h index ce1e4edea6f3..a26de24cc9f9 100644 --- a/include/os/windows/spl/sys/debug.h +++ b/include/os/windows/spl/sys/debug.h @@ -67,7 +67,7 @@ #define __printflike(X, Y) #define __unused #define always_inline __forceinline -#define __NORETURN +#define _Noreturn #else @@ -86,7 +86,8 @@ #define __printflike(a, b) __attribute__((__format__(__printf__, a, b))) #define __unused __attribute__((unused)) -#define __NORETURN __attribute__((__noreturn__)) +#define _Noreturn __attribute__((__noreturn__)) + #endif diff --git a/lib/libspl/include/os/windows/sys/sysmacros.h b/lib/libspl/include/os/windows/sys/sysmacros.h index ebb3eb1c315f..5bfe6a2ec790 100644 --- a/lib/libspl/include/os/windows/sys/sysmacros.h +++ b/lib/libspl/include/os/windows/sys/sysmacros.h @@ -48,7 +48,13 @@ #define makedevice(maj, min) makedev(maj, min) #define _sysconf(a) sysconf(a) -// #define __NORETURN __attribute__((noreturn)) + + +#ifdef _MSC_VER +#define _Noreturn +#else +#define _Noreturn __attribute__((__noreturn__)) +#endif /* * Compatibility macros/typedefs needed for Solaris -> Windows port @@ -111,3 +117,4 @@ #define _LITTLE_ENDIAN #endif /* _LIBSPL_SYS_SYSMACROS_H */ +