From 1ce6e7c8c8bc7ec8373464490fc05b35d0c5c4f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
Date: Thu, 11 Aug 2016 22:25:38 +0100
Subject: [PATCH] include: Migrate d3d10misc.h to an IDL file.
Reply-To: wine-devel <wine-devel@winehq.org>

This allows building d3d10_1.idl with MIDL. Previously D3D10_DRIVER_TYPE
was unknown to MIDL, causing a build failure.
---
 include/Makefile.in   |  2 +-
 include/d3d10misc.h   | 49 -------------------------------------------------
 include/d3d10misc.idl | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 50 deletions(-)
 delete mode 100644 include/d3d10misc.h
 create mode 100644 include/d3d10misc.idl

diff --git a/include/Makefile.in b/include/Makefile.in
index 4aaefaf..1ac5024 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -36,6 +36,7 @@ IDL_SRCS = \
 	d2d1.idl \
 	d3d10.idl \
 	d3d10_1.idl \
+	d3d10misc.idl \
 	d3d10sdklayers.idl \
 	d3d11.idl \
 	d3d11_1.idl \
@@ -235,7 +236,6 @@ HEADER_SRCS = \
 	d3d.h \
 	d3d10_1shader.h \
 	d3d10effect.h \
-	d3d10misc.h \
 	d3d10shader.h \
 	d3d11shader.h \
 	d3d8.h \
diff --git a/include/d3d10misc.h b/include/d3d10misc.h
deleted file mode 100644
index f8f5617..0000000
--- a/include/d3d10misc.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2008 Henri Verbeet for CodeWeavers
- *
- * 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 __D3D10MISC_H__
-#define __D3D10MISC_H__
-
-#include "d3d10.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum D3D10_DRIVER_TYPE {
-    D3D10_DRIVER_TYPE_HARDWARE  = 0,
-    D3D10_DRIVER_TYPE_REFERENCE = 1,
-    D3D10_DRIVER_TYPE_NULL      = 2,
-    D3D10_DRIVER_TYPE_SOFTWARE  = 3,
-    D3D10_DRIVER_TYPE_WARP      = 5,
-} D3D10_DRIVER_TYPE;
-
-HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
-        HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
-
-HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
-        HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
-        IDXGISwapChain **swapchain, ID3D10Device **device);
-
-HRESULT WINAPI D3D10CreateBlob(SIZE_T data_size, ID3D10Blob **blob);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __D3D10MISC_H__ */
diff --git a/include/d3d10misc.idl b/include/d3d10misc.idl
new file mode 100644
index 0000000..e32b3d6
--- /dev/null
+++ b/include/d3d10misc.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2008 Henri Verbeet for CodeWeavers
+ *
+ * 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
+ */
+
+import "d3d10.idl";
+
+typedef enum D3D10_DRIVER_TYPE
+{
+    D3D10_DRIVER_TYPE_HARDWARE  = 0,
+    D3D10_DRIVER_TYPE_REFERENCE = 1,
+    D3D10_DRIVER_TYPE_NULL      = 2,
+    D3D10_DRIVER_TYPE_SOFTWARE  = 3,
+    D3D10_DRIVER_TYPE_WARP      = 5,
+} D3D10_DRIVER_TYPE;
+
+[local] HRESULT __stdcall D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
+        HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
+
+[local] HRESULT __stdcall D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
+        HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
+        IDXGISwapChain **swapchain, ID3D10Device **device);
+
+[local] HRESULT __stdcall D3D10CreateBlob(SIZE_T data_size, ID3D10Blob **blob);
-- 
2.7.3

