I am not familiar with xcode, but here is how it is done almost everywhere. Your user statement will look like this:
#define MY_ASSERT(a1, a2, desc, ...) {\ PrintAssertMessage(...); \ DebugBreak(); \ }
The windows already have the DebugBreak function in the win32 API. On Linux and most other systems that run IA32 / X64, you can simply call int 3, which is an interrupt trap.
asm ("int 3");
I read that in xcode this is:
__asm {int 3}
or
__asm__("int $3")
or
__asm__("trap")
In any case, this should be surrounded by a macro that also disables the statement in debug builds, as well as a macro that defines how to call a breakpoint.
source share