mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
Use LDAP_F and LDAP_P macros.
Fix LDAP_HI 0x377 vs 0377 bug.
This commit is contained in:
parent
cc3785eaab
commit
12ed7e46ef
6 changed files with 20 additions and 11 deletions
|
|
@ -27,7 +27,9 @@
|
||||||
* create a replacement and hope it works
|
* 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) \
|
#define assert(test) \
|
||||||
((test) \
|
((test) \
|
||||||
? (void)0 \
|
? (void)0 \
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@
|
||||||
# include <libutil.h>
|
# include <libutil.h>
|
||||||
#else
|
#else
|
||||||
/* use lutil version */
|
/* use lutil version */
|
||||||
extern void (setproctitle) LDAP_P((const char *fmt, ...));
|
LDAP_F(void) (setproctitle) LDAP_P((const char *fmt, ...));
|
||||||
extern int Argc;
|
LDAP_F(int) Argc;
|
||||||
extern char **Argv;
|
LDAP_F(char) **Argv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LDAP_PROCTITLE */
|
#endif /* LDAP_PROCTITLE */
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
#endif /* HAVE_PCNFS */
|
#endif /* HAVE_PCNFS */
|
||||||
|
|
||||||
#ifndef INADDR_LOOPBACK
|
#ifndef INADDR_LOOPBACK
|
||||||
#define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
|
#define INADDR_LOOPBACK (0x7f000001UL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MAXHOSTNAMELEN
|
#ifndef MAXHOSTNAMELEN
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* use ldap_pvt_strtok instead of strtok or strtok_r! */
|
/* 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
|
#ifndef HAVE_STRDUP
|
||||||
/* strdup() is missing, declare our own version */
|
/* strdup() is missing, declare our own version */
|
||||||
# undef strdup
|
# undef strdup
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETPASS
|
#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
|
#endif
|
||||||
|
|
||||||
/* getopt() defines may be in separate include file */
|
/* getopt() defines may be in separate include file */
|
||||||
|
|
@ -46,10 +48,12 @@ extern char* (getpass) LDAP_P((const char *getpass));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_TEMPNAM
|
#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
|
#endif
|
||||||
#ifndef HAVE_MKTEMP
|
#ifndef HAVE_MKTEMP
|
||||||
extern char *(mktemp)(char *);
|
LDAP_F(char *)(mktemp) LDAP_P((char *));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* use lutil file locking */
|
/* use lutil file locking */
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
# include <sys/wait.h>
|
# include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LDAP_HI(s) (((s) >> 8) & 0x377)
|
#define LDAP_HI(s) (((s) >> 8) & 0377)
|
||||||
#define LDAP_LO(s) ((s) & 0377)
|
#define LDAP_LO(s) ((s) & 0377)
|
||||||
|
|
||||||
/* These should work on non-POSIX UNIX platforms,
|
/* These should work on non-POSIX UNIX platforms,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue