]> git.meshlink.io Git - catta/commitdiff
moved back windows compat headers and fixed catta headers to stop clutter dependent...
authoreverHannes <hannes.ahrens@everbase.net>
Mon, 24 Aug 2015 18:36:08 +0000 (20:36 +0200)
committerHiveError <hiveerror@gmail.com>
Mon, 24 Aug 2015 18:36:08 +0000 (20:36 +0200)
also fixed WINVER to be a project property set in src/Makefile.am instead of undef/define override in wincompat.h

29 files changed:
configure.ac
include/Makefile.am
include/catta/compat/wincompat.h [deleted file]
include/catta/compat/windows/arpa/inet.h [deleted file]
include/catta/compat/windows/net/if.h [deleted file]
include/catta/compat/windows/netinet/in.h [deleted file]
include/catta/compat/windows/sys/ioctl.h [deleted file]
include/catta/compat/windows/sys/poll.h [deleted file]
include/catta/compat/windows/sys/select.h [deleted file]
include/catta/compat/windows/sys/socket.h [deleted file]
include/catta/compat/windows/sys/uio.h [deleted file]
include/catta/compat/windows/sys/utsname.h [deleted file]
include/catta/simple-watch.h
include/catta/thread-watch.h
include/catta/timeval.h
include/catta/watch.h
src/Makefile.am
src/compat/windows/include/arpa/inet.h [new file with mode: 0644]
src/compat/windows/include/net/if.h [new file with mode: 0644]
src/compat/windows/include/netinet/in.h [new file with mode: 0644]
src/compat/windows/include/sys/ioctl.h [new file with mode: 0644]
src/compat/windows/include/sys/poll.h [new file with mode: 0644]
src/compat/windows/include/sys/select.h [new file with mode: 0644]
src/compat/windows/include/sys/socket.h [new file with mode: 0644]
src/compat/windows/include/sys/uio.h [new file with mode: 0644]
src/compat/windows/include/sys/utsname.h [new file with mode: 0644]
src/compat/windows/wincompat.c
src/compat/windows/wincompat.h [new file with mode: 0644]
src/iface-windows.c

index c5314af0e042c63e3d4e698a9e8696b8a9fa74ec..d760f340af3c5c40b76658830f07419f9239c5db 100644 (file)
@@ -59,7 +59,7 @@ fi
 AC_CHECK_DECL(_WIN32)
 AM_CONDITIONAL([WINDOWS], [ test "x$ac_cv_have_decl__WIN32" = "xyes" ])
 if test "x$ac_cv_have_decl__WIN32" = "xyes" ; then
