[PATCH 4/5] Introduce X_NORETURN macro defined as __attribute__((noreturn)) for gcc
Mikhail Gusarov
dottedmag at dottedmag.net
Wed May 12 13:33:13 PDT 2010
Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
include/misc.h | 6 ++++++
include/os.h | 5 +----
os/log.c | 5 ++---
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/misc.h b/include/misc.h
index c7add25..e4bdee4 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -106,6 +106,12 @@ typedef unsigned long ATOM;
#define X_DEPRECATED
#endif
+#if defined(__GNUC__) && (__GNUC__ > 2)
+#define X_NORETURN __attribute__((noreturn))
+#else
+#define X_NORETURN
+#endif
+
#ifndef _XTYPEDEF_CALLBACKLISTPTR
typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
#define _XTYPEDEF_CALLBACKLISTPTR
diff --git a/include/os.h b/include/os.h
index 7f358ee..82d6694 100644
--- a/include/os.h
+++ b/include/os.h
@@ -547,10 +547,7 @@ extern _X_EXPORT void FreeAuditTimer(void);
extern _X_EXPORT void AuditF(const char *f, ...) _printf_attribute(1,2);
extern _X_EXPORT void VAuditF(const char *f, va_list args);
extern _X_EXPORT void FatalError(const char *f, ...) _printf_attribute(1,2)
-#if defined(__GNUC__) && (__GNUC__ > 2)
-__attribute((noreturn))
-#endif
-;
+ X_NORETURN;
#ifdef DEBUG
#define DebugF ErrorF
diff --git a/os/log.c b/os/log.c
index ff78545..0781659 100644
--- a/os/log.c
+++ b/os/log.c
@@ -402,9 +402,8 @@ LogMessage(MessageType type, const char *format, ...)
va_end(ap);
}
-#ifdef __GNUC__
-void AbortServer(void) __attribute__((noreturn));
-#endif
+void
+AbortServer(void) X_NORETURN;
void
AbortServer(void)
--
1.7.1
More information about the xorg-devel
mailing list