brssl: c2nim-generated spelling (#33)

* generate brssl.nim with regenerate.sh as well
This commit is contained in:
Jacek Sieka 2022-07-07 18:47:59 +02:00 committed by GitHub
parent 32e125015a
commit 1e9b702650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -2,7 +2,6 @@ import
"."/[csources, bearssl_x509]
{.pragma: importcFunc, cdecl, gcsafe, noSideEffect, raises: [].}
{.pragma: headerFunc, importcFunc, header: "brssl.h".}
{.used.}
const
@ -16,9 +15,12 @@ const
{.compile: bearToolsPath & "files.c".}
type
X509NoAnchorContext* {.importc: "x509_noanchor_context",
header: "brssl.h", bycopy.} = object
X509NoanchorContext* {.importc: "x509_noanchor_context", header: "brssl.h", bycopy.} = object
vtable* {.importc: "vtable".}: ptr X509Class
inner* {.importc: "inner".}: ptr ptr X509Class
proc initNoAnchor*(xwc: var X509NoAnchorContext, inner: ptr ptr X509Class) {.
importcFunc, importc: "x509_noanchor_init", header: "brssl.h".}
proc x509NoanchorInit*(xwc: var X509NoanchorContext; inner: ptr ptr X509Class) {.importcFunc,
importc: "x509_noanchor_init", header: "brssl.h".}
proc initNoAnchor*(xwc: var X509NoanchorContext, inner: ptr ptr X509Class) {.
importcFunc, importc: "x509_noanchor_init", header: "brssl.h", deprecated: "x509NoanchorInit".}

View File

@ -1,6 +1,10 @@
#!/bin/sh
[[ $(c2nim -v) == "0.9.18" ]] || echo "Different c2nim used, check the code"
mkdir -p gen
cp bearssl/csources/inc/*.h gen
cp bearssl/csources/tools/brssl.h gen
# c2nim gets confused by #ifdef inside struct's
unifdef -m -UBR_DOXYGEN_IGNORE gen/*.h
@ -11,7 +15,6 @@ unifdef -m -UBR_DOXYGEN_IGNORE gen/*.h
# https://github.com/nim-lang/c2nim/issues/241
# https://github.com/nim-lang/c2nim/issues/242
[[ $(c2nim -v) == "0.9.18" ]] || echo "Different c2nim used, check the code"
c2nim --header --importc --nep1 --prefix:br_ --prefix:BR_ --skipinclude --cdecl --skipcomments gen/*.h
rm gen/*.h