-    CPPFLAGS="$CPPFLAGS -I`pwd`/include/compat/windows"
+    CPPFLAGS="$CPPFLAGS -I`pwd`/src/compat/windows/include"
 fi
 AC_CHECK_MEMBER([struct in_pktinfo.ipi_spec_dst],
     AC_DEFINE([HAVE_IPI_SPEC_DST], [], [struct in_pktinfo has ipi_spec_dst member]),
index fae04cad3567c037ff4f540a34ca3c67857987b7..79513202775d0055da9b43334767f2da389aceaf 100644 (file)
@@ -35,14 +35,4 @@ nobase_include_HEADERS = \
        catta/log.h \
        catta/rr.h \
        catta/publish.h \
-       catta/lookup.h \
-       catta/compat/wincompat.h \
-       catta/compat/windows/arpa/inet.h \
-       catta/compat/windows/net/if.h \
-       catta/compat/windows/netinet/in.h \
-       catta/compat/windows/sys/ioctl.h \
-       catta/compat/windows/sys/poll.h \
-       catta/compat/windows/sys/select.h \
-       catta/compat/windows/sys/socket.h \
-       catta/compat/windows/sys/uio.h \
-       catta/compat/windows/sys/utsname.h
+       catta/lookup.h
diff --git a/include/catta/compat/wincompat.h b/include/catta/compat/wincompat.h
deleted file mode 100644 (file)
index 6d6f414..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#ifndef foowincompatfoo
-#define foowincompatfoo
-
-// This file and its companion wincompat.c provide some Posix interfaces to
-// Windows APIs so the rest of the code can keep using them.
-
-
-// require at least Windows Vista
-#undef WINVER
-#undef _WIN32_WINNT
-#define WINVER 0x0600
-#define _WIN32_WINNT WINVER
-
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <mswsock.h>
-#include <sys/types.h>
-
-
-// wrappers around WSAStartup/WSACleanup to avoid clutter
-void winsock_init(void);
-void winsock_exit(void);
-
-
-// the equivalent of strerror(errno) for Windows sockets
-char *errnostrsocket(void);
-
-
-// Winsock doesn't have recvmsg/sendmsg but offers the same functionality
-// with WSARecvMsg/WSASendMsg, so we implement the former in terms of the
-// latter.
-
-struct iovec {                   /* Scatter/gather array items */
-   void  *iov_base;              /* Starting address */
-   size_t iov_len;               /* Number of bytes to transfer */
-};
-
-struct msghdr {
-   void         *msg_name;       /* optional address */
-   socklen_t     msg_namelen;    /* size of address */
-   struct iovec *msg_iov;        /* scatter/gather array */
-   size_t        msg_iovlen;     /* # elements in msg_iov */
-   void         *msg_control;    /* ancillary data, see below */
-   size_t        msg_controllen; /* ancillary data buffer len */
-   int           msg_flags;      /* flags on received message */
-};
-
-// MSDN says this struct is called wsacmsghdr but MingW uses _WSACMSGHDR.
-// TODO: Verify what it is on actual Windows.
-// cf. http://msdn.microsoft.com/en-us/library/ms741645(v=vs.85).aspx
-// -->
-// MingW32 x86 4.8.1 uses wsacmsghdr, MingW x86_x64 uses _WSACMSGHDR and Visual Studio 2015 RC (ws2def.h) defines:
-// #if(_WIN32_WINNT >= 0x0600)
-// #define _WSACMSGHDR cmsghdr
-// #endif //(_WIN32_WINNT>=0x0600)
-// typedef struct _WSACMSGHDR {
-//     SIZE_T      cmsg_len;
-//     INT         cmsg_level;
-//     INT         cmsg_type;
-//     /* followed by UCHAR cmsg_data[] */
-// } WSACMSGHDR, *PWSACMSGHDR, FAR *LPWSACMSGHDR;
-#ifdef __MINGW32__
-  #ifdef __MINGW64_VERSION_MAJOR
-    #define cmsghdr _WSACMSGHDR     // as in 'struct cmsghdr'
-  #else
-    #define cmsghdr wsacmsghdr      // as in 'struct cmsghdr'
-  #endif
-#elif (_WIN32_WINNT < 0x0600)
-  #define cmsghdr _WSACMSGHDR
-#endif
-
-// VS2015 ws2def.h already defines: #define CMSG_FIRSTHDR WSA_CMSG_FIRSTHDR
-#ifdef CMSG_FIRSTHDR
-#undef CMSG_FIRSTHDR
-#endif
-static inline struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *m) {
-    WSAMSG wm;
-    wm.Control.len = m->msg_controllen;
-    wm.Control.buf = (char*)m->msg_control;
-    return WSA_CMSG_FIRSTHDR(&wm);
-}
-
-// VS2015 ws2def.h already defines: #define CMSG_NXTHDR WSA_CMSG_NXTHDR
-#ifdef CMSG_NXTHDR
-#undef CMSG_NXTHDR
-#endif
-static inline struct cmsghdr *CMSG_NXTHDR(struct msghdr *m, struct cmsghdr *c) {
-    WSAMSG wm;
-    wm.Control.len = m->msg_controllen;
-    wm.Control.buf = (char*)m->msg_control;
-    return WSA_CMSG_NXTHDR(&wm, c);
-}
-
-#ifndef CMSG_SPACE
- #define CMSG_SPACE(len) WSA_CMSG_SPACE(len)
-#endif
-#ifndef CMSG_LEN
- #define CMSG_LEN(len) WSA_CMSG_LEN(len)
-#endif
-
-// we're going to be naughty and redefine CMSG_DATA as an alias even though it
-// is also a constant defined in wincrypt.h which we don't care about.
-#undef CMSG_DATA
-#define CMSG_DATA(c) WSA_CMSG_DATA(c)
-
-#ifdef _MSC_VER
-   // VS2012 and up has no ssize_t defined, before it was defined as unsigned int
-   #ifndef _SSIZE_T
-   #define _SSIZE_T
-   typedef signed int        ssize_t;
-   #endif
-#endif
-
-ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
-ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags);
-
-// ESHUTDOWN does not seem to exist on Windows, even though WSAESHUTDOWN does.
-// MingW doesn't define it and MSDN doesn't list it, so we alias it to EBADF.
-// cf. http://msdn.microsoft.com/en-us/library/5814770t.aspx
-#ifndef ESHUTDOWN
-#define ESHUTDOWN EBADF
-#endif
-
-
-// Windows doesn't have ioctl but offers ioctlsocket for some socket-related
-// functions. Unfortunately, argument types differ, so we implement a
-// (restricted) wrapper.
-int ioctl(int d, unsigned long request, int *p);
-
-
-// Windows lacks poll, but WSAPoll is good enough for us.
-#define poll(fds, nfds, timeout) WSAPoll(fds, nfds, timeout)
-
-// Windows lacks pipe. It has an equivalent CreatePipe but we really need
-// something to give to WSAPoll, so we fake it with a local TCP socket. (ugh)
-int pipe(int pipefd[2]);
-
-// pipe(socket)-specific read/write/close equivalents
-#define closepipe closesocket
-#define writepipe(s,buf,len) send(s, buf, len, 0)
-#define readpipe(s,buf,len) recv(s, buf, len, 0)
-
-
-// Windows logically doesn't have uname, so we supply a replacement.
-
-struct utsname {
-   char sysname[9];    /* Operating system name (e.g., "Linux") */
-   char nodename[MAX_COMPUTERNAME_LENGTH+1];
-                       /* Name within "some implementation-defined network" */
-   char release[9];    /* Operating system release (e.g., "2.6.28") */
-   char version[9];    /* Operating system version */
-   char machine[9];    /* Hardware identifier */
-};
-
-int uname(struct utsname *buf);
-
-
-#endif
diff --git a/include/catta/compat/windows/arpa/inet.h b/include/catta/compat/windows/arpa/inet.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/net/if.h b/include/catta/compat/windows/net/if.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/netinet/in.h b/include/catta/compat/windows/netinet/in.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/sys/ioctl.h b/include/catta/compat/windows/sys/ioctl.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/sys/poll.h b/include/catta/compat/windows/sys/poll.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/sys/select.h b/include/catta/compat/windows/sys/select.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/sys/socket.h b/include/catta/compat/windows/sys/socket.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/sys/uio.h b/include/catta/compat/windows/sys/uio.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
diff --git a/include/catta/compat/windows/sys/utsname.h b/include/catta/compat/windows/sys/utsname.h
deleted file mode 100644 (file)
index cc77ee8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../wincompat.h"
index ce91d1f04ce08745e9ff7e7873c561cf6a093d8d..fb126adb06916afce6e87d3529701710a5aa926c 100644 (file)
@@ -22,7 +22,6 @@
 
 /** \file simple-watch.h Simple poll() based main loop implementation */
 
