aboutsummaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-10-09 16:26:35 -0700
committerJunio C Hamano <gitster@pobox.com>2009-10-09 16:26:35 -0700
commitc2c865684bf24ba422bb2624a5260df7302976fe (patch)
tree7e7e5464cbf08350f3d9d7101863508146d9bdff /git-compat-util.h
parent302e99b79a47e55274c9ba91bb7ac9d5d6292925 (diff)
parent18660bc96ec0419cc096a53998d3197f2b905e8a (diff)
downloadgit-c2c865684bf24ba422bb2624a5260df7302976fe.tar.gz
git-c2c865684bf24ba422bb2624a5260df7302976fe.tar.xz
Merge branch 'ef/msvc-noreturn'
* ef/msvc-noreturn: add NORETURN_PTR for function pointers increase portability of NORETURN declarations
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 8d6e29cde..ef6080338 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -176,8 +176,10 @@ extern char *gitbasename(char *);
#ifdef __GNUC__
#define NORETURN __attribute__((__noreturn__))
+#define NORETURN_PTR __attribute__((__noreturn__))
#else
#define NORETURN
+#define NORETURN_PTR
#ifndef __attribute__
#define __attribute__(x)
#endif
@@ -186,13 +188,13 @@ extern char *gitbasename(char *);
#include "compat/bswap.h"
/* General helper functions */
-extern void usage(const char *err) NORETURN;
-extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
-extern void die_errno(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
+extern NORETURN void usage(const char *err);
+extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));
+extern NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
-extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);
+extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
extern int prefixcmp(const char *str, const char *prefix);
extern time_t tm_to_time_t(const struct tm *tm);