Make OPENSSL_die as noreturn
authorhesiod <tobias@miglix.eu>
Wed, 18 May 2016 17:34:27 +0000 (13:34 -0400)
committerRich Salz <rsalz@openssl.org>
Wed, 18 May 2016 17:37:01 +0000 (13:37 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/526)

include/openssl/crypto.h
include/openssl/e_os2.h

index 42ba57bb592471c9f150eba458a8c9e2762b4aa2..1162c71041a1093542607a60177c6318683334da 100644 (file)
@@ -310,10 +310,10 @@ int CRYPTO_mem_leaks(BIO *bio);
 # endif
 
 /* die if we have to */
+ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line);
 # if OPENSSL_API_COMPAT < 0x10100000L
 #  define OpenSSLDie(f,l,a) OPENSSL_die((a),(f),(l))
 # endif
-void OPENSSL_die(const char *assertion, const char *file, int line);
 # define OPENSSL_assert(e) \
     (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
 
index c556e57ca9614760922fff4c10345f3efae48ef0..1b1364dc0a41222b6c821a68c7205c7182f13da2 100644 (file)
@@ -293,6 +293,14 @@ typedef unsigned __int64 uint64_t;
 #  define ossl_inline inline
 # endif
 
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
+#  define ossl_noreturn __attribute__((noreturn))
+# elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+#  define ossl_noreturn _Noreturn
+# else
+#  define ossl_noreturn
+# endif
+
 #ifdef  __cplusplus
 }
 #endif