Skip to content

Commit 7665482

Browse files
Merge branch 'main' into codex/quic-shared-socket
2 parents 1d1e7f4 + e2daec6 commit 7665482

3 files changed

Lines changed: 508 additions & 487 deletions

File tree

generate_lsquic_ffi.nim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@
22
# Copyright (c) Status Research & Development GmbH
33

44
import futhark
5+
import std/json
56
from os import parentDir, `/`
67

78
import boringssl
89

10+
proc dropGeneratedCEnumsImpl(opirOutput: JsonNode): JsonNode =
11+
var resp = newJArray()
12+
for node in opirOutput:
13+
# enums are generated manually to avoid issue described in
14+
# https://github.com/PMunch/futhark/issues/152
15+
if node{"kind"}.getStr("") == "enum":
16+
continue
17+
resp.add node
18+
resp
19+
920
importc:
1021
outputPath currentSourcePath.parentDir / "tmp_lsquic_ffi.nim"
1122
path currentSourcePath.parentDir / "libs/lsquic/include"
23+
addopircallback proc(opirOutput: JsonNode): JsonNode {.closure.} =
24+
dropGeneratedCEnumsImpl(opirOutput)
1225
rename FILE, CFile # Rename `FILE` that STB uses to `CFile` which is the Nim equivalent
1326
rename struct_sockaddr, SockAddr # Rename `struct_sockaddr` for chronos SockAddr
1427
"lsquic.h"

0 commit comments

Comments
 (0)