Back to index

openldap  2.4.31
assert.c
Go to the documentation of this file.
00001 /* $OpenLDAP$ */
00002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00003  *
00004  * Copyright 1998-2012 The OpenLDAP Foundation.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted only as authorized by the OpenLDAP
00009  * Public License.
00010  *
00011  * A copy of this license is available in the file LICENSE in the
00012  * top-level directory of the distribution or, alternatively, at
00013  * <http://www.OpenLDAP.org/license.html>.
00014  */
00015 
00016 #include "portable.h"
00017 
00018 #ifdef LDAP_NEED_ASSERT
00019 
00020 #include <stdio.h>
00021 
00022 /*
00023  * helper for our private assert() macro
00024  *
00025  * note: if assert() doesn't exist, like abort() or raise() won't either.
00026  * could use kill() but that might be problematic.  I'll just ignore this
00027  * issue for now.
00028  */
00029 
00030 void
00031 ber_pvt_assert( const char *file, int line, const char *test )
00032 {
00033        fprintf(stderr,
00034               _("Assertion failed: %s, file %s, line %d\n"),
00035                      test, file, line);
00036 
00037        abort();
00038 }
00039 
00040 #endif