ast2 var of proc type, multiple proc type block
This commit is contained in:
parent
bd1c283eb9
commit
534acf9259
6 changed files with 310 additions and 158 deletions
|
|
@ -32,7 +32,10 @@ typedef char *A10[3][6];
|
|||
typedef char *(*A11)[3];
|
||||
typedef struct A0 *A111[12];
|
||||
|
||||
typedef int **(*A12)(int, int b, int *c, int *, int *count[4], int (*func)(int, int));
|
||||
typedef int
|
||||
**(*A12)(int, int b, int *c, int *, int *count[4], int (*func)(int, int)),
|
||||
**(*A121)(float, float b, float *c, float *, float *count[4], float (*func)(float, float)),
|
||||
**(*A122)(char, char b, char *c, char *, char *count[4], char (*func)(char, char));
|
||||
typedef int A13(int, int, void (*func)(void));
|
||||
|
||||
struct A14 { volatile char a1; };
|
||||
|
|
@ -104,8 +107,11 @@ typedef enum VSPresetFormat {
|
|||
|
||||
//struct A2 test_proc1(struct A0 a);
|
||||
|
||||
|
||||
|
||||
// Proc vars
|
||||
void
|
||||
*(*pcre_malloc)(size_t),
|
||||
(*pcre_free)(void *),
|
||||
*(*pcre_stack_malloc)(size_t);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,14 @@ assert A12 is proc(a1: cint, b: cint, c: ptr cint, a4: ptr cint, count: array[4,
|
|||
checkPragmas(A12, pHeaderImp & "cdecl")
|
||||
var a12: A12
|
||||
|
||||
assert A121 is proc(a1: cfloat, b: cfloat, c: ptr cfloat, a4: ptr cfloat, count: array[4, ptr cfloat], `func`: proc(a1: cfloat, a2: cfloat): cfloat {.cdecl.}): ptr ptr cint {.cdecl.}
|
||||
checkPragmas(A121, pHeaderImp & "cdecl")
|
||||
var a121: A121
|
||||
|
||||
assert A122 is proc(a1: cchar, b: cchar, c: cstring, a4: cstring, count: array[4, cstring], `func`: proc(a1: cchar, a2: cchar): cchar {.cdecl.}): ptr ptr cint {.cdecl.}
|
||||
checkPragmas(A122, pHeaderImp & "cdecl")
|
||||
var a122: A122
|
||||
|
||||
assert A13 is proc(a1: cint, a2: cint, `func`: proc() {.cdecl.}): cint {.cdecl.}
|
||||
checkPragmas(A13, pHeaderImp & "cdecl")
|
||||
var a13: A13
|
||||
|
|
@ -291,4 +299,13 @@ assert cmGray == 1000000
|
|||
assert pfGray16 == 1000011
|
||||
assert pfYUV422P8 == pfYUV420P8 + 1
|
||||
assert pfRGB27 == cmRGB.VSPresetFormat + 11
|
||||
assert pfCompatYUY2 == pfCompatBGR32 + 1
|
||||
assert pfCompatYUY2 == pfCompatBGR32 + 1
|
||||
|
||||
assert pcre_malloc is proc(a1: uint): pointer {.cdecl.}
|
||||
checkPragmas(pcre_malloc, @["importc", "cdecl"] & pHeader)
|
||||
|
||||
assert pcre_free is proc(a1: pointer) {.cdecl.}
|
||||
checkPragmas(pcre_free, @["importc", "cdecl"] & pHeader)
|
||||
|
||||
assert pcre_stack_malloc is proc(a1: uint): pointer {.cdecl.}
|
||||
checkPragmas(pcre_stack_malloc, @["importc", "cdecl"] & pHeader)
|
||||
|
|
@ -35,7 +35,9 @@ cImport(pcreH, dynlib="dynpcre", flags = FLAGS)
|
|||
|
||||
echo version()
|
||||
|
||||
proc my_malloc(a1: uint) {.cdecl.} =
|
||||
discard
|
||||
when FLAGS.len != 0:
|
||||
# Legacy algorithm is broken - does not convert void * return to pointer
|
||||
proc my_malloc(a1: uint): pointer {.cdecl.} =
|
||||
discard
|
||||
|
||||
malloc = my_malloc
|
||||
malloc = my_malloc
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import os, nimterop/[cimport, build, paths]
|
||||
import os, nimterop/[cimport, build]
|
||||
|
||||
const
|
||||
baseDir = getProjectCacheDir("nimterop" / "tests" / "soloud")
|
||||
|
|
@ -6,7 +6,7 @@ const
|
|||
src = baseDir/"src"
|
||||
|
||||
static:
|
||||
gitPull("https://github.com/jarikomppa/soloud", baseDir, "include/*\nsrc/*\n")
|
||||
gitPull("https://github.com/jarikomppa/soloud", baseDir, "include/*\nsrc/*\n", checkout = "RELEASE_20200207")
|
||||
cDebug()
|
||||
cDisableCaching()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue