From: Arne Schwabe Date: Wed, 12 May 2021 13:15:08 +0000 (+0200) Subject: Add noreturn attribute for MSVC to assert_failed method. X-Git-Tag: v2.6_beta1~503 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad2140e0337f99c183e732b61df03ae29bdec766;p=thirdparty%2Fopenvpn.git Add noreturn attribute for MSVC to assert_failed method. Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20210512131511.1309914-7-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22344.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/error.h b/src/openvpn/error.h index 1a5521654..469afe20a 100644 --- a/src/openvpn/error.h +++ b/src/openvpn/error.h @@ -202,8 +202,14 @@ FILE *msg_fp(const unsigned int flags); #define ASSERT(x) do { if (!(x)) {assert_failed(__FILE__, __LINE__, NULL);}} while (false) #endif +#ifdef _MSC_VER +__declspec(noreturn) +#endif void assert_failed(const char *filename, int line, const char *condition) -__attribute__((__noreturn__)); +#ifndef _MSC_VER +__attribute__((__noreturn__)) +#endif +; /* Poor-man's static_assert() for when not supplied by assert.h, taken from * Linux's sys/cdefs.h under GPLv2 */