]> mj.ucw.cz Git - pciutils.git/commitdiff
Introduced NONRET macro
authorMartin Mares <mj@ucw.cz>
Fri, 26 Dec 2003 21:30:06 +0000 (21:30 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:18:09 +0000 (14:18 +0200)
pciutils.h, common.c, setpci.c: Introduced a NONRET macro encapsulating
the GCC specific __attribute__((noreturn)) and killed the hack with
redefining __attribute__ on non-GCC compilers.
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-10

ChangeLog
common.c
pciutils.h
setpci.c

index 17ab1084d66d46bafa8ed556d33fca9229308552..0a7a20458b9be72f4224d7e6223037ea5e9fa11e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2003-12-26  Martin Mares  <mj@ucw.cz>
 
+       * pciutils.h, common.c, setpci.c: Introduced a NONRET macro encapsulating
+       the GCC specific __attribute__((noreturn)) and killed the hack with
+       redefining __attribute__ on non-GCC compilers.
+
        * Makefile: Added missing dependencies. Parallel builds work now.
        Problem reported by Andreas Haumer <andreas@xss.co.at>, but I chose
        a different fix.
index 5b938dd5b26570b9731526f74e266a412a2a4519..846b1e60204653ecaa29703287befe13b0c964d0 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1,7 +1,7 @@
 /*
  *     Linux PCI Utilities -- Common Functions
  *
- *     Copyright (c) 1997--1999 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -14,7 +14,7 @@
 
 #include "pciutils.h"
 
-void __attribute__((noreturn))
+void NONRET
 die(char *msg, ...)
 {
   va_list args;
index 0997df7628756846ea7563d2b9d20eeb3c4de20d..96313581a81ec3b428e921639d3e049d37be3a1a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Linux PCI Utilities -- Declarations
  *
- *     Copyright (c) 1997--1999 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
 #define PCIUTILS_VERSION PCILIB_VERSION
 
 #if !defined(__GNUC__)
-#define __attribute__(x)
+#define NONRET
 #define inline
+#else
+#define NONRET __attribute__((noreturn))
 #endif
 
-void __attribute__((noreturn)) die(char *msg, ...);
+void die(char *msg, ...) NONRET;
 void *xmalloc(unsigned int howmuch);
 int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
 
index a3415073e459375cc0e00dff5d6d7086f14354b6..8ee6f3a9be58dc7ce7c1dd460bf6ea82b649764a 100644 (file)
--- a/setpci.c
+++ b/setpci.c
@@ -249,9 +249,7 @@ static const struct reg_name pci_reg_names[] = {
   { 0x00, 0, NULL }
 };
 
-static void usage(void) __attribute__((noreturn));
-
-static void
+static void NONRET
 usage(void)
 {
   fprintf(stderr,