[PATCH vkd3d 2/5] include: Move vkd3d_result to common header.

Józef Kucia joseph.kucia at gmail.com
Thu Nov 8 10:19:29 CST 2018


From: Józef Kucia <jkucia at codeweavers.com>

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 Makefile.am            |  1 +
 include/vkd3d.h        |  4 ++--
 include/vkd3d_shader.h | 16 ++-------------
 include/vkd3d_types.h  | 44 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 16 deletions(-)
 create mode 100644 include/vkd3d_types.h

diff --git a/Makefile.am b/Makefile.am
index 111671837b87..c2a20c6149c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,7 @@ vkd3d_public_headers = \
 	include/vkd3d_dxgibase.h \
 	include/vkd3d_dxgiformat.h \
 	include/vkd3d_shader.h \
+	include/vkd3d_types.h \
 	include/vkd3d_utils.h \
 	include/vkd3d_windows.h
 
diff --git a/include/vkd3d.h b/include/vkd3d.h
index de805420f67a..096530959843 100644
--- a/include/vkd3d.h
+++ b/include/vkd3d.h
@@ -19,6 +19,8 @@
 #ifndef __VKD3D_H
 #define __VKD3D_H
 
+#include <vkd3d_types.h>
+
 #ifndef VKD3D_NO_WIN32_TYPES
 # include "vkd3d_windows.h"
 # include "vkd3d_d3d12.h"
@@ -32,8 +34,6 @@
 extern "C" {
 #endif  /* __cplusplus */
 
-#define VKD3D_FORCE_32_BIT_ENUM(name) name##_FORCE_32BIT = 0x7fffffff
-
 enum vkd3d_structure_type
 {
     VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h
index f96e5055c7cb..20ed0fb29b9f 100644
--- a/include/vkd3d_shader.h
+++ b/include/vkd3d_shader.h
@@ -19,12 +19,12 @@
 #ifndef __VKD3D_SHADER_H
 #define __VKD3D_SHADER_H
 
+#include <vkd3d_types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif  /* __cplusplus */
 
-#define VKD3D_FORCE_32_BIT_ENUM(name) name##_FORCE_32BIT = 0x7fffffff
-
 enum vkd3d_shader_structure_type
 {
     VKD3D_SHADER_STRUCTURE_TYPE_SHADER_INTERFACE,
@@ -34,18 +34,6 @@ enum vkd3d_shader_structure_type
     VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_STRUCTURE_TYPE),
 };
 
-enum vkd3d_result
-{
-    VKD3D_OK = 0,
-    VKD3D_ERROR = -1, /* unspecified failure */
-    VKD3D_ERROR_OUT_OF_MEMORY = -2,
-    VKD3D_ERROR_INVALID_ARGUMENT = -3,
-    VKD3D_ERROR_INVALID_SHADER = -4,
-    VKD3D_ERROR_NOT_IMPLEMENTED = -5,
-
-    VKD3D_FORCE_32_BIT_ENUM(VKD3D_RESULT),
-};
-
 enum vkd3d_shader_compiler_option
 {
     VKD3D_SHADER_STRIP_DEBUG = 0x00000001,
diff --git a/include/vkd3d_types.h b/include/vkd3d_types.h
new file mode 100644
index 000000000000..34c667489911
--- /dev/null
+++ b/include/vkd3d_types.h
@@ -0,0 +1,44 @@
+/*
+ * 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_TYPES_H
+#define __VKD3D_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif  /* __cplusplus */
+
+#define VKD3D_FORCE_32_BIT_ENUM(name) name##_FORCE_32BIT = 0x7fffffff
+
+enum vkd3d_result
+{
+    VKD3D_OK = 0,
+    VKD3D_ERROR = -1, /* unspecified failure */
+    VKD3D_ERROR_OUT_OF_MEMORY = -2,
+    VKD3D_ERROR_INVALID_ARGUMENT = -3,
+    VKD3D_ERROR_INVALID_SHADER = -4,
+    VKD3D_ERROR_NOT_IMPLEMENTED = -5,
+
+    VKD3D_FORCE_32_BIT_ENUM(VKD3D_RESULT),
+};
+
+#ifdef __cplusplus
+}
+#endif  /* __cplusplus */
+
+#endif  /* __VKD3D_TYPES_H */
-- 
2.18.1




More information about the wine-devel mailing list