about summary refs log tree commit diff stats
path: root/src/bindings
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-01 19:05:45 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-01 19:37:48 +0200
commitaf3dbce840d0d0956663ffb20012329a4c22d5dd (patch)
treeda3c2bad567d9b08f585cbc973aac61ef4eb05ae /src/bindings
parentcab49aa0952c24941bcfb9a5b483f796158bf373 (diff)
downloadchawan-af3dbce840d0d0956663ffb20012329a4c22d5dd.tar.gz
Fixes & workarounds to compile on Nim 2.0.0
* Import punycode, as it has been removed from stdlib.
* Fix some syntax errors
* Apparently you can no longer compare distinct pointers with nil.
  Add explicit comparisons with typeof(nil) instead.
* htmlparser: rename _ to other, as semantics of _ have changed.
  (Quite a shame, it looked better with _. Oh well.)
* Explicitly specify mm:refc, as the browser OOMs with orc for
  some reason.

Confirmed to compile & run on 2.0.0, 1.6.14, 1.6.12, 1.6.10 and 1.6.8.
(<1.6.8 it's broken & wontfix.)
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/curl.nim2
-rw-r--r--src/bindings/quickjs.nim3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bindings/curl.nim b/src/bindings/curl.nim
index 07395b65..ed2057eb 100644
--- a/src/bindings/curl.nim
+++ b/src/bindings/curl.nim
@@ -286,7 +286,9 @@ type
     CURLMSG_LAST # last, not used
 
 proc `==`*(a: CURL, b: CURL): bool {.borrow.}
+proc `==`*(a: CURL, b: typeof(nil)): bool {.borrow.}
 proc `==`*(a: CURLM, b: CURLM): bool {.borrow.}
+proc `==`*(a: CURLM, b: typeof(nil)): bool {.borrow.}
 
 {.push importc.}
 
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim
index 7ff8fd0f..d415c17e 100644
--- a/src/bindings/quickjs.nim
+++ b/src/bindings/quickjs.nim
@@ -281,7 +281,8 @@ template JS_CGETSET_DEF*(n: string, fgetter, fsetter: untyped): JSCFunctionListE
                            get: JSCFunctionType(getter: fgetter),
                            set: JSCFunctionType(setter: fsetter))))
 
-template JS_CGETSET_MAGIC_DEF*(n: string, fgetter, fsetter: untyped, m: cint): JSCFunctionListEntry =
+template JS_CGETSET_MAGIC_DEF*(n: string, fgetter, fsetter: untyped,
+    m: int16): JSCFunctionListEntry =
   JSCFunctionListEntry(name: cstring(n),
                        prop_flags: JS_PROP_CONFIGURABLE,
                        def_type: JS_DEF_CGETSET_MAGIC,