From 48ed0a10d7a8ce661a9f776dfbd50fc7d7f9d633 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 9 Aug 2015 10:54:28 -0600 Subject: [PATCH] Minor code compaction (following #296) --- imgui.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 779fb584..feedf58c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8706,19 +8706,19 @@ void ImGui::Color(const char* prefix, unsigned int v) // PLATFORM DEPENDANT HELPERS //----------------------------------------------------------------------------- -#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS) - -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN +#if defined(_WIN32) && !defined(_WINDOWS_) && (!defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS) || !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS)) +#undef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN -#endif #include #endif + +// Win32 API clipboard implementation +#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS) + #ifdef _MSC_VER #pragma comment(lib, "user32") #endif -// Win32 API clipboard implementation static const char* GetClipboardTextFn_DefaultImpl() { static char* buf_local = NULL; @@ -8743,7 +8743,6 @@ static const char* GetClipboardTextFn_DefaultImpl() return buf_local; } -// Win32 API clipboard implementation static void SetClipboardTextFn_DefaultImpl(const char* text) { if (!OpenClipboard(NULL)) @@ -8786,14 +8785,9 @@ static void SetClipboardTextFn_DefaultImpl(const char* text) #endif +// Win32 API IME support (for Asian languages, etc.) #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS) -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif #include #ifdef _MSC_VER #pragma comment(lib, "imm32")