mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1119776, Part 4: Avoid defining snprintf when MSVC provides it (MFBT), r=waldo
This commit is contained in:
parent
d871011af1
commit
7cc31e9b8e
@ -93,9 +93,6 @@ public:
|
||||
T* get() const { return mPtr; }
|
||||
|
||||
#ifdef MOZ_REFCOUNTED_LEAK_CHECKING
|
||||
#ifdef XP_WIN
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
const char* typeName() const
|
||||
{
|
||||
static char nameBuffer[1024];
|
||||
@ -106,15 +103,17 @@ public:
|
||||
MOZ_ASSERT(strlen(innerType) + sizeof("WeakReference<>") <
|
||||
ArrayLength(nameBuffer),
|
||||
"Exceedingly large type name");
|
||||
snprintf(nameBuffer, ArrayLength(nameBuffer), "WeakReference<%s>",
|
||||
innerType);
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
_snprintf
|
||||
#else
|
||||
::snprintf
|
||||
#endif
|
||||
(nameBuffer, ArrayLength(nameBuffer), "WeakReference<%s>", innerType);
|
||||
// This is usually not OK, but here we are returning a pointer to a static
|
||||
// buffer which will immediately be used by the caller.
|
||||
return nameBuffer;
|
||||
}
|
||||
|
||||
size_t typeSize() const { return sizeof(*this); }
|
||||
#undef snprintf
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user