about summary refs log tree commit diff stats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-02 10:56:42 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-02 10:56:42 +0100
commitc9588388d04bb3180c3cfec4359462421c0407f0 (patch)
treeea0de3de960bfb88ae2463c92cf7a3f745f2b63b /src/js
parent2fb87f5c609be4d42f71fbd6a9439de47c6d0189 (diff)
downloadchawan-c9588388d04bb3180c3cfec4359462421c0407f0.tar.gz
Get rid of clang 16 workaround
* bindings/quickjs: importc and use correct pointer types
* add constcharp module for when it is unavoidable
Diffstat (limited to 'src/js')
-rw-r--r--src/js/module.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/module.nim b/src/js/module.nim
index bae146a7..70755ebd 100644
--- a/src/js/module.nim
+++ b/src/js/module.nim
@@ -1,3 +1,4 @@
+import bindings/constcharp
 import bindings/quickjs
 import js/javascript
 import js/tojs
@@ -23,6 +24,6 @@ proc finishLoadModule*(ctx: JSContext, f: string, name: cstring): JSModuleDef =
   result = cast[JSModuleDef](JS_VALUE_GET_PTR(funcVal))
   JS_FreeValue(ctx, funcVal)
 
-proc normalizeModuleName*(ctx: JSContext, base_name: cstring, name: cstring,
+proc normalizeModuleName*(ctx: JSContext, base_name, name: cstringConst,
     opaque: pointer): cstring {.cdecl.} =
-  return js_strdup(ctx, name)
+  return js_strdup(ctx, cstring(name))