Add SPICE_ATTR_NORETURN and use it for a few functions

This commit is contained in:
Marc-André Lureau 2012-03-20 02:28:20 +01:00
parent a1df67b3c5
commit f7af6264ea
2 changed files with 10 additions and 1 deletions

View File

@ -37,7 +37,7 @@
#include "lines.h"
#include "rop3.h"
#include "mem.h"
#include "macros.h"
#include "mutex.h"
#define ROUND(_x) ((int)floor((_x) + 0.5))
@ -1737,6 +1737,7 @@ static pixman_image_t *canvas_scale_surface(pixman_image_t *src, const SpiceRect
return surface;
}
SPICE_ATTR_NORETURN
SPICE_ATTR_PRINTF(2, 3) static void quic_usr_error(QuicUsrContext *usr, const char *fmt, ...)
{
QuicData *usr_data = (QuicData *)usr;
@ -1779,6 +1780,7 @@ SPICE_ATTR_PRINTF(2, 3) static void lz_usr_warn(LzUsrContext *usr, const char *f
va_end(ap);
}
SPICE_ATTR_NORETURN
SPICE_ATTR_PRINTF(2, 3) static void lz_usr_error(LzUsrContext *usr, const char *fmt, ...)
{
LzData *usr_data = (LzData *)usr;

View File

@ -26,5 +26,12 @@
#define SPICE_ATTR_PRINTF(a,b)
#endif /* __GNUC__ */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
#define SPICE_ATTR_NORETURN \
__attribute__((noreturn))
#else
#define SPICE_ATTR_NORETURN
#endif /* __GNUC__ */
#endif /* __MACROS_H */