Bug 1329593 - Compiling with mingw-w64 is broken with conflict-with-previous-declaration errors. r=gcp, a=jcristau
authorDimi Lee <dlee@mozilla.com>
Thu, 12 Jan 2017 23:00:22 +0800
changeset 353633 40fcae3eee184f7338cf52d2c887f0261f093697
parent 353632 b998b3f693e1449df32e0855e92cb8973eeed493
child 353634 fd642e0cca778eb13702e616e36d9940217624f9
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp, jcristau
bugs1329593
milestone52.0a2
Bug 1329593 - Compiling with mingw-w64 is broken with conflict-with-previous-declaration errors. r=gcp, a=jcristau
toolkit/components/url-classifier/nsUrlClassifierDBService.h
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.h
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.h
@@ -20,16 +20,23 @@
 #include "nsICryptoHMAC.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/TimeStamp.h"
 
 #include "Entries.h"
 #include "LookupCache.h"
 
+// GCC < 6.1 workaround, see bug 1329593
+#if defined(XP_WIN) && defined(__MINGW32__)
+#define GCC_MANGLING_WORKAROUND __stdcall
+#else
+#define GCC_MANGLING_WORKAROUND
+#endif
+
 // The hash length for a domain key.
 #define DOMAIN_LENGTH 4
 
 // The hash length of a partial hash entry.
 #define PARTIAL_LENGTH 4
 
 // The hash length of a complete hash entry.
 #define COMPLETE_LENGTH 32
@@ -164,20 +171,20 @@ public:
 
   // Perform a blocking classifier lookup for a given url. Can be called on
   // either the main thread or the worker thread.
   nsresult DoLocalLookup(const nsACString& spec,
                          const nsACString& tables,
                          LookupResultArray* results);
 
   // Open the DB connection
-  nsresult OpenDb();
+  nsresult GCC_MANGLING_WORKAROUND OpenDb();
 
   // Provide a way to forcibly close the db connection.
-  nsresult CloseDb();
+  nsresult GCC_MANGLING_WORKAROUND CloseDb();
 
   nsresult CacheCompletions(CacheResultArray * aEntries);
   nsresult CacheMisses(PrefixArray * aEntries);
 
 private:
   // No subclassing
   ~nsUrlClassifierDBServiceWorker();