File: quickjs_hurd.diff

package info (click to toggle)
qbs 2.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 31,680 kB
  • sloc: cpp: 118,760; ansic: 68,952; javascript: 14,463; python: 5,828; asm: 1,742; sh: 871; java: 693; objc: 409; lex: 194; xml: 141; perl: 137; yacc: 86; makefile: 55; cs: 41
file content (32 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Author: Pino Toscano <pino@debian.org>
Description: Make the quickjs embedded copy build on GNU/Hurd
 Backport/adapt the changes done in the upstream quickjs project for supporting
 GNU/Hurd to the embedded copy in qbs:
 https://github.com/bellard/quickjs/pull/316
 .
 This patch can be dropped when qbs rebases its copy to a new version of the
 upstream quickjs.
Forwarded: not-needed
Origin: vendor
Last-Update: 2024-12-10

--- a/src/shared/quickjs/quickjs.c
+++ b/src/shared/quickjs/quickjs.c
@@ -36,7 +36,7 @@
 #include <math.h>
 #if defined(__APPLE__)
 #include <malloc/malloc.h>
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__GLIBC__)
 #include <malloc.h>
 #elif defined(__FreeBSD__)
 #include <malloc_np.h>
@@ -1763,7 +1763,7 @@ static size_t js_def_malloc_usable_size(
     return _msize((void *)ptr);
 #elif defined(EMSCRIPTEN)
     return 0;
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__GLIBC__)
     return malloc_usable_size((void *)ptr);
 #else
     /* change this to `return 0;` if compilation fails */