浏览代码

win-capture: Fix VS2015 update 2 compiler error

Having volatile variables inside of a union causes a C1001 compiler
error in visual studio 2015 update 2.

Closes jp9000/obs-studio#544
jp9000 9 年之前
父节点
当前提交
6ca3cd3504
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      plugins/win-capture/graphics-hook/d3d9-capture.cpp

+ 2 - 1
plugins/win-capture/graphics-hook/d3d9-capture.cpp

@@ -36,6 +36,8 @@ struct d3d9_data {
 	bool                   using_shtex : 1;
 	bool                   using_shtex : 1;
 	bool                   using_scale : 1;
 	bool                   using_scale : 1;
 
 
+	volatile bool          issued_queries[NUM_BUFFERS];
+
 	union {
 	union {
 		/* shared texture */
 		/* shared texture */
 		struct {
 		struct {
@@ -53,7 +55,6 @@ struct d3d9_data {
 			IDirect3DSurface9      *render_targets[NUM_BUFFERS];
 			IDirect3DSurface9      *render_targets[NUM_BUFFERS];
 			IDirect3DQuery9        *queries[NUM_BUFFERS];
 			IDirect3DQuery9        *queries[NUM_BUFFERS];
 			struct shmem_data      *shmem_info;
 			struct shmem_data      *shmem_info;
-			volatile bool          issued_queries[NUM_BUFFERS];
 			bool                   texture_mapped[NUM_BUFFERS];
 			bool                   texture_mapped[NUM_BUFFERS];
 			uint32_t               pitch;
 			uint32_t               pitch;
 			int                    cur_tex;
 			int                    cur_tex;