mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Define a NORETURN macro
This commit is contained in:
@@ -162,11 +162,15 @@ struct abstract_ip_hdr {
|
||||
u32 ipid; /* IPv4 IP ID or IPv6 flow label. */
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#if defined(__GNUC__)
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_VER)
|
||||
#define NORETURN __declspec((noreturn))
|
||||
#else
|
||||
#define NORETURN
|
||||
#endif
|
||||
void netutil_fatal(const char *str, ...)
|
||||
__attribute__ ((noreturn))
|
||||
|
||||
NORETURN void netutil_fatal(const char *str, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
int netutil_error(const char *str, ...)
|
||||
|
||||
@@ -371,6 +371,14 @@ extern "C" int vsnprintf (char *, size_t, const char *, va_list);
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_VER)
|
||||
#define NORETURN __declspec((noreturn))
|
||||
#else
|
||||
#define NORETURN
|
||||
#endif
|
||||
|
||||
|
||||
static inline int checked_fd_isset(int fd, fd_set *fds) {
|
||||
#ifndef WIN32
|
||||
|
||||
@@ -129,11 +129,7 @@
|
||||
#include "nbase.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#endif
|
||||
static void fatal(char *fmt, ...)
|
||||
__attribute__ ((noreturn))
|
||||
NORETURN static void fatal(char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
static void fatal(char *fmt, ...) {
|
||||
|
||||
@@ -168,11 +168,7 @@ do { \
|
||||
|
||||
void die(char *);
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#endif
|
||||
void bye(const char *, ...)
|
||||
__attribute__ ((noreturn))
|
||||
NORETURN void bye(const char *, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
/* zero out some memory, bzero() is deprecated */
|
||||
|
||||
12
nmap_error.h
12
nmap_error.h
@@ -154,20 +154,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#endif
|
||||
void fatal(const char *fmt, ...)
|
||||
__attribute__ ((noreturn))
|
||||
NORETURN void fatal(const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
void error(const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#endif
|
||||
void pfatal(const char *err, ...)
|
||||
__attribute__ ((noreturn))
|
||||
NORETURN void pfatal(const char *err, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
void gh_perror(const char *err, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
@@ -74,19 +74,18 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#if defined(__GNUC__)
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_VER)
|
||||
#define NORETURN __declspec((noreturn))
|
||||
#else
|
||||
#define NORETURN
|
||||
#endif
|
||||
void fatal(char *fmt, ...)
|
||||
__attribute__ ((noreturn))
|
||||
|
||||
NORETURN void fatal(char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(noreturn)
|
||||
#endif
|
||||
void pfatal(char *fmt, ...)
|
||||
__attribute__ ((noreturn))
|
||||
NORETURN void pfatal(char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
#endif /* ERROR_H */
|
||||
|
||||
Reference in New Issue
Block a user