2 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5 * Redistribution and use in source and binary forms are permitted only
6 * as authorized by the OpenLDAP Public License. A copy of this
7 * license is available at http://www.OpenLDAP.org/license.html or
8 * in file LICENSE in the top-level directory of the distribution.
15 #if defined(__cplusplus) || defined(c_plusplus)
16 # define LDAP_BEGIN_DECL extern "C" {
17 # define LDAP_END_DECL }
19 # define LDAP_BEGIN_DECL /* begin declarations */
20 # define LDAP_END_DECL /* end declarations */
23 #if !defined(__NO_PROTOTYPES) && ( defined(__NEED_PROTOTYPES) || \
24 defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) )
27 # define LDAP_P(protos) protos
28 # define LDAP_CONCAT1(x,y) x ## y
29 # define LDAP_CONCAT(x,y) LDAP_CONCAT1(x,y)
30 # define LDAP_STRING(x) #x /* stringify without expanding x */
31 # define LDAP_XSTRING(x) LDAP_STRING(x) /* expand x, then stringify */
34 # define LDAP_CONST const
37 #else /* no prototypes */
40 # define LDAP_P(protos) ()
41 # define LDAP_CONCAT(x,y) x/**/y
42 # define LDAP_STRING(x) "x"
45 # define LDAP_CONST /* no const */
48 #endif /* no prototypes */
51 # define LDAP_F_IMPORT extern __declspec( dllimport )
52 # define LDAP_F_EXPORT extern __declspec( dllexport )
54 # define LDAP_F_IMPORT extern
55 # define LDAP_F_EXPORT extern
58 #endif /* _LDAP_CDEFS_H */
60 /* purposely allow these to be redefined */
62 # define LDAP_F_PRE LDAP_F_IMPORT
65 # define LDAP_F_POST /* no post */
68 #define LDAP_F(type) LDAP_F_PRE type LDAP_F_POST