Use LDAP_F and LDAP_P macros.

Fix LDAP_HI 0x377 vs 0377 bug.
This commit is contained in:
Kurt Zeilenga 1999-06-07 18:35:30 +00:00
parent cc3785eaab
commit 12ed7e46ef
6 changed files with 20 additions and 11 deletions

View File

@ -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 \

View File

@ -18,9 +18,9 @@
# include <libutil.h>
#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 */

View File

@ -56,7 +56,7 @@
#endif /* HAVE_PCNFS */
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
#define INADDR_LOOPBACK (0x7f000001UL)
#endif
#ifndef MAXHOSTNAMELEN

View File

@ -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

View File

@ -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 */

View File

@ -18,7 +18,7 @@
# include <sys/wait.h>
#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,