T
Thomas Barth
Hi,
I don't understand the following definitions in a
header-file for sample codes, that have been written in msvs.
I try to get the sample codes "clean" to compiling them
with the GNU-Compiler.
#ifdef _X86_
#define DebugBreak() _asm { int 3 }
#endif
When using DebugBreak, the GNU-Compiler prints the error:
inline void chFAIL(PSTR szMsg) {
chMB(szMsg);
DebugBreak(); //error*
}
*error: multiple markers at this line
- _asm undeclared (first use this function)
- parse error before '{' token
I am also confused of "_asm { int 3 } " I can't find an
explanation for that in my C++ books.
#define chBEGINTHREADEX(psa, cbStack, pfnStartAddr, \
pvParam, fdwCreate, pdwThreadId) \
((HANDLE)_beginthreadex( \
(void *) (psa), \
(unsigned) (cbStack), \
(PTHREAD_START) (pfnStartAddr), \
(void *) (pvParam), \
(unsigned) (fdwCreate), \
(unsigned *) (pdwThreadId)))
An inline function is the better choice, isn't it?
Thanks in advance,
Thomas B.
I don't understand the following definitions in a
header-file for sample codes, that have been written in msvs.
I try to get the sample codes "clean" to compiling them
with the GNU-Compiler.
#ifdef _X86_
#define DebugBreak() _asm { int 3 }
#endif
When using DebugBreak, the GNU-Compiler prints the error:
inline void chFAIL(PSTR szMsg) {
chMB(szMsg);
DebugBreak(); //error*
}
*error: multiple markers at this line
- _asm undeclared (first use this function)
- parse error before '{' token
I am also confused of "_asm { int 3 } " I can't find an
explanation for that in my C++ books.
#define chBEGINTHREADEX(psa, cbStack, pfnStartAddr, \
pvParam, fdwCreate, pdwThreadId) \
((HANDLE)_beginthreadex( \
(void *) (psa), \
(unsigned) (cbStack), \
(PTHREAD_START) (pfnStartAddr), \
(void *) (pvParam), \
(unsigned) (fdwCreate), \
(unsigned *) (pdwThreadId)))
An inline function is the better choice, isn't it?
Thanks in advance,
Thomas B.