From fbbfdf9f13e92da2dc31b56081302f09fdb62e49 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 3 Nov 2008 16:29:56 -0800 Subject: [PATCH] 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 --- include/git/common.h | 7 ------- tests/test_lib.h | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/git/common.h b/include/git/common.h index 98822557c..5841342a0 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 7e7c39379..41cb5ab07 100644 --- a/tests/test_lib.h +++ b/tests/test_lib.h @@ -26,6 +26,13 @@ #include #include +/** 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); /**