mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
__cdecl markup for non-standard calling conventions via MSVC
This commit is contained in:
parent
7cc1bc7635
commit
2c4a761982
10
imgui.cpp
10
imgui.cpp
@ -661,6 +661,12 @@
|
|||||||
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define IMGUI_CDECL __cdecl
|
||||||
|
#else
|
||||||
|
#define IMGUI_CDECL
|
||||||
|
#endif
|
||||||
|
|
||||||
// Clang warnings with -Weverything
|
// Clang warnings with -Weverything
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning : unknown warning group '-Wformat-pedantic *' // not all warnings are known by all clang versions.. so ignoring warnings triggers new warnings on some configuration. great!
|
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning : unknown warning group '-Wformat-pedantic *' // not all warnings are known by all clang versions.. so ignoring warnings triggers new warnings on some configuration. great!
|
||||||
@ -1504,7 +1510,7 @@ void ImGuiStorage::BuildSortByKey()
|
|||||||
{
|
{
|
||||||
struct StaticFunc
|
struct StaticFunc
|
||||||
{
|
{
|
||||||
static int PairCompareByID(const void* lhs, const void* rhs)
|
static int IMGUI_CDECL PairCompareByID(const void* lhs, const void* rhs)
|
||||||
{
|
{
|
||||||
// We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that.
|
// We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that.
|
||||||
if (((const Pair*)lhs)->key > ((const Pair*)rhs)->key) return +1;
|
if (((const Pair*)lhs)->key > ((const Pair*)rhs)->key) return +1;
|
||||||
@ -3793,7 +3799,7 @@ static void MarkIniSettingsDirty(ImGuiWindow* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Add a more explicit sort order in the window structure.
|
// FIXME: Add a more explicit sort order in the window structure.
|
||||||
static int ChildWindowComparer(const void* lhs, const void* rhs)
|
static int IMGUI_CDECL ChildWindowComparer(const void* lhs, const void* rhs)
|
||||||
{
|
{
|
||||||
const ImGuiWindow* a = *(const ImGuiWindow**)lhs;
|
const ImGuiWindow* a = *(const ImGuiWindow**)lhs;
|
||||||
const ImGuiWindow* b = *(const ImGuiWindow**)rhs;
|
const ImGuiWindow* b = *(const ImGuiWindow**)rhs;
|
||||||
|
@ -202,8 +202,10 @@ struct stbrp_context
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define STBRP__NOTUSED(v) (void)(v)
|
#define STBRP__NOTUSED(v) (void)(v)
|
||||||
|
#define STBRP__CDECL __cdecl
|
||||||
#else
|
#else
|
||||||
#define STBRP__NOTUSED(v) (void)sizeof(v)
|
#define STBRP__NOTUSED(v) (void)sizeof(v)
|
||||||
|
#define STBRP__CDECL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -509,7 +511,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rect_height_compare(const void *a, const void *b)
|
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||||
@ -531,7 +533,7 @@ static int rect_width_compare(const void *a, const void *b)
|
|||||||
return (p->h > q->h) ? -1 : (p->h < q->h);
|
return (p->h > q->h) ? -1 : (p->h < q->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rect_original_order(const void *a, const void *b)
|
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||||
|
Loading…
Reference in New Issue
Block a user