diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index e347b710b..80e3a3a2c 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -90,7 +90,26 @@ if(WIN32) # We only support the Unicode API UNICODE _UNICODE) - target_compile_definitions(laf-base PRIVATE _CRT_SECURE_NO_WARNINGS) + if(MSVC) + target_compile_options(laf-base PUBLIC + # Disable warnings about possible loss of data + -wd4244 + + # Disable warnings about conversion from size_t to int + -wd4267 + + # Disable warning about using 'this' used in base member initializer list + -wd4355 + + # Disable function not inlined (generated by MSVC header files) + -wd4710 + + # Avoid warnings about usage of insecure standard C library + # functions and C++ STL functions + -D_CRT_SECURE_NO_WARNINGS + -D_SCL_SECURE_NO_WARNINGS) + endif() + target_link_libraries(laf-base dbghelp shlwapi version) else() if(APPLE) diff --git a/gfx/path_skia.h b/gfx/path_skia.h index 1914b7b36..f96d00851 100644 --- a/gfx/path_skia.h +++ b/gfx/path_skia.h @@ -14,11 +14,6 @@ #include "include/core/SkPath.h" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) // 'argument': conversion from 'T' to 'SkScalar', possible loss of data -#endif - namespace gfx { // Simple wrapper for SkPath @@ -119,8 +114,4 @@ namespace gfx { } // namespace gfx -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #endif diff --git a/os/skia/skia_system.h b/os/skia/skia_system.h index fae6d54c3..f310ef3f2 100644 --- a/os/skia/skia_system.h +++ b/os/skia/skia_system.h @@ -66,8 +66,8 @@ class SkiaSystem final : public SkiaSystemBase { } void setTabletOptions(const TabletOptions& options) override { -#if LAF_WINDOWS SkiaSystemBase::setTabletOptions(options); +#if LAF_WINDOWS if (SkiaWindow* window = dynamic_cast(defaultWindow())) { // TODO notify all windows window->onTabletOptionsChange(); diff --git a/os/win/dnd.cpp b/os/win/dnd.cpp index c17cfbb89..b0599681a 100644 --- a/os/win/dnd.cpp +++ b/os/win/dnd.cpp @@ -273,7 +273,6 @@ bool DragDataProviderWin::contains(DragDataItemType type) UINT urlFormat = RegisterClipboardFormat(CFSTR_INETURL); UINT pngFormat = RegisterClipboardFormat(L"PNG"); UINT fileDescriptorFormat = RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR); - char name[101]; FORMATETC fmt; while (formats->Next(1, &fmt, nullptr) == S_OK) { switch (fmt.cfFormat) {