+/*
+ * Default "extern" declarations or macro substitutes for library routines.
+ * When necessary, these routines are provided by files in src/port/.
+ */
+#ifndef HAVE_FSEEKO
+#define fseeko(a, b, c) fseek((a), (b), (c))
+#define ftello(a) ftell((a))
+#endif
+
+#ifndef HAVE_ISINF
+extern int isinf(double x);
+#endif
+
+#ifndef HAVE_GETHOSTNAME
+extern int gethostname(char *name, int namelen);
+#endif
+
+#ifndef HAVE_INET_ATON
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+extern int inet_aton(const char *cp, struct in_addr * addr);
+#endif
+
+/*
+ * When there is no sigsetjmp, its functionality is provided by plain
+ * setjmp. Incidentally, nothing provides setjmp's functionality in
+ * that case.
+ */
+#ifndef HAVE_SIGSETJMP
+# define sigjmp_buf jmp_buf
+# define sigsetjmp(x,y) setjmp(x)
+# define siglongjmp longjmp
+#endif
+
+#ifndef HAVE_STRCASECMP
+extern int strcasecmp(char *s1, char *s2);
+#endif
+
+#ifndef HAVE_STRDUP
+extern char *strdup(char const *);
+#endif
+
+#ifndef HAVE_RANDOM
+extern long random(void);
+#endif
+
+#ifndef HAVE_SRANDOM
+extern void srandom(unsigned int seed);
+#endif
+
+#if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC
+extern int fdatasync(int fildes);
+#endif
+
+/* If strtoq() exists, rename it to the more standard strtoll() */
+#if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ)
+# define strtoll strtoq
+# define HAVE_STRTOLL 1
+#endif
+
+/* If strtouq() exists, rename it to the more standard strtoull() */
+#if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ)
+# define strtoull strtouq
+# define HAVE_STRTOULL 1
+#endif
+