Commit fbbfdf9f by Shawn O. Pearce

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>
parent b3a2f90e
...@@ -43,13 +43,6 @@ ...@@ -43,13 +43,6 @@
# define GIT_EXTERN(type) type # define GIT_EXTERN(type) type
#endif #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. */ /** Declare a function's takes printf style arguments. */
#ifdef __GNUC__ #ifdef __GNUC__
# define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b))) # define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b)))
......
...@@ -26,6 +26,13 @@ ...@@ -26,6 +26,13 @@
#include <stdio.h> #include <stdio.h>
#include <git/common.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. * Declares a new test block starting, with the specified name.
* @param name C symbol to assign to this test's function. * @param name C symbol to assign to this test's function.
...@@ -55,7 +62,7 @@ extern void test_end(void); ...@@ -55,7 +62,7 @@ extern void test_end(void);
* @param fmt printf style format string. * @param fmt printf style format string.
*/ */
extern void test_die(const char *fmt, ...) extern void test_die(const char *fmt, ...)
GIT_NORETURN NORETURN
GIT_FORMAT_PRINTF(1, 2); GIT_FORMAT_PRINTF(1, 2);
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment