diff --git a/modules/juce_core/text/juce_NewLine.h b/modules/juce_core/text/juce_NewLine.h index de7af27d5d..d3e52b3a20 100644 --- a/modules/juce_core/text/juce_NewLine.h +++ b/modules/juce_core/text/juce_NewLine.h @@ -30,9 +30,11 @@ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. ============================================================================== -*/ - -namespace juce +*/ + +#pragma once + +namespace juce { //============================================================================== diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 8ac68ea1f1..6c854010ce 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -32,10 +32,14 @@ ============================================================================== */ +#include +#include "juce_NewLine.h" + namespace juce { - +#if defined(JUCE_BEGIN_IGNORE_WARNINGS_MSVC) JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4514 4996) +#endif NewLine newLine; @@ -324,7 +328,7 @@ String::String (const char* const t) any unicode string to a valid C++ string literal, creating ascii escape sequences that will work in any compiler. */ - jassert (t == nullptr || CharPointer_ASCII::isValidString (t, std::numeric_limits::max())); + jassert (t == nullptr || CharPointer_ASCII::isValidString (t, (std::numeric_limits::max)())); } String::String (const char* const t, const size_t maxChars) @@ -367,7 +371,7 @@ String::String (const char8_t* const t) : String (CharPointer_UTF8 (reinterpret_ /* If you get an assertion here, then you're trying to create a string using the standard C++ type for UTF-8 character representation, but the data consists of invalid UTF-8 characters! */ - jassert (t == nullptr || CharPointer_UTF8::isValidString (reinterpret_cast (t), std::numeric_limits::max())); + jassert (t == nullptr || CharPointer_UTF8::isValidString (reinterpret_cast (t), (std::numeric_limits::max)())); } String::String (const char8_t* t, size_t maxChars) : String (CharPointer_UTF8 (reinterpret_cast (t)), maxChars) @@ -2148,7 +2152,7 @@ String String::fromUTF8 (const char* const buffer, int bufferSizeBytes) if (bufferSizeBytes < 0) { - jassert (CharPointer_UTF8::isValidString (buffer, std::numeric_limits::max())); + jassert (CharPointer_UTF8::isValidString (buffer, (std::numeric_limits::max)())); return { CharPointer_UTF8 (buffer) }; } @@ -2197,7 +2201,7 @@ StringRef::StringRef (const char* stringLiteral) noexcept because there's no other way to represent these strings in a way that isn't dependent on the compiler, source code editor and platform. */ - jassert (CharPointer_ASCII::isValidString (stringLiteral, std::numeric_limits::max())); + jassert (CharPointer_ASCII::isValidString (stringLiteral, (std::numeric_limits::max)())); #endif }