From 351c409317242857937b16a6d461b59ec6e690e0 Mon Sep 17 00:00:00 2001 From: Phil Christensen <> Date: Mon, 6 Feb 2017 10:44:25 +0100 Subject: C++ conformance fixes (MSVC /permissive-) We (the Microsoft C++ team) use the Blender project as part of our "Real world code" tests. I noticed a place in WIN32 specific code (dvpapi.cpp:85) where a string literal is losing its const-ness when being passed to BLI_dynlib_open(). This is not permitted when using the /permissive- conformance compiler switch (see our blog https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/) My suggested fix is to add const and propagate it where needed. Another possible fix would be to explicitly cast away the const. Reviewers: mont29, sergey, LazyDodo Subscribers: Blendify, sergey, mont29, LazyDodo Tags: #platform:_windows Differential Revision: https://developer.blender.org/D2495 --- source/blender/blenlib/intern/dynlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/intern/dynlib.c') diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c index b47c2ee60a6..51b91fb360f 100644 --- a/source/blender/blenlib/intern/dynlib.c +++ b/source/blender/blenlib/intern/dynlib.c @@ -50,7 +50,7 @@ struct DynamicLibrary { #include "utf_winfunc.h" #include "utfconv.h" -DynamicLibrary *BLI_dynlib_open(char *name) +DynamicLibrary *BLI_dynlib_open(const char *name) { DynamicLibrary *lib; void *handle; @@ -106,7 +106,7 @@ void BLI_dynlib_close(DynamicLibrary *lib) #include -DynamicLibrary *BLI_dynlib_open(char *name) +DynamicLibrary *BLI_dynlib_open(const char *name) { DynamicLibrary *lib; void *handle = dlopen(name, RTLD_LAZY); -- cgit v1.2.3