1999-09-08 15:06:24 -04:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-25 18:17:08 -05:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
|
*
|
2020-01-09 11:50:21 -05:00
|
|
|
* Copyright 1998-2020 The OpenLDAP Foundation.
|
1999-03-19 22:13:24 -05:00
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
2003-11-25 18:17:08 -05: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-19 22:13:24 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
|
|
#ifdef LDAP_NEED_ASSERT
|
|
|
|
|
|
1999-07-12 23:50:39 -04:00
|
|
|
#include <stdio.h>
|
1999-03-19 22:13:24 -05: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-12 23:50:39 -04:00
|
|
|
void
|
1999-08-01 17:41:46 -04:00
|
|
|
ber_pvt_assert( const char *file, int line, const char *test )
|
1999-03-19 22:13:24 -05:00
|
|
|
{
|
|
|
|
|
fprintf(stderr,
|
2003-04-06 01:19:13 -05:00
|
|
|
_("Assertion failed: %s, file %s, line %d\n"),
|
1999-03-19 22:13:24 -05:00
|
|
|
test, file, line);
|
|
|
|
|
|
|
|
|
|
abort();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|