Page 1 of 1

xptr variable

Posted: Sat Mar 07, 2015 8:38 am
by Rado1
In the current ZGE, it is possible to use xptr type and I'm using it extensively for pointers to C++ structures passed to/returned from external libraries. (Before xptr I was using int type for pointers; which worked for 32bit machines, but not for 64bit.)

Unfortunately, ZGE does not provide full comfort for xptr because it is not possible to declare/use global variable of type xptr. Therefore I request to:

1. Add xptr to the Variable.Type list.

2. If ZLibrary defines a global variable of type xptr, e.g.

Code: Select all

xptr AAA;
, ZExternalLibrary or ZLibrary defines a function returning xptr, e.g.

Code: Select all

xptr foo() {}
, it should be possible to write the following expression

Code: Select all

AAA = foo();
Unfortunately, at the moment, ZGE reports syntax error Invalid conversion: ((float)foo()). An interesting point is that if the xptr variable is defined in expression locally, no syntax error is reported and the code works correctly.

Posted: Mon Mar 09, 2015 9:29 am
by VilleK
Hi Rado1,

Yes, I agree. I've now added support for this. Please download beta and try again.

(the problem with sleep on Android that you reported earlier should also be fixed now)

/V

Posted: Mon Mar 09, 2015 10:55 am
by Rado1
Ville, checked the latest beta and it works fine; xptr variables and also sleep() on Android. Thanks!