]> git.sur5r.net Git - openldap/blob - include/ldap_cdefs.h
Rework prototype ifdef to use __NO_PROTOTYPES and __NEED_PROTOTYPES
[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  /* empty */
11 #       define LDAP_END_DECL    /* empty */
12 #endif
13
14 #if !defined(__NO_PROTOTYPES) && ( \
15         defined(__STDC__) || defined(__cplusplus) || \
16         defined(__NEED_PROTOTYPES) )
17
18         /* ANSI C or C++ */
19 #       define LDAP_P(protos)   protos
20 #       define LDAP_CONCAT1(x,y)        x ## y
21 #       define LDAP_CONCAT(x,y) LDAP_CONCAT1(x,y)
22 #       define LDAP_STRING(x)   #x /* stringify without expanding x */
23 #       define LDAP_XSTRING(x)  LDAP_STRING(x) /* expand x, then stringify */
24
25 #else /* no prototypes */
26
27         /* traditional C */
28 #       define LDAP_P(protos)   ()
29 #       define LDAP_CONCAT(x,y) x/**/y
30 #       define LDAP_STRING(x)   "x"
31
32 #endif /* no prototypes */
33
34
35 #ifndef LDAP_F
36 #       ifdef _WIN32
37 #               define LDAP_F   __declspec( dllexport )
38 #       else /* ! _WIN32 */
39 #               define LDAP_F   extern
40 #       endif /* _WIN32 */
41 #endif /* LDAP_FDECL */
42
43 #endif /* _LDAP_CDEFS_H */