Prechádzať zdrojové kódy

define attribute_noreturn

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 15 rokov pred
rodič
commit
587a72856b
2 zmenil súbory, kde vykonal 10 pridanie a 2 odobranie
  1. 4 2
      utils/ldconfig.c
  2. 6 0
      utils/porting.h

+ 4 - 2
utils/ldconfig.c

@@ -114,7 +114,8 @@ static void warnx(const char *s, ...)
 	fprintf(stderr, "\n");
 }
 
-static attribute_noreturn void err(int errnum, const char *s, ...)
+static void err(int errnum, const char *s, ...) attribute_noreturn;
+static void err(int errnum, const char *s, ...)
 {
 	va_list p;
 
@@ -783,7 +784,8 @@ void cache_print(void)
 }
 #endif
 
-static attribute_noreturn void usage(void)
+static void usage(void) attribute_noreturn;
+static void usage(void)
 {
 	fprintf(stderr,
 #ifdef __LDSO_CACHE_SUPPORT__

+ 6 - 0
utils/porting.h

@@ -72,4 +72,10 @@
 # error "Unknown host byte order!"
 #endif
 
+#if defined __GNUC__ || defined __ICC
+# define attribute_noreturn __attribute__ ((__noreturn__))
+#else
+# define attribute_noreturn
+#endif
+
 #endif