Merge pull request #9 from ClassicNick/VC2015

Enable Visual C++ 2015 compatibility
This commit is contained in:
2025-04-04 17:27:31 +08:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
+4
View File
@@ -18,12 +18,15 @@
# include "mozilla/throw_msvc.h"
#endif
#if defined (_MSC_VER) && _MSC_VER <= 1800
// Code might include <new> before other wrapped headers, but <new>
// includes <exception> and so we want to wrap it. But mozalloc.h
// wants <new> also, so we break the cycle by always explicitly
// including <new> here.
#include <${NEW_HEADER_PATH}>
#endif
#if defined (_MSC_VER) && _MSC_VER <= 1800
// See if we're in code that can use mozalloc. NB: this duplicates
// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
// can't build with that being included before base/basictypes.h.
@@ -32,6 +35,7 @@
#else
# error "STL code can only be used with infallible ::operator new()"
#endif
#endif
#ifdef _DEBUG
// From
+4
View File
@@ -8,12 +8,14 @@
#ifndef mozilla_msvc_raise_wrappers_h
#define mozilla_msvc_raise_wrappers_h
#if defined (_MSC_VER) && _MSC_VER <= 1800
#ifdef _XSTDDEF_
# error "Unable to wrap _RAISE(); CRT _RAISE() already defined"
#endif
#ifdef _XUTILITY_
# error "Unable to wrap _X[exception](); CRT versions already declared"
#endif
#endif
#ifdef _FUNCTIONAL_
# error "Unable to wrap _Xbad_function_call(); CRT version already declared"
#endif
@@ -24,11 +26,13 @@
// We #define them to be named differently so we can ensure the exception
// throwing semantics of these functions work exactly the way we want, by
// defining our own versions in msvc_raise_wrappers.cpp.
#if defined (_MSC_VER) && _MSC_VER <= 1800
# define _Xinvalid_argument moz_Xinvalid_argument
# define _Xlength_error moz_Xlength_error
# define _Xout_of_range moz_Xout_of_range
# define _Xoverflow_error moz_Xoverflow_error
# define _Xruntime_error moz_Xruntime_error
#endif
// used by <functional>
# define _Xbad_function_call moz_Xbad_function_call
+2 -2
View File
@@ -505,7 +505,7 @@ struct MessageWindow {
::_snwprintf(classNameBuffer,
128, // size of classNameBuffer in PRUnichars
L"%s%s",
wwc(NS_ConvertUTF8toUTF16(gAppData->remotingName).get()),
static_cast<const wchar_t*>(NS_ConvertUTF8toUTF16(gAppData->remotingName).get()),
L"MessageWindow" );
mClassName = classNameBuffer;
}
@@ -668,7 +668,7 @@ nsNativeAppSupportWin::Start( bool *aResult ) {
::_snwprintf(reinterpret_cast<wchar_t*>(mMutexName),
sizeof mMutexName / sizeof(char16_t), L"%s%s%s",
MOZ_MUTEX_NAMESPACE,
wwc(NS_ConvertUTF8toUTF16(gAppData->name).get()),
static_cast<const wchar_t*>(NS_ConvertUTF8toUTF16(gAppData->name).get()),
MOZ_STARTUP_MUTEX_NAME );
Win32Mutex startupLock = Win32Mutex( mMutexName );