mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-25 17:34:20 +00:00
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>
This commit is contained in:
parent
b3a2f90e54
commit
fbbfdf9f13
@ -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)))
|
||||
|
||||
@ -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);
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user