Open GoogleCodeExporter opened 8 years ago
Also there are a bracket inside the "ifdef".
Original comment by teritri...@gmail.com
on 18 Dec 2010 at 3:53
What compiler/version are you using?
Apparently it doesn't like that I've defined both a unary and binary minus
operator, but it works just fine with g++ 4.2.1.
What's wrong with the bracket? It's closing the extern C chunk.
Original comment by slemb...@gmail.com
on 18 Dec 2010 at 4:16
Oh, wait a minute.
"declaration of C function ‘cpVect operator-(cpVect)’ ..."
So why does it think that it's still in the extern C block? Hrm. I have no idea
what is going on then.
Original comment by slemb...@gmail.com
on 18 Dec 2010 at 4:23
g++ version 4.4.5
Problem with the bracket
#ifdef __cplusplus
}//end braket of extern "C"
//...
#endif
Correction
#ifdef __cplusplus
}//end bracket of extern "C"
#endif
#ifdef __cplusplus
//...
#endif
I think that this will avoid headaches later.
The operators with vectors works fine now with a test that i did:
original
static inline cpVect operator -(const cpVect v1, const cpVect v2){return
cpvsub(v1, v2);}
static inline cpBool operator ==(const cpVect v1, const cpVect v2){return
cpveql(v1, v2);}
static inline cpVect operator -(const cpVect v){return cpvneg(v);}
Changue the minus operator of
static inline cpVect operator -(const cpVect v){return cpvneg(v);}
by, for example
static inline cpVect operator !(const cpVect v){return cpvneg(v);}
Compiles fine and...
cpvect test = {1, 1}
test = !test;
//{-1, -1} works very well
but i dont know if is ok for you
Original comment by teritri...@gmail.com
on 18 Dec 2010 at 5:51
Original issue reported on code.google.com by
teritri...@gmail.com
on 18 Dec 2010 at 3:46