=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: tests: Introduce common header for d3d12 crosstests.

Alexandre Julliard julliard at winehq.org
Tue Dec 4 13:22:16 CST 2018


Module: vkd3d
Branch: master
Commit: fa997de83d615793af3643494df15a604866ebd5
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=fa997de83d615793af3643494df15a604866ebd5

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Dec  4 15:55:58 2018 +0100

tests: Introduce common header for d3d12 crosstests.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tests/d3d12.c            | 41 +------------------------------
 tests/d3d12_crosstest.h  | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/d3d12_test_utils.h |  6 ++---
 3 files changed, 67 insertions(+), 43 deletions(-)

diff --git a/tests/d3d12.c b/tests/d3d12.c
index 6f45ac9..8f9e2c6 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -16,46 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-/* Hack for MinGW-w64 headers.
- *
- * We want to use WIDL C inline wrappers because some methods
- * in D3D12 interfaces return aggregate objects. Unfortunately,
- * WIDL C inline wrappers are broken when used with MinGW-w64
- * headers because FORCEINLINE expands to extern inline
- * which leads to the "multiple storage classes in declaration
- * specifiers" compiler error.
- */
-#ifdef __MINGW32__
-# include <_mingw.h>
-# ifdef __MINGW64_VERSION_MAJOR
-#  undef __forceinline
-#  define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
-# endif
-
-# define _HRESULT_DEFINED
-typedef int HRESULT;
-#endif
-
-#define COBJMACROS
-#define INITGUID
-#include "vkd3d_test.h"
-#include "vkd3d_windows.h"
-#define WIDL_C_INLINE_WRAPPERS
-#include "vkd3d_d3d12.h"
-
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include <time.h>
-
-#ifdef _WIN32
-# include "vkd3d_dxgi1_4.h"
-#else
-# include <pthread.h>
-# include "vkd3d_utils.h"
-#endif
-
-#include "d3d12_test_utils.h"
+#include "d3d12_crosstest.h"
 
 struct vec2
 {
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h
new file mode 100644
index 0000000..daf156b
--- /dev/null
+++ b/tests/d3d12_crosstest.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2016-2018 Józef Kucia 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 __VKD3D_D3D12_CROSSTEST_H
+#define __VKD3D_D3D12_CROSSTEST_H
+
+/* Hack for MinGW-w64 headers.
+ *
+ * We want to use WIDL C inline wrappers because some methods
+ * in D3D12 interfaces return aggregate objects. Unfortunately,
+ * WIDL C inline wrappers are broken when used with MinGW-w64
+ * headers because FORCEINLINE expands to extern inline
+ * which leads to the "multiple storage classes in declaration
+ * specifiers" compiler error.
+ */
+#ifdef __MINGW32__
+# include <_mingw.h>
+# ifdef __MINGW64_VERSION_MAJOR
+#  undef __forceinline
+#  define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
+# endif
+
+# define _HRESULT_DEFINED
+typedef int HRESULT;
+#endif
+
+#define COBJMACROS
+#define INITGUID
+#include "vkd3d_test.h"
+#include "vkd3d_windows.h"
+#define WIDL_C_INLINE_WRAPPERS
+#include "vkd3d_d3d12.h"
+
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <time.h>
+
+#ifdef _WIN32
+# include "vkd3d_dxgi1_4.h"
+#else
+# include <pthread.h>
+# include "vkd3d_utils.h"
+#endif
+
+#include "d3d12_test_utils.h"
+
+#endif  /* __VKD3D_D3D12_CROSSTEST_H */
diff --git a/tests/d3d12_test_utils.h b/tests/d3d12_test_utils.h
index c2e7a3d..02c5a74 100644
--- a/tests/d3d12_test_utils.h
+++ b/tests/d3d12_test_utils.h
@@ -16,8 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#ifndef __VKD3D_D3D12_TEST_H
-#define __VKD3D_D3D12_TEST_H
+#ifndef __VKD3D_D3D12_TEST_UTILS_H
+#define __VKD3D_D3D12_TEST_UTILS_H
 
 #define wait_queue_idle(a, b) wait_queue_idle_(__LINE__, a, b)
 static void wait_queue_idle_(unsigned int line, ID3D12Device *device, ID3D12CommandQueue *queue);
@@ -769,4 +769,4 @@ static inline D3D12_GPU_DESCRIPTOR_HANDLE get_gpu_sampler_handle(struct test_con
     return get_gpu_handle(context->device, heap, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, offset);
 }
 
-#endif  /* __VKD3D_D3D12_TEST_H */
+#endif  /* __VKD3D_D3D12_TEST_UTILS_H */




More information about the wine-cvs mailing list