This code seems to be omitted from the C API:
#ifndef GImGui
extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
#endif
I ran into it while trying to implement editable selectable from here: ocornut/imgui#2718 (comment)
I'm not sure if that would require some cast magic to work. I guess a getter function could work too.
This works as workaround:
ImGuiWindow* win = ImGui_GetCurrentWindow();
ImGuiContext* g = win->Ctx;