AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h sys/param.h sys/wait.h sys/limits.h netinet/in.h arpa/inet.h machine/limits.h syslog.h sys/time.h sys/resource.h)
-AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit setrlimit)
-AC_REPLACE_FUNCS(strlcat strlcpy)
+AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit setrlimit strlcat strlcpy)
AC_CHECK_MEMBERS([struct timeval.tv_sec])
# Set CFLAGS _after_ all the above checks, since our warnings are stricter
# than autoconf's macros like.
-CFLAGS="$CFLAGS -Wall -W -Wno-unused-parameter -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wendif-labels -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -g -O2"
+CFLAGS="$CFLAGS -Wall -W -Wno-unused-parameter -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -g -O2"
# Add these in when you feel like fun.
-# -Wbad-function-cast -Werror
+# -Wbad-function-cast -Werror -Wdeclaration-after-statement
echo "confdir: $CONFDIR"
#include "log.h"
#include "util.h"
+/* Inline the strl functions if the plaform doesn't have them. */
+#ifndef HAVE_STRLCPY
+#include "strlcpy.c"
+#endif
+#ifndef HAVE_STRLCAT
+#include "strlcat.c"
+#endif
+
/** Replacement for snprintf. Differs from platform snprintf in two
* ways: First, always NUL-terminates its output. Second, always
* returns -1 if the result is truncated. (Note that this return
#define strncasecmp strnicmp
#define strcasecmp stricmp
#endif
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t siz);
+#endif
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *dst, const char *src, size_t siz);
+#endif
int tor_snprintf(char *str, size_t size, const char *format, ...)
CHECK_PRINTF(3,4);
#define INADDR_NONE ((unsigned long) -1)
#endif
-/* Inline the strl functions if the plaform doesn't have them. */
-#ifndef HAVE_STRLCPY
-#include "strlcpy.c"
-#endif
-#ifndef HAVE_STRLCAT
-#include "strlcat.c"
-#endif
-
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* String manipulation */
#define HEX_CHARACTERS "0123456789ABCDEFabcdef"
-size_t strlcat(char *dst, const char *src, size_t siz);
-size_t strlcpy(char *dst, const char *src, size_t siz);
-
void tor_strlower(char *s);
int strcmpstart(const char *s1, const char *s2);
int tor_strstrip(char *s, const char *strip);