dnl Checks for header files.
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/un.h sys/wait.h netdb.h arpa/inet.h dirent.h])
-AC_CHECK_HEADERS([time.h],
- [], [], [#include "src/have.h"]
-)
+AC_CHECK_HEADERS([syslog.h sys/file.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/un.h sys/wait.h netdb.h arpa/inet.h dirent.h])
dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_VOLATILE
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
-AC_STRUCT_TM
-
MeshLink_ATTRIBUTE(__malloc__)
MeshLink_ATTRIBUTE(__warn_unused_result__)
dnl Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([asprintf fchmod fork get_current_dir_name gettimeofday random select strdup strerror time usleep],
+AC_CHECK_FUNCS([asprintf fchmod fork gettimeofday random select strdup usleep],
[], [], [#include "src/have.h"]
)
#include "xalloc.h"
-#ifndef HAVE_GET_CURRENT_DIR_NAME
-/*
- Replacement for the GNU get_current_dir_name function:
-
- get_current_dir_name will malloc(3) an array big enough to hold the
- current directory name. If the environment variable PWD is set, and
- its value is correct, then that value will be returned.
-*/
-char *get_current_dir_name(void) {
- size_t size;
- char *buf;
- char *r;
-
- /* Start with 100 bytes. If this turns out to be insufficient to
- contain the working directory, double the size. */
- size = 100;
- buf = xmalloc(size);
-
- errno = 0; /* Success */
- r = getcwd(buf, size);
-
- /* getcwd returns NULL and sets errno to ERANGE if the bufferspace
- is insufficient to contain the entire working directory. */
- while(r == NULL && errno == ERANGE) {
- free(buf);
- size <<= 1; /* double the size */
- buf = xmalloc(size);
- r = getcwd(buf, size);
- }
-
- return buf;
-}
-#endif
-
#ifndef HAVE_ASPRINTF
int asprintf(char **buf, const char *fmt, ...) {
int result;
#include "fake-getaddrinfo.h"
#include "fake-getnameinfo.h"
-#ifndef HAVE_GET_CURRENT_DIR_NAME
-extern char *get_current_dir_name(void);
-#endif
-
#ifndef HAVE_ASPRINTF
extern int asprintf(char **, const char *, ...);
extern int vasprintf(char **, const char *, va_list ap);
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <inttypes.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <ws2tcpip.h>
#endif
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif
-
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
/* Include system specific headers */
#ifdef HAVE_SYSLOG_H
#include "have.h"
-#ifndef HAVE_STDBOOL_H
-typedef int bool;
-#define true 1
-#define false 0
-#endif
-
#ifndef HAVE_STRSIGNAL
# define strsignal(p) ""
#endif