Bug 945216 - Fixed mozglue/ compilation on mingw. r=glandium
authorJacek Caban <jacek@codeweavers.com>
Tue, 17 Dec 2013 12:01:39 +0100
changeset 171019 0a33a6499fcca877e8e50abb4133fc81c4ac3854
parent 171018 81a5cd771bfe933a12d5b06ac6d348cd54f85b09
child 171020 bfeb49413f4ed78d52b958d30eb9b125ae5cf35b
push id5166
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:47:54 +0000
treeherdermozilla-aurora@977eb2548b2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs945216
milestone29.0a1
Bug 945216 - Fixed mozglue/ compilation on mingw. r=glandium
mozglue/build/Makefile.in
mozglue/build/WindowsDllBlocklist.cpp
--- a/mozglue/build/Makefile.in
+++ b/mozglue/build/Makefile.in
@@ -42,17 +42,17 @@ GARBAGE += mozglue.def
 
 ifneq (,$(filter -DEFAULTLIB:mozcrt,$(MOZ_GLUE_LDFLAGS)))
 # Don't install the import library if we use mozcrt
 NO_INSTALL_IMPORT_LIBRARY = 1
 endif
 
 
 EXTRA_DSO_LDOPTS += \
-	version.lib \
+	$(call EXPAND_LIBNAME,version) \
 	$(NULL)
 
 STL_FLAGS=
 
 endif
 
 ifeq (Darwin_1,$(OS_TARGET)_$(MOZ_REPLACE_MALLOC))
 EXTRA_DSO_LDOPTS += \
--- a/mozglue/build/WindowsDllBlocklist.cpp
+++ b/mozglue/build/WindowsDllBlocklist.cpp
@@ -158,17 +158,17 @@ static const char kUser32BeforeBlocklist
 static const int kUser32BeforeBlocklistParameterLen =
   sizeof(kUser32BeforeBlocklistParameter) - 1;
 
 static DWORD sThreadLoadingXPCOMModule;
 static bool sBlocklistInitFailed;
 static bool sUser32BeforeBlocklist;
 
 // Duplicated from xpcom glue. Ideally this should be shared.
-static void
+void
 printf_stderr(const char *fmt, ...)
 {
   if (IsDebuggerPresent()) {
     char buf[2048];
     va_list args;
     va_start(args, fmt);
     vsnprintf(buf, sizeof(buf), fmt, args);
     buf[sizeof(buf) - 1] = '\0';
@@ -363,17 +363,17 @@ DllBlockSet::Add(const char* name, unsig
 void
 DllBlockSet::Write(HANDLE file)
 {
   AutoCriticalSection lock(&sLock);
   DWORD nBytes;
 
   // Because this method is called after a crash occurs, and uses heap memory,
   // protect this entire block with a structured exception handler.
-  __try {
+  MOZ_SEH_TRY {
     for (DllBlockSet* b = gFirst; b; b = b->mNext) {
       // write name[,v.v.v.v];
       WriteFile(file, b->mName, strlen(b->mName), &nBytes, nullptr);
       if (b->mVersion != -1) {
         WriteFile(file, ",", 1, &nBytes, nullptr);
         uint16_t parts[4];
         parts[0] = b->mVersion >> 48;
         parts[1] = (b->mVersion >> 32) & 0xFFFF;
@@ -386,17 +386,17 @@ DllBlockSet::Write(HANDLE file)
           if (p != 3) {
             WriteFile(file, ".", 1, &nBytes, nullptr);
           }
         }
       }
       WriteFile(file, ";", 1, &nBytes, nullptr);
     }
   }
-  __except (EXCEPTION_EXECUTE_HANDLER) { }
+  MOZ_SEH_EXCEPT (EXCEPTION_EXECUTE_HANDLER) { }
 }
 
 static
 wchar_t* getFullPath (PWCHAR filePath, wchar_t* fname)
 {
   // In Windows 8, the first parameter seems to be used for more than just the
   // path name.  For example, its numerical value can be 1.  Passing a non-valid
   // pointer to SearchPathW will cause a crash, so we need to check to see if we