tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] On Windows assert() definition is not complete


From: YX Hao
Subject: [Tinycc-devel] On Windows assert() definition is not complete
Date: Sat, 28 Jun 2014 22:01:41 +0800

Hi,

This is found when I build and use the posix c regex (v2.19) on windows.

TCC uses mingw-w64's "assert.h", and it assumes "extern _wassert( )".
Here is the problem. The function "_wassert( )" can be found, for example, in 
win7's "msvcrt.dll", but can not be found in XP's "msvcrt.dll".

Code reference:
---------------------------------
......
extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t 
*_File,unsigned _Line);

#ifdef __cplusplus
}
#endif

#ifndef assert
#define assert(_Expression) (void)((!!(_Expression)) || 
(_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
#endif
......
---------------------------------

So, when assert is used, it causes "undefined symbol '_wassert'" error, on XP 
or with a XP "msvcrt.def" file.

Mingw-w64 implemented its own "wassert()" in a "wassert.c" file. Details are a 
little complicated (read the file).

What shall we do?

Regards,
YX





reply via email to

[Prev in Thread] Current Thread [Next in Thread]