]> git.sur5r.net Git - openldap/blobdiff - include/ldap_cdefs.h
Remove incorrect use of <matched> entry
[openldap] / include / ldap_cdefs.h
index cd86d77f97bbec94ff1d99cfd7e1c5c914bad078..c0088a0bca6b6b9a48cb9b60135d01dc59bdcfda 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
@@ -12,7 +13,7 @@
 #ifndef _LDAP_CDEFS_H
 #define _LDAP_CDEFS_H
 
-#if defined(__cplusplus)
+#if defined(__cplusplus) || defined(c_plusplus)
 #      define LDAP_BEGIN_DECL  extern "C" {
 #      define LDAP_END_DECL    }
 #else
@@ -20,9 +21,8 @@
 #      define LDAP_END_DECL    /* end declarations */
 #endif
 
-#if !defined(__NO_PROTOTYPES) && ( \
-       defined(__STDC__) || defined(__cplusplus) || \
-       defined(__NEED_PROTOTYPES) )
+#if !defined(__NO_PROTOTYPES) && ( defined(__NEED_PROTOTYPES) || \
+       defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) )
 
        /* ANSI C or C++ */
 #      define LDAP_P(protos)   protos
 
 #endif /* no prototypes */
 
+#if _WIN32 && _DLL
+#      define LDAP_F_IMPORT    extern __declspec( dllimport )
+#      define LDAP_F_EXPORT    extern __declspec( dllexport )
+#else
+#      define LDAP_F_IMPORT    extern
+#      define LDAP_F_EXPORT    extern
+#endif
+
+#endif /* _LDAP_CDEFS_H */
 
+/* purposely allow these to be redefined */
+#ifndef LDAP_F_PRE
+#      define LDAP_F_PRE       LDAP_F_IMPORT
+#endif
+#ifndef LDAP_F_POST
+#      define LDAP_F_POST      /* no post */
+#endif
 #ifndef LDAP_F
-#      ifdef _WIN32
-#              define LDAP_F   __declspec( dllexport )
-#      else /* ! _WIN32 */
-#              define LDAP_F   extern
-#      endif /* _WIN32 */
-#endif /* LDAP_FDECL */
+#define LDAP_F(type)   LDAP_F_PRE type LDAP_F_POST
+#endif
 
-#endif /* _LDAP_CDEFS_H */