Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0215-erts-Add-noreturn-to-esock-abort.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0215-erts-Add-noreturn-to-esock-abort.patch of Package erlang
From d04e89ea3f04002d408156b789983815c2f72a4d Mon Sep 17 00:00:00 2001 From: Lukas Larsson <lukas@erlang.org> Date: Tue, 3 Nov 2020 08:57:45 +0100 Subject: [PATCH 05/11] erts: Add noreturn to esock abort --- erts/emulator/nifs/common/socket_int.h | 22 ++++++++++++++++++++++ erts/emulator/nifs/common/socket_util.c | 3 ++- erts/emulator/nifs/common/socket_util.h | 9 +++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/erts/emulator/nifs/common/socket_int.h b/erts/emulator/nifs/common/socket_int.h index 6fb25ee6a8..afe1b8e61a 100644 --- a/erts/emulator/nifs/common/socket_int.h +++ b/erts/emulator/nifs/common/socket_int.h @@ -66,6 +66,28 @@ #endif +/* Copied from sys.h + * In VC++, noreturn is a declspec that has to be before the types, + * but in GNUC it is an attribute to be placed between return type + * and function name, hence __decl_noreturn <types> __noreturn <function name> + * + * at some platforms (e.g. Android) __noreturn is defined at sys/cdef.h + */ +#if __GNUC__ +# define __decl_noreturn +# ifndef __noreturn +# define __noreturn __attribute__((noreturn)) +# endif +#else +# if defined(__WIN32__) && defined(_MSC_VER) +# define __noreturn +# define __decl_noreturn __declspec(noreturn) +# else +# define __noreturn +# define __decl_noreturn +# endif +#endif + #include <erl_nif.h> /* The general purpose sockaddr */ diff --git a/erts/emulator/nifs/common/socket_util.c b/erts/emulator/nifs/common/socket_util.c index ce879dbfb3..61ea615de8 100644 --- a/erts/emulator/nifs/common/socket_util.c +++ b/erts/emulator/nifs/common/socket_util.c @@ -1827,7 +1827,8 @@ size_t esock_strnlen(const char *s, size_t maxlen) * */ extern -void esock_abort(const char* expr, +void __noreturn +esock_abort(const char* expr, const char* func, const char* file, int line) diff --git a/erts/emulator/nifs/common/socket_util.h b/erts/emulator/nifs/common/socket_util.h index 3a0a84a8d8..8d35d3c06d 100644 --- a/erts/emulator/nifs/common/socket_util.h +++ b/erts/emulator/nifs/common/socket_util.h @@ -222,10 +222,11 @@ ERL_NIF_TERM esock_encode_level(ErlNifEnv* env, int level); extern size_t esock_strnlen(const char *s, size_t maxlen); extern -void esock_abort(const char* expr, - const char* func, - const char* file, - int line); +void __noreturn +esock_abort(const char* expr, + const char* func, + const char* file, + int line); extern ERL_NIF_TERM esock_self(ErlNifEnv* env); -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor