1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-26 07:17:08 +08:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2005-01-02 04:49:32 +08:00
|
|
|
* Copyright 1998-2005 The OpenLDAP Foundation.
|
1999-03-20 11:13:24 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2003-11-26 07:17:08 +08:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
1999-03-20 11:13:24 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#ifdef LDAP_NEED_ASSERT
|
|
|
|
|
1999-07-13 11:50:39 +08:00
|
|
|
#include <stdio.h>
|
1999-03-20 11:13:24 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* helper for our private assert() macro
|
|
|
|
*
|
|
|
|
* note: if assert() doesn't exist, like abort() or raise() won't either.
|
|
|
|
* could use kill() but that might be problematic. I'll just ignore this
|
|
|
|
* issue for now.
|
|
|
|
*/
|
|
|
|
|
1999-07-13 11:50:39 +08:00
|
|
|
void
|
1999-08-02 05:41:46 +08:00
|
|
|
ber_pvt_assert( const char *file, int line, const char *test )
|
1999-03-20 11:13:24 +08:00
|
|
|
{
|
|
|
|
fprintf(stderr,
|
2003-04-06 14:19:13 +08:00
|
|
|
_("Assertion failed: %s, file %s, line %d\n"),
|
1999-03-20 11:13:24 +08:00
|
|
|
test, file, line);
|
|
|
|
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|