Move GIT_NORETURN into test_lib.h only We should never have a noreturn style function in the library itself, as such a function would prevent the calling application from handling error conditions the way it wants. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/include/git/common.h b/include/git/common.h
index 9882255..5841342 100644
--- a/include/git/common.h
+++ b/include/git/common.h
@@ -43,13 +43,6 @@
# define GIT_EXTERN(type) type
#endif
-/** Declare a function never returns to the caller. */
-#ifdef __GNUC__
-# define GIT_NORETURN __attribute__((__noreturn__))
-#else
-# define GIT_NORETURN /* empty */
-#endif
-
/** Declare a function's takes printf style arguments. */
#ifdef __GNUC__
# define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b)))
diff --git a/tests/test_lib.h b/tests/test_lib.h
index 7e7c393..41cb5ab 100644
--- a/tests/test_lib.h
+++ b/tests/test_lib.h
@@ -26,6 +26,13 @@
#include <stdio.h>
#include <git/common.h>
+/** Declare a function never returns to the caller. */
+#ifdef __GNUC__
+# define NORETURN __attribute__((__noreturn__))
+#else
+# define NORETURN /* noreturn */
+#endif
+
/**
* Declares a new test block starting, with the specified name.
* @param name C symbol to assign to this test's function.
@@ -55,7 +62,7 @@ extern void test_end(void);
* @param fmt printf style format string.
*/
extern void test_die(const char *fmt, ...)
- GIT_NORETURN
+ NORETURN
GIT_FORMAT_PRINTF(1, 2);
/**