* assert.cc (__assert_func): New function, to match newlib header

change.
	* cygwin.din: Export __assert_func.
	* include/cygwin/version.h: Bump API minor number.
This commit is contained in:
Eric Blake 2007-06-27 12:46:35 +00:00
parent 3473e6bd7b
commit 048e00e01d
4 changed files with 25 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2007-06-27 Eric Blake <ebb9@byu.net>
* assert.cc (__assert_func): New function, to match newlib header
change.
* cygwin.din: Export __assert_func.
* include/cygwin/version.h: Bump API minor number.
2007-06-21 Corinna Vinschen <corinna@vinschen.de> 2007-06-21 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (WSAIoctl): Remove. * autoload.cc (WSAIoctl): Remove.

View File

@ -1,6 +1,6 @@
/* assert.cc: Handle the assert macro for WIN32. /* assert.cc: Handle the assert macro for WIN32.
Copyright 1997, 1998, 2000, 2001 Red Hat, Inc. Copyright 1997, 1998, 2000, 2001, 2007 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -22,6 +22,13 @@ details. */
extern "C" void extern "C" void
__assert (const char *file, int line, const char *failedexpr) __assert (const char *file, int line, const char *failedexpr)
{
__assert_func (file, line, NULL, failedexpr);
}
extern "C" void
__assert_func (const char *file, int line, const char *func,
const char *failedexpr)
{ {
HANDLE h; HANDLE h;
@ -35,15 +42,17 @@ __assert (const char *file, int line, const char *failedexpr)
char *buf; char *buf;
buf = (char *) alloca (100 + strlen (failedexpr)); buf = (char *) alloca (100 + strlen (failedexpr));
__small_sprintf (buf, "Failed assertion\n\t%s\nat line %d of file %s", __small_sprintf (buf, "Failed assertion\n\t%s\nat line %d of file %s%s%s",
failedexpr, line, file); failedexpr, line, file,
func ? "\nin function " : "", func ? func : "");
MessageBox (NULL, buf, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); MessageBox (NULL, buf, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
} }
else else
{ {
CloseHandle (h); CloseHandle (h);
small_printf ("assertion \"%s\" failed: file \"%s\", line %d\n", small_printf ("assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
failedexpr, file, line); failedexpr, file, line,
func ? ", function: " : "", func ? func : "");
} }
#ifdef DEBUGGING #ifdef DEBUGGING

View File

@ -118,6 +118,7 @@ _asprintf = asprintf SIGFE
asprintf_r = _asprintf_r SIGFE asprintf_r = _asprintf_r SIGFE
_asprintf_r SIGFE _asprintf_r SIGFE
__assert SIGFE __assert SIGFE
__assert_func SIGFE
__assertfail SIGFE __assertfail SIGFE
atan NOSIGFE atan NOSIGFE
_atan = atan NOSIGFE _atan = atan NOSIGFE

View File

@ -313,12 +313,13 @@ details. */
171: Export exp10, exp10f, pow10, pow10f, strcasestr, funopen, 171: Export exp10, exp10f, pow10, pow10f, strcasestr, funopen,
fopencookie. fopencookie.
172: Export getifaddrs, freeifaddrs. 172: Export getifaddrs, freeifaddrs.
173: Export __assert_func.
*/ */
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0 #define CYGWIN_VERSION_API_MAJOR 0
#define CYGWIN_VERSION_API_MINOR 172 #define CYGWIN_VERSION_API_MINOR 173
/* There is also a compatibity version number associated with the /* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible shared memory regions. It is incremented when incompatible