diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 775282052..aa75a5d29 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -50,6 +50,9 @@ #include #include +#include "mozilla-config.h" +#include "plvmx.h" + using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::unicode; @@ -2742,7 +2745,7 @@ inline static bool IsChar8Bit(char16_t aCh) { return aCh < 0x100; } inline static bool HasSpaces(const uint8_t *aString, uint32_t aLen) { - return memchr(aString, 0x20, aLen) != nullptr; + return VMX_MEMCHR(aString, 0x20, aLen) != nullptr; } inline static bool HasSpaces(const char16_t *aString, uint32_t aLen) diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index a7f85ddb5..349866f35 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -80,6 +80,9 @@ #include "GeckoProfiler.h" +#include "mozilla-config.h" +#include "plvmx.h" + #ifdef DEBUG #undef NOISY_REFLOW #undef NOISY_TRIM @@ -2891,7 +2894,7 @@ static int32_t FindChar(const nsTextFragment* frag, } else { if (uint16_t(ch) <= 0xFF) { const char* str = frag->Get1b() + aOffset; - const void* p = memchr(str, ch, aLength); + const void* p = VMX_MEMCHR(str, ch, aLength); if (p) return (static_cast(p) - str) + aOffset; } diff --git a/xpcom/string/nsCharTraits.h b/xpcom/string/nsCharTraits.h index d93e1f5dc..3775f10ec 100644 --- a/xpcom/string/nsCharTraits.h +++ b/xpcom/string/nsCharTraits.h @@ -12,6 +12,9 @@ #include "nscore.h" // for |char16_t| +#include "mozilla-config.h" +#include "plvmx.h" // for |vmx_memchr| (if implemented) + // This file may be used (through nsUTF8Utils.h) from non-XPCOM code, in // particular the standalone software updater. In that case stub out // the macros provided by nsDebug.h which are only usable when linking XPCOM @@ -501,8 +504,8 @@ struct nsCharTraits static const char_type* find(const char_type* aStr, size_t aN, char_type aChar) { - return reinterpret_cast(memchr(aStr, to_int_type(aChar), - aN)); + return reinterpret_cast(VMX_MEMCHR(aStr, to_int_type(aChar), + aN)); } };