assert.c revision 1.1.1.1.2.2 1 /* $OpenLDAP: pkg/ldap/libraries/liblber/assert.c,v 1.13.2.3 2008/02/11 23:26:41 kurt Exp $ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3 *
4 * Copyright 1998-2008 The OpenLDAP Foundation.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
9 * Public License.
10 *
11 * A copy of this license is available in the file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
14 */
15
16 #include "portable.h"
17
18 #ifdef LDAP_NEED_ASSERT
19
20 #include <stdio.h>
21
22 /*
23 * helper for our private assert() macro
24 *
25 * note: if assert() doesn't exist, like abort() or raise() won't either.
26 * could use kill() but that might be problematic. I'll just ignore this
27 * issue for now.
28 */
29
30 void
31 ber_pvt_assert( const char *file, int line, const char *test )
32 {
33 fprintf(stderr,
34 _("Assertion failed: %s, file %s, line %d\n"),
35 test, file, line);
36
37 abort();
38 }
39
40 #endif
41