Commit fbbfdf9f13e92da2dc31b56081302f09fdb62e49

Shawn O. Pearce 2008-11-03T16:29:56

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>

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);
 
 /**