From: Howard Chu Date: Thu, 28 Oct 1999 07:28:53 +0000 (+0000) Subject: Fixed the LDAP_F macro. X-Git-Tag: UCDATA_2_4~288 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0991e22550247e142a5e10dee3c7e29dbb8af7e1;p=openldap Fixed the LDAP_F macro. See README 1.27 log --- diff --git a/include/ac/assert.h b/include/ac/assert.h index 6c3a44ed77..42282ad21c 100644 --- a/include/ac/assert.h +++ b/include/ac/assert.h @@ -31,6 +31,15 @@ * 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 )); diff --git a/include/ac/setproctitle.h b/include/ac/setproctitle.h index 5bf1d2f496..62eda796de 100644 --- a/include/ac/setproctitle.h +++ b/include/ac/setproctitle.h @@ -18,6 +18,15 @@ #if defined( HAVE_LIBUTIL_H ) # include #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))); diff --git a/include/ac/socket.h b/include/ac/socket.h index fc1d533b6f..1d9d1840f3 100644 --- a/include/ac/socket.h +++ b/include/ac/socket.h @@ -139,7 +139,7 @@ extern char* WSAGetErrorString LDAP_P((int)); #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) diff --git a/include/ac/string.h b/include/ac/string.h index 980511d3d0..bc884ae81b 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -42,6 +42,15 @@ # 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 )); diff --git a/include/ac/unistd.h b/include/ac/unistd.h index 32734777e4..d62d3b86bd 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -23,6 +23,15 @@ /* note: callers of crypt(3) should include */ +#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 @@ -48,9 +57,13 @@ LDAP_F(char*)(getpass)(); 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) diff --git a/include/avl.h b/include/avl.h index ae3b44ab65..deb79950c3 100644 --- a/include/avl.h +++ b/include/avl.h @@ -61,6 +61,15 @@ typedef int (*AVL_CMP) LDAP_P((const void*, const void*)); 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 )); diff --git a/include/disptmpl.h b/include/disptmpl.h index ba6f4bd982..cf2f2865a4 100644 --- a/include/disptmpl.h +++ b/include/disptmpl.h @@ -225,6 +225,15 @@ struct ldap_disptmpl { 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 )); diff --git a/include/getopt-compat.h b/include/getopt-compat.h index 14b2a2f5b0..24fbbb5a87 100644 --- a/include/getopt-compat.h +++ b/include/getopt-compat.h @@ -21,6 +21,15 @@ LDAP_BEGIN_DECL 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, diff --git a/include/lber.h b/include/lber.h index 56eaa24e55..240925517a 100644 --- a/include/lber.h +++ b/include/lber.h @@ -163,6 +163,15 @@ typedef struct berval { 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: */ diff --git a/include/lber_pvt.h b/include/lber_pvt.h index 7e26591cea..c407f4eab0 100644 --- a/include/lber_pvt.h +++ b/include/lber_pvt.h @@ -20,6 +20,15 @@ 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 */ diff --git a/include/ldap.h b/include/ldap.h index ff3a22a2c5..cda3ad767a 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -504,6 +504,15 @@ typedef struct ldap_url_desc { */ 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: */ diff --git a/include/ldap_log.h b/include/ldap_log.h index dfb2e7a9cd..ac0f4c3a2b 100644 --- a/include/ldap_log.h +++ b/include/ldap_log.h @@ -74,6 +74,15 @@ extern int ldap_syslog_level; #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))); diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h index 2b20ed4929..f20b7ebfcb 100644 --- a/include/ldap_pvt.h +++ b/include/ldap_pvt.h @@ -23,6 +23,15 @@ LDAP_BEGIN_DECL struct hostent; /* avoid pulling in */ +#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, diff --git a/include/ldap_pvt_thread.h b/include/ldap_pvt_thread.h index a006a2ef66..2861681bad 100644 --- a/include/ldap_pvt_thread.h +++ b/include/ldap_pvt_thread.h @@ -137,7 +137,8 @@ typedef struct ldap_pvt_thread_lwp_cv ldap_pvt_thread_cond_t; 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 @@ -176,6 +177,15 @@ LDAP_END_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 )); diff --git a/include/ldap_schema.h b/include/ldap_schema.h index c0c21bc88d..1fdb9e952e 100644 --- a/include/ldap_schema.h +++ b/include/ldap_schema.h @@ -87,6 +87,15 @@ typedef struct ldap_objectclass { #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 )); diff --git a/include/ldif.h b/include/ldif.h index a50bbf0634..caba0b613e 100644 --- a/include/ldif.h +++ b/include/ldif.h @@ -48,6 +48,15 @@ extern int ldif_debug; ((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, diff --git a/include/lutil.h b/include/lutil.h index 152c1316fd..39e7d70f2b 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -19,14 +19,23 @@ * 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 */ diff --git a/include/lutil_lockf.h b/include/lutil_lockf.h index 728b445cbf..ec9f0e6e04 100644 --- a/include/lutil_lockf.h +++ b/include/lutil_lockf.h @@ -19,6 +19,15 @@ 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 )); diff --git a/include/lutil_md5.h b/include/lutil_md5.h index 6a140c9753..1d06b74c82 100644 --- a/include/lutil_md5.h +++ b/include/lutil_md5.h @@ -36,6 +36,15 @@ struct lutil_MD5Context { 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)); diff --git a/include/lutil_sha1.h b/include/lutil_sha1.h index 07f82fb8eb..1f335065a0 100644 --- a/include/lutil_sha1.h +++ b/include/lutil_sha1.h @@ -36,6 +36,15 @@ typedef struct { 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])); diff --git a/include/srchpref.h b/include/srchpref.h index e3523b0051..3f1ae6d581 100644 --- a/include/srchpref.h +++ b/include/srchpref.h @@ -78,6 +78,15 @@ struct ldap_searchobj { #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 ));