From 334e33cfde9e2c152d8ee2a30d2d9126aee0de01 Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jackpot51@gmail.com> Date: Fri, 10 Mar 2023 10:45:19 -0700 Subject: [PATCH] Fix abort definition for C++ --- include/bits/stdlib.h | 8 ++++---- src/c/stdlib.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/bits/stdlib.h b/include/bits/stdlib.h index fd13c94fa..39e776479 100644 --- a/include/bits/stdlib.h +++ b/include/bits/stdlib.h @@ -1,6 +1,10 @@ #ifndef _BITS_STDLIB_H #define _BITS_STDLIB_H +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __cplusplus // C++ needs abort to be a function, define backup function void abort(void); @@ -9,10 +13,6 @@ void abort(void); #define abort() __abort(__func__, __FILE__, __LINE__) #endif -#ifdef __cplusplus -extern "C" { -#endif - long double strtold(const char *nptr, char **endptr); #ifdef __cplusplus diff --git a/src/c/stdlib.c b/src/c/stdlib.c index 3b58c0ccd..57367c6bc 100644 --- a/src/c/stdlib.c +++ b/src/c/stdlib.c @@ -8,7 +8,7 @@ long double strtold(const char *nptr, char **endptr) { void __abort(const char *func, const char *file, int line); // backup definition of abort for programs that link it directly -void abort() { +void abort(void) { // call detailed abort function __abort(__func__, __FILE__, __LINE__); } -- GitLab