4 * Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
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. A copy of this license is available at
10 * http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 * top-level directory of the distribution.
21 #if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS )
26 #else /* !(HAVE_ASSERT_H || STDC_HEADERS) */
28 #define LDAP_NEED_ASSERT 1
31 * no assert()... must be a very old compiler.
32 * create a replacement and hope it works
35 LIBLBER_F (void) ber_pvt_assert LDAP_P(( const char *file, int line,
38 /* Can't use LDAP_STRING(test), that'd expand to "test" */
39 #if defined(__STDC__) || defined(__cplusplus)
40 #define assert(test) \
41 ((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, #test ) )
43 #define assert(test) \
44 ((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, "test" ) )
47 #endif /* (HAVE_ASSERT_H || STDC_HEADERS) */
49 #else /* !LDAP_DEBUG */
51 #define assert(test) ((void)0)
52 #endif /* LDAP_DEBUG */
54 #endif /* _AC_ASSERT_H */