Skip to content

Commit 2199194

Browse files
committed
Add macOS supported
1 parent 86f00ab commit 2199194

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

unixExample/backends/ImGuiNotify.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ namespace ImGui
527527
#ifdef _WIN32
528528
sprintf_s(windowName, "##TOAST%d", (int)i);
529529
#elif defined(__linux__) || defined(__EMSCRIPTEN__)
530-
sprintf(windowName, "##TOAST%d", (int)i);
530+
std::sprintf(windowName, "##TOAST%d", (int)i);
531+
#elif defined (__APPLE__)
532+
std::snprintf(windowName, 50, "##TOAST%d", (int)i);
531533
#else
532534
throw "Unsupported platform";
533535
#endif

win32Example/backends/ImGuiNotify.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ namespace ImGui
527527
#ifdef _WIN32
528528
sprintf_s(windowName, "##TOAST%d", (int)i);
529529
#elif defined(__linux__) || defined(__EMSCRIPTEN__)
530-
sprintf(windowName, "##TOAST%d", (int)i);
530+
std::sprintf(windowName, "##TOAST%d", (int)i);
531+
#elif defined (__APPLE__)
532+
std::snprintf(windowName, 50, "##TOAST%d", (int)i);
531533
#else
532534
throw "Unsupported platform";
533535
#endif

0 commit comments

Comments
 (0)