aboutsummaryrefslogtreecommitdiff
path: root/src/common/tuklib_exit.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-09-08 18:19:26 +0300
committerLasse Collin <lasse.collin@tukaani.org>2023-09-22 20:06:21 +0300
commit90c94dddfd57b7d744bfad64c54e10d15778144b (patch)
tree4319b205d0cdeed9abbc38b3b9555c56845ac158 /src/common/tuklib_exit.h
parentUpdate THANKS. (diff)
downloadxz-90c94dddfd57b7d744bfad64c54e10d15778144b.tar.xz
tuklib: Update tuklib_attr_noreturn for C11/C17 and C23.
This makes no difference for GCC or Clang as they support GNU C's __attribute__((__noreturn__)) but this helps with MSVC: - VS 2019 version 16.7 and later support _Noreturn if the options /std:c11 or /std:c17 are used. This gets handled with the check for __STDC_VERSION__ >= 201112. - When MSVC isn't in C11/C17 mode, __declspec(noreturn) is used. C23 will deprecate _Noreturn (and <stdnoreturn.h>) for [[noreturn]]. This commit anticipates that but the final __STDC_VERSION__ value isn't known yet.
Diffstat (limited to 'src/common/tuklib_exit.h')
-rw-r--r--src/common/tuklib_exit.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/tuklib_exit.h b/src/common/tuklib_exit.h
index b11776f0..f8f35a6b 100644
--- a/src/common/tuklib_exit.h
+++ b/src/common/tuklib_exit.h
@@ -18,8 +18,8 @@
TUKLIB_DECLS_BEGIN
#define tuklib_exit TUKLIB_SYMBOL(tuklib_exit)
-extern void tuklib_exit(int status, int err_status, int show_error)
- tuklib_attr_noreturn;
+tuklib_attr_noreturn
+extern void tuklib_exit(int status, int err_status, int show_error);
TUKLIB_DECLS_END
#endif