2020-03-03 15:37:10 +00:00
|
|
|
void printf (string fmt, ...) = #0;
|
|
|
|
|
2022-01-30 05:17:52 +00:00
|
|
|
#if __RUAMOKO__ > 1
|
|
|
|
#define dot @dot
|
|
|
|
#define X .y
|
|
|
|
#else
|
|
|
|
#define dot *
|
|
|
|
#define X
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void forcelive (float z)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
float foo (vector _v, float _z)
|
2020-03-03 15:37:10 +00:00
|
|
|
{
|
2022-01-30 05:17:52 +00:00
|
|
|
vector v = _v;
|
|
|
|
float z = _z;
|
|
|
|
_v = nil;
|
2022-01-30 11:01:32 +00:00
|
|
|
_z = 0;
|
|
|
|
forcelive (_z);
|
2022-01-30 05:17:52 +00:00
|
|
|
forcelive (z);
|
|
|
|
return (v dot *(vector*)(&v.y))X;
|
2020-03-03 15:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, string *argv)
|
|
|
|
{
|
|
|
|
vector v = [1, 2, 3];
|
|
|
|
vector w = [2, 3, 4];
|
|
|
|
float f;
|
2022-01-30 05:17:52 +00:00
|
|
|
printf ("%v %g %g %g\n", v, v dot v, v dot w, f=foo (v, 4));
|
|
|
|
return f != (v dot w)X;
|
2020-03-03 15:37:10 +00:00
|
|
|
}
|