From 12ed7e46ef97df8bc628c48eb6bbd121db95d2b2 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 7 Jun 1999 18:35:30 +0000 Subject: [PATCH] Use LDAP_F and LDAP_P macros. Fix LDAP_HI 0x377 vs 0377 bug. --- include/ac/assert.h | 4 +++- include/ac/setproctitle.h | 6 +++--- include/ac/socket.h | 2 +- include/ac/string.h | 7 +++++-- include/ac/unistd.h | 10 +++++++--- include/ac/wait.h | 2 +- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/include/ac/assert.h b/include/ac/assert.h index f0720684ae..48adc864cc 100644 --- a/include/ac/assert.h +++ b/include/ac/assert.h @@ -27,7 +27,9 @@ * create a replacement and hope it works */ -void ber_pvt_assert(char* file, int line, char* test); +LDAP_F(void) ber_pvt_assert LDAP_F(( + char* file, int line, char* test)); + #define assert(test) \ ((test) \ ? (void)0 \ diff --git a/include/ac/setproctitle.h b/include/ac/setproctitle.h index 92be853b3b..c85eb452da 100644 --- a/include/ac/setproctitle.h +++ b/include/ac/setproctitle.h @@ -18,9 +18,9 @@ # include #else /* use lutil version */ - extern void (setproctitle) LDAP_P((const char *fmt, ...)); - extern int Argc; - extern char **Argv; + LDAP_F(void) (setproctitle) LDAP_P((const char *fmt, ...)); + LDAP_F(int) Argc; + LDAP_F(char) **Argv; #endif #endif /* LDAP_PROCTITLE */ diff --git a/include/ac/socket.h b/include/ac/socket.h index 0e0a4a93c0..e640e6c8c2 100644 --- a/include/ac/socket.h +++ b/include/ac/socket.h @@ -56,7 +56,7 @@ #endif /* HAVE_PCNFS */ #ifndef INADDR_LOOPBACK -#define INADDR_LOOPBACK ((unsigned long) 0x7f000001) +#define INADDR_LOOPBACK (0x7f000001UL) #endif #ifndef MAXHOSTNAMELEN diff --git a/include/ac/string.h b/include/ac/string.h index a5592baef9..ca2eeb0b7d 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -42,9 +42,12 @@ #endif /* use ldap_pvt_strtok instead of strtok or strtok_r! */ -extern char *ldap_pvt_strtok( char *str, const char *delim, char **pos ); +LDAP_F(char *) ldap_pvt_strtok LDAP_P(( + char *str, const char *delim, char **pos )); + +LDAP_F(char *) ldap_pvt_strdup LDAP_P(( + const char * s )); -extern char *ldap_pvt_strdup( const char * s ); #ifndef HAVE_STRDUP /* strdup() is missing, declare our own version */ # undef strdup diff --git a/include/ac/unistd.h b/include/ac/unistd.h index db1e3cb7c9..44413ddb41 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -28,7 +28,9 @@ #endif #ifndef HAVE_GETPASS -extern char* (getpass) LDAP_P((const char *getpass)); +LDAP_F(char*)(getpass) LDAP_P((const char *getpass)); +#else +LDAP_F(char*)(getpass)(); #endif /* getopt() defines may be in separate include file */ @@ -46,10 +48,12 @@ extern char* (getpass) LDAP_P((const char *getpass)); #endif #ifndef HAVE_TEMPNAM - extern char *(tempnam)(const char *tmpdir, const char *prefix); + LDAP_F(char *)(tempnam) LDAP_P(( + const char *tmpdir, + const char *prefix)); #endif #ifndef HAVE_MKTEMP - extern char *(mktemp)(char *); + LDAP_F(char *)(mktemp) LDAP_P((char *)); #endif /* use lutil file locking */ diff --git a/include/ac/wait.h b/include/ac/wait.h index 471c6a16f9..b3c4804d96 100644 --- a/include/ac/wait.h +++ b/include/ac/wait.h @@ -18,7 +18,7 @@ # include #endif -#define LDAP_HI(s) (((s) >> 8) & 0x377) +#define LDAP_HI(s) (((s) >> 8) & 0377) #define LDAP_LO(s) ((s) & 0377) /* These should work on non-POSIX UNIX platforms, -- 2.39.5