Fix LDAP_HI 0x377 vs 0377 bug.
* 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 \
# 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 */
#endif /* HAVE_PCNFS */
#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
+#define INADDR_LOOPBACK (0x7f000001UL)
#endif
#ifndef MAXHOSTNAMELEN
#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
#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 */
#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 */
# 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,