Skip to content

Commit

Permalink
Windows: Use _Noreturn properly
Browse files Browse the repository at this point in the history
  • Loading branch information
lundman authored and andrewc12 committed Sep 23, 2022
1 parent 209bec2 commit eb5c0b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/os/windows/spl/sys/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#define __printflike(X, Y)
#define __unused
#define always_inline __forceinline
#define __NORETURN
#define _Noreturn

#else

Expand All @@ -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

Expand Down
9 changes: 8 additions & 1 deletion lib/libspl/include/os/windows/sys/sysmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,3 +117,4 @@
#define _LITTLE_ENDIAN

#endif /* _LIBSPL_SYS_SYSMACROS_H */

0 comments on commit eb5c0b2

Please sign in to comment.