-#include <sys/poll.h>
 #include <catta/cdecl.h>
 #include <catta/watch.h>
 
index 3ecb1e448733933f208e3464eb2909433d0ec695..7057dfffe83adad1eb92ce961e8a94447eb543db 100644 (file)
@@ -22,7 +22,6 @@
 
 /** \file thread-watch.h Threaded poll() based main loop implementation */
 
-#include <sys/poll.h>
 #include <catta/cdecl.h>
 #include <catta/watch.h>
 
index d78d2296e3fba51fc75a84be4211a9402abca14c..0c52eaa92a7f72bc767864810d60806cdac68f3e 100644 (file)
 /** \file timeval.h Functions to facilitate timeval handling */
 
 #include <inttypes.h>
-#ifndef _MSC_VER
-#include <sys/time.h>
+#ifdef _WIN32
+    #include <winsock2.h> // timeval
+#else
+    #include <sys/time.h>
 #endif
 
 #include <catta/cdecl.h>
index 7824724ba0826b8aa2068344f5020464f7c75dfe..a0c6389c5d3def031c7c32e5c50cbcd378c00c2c 100644 (file)
 
 /** \file watch.h Simplistic main loop abstraction */
 
-#include <sys/poll.h>
-#ifndef _MSC_VER
-#include <sys/time.h>
+#ifdef _WIN32
+    #include <winsock2.h> // POLLIN
+#else
+    #include <sys/poll.h>
+    #include <sys/time.h>
 #endif
 
 #include <catta/cdecl.h>
index b78e013ff574e19fac0502d06ec556aaddddd948..9471992c950abbc642d243357c38a947c3ba95a8 100644 (file)
@@ -85,15 +85,19 @@ endif
 endif
 endif
 
+if WINDOWS
+# require Windows Vista or above (for winsock2)
+AM_CFLAGS+=-DWINVER=0x0600 -D_WIN32_WINNT=0x0600
+endif
+
 libcatta_la_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
 libcatta_la_LIBADD = $(AM_LDADD) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 libcatta_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBCATTA_VERSION_INFO)
 
 if WINDOWS
