Skip to content

Commit

Permalink
Bug 1119068 - Clean up some code used for older unsupported MSVC vers…
Browse files Browse the repository at this point in the history
…ions; r=bsmedberg
  • Loading branch information
ehsan committed Jan 13, 2015
1 parent ebc5bb1 commit d6d5481
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 60 deletions.
12 changes: 3 additions & 9 deletions gfx/ycbcr/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,9 @@ if CONFIG['INTEL_ARCHITECTURE']:

if CONFIG['_MSC_VER']:
if CONFIG['OS_TEST'] == 'x86_64':
if CONFIG['_MSC_VER'] == '1400':
# VC8 doesn't support some SSE2 built-in functions
SOURCES += [
'yuv_row_win.cpp',
]
else:
SOURCES += [
'yuv_row_win64.cpp',
]
SOURCES += [
'yuv_row_win64.cpp',
]
else:
SOURCES += [
'yuv_row_win.cpp',
Expand Down
24 changes: 1 addition & 23 deletions ipc/app/sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,11 @@ static const PRUint32 H256[8] = {
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
};

#if (_MSC_VER >= 1300)
#if defined(_MSC_VER)
#include <stdlib.h>
#pragma intrinsic(_byteswap_ulong)
#define SHA_HTONL(x) _byteswap_ulong(x)
#define BYTESWAP4(x) x = SHA_HTONL(x)
#elif defined(_MSC_VER) && defined(NSS_X86_OR_X64)
#ifndef FORCEINLINE
#if (_MSC_VER >= 1200)
#define FORCEINLINE __forceinline
#else
#define FORCEINLINE __inline
#endif
#endif
#define FASTCALL __fastcall

static FORCEINLINE PRUint32 FASTCALL
swap4b(PRUint32 dwd)
{
__asm {
mov eax,dwd
bswap eax
}
}

#define SHA_HTONL(x) swap4b(x)
#define BYTESWAP4(x) x = SHA_HTONL(x)

#elif defined(__GNUC__) && defined(NSS_X86_OR_X64)
static __inline__ PRUint32 swap4b(PRUint32 value)
{
Expand Down
19 changes: 4 additions & 15 deletions toolkit/crashreporter/client/crashreporter_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,19 +1439,13 @@ ifstream* UIOpenRead(const string& filename)
{
// adapted from breakpad's src/common/windows/http_upload.cc

// The "open" method on pre-MSVC8 ifstream implementations doesn't accept a
// wchar_t* filename, so use _wfopen directly in that case. For VC8 and
// later, _wfopen has been deprecated in favor of _wfopen_s, which does
// not exist in earlier versions, so let the ifstream open the file itself.
#if _MSC_VER >= 1400 // MSVC 2005/8
#if defined(_MSC_VER)
ifstream* file = new ifstream();
file->open(UTF8ToWide(filename).c_str(), ios::in);
#elif defined(_MSC_VER)
ifstream* file = new ifstream(_wfopen(UTF8ToWide(filename).c_str(), L"r"));
#else // GCC
ifstream* file = new ifstream(WideToMBCP(UTF8ToWide(filename), CP_ACP).c_str(),
ios::in);
#endif // _MSC_VER >= 1400
#endif // _MSC_VER

return file;
}
Expand All @@ -1469,18 +1463,13 @@ ofstream* UIOpenWrite(const string& filename,
mode = mode | ios::binary;
}

// For VC8 and later, _wfopen has been deprecated in favor of _wfopen_s,
// which does not exist in earlier versions, so let the ifstream open the
// file itself.
#if _MSC_VER >= 1400 // MSVC 2005/8
#if defined(_MSC_VER)
ofstream* file = new ofstream();
file->open(UTF8ToWide(filename).c_str(), mode);
#elif defined(_MSC_VER)
#error "Compiling with your version of MSVC is no longer supported."
#else // GCC
ofstream* file = new ofstream(WideToMBCP(UTF8ToWide(filename), CP_ACP).c_str(),
mode);
#endif // _MSC_VER >= 1400
#endif // _MSC_VER

return file;
}
Expand Down
8 changes: 0 additions & 8 deletions toolkit/mozapps/installer/upload-files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ JSSHELL_BINS = \
$(DIST)/bin/$(DLL_PREFIX)mozglue$(DLL_SUFFIX) \
$(NULL)
ifndef MOZ_NATIVE_NSPR
ifeq ($(_MSC_VER),1600)
JSSHELL_BINS += $(DIST)/bin/msvcr100.dll
JSSHELL_BINS += $(DIST)/bin/msvcp100.dll
endif
ifeq ($(_MSC_VER),1700)
JSSHELL_BINS += $(DIST)/bin/msvcr110.dll
JSSHELL_BINS += $(DIST)/bin/msvcp110.dll
endif
ifeq ($(_MSC_VER),1800)
JSSHELL_BINS += $(DIST)/bin/msvcr120.dll
JSSHELL_BINS += $(DIST)/bin/msvcp120.dll
Expand Down
6 changes: 1 addition & 5 deletions toolkit/xre/WindowsCrtPatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ Init()
MOZ_ASSERT(!GetModuleHandleA("msvcr120.dll"));
MOZ_ASSERT(!GetModuleHandleA("msvcr120d.dll"));

// Temporary until we fully switch over to VS 2013:
MOZ_ASSERT(!GetModuleHandleA("msvcr100.dll"));
MOZ_ASSERT(!GetModuleHandleA("msvcr100d.dll"));

#if defined(_M_IX86) && defined(_MSC_VER) && _MSC_VER >= 1800
#if defined(_M_IX86) && defined(_MSC_VER)
if (!mozilla::IsXPSP3OrLater()) {
NtdllIntercept.Init("ntdll.dll");
NtdllIntercept.AddHook("RtlImageNtHeader",
Expand Down

0 comments on commit d6d5481

Please sign in to comment.