Double pointer support

This commit is contained in:
Ganesh Viswanathan 2019-03-23 13:33:52 -05:00
commit 454403b9fe
7 changed files with 111 additions and 32 deletions

View file

@ -60,6 +60,10 @@ void *test_call9() {
return NULL;
}
void **test_call10(int **param1) {
return NULL;
}
void multiline1(void) {}
void *multiline2(void) {

View file

@ -108,6 +108,7 @@ unsigned char test_call_param6(UNION2 param1);
int test_call_param7(union UNION1 param1);
float test_call_param8(int *param1);
void *test_call9();
void **test_call10(int **param1);
// Issue #58
void
@ -131,6 +132,20 @@ UNION3 test_call_etype_ptr3();
typedef struct _Kernel { char name; } *Kernel;
// Double pointers
typedef void **DVOIDPTR;
typedef int **DINTPTR;
struct dstruct {
int **field1;
};
typedef struct dstruct2 {
char **field1;
float **field2;
void **(*tcv)(int **param1);
} DSTRUCT2;
#ifdef __cplusplus
}
#endif

View file

@ -145,3 +145,19 @@ when false:
doAssert foobar1(3) == OSDEF * 3
when false: # Error: undeclared identifier: 'foobar2'
doAssert foobar2(3) == 3 + 1
# Double pointer
var
dv: DVOIDPTR
di: DINTPTR
ds: dstruct
cstr = "Hello".cstring
ds2: DSTRUCT2
dv = addr vptr
di = addr iptr
ds.field1 = di
ds2.field1 = addr cstr
ds2.tcv = test_call10
check ds2.tcv(di) == nil