-libcatta_la_CFLAGS += -I$(top_srcdir)/include/catta/compat/windows
 libcatta_la_SOURCES += \
-       compat/windows/wincompat.c
+       compat/windows/wincompat.c \
+       compat/windows/wincompat.h
 libcatta_la_LIBADD += -lws2_32 -liphlpapi
 libcatta_la_LDFLAGS += -no-undefined -Wl,--kill-at,--output-def=.libs/libcatta-0.def
 endif
-
diff --git a/src/compat/windows/include/arpa/inet.h b/src/compat/windows/include/arpa/inet.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/net/if.h b/src/compat/windows/include/net/if.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/netinet/in.h b/src/compat/windows/include/netinet/in.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/sys/ioctl.h b/src/compat/windows/include/sys/ioctl.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/sys/poll.h b/src/compat/windows/include/sys/poll.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/sys/select.h b/src/compat/windows/include/sys/select.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/sys/socket.h b/src/compat/windows/include/sys/socket.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/sys/uio.h b/src/compat/windows/include/sys/uio.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
diff --git a/src/compat/windows/include/sys/utsname.h b/src/compat/windows/include/sys/utsname.h
new file mode 100644 (file)
index 0000000..cc77ee8
--- /dev/null
@@ -0,0 +1 @@
+#include "../../wincompat.h"
index b60eb8f66ccd2f5e4574f2ca53edf60729ef0573..93a557e1e897a35c5663af87f0d988cae62abc1a 100644 (file)
@@ -1,4 +1,4 @@
-#include "catta/compat/wincompat.h"
+#include "wincompat.h"
 #include <errno.h>
 #include <stdlib.h>
 #include <assert.h>
