summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2020-04-19 14:12:33 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2020-04-19 14:12:33 +0000
commit9411aac0ac42665970975e0eb749f10a84806378 (patch)
tree6302cca920ce042d24458700f3fed75ccf35f6b4
parent5a42624cf52c8bfbcceae265455f10ad3884fca6 (diff)
downloadVirtualBox-svn-9411aac0ac42665970975e0eb749f10a84806378.tar.gz
Additions/3D: VC++ 14.1 adjustments and warnings. bugref:8489
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@83832 cfe28804-0f27-0410-a406-dd0f0b0b656f
-rw-r--r--src/VBox/Additions/3D/mesa/Makefile.kmk21
-rw-r--r--src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk8
-rw-r--r--src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c2
-rw-r--r--src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk7
-rw-r--r--src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxMpLogger.cpp2
-rw-r--r--src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxWddmUmHlp.h2
-rw-r--r--src/VBox/Additions/3D/win/include/VBoxGaDriver.h4
7 files changed, 40 insertions, 6 deletions
diff --git a/src/VBox/Additions/3D/mesa/Makefile.kmk b/src/VBox/Additions/3D/mesa/Makefile.kmk
index 4e63eb16a50..376325ed43b 100644
--- a/src/VBox/Additions/3D/mesa/Makefile.kmk
+++ b/src/VBox/Additions/3D/mesa/Makefile.kmk
@@ -92,11 +92,23 @@ TEMPLATE_VBoxMesa3DGuestR3Lib_CXXFLAGS = $(filter-out -WX,$(TEMPLATE_VBoxMe
# -wd4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
# -wd4805: '|=' : unsafe mix of type 'GLboolean' and type 'bool' in operation
# -wd4918: 'y' : invalid character in pragma optimization list
-VBOX_MESA3D_VCC_DISABLED_WARNINGS = \
+VBOX_MESA3D_VCC_DISABLED_WARNINGS := \
-wd4005 -wd4013 -wd4018 -wd4054 -wd4057 -wd4090 -wd4098 -wd4099 -wd4100 -wd4101 -wd4130 -wd4132 -wd4146 \
-wd4152 -wd4189 -wd4200 -wd4204 -wd4206 -wd4211 -wd4221 -wd4245 -wd4255 -wd4258 -wd4265 -wd4267 -wd4266 \
-wd4287 -wd4291 -wd4305 -wd4306 -wd4310 -wd4311 -wd4351 -wd4355 -wd4388 -wd4389 -wd4640 -wd4668 -wd4700 \
-wd4701 -wd4702 -wd4703 -wd4756 -wd4800 -wd4805 -wd4918
+if "$(VBOX_NEWER_VCC_TOOL_STEM)" >= "VCC141"
+# -wd4458: declaration of 'array' hides class member
+# -wd4477: 'fprintf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LONGLONG'
+# -wd4774: 'printf' : format string expected in argument 1 is not a string literal
+# -wd4456: declaration of 'pos_dst' hides previous local declaration
+# -wd4777: '_snprintf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 1 has type 'const DWORD'
+# -wd4459: declaration of 'stw_dev' hides global declaration
+# -wd4457: declaration of 'usage' hides function parameter
+VBOX_MESA3D_VCC_DISABLED_WARNINGS += \
+ -wd4458 -wd4477 -wd4774 -wd4456 -wd4777 -wd4459 -wd4457
+endif
+
TEMPLATE_VBoxMesa3DGuestR3Lib_CFLAGS.win += $(VBOX_MESA3D_VCC_DISABLED_WARNINGS)
TEMPLATE_VBoxMesa3DGuestR3Lib_CXXFLAGS.win += $(VBOX_MESA3D_VCC_DISABLED_WARNINGS)
endif
@@ -110,10 +122,17 @@ TEMPLATE_VBoxMesa3DGuestR3Lib_INCS = \
$(VBOX_MESA)/src/compiler/nir \
$(VBOX_MESA)/src/gallium/state_trackers/wgl \
$(TEMPLATE_VBoxMesa3DGuestR3Dll_INCS)
+ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
+TEMPLATE_VBoxMesa3DGuestR3Lib_DEFS = \
+ $(TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS) \
+ PACKAGE_VERSION="$(VBOX_MESA)" \
+ PACKAGE_BUGREPORT="$(VBOX_MESA)"
+else
TEMPLATE_VBoxMesa3DGuestR3Lib_DEFS = \
$(TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS) \
PACKAGE_VERSION=\"$(VBOX_MESA)\" \
PACKAGE_BUGREPORT=\"$(VBOX_MESA)\"
+endif
# For wgl, glapi and mesa
TEMPLATE_VBoxMesa3DGuestR3Lib_DEFS += \
MAPI_MODE_UTIL _GDI32_ BUILD_GL32 KHRONOS_DLL_EXPORTS GL_API=GLAPI GL_APIENTRY=GLAPIENTRY _GLAPI_NO_EXPORTS
diff --git a/src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk b/src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk
index ca5c83fba64..7fcf5ad0c4c 100644
--- a/src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk
+++ b/src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk
@@ -26,7 +26,13 @@ DLLS.amd64 += VBoxGL-x86
VBoxGL_TEMPLATE = VBoxMesa3DGuestR3DllMinVista
# -wd4005: '__useHeader' : redefinition
-VBoxGL_CFLAGS = -wd4005
+VBoxGL_CFLAGS := -wd4005
+if "$(VBOX_NEWER_VCC_TOOL_STEM)" >= "VCC141"
+# -wd4204: nonstandard extension used: non-constant aggregate initializer
+# -wd4459: stw_device.h(102): warning C4459: declaration of 'stw_dev' hides global declaration
+# -wd4668: c99_compat.h(99): warning C4668: '__STDC_VERSION__' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
+VBoxGL_CFLAGS += -wd4204 -wd4459 -wd4668
+endif
VBoxGL_INCS = \
$(VBOX_PATH_3D)/win/include \
$(VBOX_PATH_MESA)/include/GL \
diff --git a/src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c b/src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c
index 0be58f83388..de3cda1a427 100644
--- a/src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c
+++ b/src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c
@@ -271,7 +271,7 @@ wddm_shared_surface_open(struct pipe_screen *screen,
if (surface)
{
D3DKMT_HANDLE hDevice = GaDrvEnvKmtDeviceHandle(pEnv);
- NTSTATUS Status = vboxKmtOpenSharedSurface(hDevice, (D3DKMT_HANDLE)hSharedSurface, surface);
+ NTSTATUS Status = vboxKmtOpenSharedSurface(hDevice, (D3DKMT_HANDLE)(uintptr_t)hSharedSurface, surface);
if (Status != STATUS_SUCCESS)
{
free(surface);
diff --git a/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk b/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk
index 0b7e338a30c..a06cca43b08 100644
--- a/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk
+++ b/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk
@@ -25,7 +25,12 @@ DLLS.amd64 += VBoxICD-x86
VBoxICD_TEMPLATE = VBoxMesa3DGuestR3DllMinVista
# -wd4005: '__useHeader' : redefinition
-VBoxICD_CFLAGS = -wd4005
+VBoxICD_CFLAGS := -wd4005
+if "$(VBOX_NEWER_VCC_TOOL_STEM)" >= "VCC141"
+# -wd4255: 'PFND3DKMT_CHECKEXCLUSIVEOWNERSHIP': no function prototype given: converting '()' to '(void)'
+VBoxICD_CFLAGS += -wd4255
+endif
+
VBoxICD_INCS = \
$(VBOX_PATH_3D)/win/include \
$(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video \
diff --git a/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxMpLogger.cpp b/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxMpLogger.cpp
index baad9757a94..cec70d2fdfe 100644
--- a/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxMpLogger.cpp
+++ b/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxMpLogger.cpp
@@ -106,7 +106,7 @@ DECLCALLBACK(void) VBoxWddmUmLog(const char *pszString)
const int cbBuffer = sizeof(szBuffer);
char *pszBuffer = &szBuffer[0];
- int cbWritten = _snprintf(pszBuffer, cbBuffer, "['%s' 0x%x.0x%x]: ",
+ int cbWritten = _snprintf(pszBuffer, cbBuffer, "['%s' 0x%lx.0x%lx]: ",
vboxUmLogGetModuleName(), GetCurrentProcessId(), GetCurrentThreadId());
if (cbWritten < 0 || cbWritten >= cbBuffer)
{
diff --git a/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxWddmUmHlp.h b/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxWddmUmHlp.h
index 9ef9bffca8b..cb8a91c11f3 100644
--- a/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxWddmUmHlp.h
+++ b/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxWddmUmHlp.h
@@ -23,7 +23,7 @@
#include <iprt/win/d3d9.h>
#include <d3dumddi.h>
-#include <d3dkmthk.h>
+#include <iprt/win/d3dkmthk.h>
#include <iprt/asm.h>
#include <iprt/cdefs.h>
diff --git a/src/VBox/Additions/3D/win/include/VBoxGaDriver.h b/src/VBox/Additions/3D/win/include/VBoxGaDriver.h
index f8ca7c3f9a9..d523e9136c1 100644
--- a/src/VBox/Additions/3D/win/include/VBoxGaDriver.h
+++ b/src/VBox/Additions/3D/win/include/VBoxGaDriver.h
@@ -72,6 +72,10 @@ typedef struct WDDMGalliumDriverEnv
void *pvMap);
} WDDMGalliumDriverEnv;
+struct pipe_context;
+struct pipe_screen;
+struct pipe_resource;
+
typedef struct pipe_screen * WINAPI FNGaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv);
typedef FNGaDrvScreenCreate *PFNGaDrvScreenCreate;