From 98465d401b6efdbf59d57a2c58bced253f9fb87f Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 22 Sep 2015 00:53:51 +0200 Subject: [PATCH] Silencing inadequate MSVC warnings when exporting as DLL (#345) --- imgui_internal.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/imgui_internal.h b/imgui_internal.h index b0e294266..22f7e8093 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -14,6 +14,11 @@ #include // FILE* #include // sqrtf() +#ifdef _MSC_VER +#pragma warning (push) +#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) +#endif + //----------------------------------------------------------------------------- // Forward Declarations //----------------------------------------------------------------------------- @@ -474,7 +479,7 @@ struct ImGuiState // Transient per-window data, reset at the beginning of the frame // FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiDrawContext is quite tenuous and could be reconsidered. -struct ImGuiDrawContext +struct IMGUI_API ImGuiDrawContext { ImVec2 CursorPos; ImVec2 CursorPosPrevLine; @@ -690,3 +695,6 @@ namespace ImGui } // namespace ImGuiP +#ifdef _MSC_VER +#pragma warning (pop) +#endif