X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Fldap_cdefs.h;h=5de63085699efd2001c2ae08647eb77945113a24;hb=9514007d96ff2ab4575106996eb74ef80be7a2e1;hp=cd86d77f97bbec94ff1d99cfd7e1c5c914bad078;hpb=031b9ec0922d3f33a29a4ed7d69c96bb459e5f4f;p=openldap diff --git a/include/ldap_cdefs.h b/include/ldap_cdefs.h index cd86d77f97..5de6308569 100644 --- a/include/ldap_cdefs.h +++ b/include/ldap_cdefs.h @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA * All rights reserved. * * Redistribution and use in source and binary forms are permitted only @@ -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(LDAP_NO_PROTOTYPES) && ( defined(LDAP_NEEDS_PROTOTYPES) || \ + defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) ) /* ANSI C or C++ */ # define LDAP_P(protos) protos @@ -48,13 +48,99 @@ #endif /* no prototypes */ +#if (__GNUC__) * 1000 + (__GNUC_MINOR__) >= 2006 +# define LDAP_GCCATTR(attrs) __attribute__(attrs) +#else +# define LDAP_GCCATTR(attrs) +#endif + + +/* Support for NT dynamic libraries. */ + +/* LBER library */ +#if defined(LBER_DECL) && defined(_WIN32) +# define LBER_F(type) extern __declspec(LBER_DECL) type +# define LBER_V(type) extern __declspec(LBER_DECL) type +#else +# define LBER_F(type) extern type +# define LBER_V(type) extern type +#endif + +/* LDAP library */ +#if defined(LDAP_DECL) && defined(_WIN32) +# define LDAP_F(type) extern __declspec(LDAP_DECL) type +# define LDAP_V(type) extern __declspec(LDAP_DECL) type +#else +# define LDAP_F(type) extern type +# define LDAP_V(type) extern type +#endif + +/* + * C library. Mingw32 links with the C run-time library by default, + * so the explicit definition of CSTATIC will keep dllimport from + * being defined. + */ +#if (defined(__MINGW32__) && !defined(CSTATIC) || \ + defined(_WIN32) && defined(_DLL)) +# define LDAP_LIBC_F(type) extern __declspec(dllimport) type +# define LDAP_LIBC_V(type) extern __declspec(dllimport) type +#else +# define LDAP_LIBC_F(type) extern type +# define LDAP_LIBC_V(type) extern type +#endif + +/* AVL library */ +#if defined(LDAP_AVL_DECL) && defined(_WIN32) +# define LDAP_AVL_F(type) extern __declspec(LDAP_AVL_DECL) type +# define LDAP_AVL_V(type) extern __declspec(LDAP_AVL_DECL) type +#else +# define LDAP_AVL_F(type) extern type +# define LDAP_AVL_V(type) extern type +#endif + +/* LDBM library */ +#if defined(LDAP_LDBM_DECL) && defined(_WIN32) +# define LDAP_LDBM_F(type) extern __declspec(LDAP_LDBM_DECL) type +# define LDAP_LDBM_V(type) extern __declspec(LDAP_LDBM_DECL) type +#else +# define LDAP_LDBM_F(type) extern type +# define LDAP_LDBM_V(type) extern type +#endif + +/* LDIF library */ +#if defined(LDAP_LDIF_DECL) && defined(_WIN32) +# define LDAP_LDIF_F(type) extern __declspec(LDAP_LDIF_DECL) type +# define LDAP_LDIF_V(type) extern __declspec(LDAP_LDIF_DECL) type +#else +# define LDAP_LDIF_F(type) extern type +# define LDAP_LDIF_V(type) extern type +#endif -#ifndef LDAP_F -# ifdef _WIN32 -# define LDAP_F __declspec( dllexport ) -# else /* ! _WIN32 */ -# define LDAP_F extern -# endif /* _WIN32 */ -#endif /* LDAP_FDECL */ +/* LUNICODE library */ +#if defined(LDAP_LUNICODE_DECL) && defined(_WIN32) +# define LDAP_LUNICODE_F(type) extern __declspec(LDAP_LUNICODE_DECL) type +# define LDAP_LUNICODE_V(type) extern __declspec(LDAP_LUNICODE_DECL) type +#else +# define LDAP_LUNICODE_F(type) extern type +# define LDAP_LUNICODE_V(type) extern type +#endif + +/* LUTIL library */ +#if defined(LDAP_LUTIL_DECL) && defined(_WIN32) +# define LDAP_LUTIL_F(type) extern __declspec(LDAP_LUTIL_DECL) type +# define LDAP_LUTIL_V(type) extern __declspec(LDAP_LUTIL_DECL) type +#else +# define LDAP_LUTIL_F(type) extern type +# define LDAP_LUTIL_V(type) extern type +#endif + +/* SLAPD (as a module exporting symbols) */ +#if defined(LDAP_SLAPD_DECL) && defined(_WIN32) +# define LDAP_SLAPD_F(type) extern __declspec(LDAP_SLAPD_DECL) type +# define LDAP_SLAPD_V(type) extern __declspec(LDAP_SLAPD_DECL) type +#else +# define LDAP_SLAPD_F(type) extern type +# define LDAP_SLAPD_V(type) extern type +#endif #endif /* _LDAP_CDEFS_H */