path: root/usage.c
diff options
authorErik Faye-Lund <>2009-09-30 18:05:49 (GMT)
committerJeff King <>2009-10-01 08:12:21 (GMT)
commita4f3131c07c1f601be1e24b2143ca7e2deea09b5 (patch)
tree2586a271cd7cd125af045dff2a741b5d7e7c6a23 /usage.c
parent1be224ba6e99f0ab34c998d7fa8023b76a15c8b6 (diff)
increase portability of NORETURN declarations
Some compilers (including at least MSVC) support NORETURN on function declarations, but only before the function-name. This patch makes it possible to define NORETURN to something meaningful for those compilers. Signed-off-by: Erik Faye-Lund <> Signed-off-by: Jeff King <>
Diffstat (limited to 'usage.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/usage.c b/usage.c
index b6aea45..0555ce6 100644
--- a/usage.c
+++ b/usage.c
@@ -36,12 +36,12 @@ static void warn_builtin(const char *warn, va_list params)
/* If we are in a dlopen()ed .so write to a global variable would segfault
* (ugh), so keep things static. */
-static void (*usage_routine)(const char *err) NORETURN = usage_builtin;
-static void (*die_routine)(const char *err, va_list params) NORETURN = die_builtin;
+static NORETURN void (*usage_routine)(const char *err) = usage_builtin;
+static NORETURN void (*die_routine)(const char *err, va_list params) = die_builtin;
static void (*error_routine)(const char *err, va_list params) = error_builtin;
static void (*warn_routine)(const char *err, va_list params) = warn_builtin;
-void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN)
+void set_die_routine(NORETURN void (*routine)(const char *err, va_list params))
die_routine = routine;