3 * Copyright 1999 The OpenLDAP Foundation, Redwood City, California, USA
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.
19 #if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS )
24 #else /* !(HAVE_ASSERT_H || STDC_HEADERS) */
26 #define LDAP_NEED_ASSERT 1
29 * no assert()... must be a very old compiler.
30 * create a replacement and hope it works
33 LDAP_F(void) ber_pvt_assert LDAP_P((
34 const char *file, int line, const char *test ));
36 /* Can't use LDAP_STRING(test), that'd expand to "test" */
37 #if defined(__STDC__) || defined(__cplusplus)
38 #define assert(test) \
39 ((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, #test ) )
41 #define assert(test) \
42 ((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, "test" ) )
45 #endif /* (HAVE_ASSERT_H || STDC_HEADERS) */
47 #else /* !LDAP_DEBUG */
49 #define assert(test) ((void)0)
50 #endif /* LDAP_DEBUG */
52 #endif /* _AC_ASSERT_H */