WIN32: hint noreturn functions
apply __declspec(noreturn) compiler hints to functions that do not return. Change-Id: I3c6c4703c7235d1df3e21dccad5272ea4cddfd36
This commit is contained in:
committed by
Nico Williams
parent
4d57ee72f3
commit
bec4818943
@@ -47,30 +47,39 @@
|
||||
#endif
|
||||
|
||||
#ifndef ROKEN_LIB_FUNCTION
|
||||
#ifdef _WIN32
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL __cdecl
|
||||
#else
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#endif
|
||||
#ifndef ROKEN_LIB_NORETURN_FUNCTION
|
||||
#ifdef _WIN32
|
||||
#define ROKEN_LIB_NORETURN_FUNCTION _declspec(noreturn)
|
||||
#else
|
||||
#define ROKEN_LIB_NORETURN_FUNCTION
|
||||
#endif
|
||||
#endif
|
||||
#ifndef ROKEN_LIB_CALL
|
||||
#ifdef _WIN32
|
||||
#define ROKEN_LIB_CALL __cdecl
|
||||
#else
|
||||
#define ROKEN_LIB_CALL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
|
||||
verr(int eval, const char *fmt, va_list ap)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
|
||||
err(int eval, const char *fmt, ...)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
|
||||
verrx(int eval, const char *fmt, va_list ap)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
|
||||
errx(int eval, const char *fmt, ...)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
vwarn(const char *fmt, va_list ap)
|
||||
__attribute__ ((__format__ (__printf__, 1, 0)));
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "err.h"
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
|
||||
errx(int eval, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -52,22 +52,49 @@
|
||||
#include <util.h>
|
||||
#endif
|
||||
|
||||
#ifndef ROKEN_LIB_FUNCTION
|
||||
#ifdef _WIN32
|
||||
# define ROKEN_LIB_CALL __cdecl
|
||||
# ifdef ROKEN_LIB_DYNAMIC
|
||||
# ifndef ROKEN_LIB_FUNCTION
|
||||
# ifdef _WIN32
|
||||
# ifdef ROKEN_LIB_DYNAMIC
|
||||
# define ROKEN_LIB_FUNCTION __declspec(dllimport)
|
||||
# define ROKEN_LIB_VARIABLE __declspec(dllimport)
|
||||
# else
|
||||
# else
|
||||
# define ROKEN_LIB_FUNCTION
|
||||
# define ROKEN_LIB_VARIABLE
|
||||
# endif
|
||||
# else
|
||||
# define ROKEN_LIB_FUNCTION
|
||||
# endif
|
||||
#else
|
||||
#define ROKEN_LIB_FUNCTION
|
||||
#define ROKEN_LIB_CALL
|
||||
#define ROKEN_LIB_VARIABLE
|
||||
#endif
|
||||
#endif
|
||||
# endif
|
||||
|
||||
# ifndef ROKEN_LIB_NORETURN_FUNCTION
|
||||
# ifdef _WIN32
|
||||
# ifdef ROKEN_LIB_DYNAMIC
|
||||
# define ROKEN_LIB_NORETURN_FUNCTION __declspec(dllimport noreturn)
|
||||
# else
|
||||
# define ROKEN_LIB_NORETURN_FUNCTION _declspec(noreturn)
|
||||
# endif
|
||||
# else
|
||||
# define ROKEN_LIB_NORETURN_FUNCTION
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef ROKEN_LIB_CALL
|
||||
# ifdef _WIN32
|
||||
# define ROKEN_LIB_CALL __cdecl
|
||||
# else
|
||||
# define ROKEN_LIB_CALL
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef ROKEN_LIB_VARIABLE
|
||||
# ifdef _WIN32
|
||||
# ifdef ROKEN_LIB_DYNAMIC
|
||||
# define ROKEN_LIB_VARIABLE __declspec(dllimport)
|
||||
# else
|
||||
# define ROKEN_LIB_VARIABLE
|
||||
# endif
|
||||
# else
|
||||
# define ROKEN_LIB_VARIABLE
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
/* Declarations for Microsoft Windows */
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "roken.h"
|
||||
#include <err.h>
|
||||
|
||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
|
||||
verrx(int eval, const char *fmt, va_list ap)
|
||||
{
|
||||
rk_warnerr(0, fmt, ap);
|
||||
|
||||
Reference in New Issue
Block a user