]> git.sur5r.net Git - openldap/blob - libraries/liblber/assert.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / libraries / liblber / assert.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1999 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted only
7  * as authorized by the OpenLDAP Public License.  A copy of this
8  * license is available at http://www.OpenLDAP.org/license.html or
9  * in file LICENSE in the top-level directory of the distribution.
10  */
11
12 #include "portable.h"
13
14 #ifdef LDAP_NEED_ASSERT
15
16 #include <stdio.h>
17
18 /*
19  * helper for our private assert() macro
20  *
21  * note: if assert() doesn't exist, like abort() or raise() won't either.
22  * could use kill() but that might be problematic.  I'll just ignore this
23  * issue for now.
24  */
25
26 void
27 ber_pvt_assert( const char *file, int line, const char *test )
28 {
29         fprintf(stderr,
30                 "Assertion failed: %s, file %s, line %d\n",
31                         test, file, line);
32
33         abort();
34 }
35
36 #endif