]> git.sur5r.net Git - openldap/blob - include/ldap_cdefs.h
2f7ed6e987491c61bff4efc498be9356baecb136
[openldap] / include / ldap_cdefs.h
1 /* LDAP C Defines */
2
3 #ifndef _LDAP_CDEFS_H
4 #define _LDAP_CDEFS_H
5
6 #if defined(__cplusplus)
7 #       define LDAP_BEGIN_DECL  extern "C" {
8 #       define LDAP_END_DECL    }
9 #else
10 #       define LDAP_BEGIN_DECL
11 #       define LDAP_END_DECL    
12 #endif
13
14 #if defined(__STDC__) || defined(__cplusplus)
15         /* ANSI C or C++ */
16 #       define LDAP_P(protos)   protos
17 #       define LDAP_CONCAT1(x,y)        x ## y
18 #       define LDAP_CONCAT(x,y) LDAP_CONCAT1(x,y)
19 #       define LDAP_STRING(x)   #x /* stringify without expanding x */
20 #       define LDAP_XSTRING(x)  LDAP_STRING(x) /* expand x, then stringify */
21 #else /* ! __STDC__ && ! __cplusplus */
22         /* traditional C */
23 #       define LDAP_P(protos)   ()
24 #       define LDAP_CONCAT(x,y) x/**/y
25 #       define LDAP_STRING(x)   "x"
26 #endif /* __STDC__ || __cplusplus */
27
28 #ifndef LDAP_F
29 #       ifdef _WIN32
30 #               define LDAP_F   __declspec( dllexport )
31 #       else /* ! _WIN32 */
32 #               define LDAP_F   extern
33 #       endif /* _WIN32 */
34 #endif /* LDAP_FDECL */
35
36 #endif /* _LDAP_CDEFS_H */