summaryrefslogtreecommitdiff
path: root/setup_once.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-20 12:12:27 +0000
committerYang Tse <yangsita@gmail.com>2007-02-20 12:12:27 +0000
commit3f00c1cc9a4787659b26240405148b1e4d7f8aec (patch)
tree8d4ecaad3b21b5e79f3dc355ee20243f2eea48fd /setup_once.h
parent324522a645c73c240cefcd05cf5fa0bbb83a9aba (diff)
downloadc-ares-3f00c1cc9a4787659b26240405148b1e4d7f8aec.tar.gz
c-ares-3f00c1cc9a4787659b26240405148b1e4d7f8aec.tar.bz2
c-ares-3f00c1cc9a4787659b26240405148b1e4d7f8aec.zip
Move header file inclusion logic and definition of timeval
struct for platforms that don't have it to setup_once.h
Diffstat (limited to 'setup_once.h')
-rw-r--r--setup_once.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/setup_once.h b/setup_once.h
index 41b42e9..32d8293 100644
--- a/setup_once.h
+++ b/setup_once.h
@@ -31,8 +31,49 @@
* Inclusion of common header files.
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <ctype.h>
#include <errno.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#else
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#endif
+
+#ifdef WIN32
+#include <io.h>
+#include <fcntl.h>
+#endif
+
+
+/*
+ * Definition of timeval struct for platforms that don't have it.
+ */
+
+#ifndef HAVE_STRUCT_TIMEVAL
+struct timeval {
+ long tv_sec;
+ long tv_usec;
+};
+#endif
+
/*
* If we have the MSG_NOSIGNAL define, make sure we use