Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use strutils.escape to handle special characters in KZG directory paths in Nim bindings #412

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bindings/nim/kzg_abi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ when not defined(kzgExternalBlst):

{.compile: srcPath & "c_kzg_4844.c"}

{.passc: "-I" & bindingsPath .}
{.passc: "-I" & srcPath .}
{.passc: "-I" & escape(bindingsPath) .}
{.passc: "-I" & escape(srcPath) .}

const
FIELD_ELEMENTS_PER_BLOB* = 4096
Expand All @@ -40,15 +40,15 @@ const
KZG_ERROR* = (2).KZG_RET
KZG_MALLOC* = (3).KZG_RET

proc `$`*(x: KZG_RET): string =
func `$`*(x: KZG_RET): string =
case x
of KZG_OK: "ok"
of KZG_BADARGS: "kzg badargs"
of KZG_ERROR: "kzg error"
of KZG_MALLOC: "kzg malloc error"
else: "kzg unknown error"

proc `==`*(a, b: KZG_RET): bool =
func `==`*(a, b: KZG_RET): bool =
a.cint == b.cint

type
Expand Down
Loading