diff --git a/src/compat/windows/wincompat.h b/src/compat/windows/wincompat.h
new file mode 100644 (file)
index 0000000..6d6f414
--- /dev/null
@@ -0,0 +1,158 @@
+#ifndef foowincompatfoo
+#define foowincompatfoo
+
+// This file and its companion wincompat.c provide some Posix interfaces to
+// Windows APIs so the rest of the code can keep using them.
+
+
+// require at least Windows Vista
+#undef WINVER
+#undef _WIN32_WINNT
+#define WINVER 0x0600
+#define _WIN32_WINNT WINVER
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#include <sys/types.h>
+
+
+// wrappers around WSAStartup/WSACleanup to avoid clutter
+void winsock_init(void);
+void winsock_exit(void);
+
+
+// the equivalent of strerror(errno) for Windows sockets
+char *errnostrsocket(void);
+
+
+// Winsock doesn't have recvmsg/sendmsg but offers the same functionality
+// with WSARecvMsg/WSASendMsg, so we implement the former in terms of the
+// latter.
+
+struct iovec {                   /* Scatter/gather array items */
+   void  *iov_base;              /* Starting address */
+   size_t iov_len;               /* Number of bytes to transfer */
+};
+
+struct msghdr {
+   void         *msg_name;       /* optional address */
+   socklen_t     msg_namelen;    /* size of address */
+   struct iovec *msg_iov;        /* scatter/gather array */
+   size_t        msg_iovlen;     /* # elements in msg_iov */
+   void         *msg_control;    /* ancillary data, see below */
+   size_t        msg_controllen; /* ancillary data buffer len */
+   int           msg_flags;      /* flags on received message */
+};
+
+// MSDN says this struct is called wsacmsghdr but MingW uses _WSACMSGHDR.
+// TODO: Verify what it is on actual Windows.
+// cf. http://msdn.microsoft.com/en-us/library/ms741645(v=vs.85).aspx
+// -->
+// MingW32 x86 4.8.1 uses wsacmsghdr, MingW x86_x64 uses _WSACMSGHDR and Visual Studio 2015 RC (ws2def.h) defines:
+// #if(_WIN32_WINNT >= 0x0600)
+// #define _WSACMSGHDR cmsghdr
+// #endif //(_WIN32_WINNT>=0x0600)
+// typedef struct _WSACMSGHDR {
+//     SIZE_T      cmsg_len;
+//     INT         cmsg_level;
+//     INT         cmsg_type;
+//     /* followed by UCHAR cmsg_data[] */
+// } WSACMSGHDR, *PWSACMSGHDR, FAR *LPWSACMSGHDR;
+#ifdef __MINGW32__
+  #ifdef __MINGW64_VERSION_MAJOR
+    #define cmsghdr _WSACMSGHDR     // as in 'struct cmsghdr'
+  #else
+    #define cmsghdr wsacmsghdr      // as in 'struct cmsghdr'
+  #endif
+#elif (_WIN32_WINNT < 0x0600)
+  #define cmsghdr _WSACMSGHDR
+#endif
+
+// VS2015 ws2def.h already defines: #define CMSG_FIRSTHDR WSA_CMSG_FIRSTHDR
+#ifdef CMSG_FIRSTHDR
+#undef CMSG_FIRSTHDR
+#endif
+static inline struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *m) {
+    WSAMSG wm;
+    wm.Control.len = m->msg_controllen;
+    wm.Control.buf = (char*)m->msg_control;
+    return WSA_CMSG_FIRSTHDR(&wm);
+}
+
+// VS2015 ws2def.h already defines: #define CMSG_NXTHDR WSA_CMSG_NXTHDR
+#ifdef CMSG_NXTHDR
+#undef CMSG_NXTHDR
+#endif
+static inline struct cmsghdr *CMSG_NXTHDR(struct msghdr *m, struct cmsghdr *c) {
+    WSAMSG wm;
+    wm.Control.len = m->msg_controllen;
+    wm.Control.buf = (char*)m->msg_control;
+    return WSA_CMSG_NXTHDR(&wm, c);
+}
+
+#ifndef CMSG_SPACE
+ #define CMSG_SPACE(len) WSA_CMSG_SPACE(len)
+#endif
+#ifndef CMSG_LEN
+ #define CMSG_LEN(len) WSA_CMSG_LEN(len)
+#endif
+
+// we're going to be naughty and redefine CMSG_DATA as an alias even though it
+// is also a constant defined in wincrypt.h which we don't care about.
+#undef CMSG_DATA
+#define CMSG_DATA(c) WSA_CMSG_DATA(c)
+
+#ifdef _MSC_VER
+   // VS2012 and up has no ssize_t defined, before it was defined as unsigned int
+   #ifndef _SSIZE_T
+   #define _SSIZE_T
+   typedef signed int        ssize_t;
+   #endif
+#endif
+
+ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
+ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags);
+
+// ESHUTDOWN does not seem to exist on Windows, even though WSAESHUTDOWN does.
+// MingW doesn't define it and MSDN doesn't list it, so we alias it to EBADF.
+// cf. http://msdn.microsoft.com/en-us/library/5814770t.aspx
+#ifndef ESHUTDOWN
+#define ESHUTDOWN EBADF
+#endif
+
+
+// Windows doesn't have ioctl but offers ioctlsocket for some socket-related
+// functions. Unfortunately, argument types differ, so we implement a
+// (restricted) wrapper.
+int ioctl(int d, unsigned long request, int *p);
+
+
+// Windows lacks poll, but WSAPoll is good enough for us.
+#define poll(fds, nfds, timeout) WSAPoll(fds, nfds, timeout)
+
+// Windows lacks pipe. It has an equivalent CreatePipe but we really need
+// something to give to WSAPoll, so we fake it with a local TCP socket. (ugh)
+int pipe(int pipefd[2]);
+
+// pipe(socket)-specific read/write/close equivalents
+#define closepipe closesocket
+#define writepipe(s,buf,len) send(s, buf, len, 0)
+#define readpipe(s,buf,len) recv(s, buf, len, 0)
+
+
+// Windows logically doesn't have uname, so we supply a replacement.
+
+struct utsname {
+   char sysname[9];    /* Operating system name (e.g., "Linux") */
+   char nodename[MAX_COMPUTERNAME_LENGTH+1];
+                       /* Name within "some implementation-defined network" */
+   char release[9];    /* Operating system release (e.g., "2.6.28") */
+   char version[9];    /* Operating system version */
+   char machine[9];    /* Hardware identifier */
+};
+
+int uname(struct utsname *buf);
+
+
+#endif
index 1d8d0f3d9671c995f7b5316b057cd92b60484819..7be73f07d97631dcbce958fce70a00a0fba60a32 100644 (file)
 #include <stdlib.h> // wcstombs
 #include <catta/malloc.h>
 #include <catta/log.h>
+#include <ws2tcpip.h>
 #include <iphlpapi.h>
 #include <assert.h>
+#include "compat/windows/wincompat.h"
 #include "hashmap.h"
 #include "util.h"   // catta_format_mac_address
 #include "fdutil.h" // catta_set_nonblock