2
0
Эх сурвалжийг харах

Fix abort definition for C++

Jeremy Soller 2 жил өмнө
parent
commit
334e33cfde

+ 4 - 4
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

+ 1 - 1
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__);
 }