diff libtomcrypt/src/headers/tomcrypt_argchk.h @ 1043:38d2f6b2d1b8

Add more ATTRIB_NORETURN annotations, from Thorsten Horstmann
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Feb 2015 22:36:20 +0800
parents 0cbe8f6dbf9e
children f849a5ca2efc
line wrap: on
line diff
--- a/libtomcrypt/src/headers/tomcrypt_argchk.h	Tue Feb 24 22:23:32 2015 +0800
+++ b/libtomcrypt/src/headers/tomcrypt_argchk.h	Tue Feb 24 22:36:20 2015 +0800
@@ -4,8 +4,16 @@
 
 #include <signal.h>
 
+/* portability macros for compiler-specific code attributes */
+#ifdef __GNUC__
+#define ATTRIB_NORETURN __attribute__((noreturn))
+#else
+#define ATTRIB_NORETURN
+#endif
+
+
 /* this is the default LibTomCrypt macro  */
-void crypt_argchk(char *v, char *s, int d);
+void crypt_argchk(char *v, char *s, int d) ATTRIB_NORETURN;
 #define LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); }
 #define LTC_ARGCHKVD(x) LTC_ARGCHK(x)