* create a replacement and hope it works
*/
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLBER_DECL
+# define LDAP_F_PRE extern __declspec(LIBLBER_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F(void) ber_pvt_assert LDAP_P((
const char *file, int line, const char *test ));
#if defined( HAVE_LIBUTIL_H )
# include <libutil.h>
#else
+
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
/* use lutil version */
LDAP_F(void) (setproctitle) LDAP_P((const char *fmt, ...)) \
LDAP_GCCATTR((format(printf, 1, 2)));
#if !defined( HAVE_INET_ATON ) && !defined( inet_aton )
#define inet_aton ldap_pvt_inet_aton
struct in_addr;
-int ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
+LDAP_F( int ) ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
#endif
#if defined(__WIN32) && defined(_ALPHA)
# endif
#endif
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
/* use ldap_pvt_strtok instead of strtok or strtok_r! */
LDAP_F(char *) ldap_pvt_strtok LDAP_P((
char *str, const char *delim, char **pos ));
/* note: callers of crypt(3) should include <ac/crypt.h> */
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
#ifndef HAVE_GETPASS
LDAP_F(char*)(getpass) LDAP_P((const char *getpass));
#else
const char *tmpdir,
const char *prefix));
#endif
+
+/* This is never even checked for or implemented if not present */
+#if 0
#ifndef HAVE_MKTEMP
LDAP_F(char *)(mktemp) LDAP_P((char *));
#endif
+#endif
/* use lutil file locking */
#define ldap_lockf(x) lutil_lockf(x)
typedef int (*AVL_DUP) LDAP_P((void*, void*));
typedef void (*AVL_FREE) LDAP_P((void*));
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBAVL_DECL
+# define LDAP_F_PRE extern __declspec(LIBAVL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
avl_free LDAP_P(( Avlnode *root, AVL_FREE dfree ));
typedef int (*ldap_writeptype) LDAP_P((
void *writeparm, char *p, ber_len_t len ));
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
ldap_init_templates LDAP_P(( char *file, struct ldap_disptmpl **tmpllistp ));
extern char *optarg;
extern int optind, opterr, optopt;
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
getopt LDAP_P((
int,
char *bv_val;
} BerValue;
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLBER_DECL
+# define LDAP_F_PRE extern __declspec(LIBLBER_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
/*
* in bprint.c:
*/
LDAP_BEGIN_DECL
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLBER_DECL
+# define LDAP_F_PRE extern __declspec(LIBLBER_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
/*
* bprint.c
*/
*/
struct timeval;
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
/*
* in options.c:
*/
#define Debug( level, fmt, arg1, arg2, arg3 )
#endif /* LDAP_DEBUG */
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F(void) lutil_debug LDAP_P((
int debug, int level,
const char* fmt, ... )) LDAP_GCCATTR((format(printf, 3, 4)));
struct hostent; /* avoid pulling in <netdb.h> */
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( char * )
ldap_pvt_ctime LDAP_P((
const time_t *tp,
LDAP_END_DECL
-#elif HAVE_NT_THREADS
+/* If we're in the NT env at all, we want these defs, threaded or not */
+#elif defined(WINNT) || defined(_WINNT) /* HAVE_NT_THREADS */
LDAP_BEGIN_DECL
LDAP_BEGIN_DECL
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
ldap_pvt_thread_initialize LDAP_P(( void ));
#define LDAP_SCHEMA_STRUCTURAL 1
#define LDAP_SCHEMA_AUXILIARY 2
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( LDAP_CONST char * )
ldap_syntax2name LDAP_P((
LDAP_SYNTAX * syn ));
((nlen) + 4 + LDIF_BASE64_LEN(vlen) \
+ ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / LDIF_LINE_WIDTH * 2 ))
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDIF_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDIF_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
ldif_parse_line LDAP_P((
LDAP_CONST char *line,
* Include file for LDAP utility routine
*/
+LDAP_BEGIN_DECL
+
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
/* n octets encode into ceiling(n/3) * 4 bytes */
/* Avoid floating point math by through extra padding */
#define LUTIL_BASE64_ENCODE_LEN(n) ((n)/3 * 4 + 4)
#define LUTIL_BASE64_DECODE_LEN(n) ((n)/4 * 3)
-LDAP_BEGIN_DECL
-
/* ISC Base64 Routines */
/* base64.c */
LDAP_BEGIN_DECL
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
lutil_lockf LDAP_P(( int fd ));
unsigned char in[64];
};
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( void )
lutil_MD5Init LDAP_P((
struct lutil_MD5Context *context));
unsigned char buffer[64];
} lutil_SHA1_CTX;
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLUTIL_DECL
+# define LDAP_F_PRE extern __declspec(LIBLUTIL_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( void )
lutil_SHA1Transform
LDAP_P((uint32 state[5], const unsigned char buffer[64]));
#define LDAP_SEARCHPREF_ERR_FILE 4
+#ifdef __MINGW32__
+# undef LDAP_F_PRE
+# ifdef LIBLDAP_DECL
+# define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
+# else
+# define LDAP_F_PRE extern
+# endif
+#endif
+
LDAP_F( int )
ldap_init_searchprefs LDAP_P(( char *file,
struct ldap_searchobj **solistp ));