mirror of
https://git.freebsd.org/ports.git
synced 2025-05-16 01:01:49 -04:00
33 lines
1.4 KiB
C
33 lines
1.4 KiB
C
source/utils.c:18:10: fatal error: 'features.h' file not found
|
|
18 | #include <features.h>
|
|
| ^~~~~~~~~~~~
|
|
source/utils.c:303:54: error: implicit declaration of function 'mallinfo' is invalid in C99
|
|
[-Werror,-Wimplicit-function-declaration]
|
|
writeToLogFile("Memory usage at exit: %u\n", mallinfo().arena);
|
|
^
|
|
source/utils.c:303:64: error: member reference base type 'int' is not a structure or union
|
|
writeToLogFile("Memory usage at exit: %u\n", mallinfo().arena);
|
|
~~~~~~~~~~^~~~~~
|
|
|
|
--- source/utils.c.orig 2024-02-01 15:55:11 UTC
|
|
+++ source/utils.c
|
|
@@ -14,7 +14,7 @@
|
|
#include <locale.h>
|
|
#include <math.h>
|
|
|
|
-#ifdef LINUX
|
|
+#if defined(__linux__)
|
|
#include <features.h>
|
|
#endif
|
|
|
|
@@ -307,9 +307,7 @@ void *checkAlloc(void *ptr, size_t size, const char *f
|
|
"\n* Shutting Down *\n\n");
|
|
writeToLogFile("Out of memory!\n");
|
|
writeToLogFile("Allocation of size %i failed in function '%s' at %s:%i.\n", size, func, file, line);
|
|
-#ifndef WIN
|
|
- writeToLogFile("Memory usage at exit: %u\n", mallinfo().arena);
|
|
-#elif LINUX
|
|
+#if defined(__GLIBC__) || defined(ANDROID) || defined(VITA)
|
|
writeToLogFile("Memory usage at exit: %u\n", mallinfo2().arena);
|
|
#endif
|
|
borExit(2);
|