From 30d7f2ee66037a3c8120538674ebd937aa8fb005 Mon Sep 17 00:00:00 2001 From: Noel Date: Sat, 22 Oct 2022 23:18:34 -0700 Subject: [PATCH] fixing c standard lib includes --- include/blah_common.h | 1 + include/blah_string.h | 4 ++-- src/blah_common.cpp | 1 + src/blah_graphics.cpp | 1 + src/blah_stream.cpp | 1 + src/internal/blah_renderer_d3d11.cpp | 2 +- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/blah_common.h b/include/blah_common.h index 88b7125..8a13522 100644 --- a/include/blah_common.h +++ b/include/blah_common.h @@ -5,6 +5,7 @@ #include // for std::size_t #include // for abort #include // for string format methods +#include // for vsnprintf #include // for standard lib math functions used in blah_calc.h // Numeric Types diff --git a/include/blah_string.h b/include/blah_string.h index 55d27a0..395a731 100644 --- a/include/blah_string.h +++ b/include/blah_string.h @@ -17,13 +17,13 @@ namespace Blah char& operator[](int index) { - BLAH_ASSERT(index >= 0 && index < length(), "Index out of range"); + BLAH_ASSERT(index >= 0 && index < length() + 1, "Index out of range"); return s_ptr()[index]; } const char& operator[](int index) const { - BLAH_ASSERT(index >= 0 && index < length(), "Index out of range"); + BLAH_ASSERT(index >= 0 && index < length() + 1, "Index out of range"); return s_ptr()[index]; } diff --git a/src/blah_common.cpp b/src/blah_common.cpp index d3bc55c..a2396da 100644 --- a/src/blah_common.cpp +++ b/src/blah_common.cpp @@ -1,5 +1,6 @@ #include #include +#include // for vsnprintf using namespace Blah; diff --git a/src/blah_graphics.cpp b/src/blah_graphics.cpp index 437d87f..8eda5bb 100644 --- a/src/blah_graphics.cpp +++ b/src/blah_graphics.cpp @@ -1,6 +1,7 @@ #include #include #include "internal/blah_internal.h" +#include // for strcmp using namespace Blah; diff --git a/src/blah_stream.cpp b/src/blah_stream.cpp index 5efb744..db49398 100644 --- a/src/blah_stream.cpp +++ b/src/blah_stream.cpp @@ -1,5 +1,6 @@ #include #include +#include // for memcpy using namespace Blah; diff --git a/src/internal/blah_renderer_d3d11.cpp b/src/internal/blah_renderer_d3d11.cpp index 9521ffe..d6c7ac2 100644 --- a/src/internal/blah_renderer_d3d11.cpp +++ b/src/internal/blah_renderer_d3d11.cpp @@ -1650,7 +1650,7 @@ Blah::Renderer* Blah::Renderer::try_make_d3d11() #else // BLAH_RENDERER_D3D11 -#include "renderer.h" +#include "blah_renderer.h" Blah::Renderer* Blah::Renderer::try_make_d3d11() { return nullptr;