From fbf2435f38725d2f9e38faf83cd72d2540af0b5d Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 29 Dec 2017 17:18:31 +0100 Subject: [PATCH] Exposed IM_OFFSETOF() helper in imgui.h --- imgui.h | 1 + imgui_internal.h | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.h b/imgui.h index f5ac95f89..a8dd3435b 100644 --- a/imgui.h +++ b/imgui.h @@ -39,6 +39,7 @@ #define IM_FMTLIST(FMT) #endif #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR))) +#define IM_OFFSETOF(_TYPE,_ELM) ((size_t)&(((_TYPE*)0)->_ELM)) #if defined(__clang__) #pragma clang diagnostic push diff --git a/imgui_internal.h b/imgui_internal.h index fc0ef6029..49e1e012b 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -77,8 +77,7 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit ImGui context pointe // Helpers //----------------------------------------------------------------------------- -#define IM_PI 3.14159265358979323846f -#define IM_OFFSETOF(_TYPE,_ELM) ((size_t)&(((_TYPE*)0)->_ELM)) +#define IM_PI 3.14159265358979323846f // Helpers: UTF-8 <> wchar IMGUI_API int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count