diff --git a/xpcom/build/BinaryPath.h b/xpcom/build/BinaryPath.h index 374763c79..b2285d994 100644 --- a/xpcom/build/BinaryPath.h +++ b/xpcom/build/BinaryPath.h @@ -15,6 +15,10 @@ #elif defined(XP_UNIX) #include #include + +#include "mozilla-config.h" +#include "plvmx.h" + #endif namespace mozilla { @@ -117,7 +121,7 @@ private: // PATH. Only do so if argv[0] looks like a path (contains a /). // 2) manually walk through the PATH and look for ourself // 3) give up - if (strchr(aArgv0, '/') && realpath(aArgv0, aResult) && + if (VMX_STRCHR(aArgv0, '/') && realpath(aArgv0, aResult) && stat(aResult, &fileStat) == 0) { return NS_OK; } diff --git a/xpcom/ds/Tokenizer.cpp b/xpcom/ds/Tokenizer.cpp index 81d6490e3..8d23a4b5b 100644 --- a/xpcom/ds/Tokenizer.cpp +++ b/xpcom/ds/Tokenizer.cpp @@ -8,6 +8,9 @@ #include "nsUnicharUtils.h" +#include "mozilla-config.h" +#include "plvmx.h" + namespace mozilla { static const char sWhitespaces[] = " \t"; @@ -264,7 +267,7 @@ Tokenizer::Parse(Token& aToken) const state = PARSE_CRLF; } else if (*next == '\n') { state = PARSE_LF; - } else if (strchr(mWhitespaces, *next)) { // not UTF-8 friendly? + } else if (VMX_STRCHR(mWhitespaces, *next)) { // not UTF-8 friendly? state = PARSE_WS; } else { state = PARSE_CHAR; @@ -339,7 +342,7 @@ Tokenizer::IsWordFirst(const char aInput) const return (ToLowerCase(static_cast(aInput)) != ToUpperCase(static_cast(aInput))) || '_' == aInput || - (mAdditionalWordChars ? !!strchr(mAdditionalWordChars, aInput) : false); + (mAdditionalWordChars ? !!VMX_STRCHR(mAdditionalWordChars, aInput) : false); } bool diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 3f6eb176a..473d91903 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -60,6 +60,9 @@ #include "prmem.h" #include "plbase64.h" +#include "mozilla-config.h" +#include "plvmx.h" + static nsresult MacErrorMapper(OSErr inErr); #endif @@ -334,7 +337,7 @@ nsLocalFile::CreateAllAncestors(uint32_t aPermissions) fprintf(stderr, "nsIFile: before: %s\n", buffer); #endif - while ((slashp = strchr(slashp + 1, '/'))) { + while ((slashp = VMX_STRCHR(slashp + 1, '/'))) { /* * Sequences of '/' are equivalent to a single '/'. */ diff --git a/xpcom/string/nsTSubstring.cpp b/xpcom/string/nsTSubstring.cpp index e0ef93df3..54d687b66 100644 --- a/xpcom/string/nsTSubstring.cpp +++ b/xpcom/string/nsTSubstring.cpp @@ -8,6 +8,9 @@ #include "mozilla/double-conversion.h" #include "mozilla/MemoryReporting.h" +#include "mozilla-config.h" +#include "plvmx.h" + using double_conversion::DoubleToStringConverter; #ifdef XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE @@ -938,7 +941,7 @@ FormatWithoutTrailingZeros(char (&aBuf)[40], double aDouble, } char* end = formattedDouble + length; - char* decimalPoint = strchr(aBuf, '.'); + char* decimalPoint = VMX_STRCHR(aBuf, '.'); // No trailing zeros to remove. if (!decimalPoint) { return length; diff --git a/xpcom/typelib/xpt/xpt_xdr.cpp b/xpcom/typelib/xpt/xpt_xdr.cpp index e2e36b3a7..173ff3b28 100644 --- a/xpcom/typelib/xpt/xpt_xdr.cpp +++ b/xpcom/typelib/xpt/xpt_xdr.cpp @@ -10,6 +10,9 @@ #include "nscore.h" #include /* strchr */ +#include "mozilla-config.h" +#include "plvmx.h" + static PRBool CheckForRepeat(XPTCursor *cursor, void **addrp, XPTPool pool, uint32_t len, XPTCursor *new_cursor, PRBool *already); @@ -407,7 +410,7 @@ XPT_DoCString(XPTArena *arena, XPTCursor *cursor, char **identp) my_cursor.state = cursor->state; start = &CURS_POINT(&my_cursor); - end = strchr(start, 0); /* find the end of the string */ + end = VMX_STRCHR(start, 0); /* find the end of the string */ if (!end) { fprintf(stderr, "didn't find end of string on decode!\n"); return PR_FALSE;