projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for building tinc with MSVC
[tinc]
/
src
/
have.h
diff --git
a/src/have.h
b/src/have.h
index
9dc3b04
..
f19c599
100644
(file)
--- a/
src/have.h
+++ b/
src/have.h
@@
-1,7
+1,10
@@
+#ifndef TINC_HAVE_H
+#define TINC_HAVE_H
+
/*
have.h -- include headers which are known to exist
Copyright (C) 1998-2005 Ivo Timmermans
/*
have.h -- include headers which are known to exist
Copyright (C) 1998-2005 Ivo Timmermans
- 2003-20
13
Guus Sliepen <guus@tinc-vpn.org>
+ 2003-20
21
Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-18,40
+21,51
@@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_HAVE_H__
-#define __TINC_HAVE_H__
-
#ifdef HAVE_MINGW
#ifdef HAVE_MINGW
-#ifdef WITH_WINDOWS2000
-#define WINVER Windows2000
-#else
-#define WINVER WindowsXP
-#endif
+#define WINVER 0x0600
+#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
+#define _CRT_SECURE_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#include <unistd.h>
+#endif
#include <limits.h>
#include <math.h>
#include <limits.h>
#include <math.h>
+#include <time.h>
+
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#elif defined(HAVE_NETBSD)
+#define alloca(size) __builtin_alloca(size)
+#endif
#ifdef HAVE_MINGW
#ifdef HAVE_MINGW
+#ifdef HAVE_W32API_H
#include <w32api.h>
#include <w32api.h>
+#endif
+
#include <winsock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#include <winsock2.h>
#include <windows.h>
#include <ws2tcpip.h>
-#endif
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
+#ifdef _MSC_VER
+#include <io.h>
+#include <process.h>
+#include <direct.h>
#endif
#endif
+#endif // HAVE_MINGW
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#ifdef HAVE_TERMIOS_H
#include <termios.h>
@@
-63,6
+77,10
@@
/* Include system specific headers */
/* Include system specific headers */
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
@@
-71,9
+89,6
@@
#include <sys/time.h>
#endif
#include <sys/time.h>
#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@
-87,6
+102,10
@@
#include <sys/file.h>
#endif
#include <sys/file.h>
#endif
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
@@
-103,16
+122,14
@@
#include <sys/resource.h>
#endif
#include <sys/resource.h>
#endif
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
+#elif defined(_MSC_VER)
+#include "dirent.h"
#endif
/* SunOS really wants sys/socket.h BEFORE net/if.h,
#endif
/* SunOS really wants sys/socket.h BEFORE net/if.h,
@@
-206,6
+223,16
@@
#include <resolv.h>
#endif
#include <resolv.h>
#endif
+#ifdef HAVE_LINUX_IF_TUN_H
+#include <linux/if_tun.h>
+#endif
+
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+#include "getopt.h"
+#endif
+
#ifdef STATUS
#undef STATUS
#endif
#ifdef STATUS
#undef STATUS
#endif
@@
-216,4
+243,4
@@
#define SLASH "/"
#endif
#define SLASH "/"
#endif
-#endif
/* __TINC_SYSTEM_H__ */
+#endif