bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Error with "Struct" in external function definition: Syntax error - expecting ','.

Open GWRon opened this issue 1 year ago • 4 comments

Use the following files: test.bmx:

SuperStrict
Framework brl.standardio

Import "aud.bmx"

Print "here"

aud.bmx:

SuperStrict 
Framework brl.basic 

Import "external.h"
Extern 
	Function test_struct:Int(f:Byte Ptr, chan:Int) = "int test_struct(struct mystruct*, int)"
	Function test:Byte Ptr() = "char* test()"
EndExtern

external.h:

#include <stddef.h>
#include <stdint.h>
struct mystruct {
  size_t something;
};

int test_struct(struct mystruct *f, int chan);
static struct mystruct myfa={0};
char* test()
{ return &myfa; }

int test_struct(struct mystruct *fa, int chan) {
  return 0;
}

(readymade zip: imp_test.zip )

Output:

[  9%] Processing:aud.bmx
[ 10%] Processing:test.bmx
Compile Error: Syntax error - expecting ','.
[/imp_test/.bmx/aud.bmx.release.linux.x64.i;4;0]
Compilation failed.

GWRon avatar Jul 06 '23 08:07 GWRon