I am porting some C++ codebase from Windows VC10 to Mac XCode 10.7 .I have a macro which wraps the "assert()" .The Microsoft compiler has no problem with the following definition:
void assert(bool result, const char *call, const char *file, int line);
/// Wraps \c assert().//
#define MY_ASSERT(call) (mynsp::assert((call), #call, __FILE__, __LINE__))
while XCode throws me an error : Too many arguments provided to function-like macro invocation
Being complete noob to OS X and LLVM my question is how to work around this issue?
Btw, assert() declaration is wrapped with custom namespace (mynsp)
<cassert>included somewhere?assertis the name of a macro defined in<cassert>; I suggest you use a different name for your function. Either that will solve your problem, or at least prevent WTF moments for people reading your code. When I seeassertin code, I simply assume it's the standard one.