Bug 1119068 - Clean up some code used for older unsupported MSVC versions; r=bsmedberg
☠☠ backed out by c47d9b79f2e5 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 07 Jan 2015 12:16:14 -0500
changeset 223431 671a52fff391a9fb805e3a05e7e337d89e8142d5
parent 223430 c034dba7a4175196c0dcaeb466751f7ee31b7d51
child 223432 e891f69a7edcba068cd40d71de30001e9e3a86b6
push id28095
push usercbook@mozilla.com
push dateTue, 13 Jan 2015 13:24:48 +0000
treeherdermozilla-central@a5700bec72e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1119068
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1119068 - Clean up some code used for older unsupported MSVC versions; r=bsmedberg
gfx/ycbcr/moz.build
ipc/app/sha256.c
toolkit/crashreporter/client/crashreporter_win.cpp
toolkit/mozapps/installer/upload-files.mk
toolkit/xre/WindowsCrtPatch.h
--- a/gfx/ycbcr/moz.build
+++ b/gfx/ycbcr/moz.build
@@ -33,25 +33,19 @@ if CONFIG['INTEL_ARCHITECTURE']:
                 'yuv_convert_mmx.cpp',
             ]
     else:
         SOURCES += ['yuv_convert_mmx.cpp']
         SOURCES['yuv_convert_mmx.cpp'].flags += CONFIG['MMX_FLAGS']
 
 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',
         ]
 elif CONFIG['OS_ARCH'] in ('Linux', 'SunOS', 'Darwin', 'DragonFly',
                            'FreeBSD', 'NetBSD', 'OpenBSD'):
     SOURCES += [
         'yuv_row_posix.cpp',
--- a/ipc/app/sha256.c
+++ b/ipc/app/sha256.c
@@ -63,43 +63,21 @@ static const PRUint32 K256[64] = {
 };
 
 /* SHA-256 initial hash values */
 static const PRUint32 H256[8] = {
     0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 
     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)
 {
     __asm__("bswap %0" : "+r" (value));
     return (value);
 }
 #define SHA_HTONL(x) swap4b(x)
 #define BYTESWAP4(x)  x = SHA_HTONL(x)
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ b/toolkit/crashreporter/client/crashreporter_win.cpp
@@ -1434,29 +1434,23 @@ bool UIDeleteFile(const string& oldfile)
 {
   return DeleteFile(UTF8ToWide(oldfile).c_str()) == TRUE;
 }
 
 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;
 }
 
 ofstream* UIOpenWrite(const string& filename,
                       bool append, // append=false
                       bool binary) // binary=false
 {
@@ -1464,28 +1458,23 @@ ofstream* UIOpenWrite(const string& file
   std::ios_base::openmode mode = ios::out;
   if (append) {
     mode = mode | ios::app;
   }
   if (binary) {
     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;
 }
 
 struct FileData
 {
   FILETIME timestamp;
   wstring path;
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -61,24 +61,16 @@ endif
 
 # JavaScript Shell packaging
 ifndef LIBXUL_SDK
 JSSHELL_BINS  = \
   $(DIST)/bin/js$(BIN_SUFFIX) \
   $(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
 endif
 ifdef MOZ_FOLD_LIBS
 JSSHELL_BINS += $(DIST)/bin/$(DLL_PREFIX)nss3$(DLL_SUFFIX)
 else
 JSSHELL_BINS += \
--- a/toolkit/xre/WindowsCrtPatch.h
+++ b/toolkit/xre/WindowsCrtPatch.h
@@ -122,21 +122,17 @@ Init()
   // catch breakage faster.
   //
   // If these assertions fail, see the comment at the top of this file for
   // possible causes. Any changes to the lines below MUST be tested on XP SP2!
   MOZ_ASSERT(!GetModuleHandleA("mozglue.dll"));
   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",
                            reinterpret_cast<intptr_t>(patched_RtlImageNtHeader),
                            reinterpret_cast<void**>(&stub_RtlImageNtHeader));
   }
 #endif
 }