Skip to content
Snippets Groups Projects
Commit 0991e225 authored by Howard Chu's avatar Howard Chu
Browse files

Fixed the LDAP_F macro.

See README 1.27 log
parent ff2908ff
No related branches found
No related tags found
No related merge requests found
Showing with 180 additions and 4 deletions
......@@ -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 ));
......
......@@ -18,6 +18,15 @@
#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)));
......
......@@ -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)
......
......@@ -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 ));
......
......@@ -23,6 +23,15 @@
/* 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
......@@ -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)
......
......@@ -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 ));
......
......@@ -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 ));
......
......@@ -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,
......
......@@ -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:
*/
......
......@@ -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
*/
......
......@@ -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:
*/
......
......@@ -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)));
......
......@@ -23,6 +23,15 @@ LDAP_BEGIN_DECL
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,
......
......@@ -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 ));
......
......@@ -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 ));
......
......@@ -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,
......
......@@ -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 */
......
......@@ -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 ));
......
......@@ -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));
......
......@@ -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]));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment