Replaces no-error passC with importc pointer type definition

This commit is contained in:
benbierens 2024-08-07 08:56:33 +02:00
parent dae62a1b9a
commit d4a9498019
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
2 changed files with 6 additions and 9 deletions

View File

@ -12,12 +12,6 @@ push: {.upraises: [].}
{.deadCodeElim: on.}
# in gcc-14, incompatible-pointer-types warning was promoted to error.
# function arguments in C of type 'const void* const * const' are seen as
# not compatible with nim 'ptr pointer' type.
# We use localPassC to disable this check for the compiling of nim-leopard.
{.localPassC:"-Wno-error=incompatible-pointer-types"}
import pkg/stew/results
import ./wrapper

View File

@ -67,6 +67,9 @@ import std/compilesettings
import std/os
import std/strutils
type
LeoDataPtr* {.importc: "const void* const * const", bycopy.} = pointer
const
LeopardCmakeFlags {.strdefine.} =
when defined(macosx):
@ -225,7 +228,7 @@ proc leoEncode*(
originalCount: cuint;
recoveryCount: cuint;
workCount: cuint;
originalData: ptr pointer;
originalData: LeoDataPtr;
workData: ptr pointer): LeopardResult {.leo, importc: "leo_encode".}
## Number of bytes in each data buffer
## Number of original_data[] buffer pointers
@ -277,8 +280,8 @@ proc leoDecode*(
originalCount: cuint;
recoveryCount: cuint;
workCount: cuint;
originalData: ptr pointer;
recoveryData: ptr pointer;
originalData: LeoDataPtr;
recoveryData: LeoDataPtr;
workData: ptr pointer): LeopardResult {.leo, importc: "leo_decode".}
## Number of bytes in each data buffer
## Number of original_data[] buffer pointers