1999-08-30 21:17:01 -04:00
|
|
|
/* $OpenLDAP$ */
|
1998-12-28 14:51:35 -05:00
|
|
|
/*
|
|
|
|
|
* Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms are permitted only
|
|
|
|
|
* as authorized by the OpenLDAP Public License. A copy of this
|
|
|
|
|
* license is available at http://www.OpenLDAP.org/license.html or
|
|
|
|
|
* in file LICENSE in the top-level directory of the distribution.
|
|
|
|
|
*/
|
1998-10-24 21:41:42 -04:00
|
|
|
/* LDAP C Defines */
|
|
|
|
|
|
|
|
|
|
#ifndef _LDAP_CDEFS_H
|
|
|
|
|
#define _LDAP_CDEFS_H
|
|
|
|
|
|
1999-07-13 14:41:00 -04:00
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
1998-10-24 21:41:42 -04:00
|
|
|
# define LDAP_BEGIN_DECL extern "C" {
|
|
|
|
|
# define LDAP_END_DECL }
|
|
|
|
|
#else
|
1998-12-23 15:01:15 -05:00
|
|
|
# define LDAP_BEGIN_DECL /* begin declarations */
|
|
|
|
|
# define LDAP_END_DECL /* end declarations */
|
1998-10-24 21:41:42 -04:00
|
|
|
#endif
|
|
|
|
|
|
1999-07-13 14:41:00 -04:00
|
|
|
#if !defined(__NO_PROTOTYPES) && ( defined(__NEED_PROTOTYPES) || \
|
|
|
|
|
defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) )
|
1998-11-12 15:30:42 -05:00
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
/* ANSI C or C++ */
|
|
|
|
|
# define LDAP_P(protos) protos
|
|
|
|
|
# define LDAP_CONCAT1(x,y) x ## y
|
|
|
|
|
# define LDAP_CONCAT(x,y) LDAP_CONCAT1(x,y)
|
|
|
|
|
# define LDAP_STRING(x) #x /* stringify without expanding x */
|
|
|
|
|
# define LDAP_XSTRING(x) LDAP_STRING(x) /* expand x, then stringify */
|
1998-11-12 15:30:42 -05:00
|
|
|
|
1999-05-03 17:10:35 -04:00
|
|
|
#ifndef LDAP_CONST
|
|
|
|
|
# define LDAP_CONST const
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-11-12 15:30:42 -05:00
|
|
|
#else /* no prototypes */
|
|
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
/* traditional C */
|
|
|
|
|
# define LDAP_P(protos) ()
|
|
|
|
|
# define LDAP_CONCAT(x,y) x/**/y
|
|
|
|
|
# define LDAP_STRING(x) "x"
|
1998-11-12 15:30:42 -05:00
|
|
|
|
1999-05-03 17:10:35 -04:00
|
|
|
#ifndef LDAP_CONST
|
|
|
|
|
# define LDAP_CONST /* no const */
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-11-12 15:30:42 -05:00
|
|
|
#endif /* no prototypes */
|
|
|
|
|
|
1999-06-03 14:24:22 -04:00
|
|
|
#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
|
|
|
|
|
|
1999-09-03 17:06:33 -04:00
|
|
|
#if (__GNUC__) * 1000 + (__GNUC_MINOR__) >= 2006
|
|
|
|
|
# define LDAP_GCCATTR(attrs) __attribute__(attrs)
|
|
|
|
|
#else
|
|
|
|
|
# define LDAP_GCCATTR(attrs)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
1999-06-03 14:24:22 -04:00
|
|
|
#endif /* _LDAP_CDEFS_H */
|
1998-10-24 21:41:42 -04:00
|
|
|
|
1999-06-03 14:24:22 -04:00
|
|
|
/* purposely allow these to be redefined */
|
1999-05-18 21:12:33 -04:00
|
|
|
#ifndef LDAP_F_PRE
|
1999-06-03 14:24:22 -04:00
|
|
|
# define LDAP_F_PRE LDAP_F_IMPORT
|
|
|
|
|
#endif
|
1999-05-18 21:12:33 -04:00
|
|
|
#ifndef LDAP_F_POST
|
1999-06-03 14:24:22 -04:00
|
|
|
# define LDAP_F_POST /* no post */
|
|
|
|
|
#endif
|
1999-05-18 21:12:33 -04:00
|
|
|
#ifndef LDAP_F
|
|
|
|
|
#define LDAP_F(type) LDAP_F_PRE type LDAP_F_POST
|
|
|
|
|
#endif
|
1998-10-24 21:41:42 -04:00
|
|
|
|