4 * Copyright 1999 The OpenLDAP Foundation, Redwood City, California, USA
7 * Redistribution and use in source and binary forms are permitted only
8 * as authorized by the OpenLDAP Public License. A copy of this
9 * license is available at http://www.OpenLDAP.org/license.html or
10 * in file LICENSE in the top-level directory of the distribution.
20 #if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS )
25 #else /* !(HAVE_ASSERT_H || STDC_HEADERS) */
27 #define LDAP_NEED_ASSERT 1
30 * no assert()... must be a very old compiler.
31 * create a replacement and hope it works
34 LIBLBER_F (void) ber_pvt_assert LDAP_P(( const char *file, int line,
37 /* Can't use LDAP_STRING(test), that'd expand to "test" */
38 #if defined(__STDC__) || defined(__cplusplus)
39 #define assert(test) \
40 ((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, #test ) )
42 #define assert(test) \
43 ((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, "test" ) )
46 #endif /* (HAVE_ASSERT_H || STDC_HEADERS) */
48 #else /* !LDAP_DEBUG */
50 #define assert(test) ((void)0)
51 #endif /* LDAP_DEBUG */
53 #endif /* _AC_ASSERT_H */