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