[PATCH 1/3] include: Add inaddr.h

Detlef Riekenberg wine.dev at web.de
Wed Aug 4 14:48:02 CDT 2010


---
 include/Makefile.in |    1 +
 include/inaddr.h    |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 include/inaddr.h

diff --git a/include/Makefile.in b/include/Makefile.in
index e6215e3..b8d26ec 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -281,6 +281,7 @@ SRCDIR_INCLUDES = \
 	imagehlp.h \
 	imm.h \
 	in6addr.h \
+	inaddr.h \
 	initguid.h \
 	intshcut.h \
 	ipexport.h \
diff --git a/include/inaddr.h b/include/inaddr.h
new file mode 100644
index 0000000..e21ae62
--- /dev/null
+++ b/include/inaddr.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2010 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#ifndef __INADDR__
+#define __INADDR__
+
+#include <windef.h>
+
+#ifdef USE_WS_PREFIX
+#define WS(x)    WS_##x
+#else
+#define WS(x)    x
+#endif
+
+typedef struct WS(in_addr)
+{
+    union {
+        struct {
+            UCHAR s_b1,s_b2,s_b3,s_b4;
+        } S_un_b;
+        struct {
+            USHORT s_w1,s_w2;
+        } S_un_w;
+        ULONG S_addr;
+    } S_un;
+} IN_ADDR, *PIN_ADDR, *LPIN_ADDR;
+
+#undef WS
+
+#ifdef USE_WS_PREFIX
+#define WS_s_addr  S_un.S_addr
+#define WS_s_net   S_un.S_un_b.s_b1
+#define WS_s_host  S_un.S_un_b.s_b2
+#define WS_s_lh    S_un.S_un_b.s_b3
+#define WS_s_impno S_un.S_un_b.s_b4
+#define WS_s_imp   S_un.S_un_w.s_w2
+#else
+#define s_addr  S_un.S_addr
+#define s_net   S_un.S_un_b.s_b1
+#define s_host  S_un.S_un_b.s_b2
+#define s_lh    S_un.S_un_b.s_b3
+#define s_impno S_un.S_un_b.s_b4
+#define s_imp   S_un.S_un_w.s_w2
+#endif  /* USE_WS_PREFIX */
+
+#endif /* __INADDR__ */
+
-- 
1.7.0.4




More information about the wine-patches mailing list