From f87deff0f35bd3a26103dd953d54c2d0a862767f Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 13 Nov 2015 17:08:54 +0100 Subject: [PATCH] Moving stdlib.h include outside of imgui.h (#405) --- examples/opengl3_example/main.cpp | 2 +- examples/opengl_example/main.cpp | 2 +- imgui.cpp | 1 + imgui.h | 1 - imgui_demo.cpp | 7 ++++--- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/opengl3_example/main.cpp b/examples/opengl3_example/main.cpp index 9ab12734..8d3135d9 100644 --- a/examples/opengl3_example/main.cpp +++ b/examples/opengl3_example/main.cpp @@ -16,7 +16,7 @@ int main(int, char**) // Setup window glfwSetErrorCallback(error_callback); if (!glfwInit()) - exit(1); + return 1; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); diff --git a/examples/opengl_example/main.cpp b/examples/opengl_example/main.cpp index 0f795ce1..01e9a679 100644 --- a/examples/opengl_example/main.cpp +++ b/examples/opengl_example/main.cpp @@ -15,7 +15,7 @@ int main(int, char**) // Setup window glfwSetErrorCallback(error_callback); if (!glfwInit()) - exit(1); + return 1; GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL2 example", NULL, NULL); glfwMakeContextCurrent(window); diff --git a/imgui.cpp b/imgui.cpp index 78514b18..0b4348fe 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -512,6 +512,7 @@ #include // toupper, isprint #include // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf +#include // NULL, malloc, free, qsort, atoi #include // vsnprintf, sscanf, printf #include // new (ptr) #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier diff --git a/imgui.h b/imgui.h index 4f3c414f..71cfdd3e 100644 --- a/imgui.h +++ b/imgui.h @@ -14,7 +14,6 @@ #include // FLT_MAX #include // va_list #include // ptrdiff_t, NULL -#include // NULL, malloc, free, qsort, atoi #include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp #define IMGUI_VERSION "1.47 WIP" diff --git a/imgui_demo.cpp b/imgui_demo.cpp index dc5b40a0..be675305 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -10,9 +10,10 @@ #endif #include "imgui.h" -#include // toupper, isprint -#include // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf -#include // vsnprintf, sscanf, printf +#include // toupper, isprint +#include // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf +#include // vsnprintf, sscanf, printf +#include // NULL, malloc, free, qsort, atoi #ifdef _MSC_VER #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen