summarylogtreecommitdiffstats
path: root/wxgtk-abicheck.patch
blob: eea4f7f6e53c6ec198714c3e2b720b54c08f5807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: Suppress error about mismatching C++ ABI version
 In practice, the differences between recent ABI versions don't seem to be
 incompatible since they apparently only affect obscure corner cases.  So
 suppress this error so we don't have to rebuild the entire wx world in one
 go.
Original Author: Olly Betts <olly@survex.com>
Forwarded: no
Last-Update: 2017-07-26

MOD for 3.1.6 by sL1pKn07 (2022-04-11)

diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp
index b450b33582..eecef3ac36 100644
--- a/src/common/appbase.cpp
+++ b/src/common/appbase.cpp
@@ -842,9 +842,30 @@ bool wxAppConsoleBase::CheckBuildOptions(const char *optionsSignature,
         wxString lib = wxString::FromAscii(WX_BUILD_OPTIONS_SIGNATURE);
         wxString prog = wxString::FromAscii(optionsSignature);
         wxString progName = wxString::FromAscii(componentName);
+        wxString msg;
 
-        wxLogFatalError(wxT("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
+        msg.Printf(wxT("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
                         lib, progName, prog);
+        int l_off = lib.Find("compiler with C++ ABI ");
+        int p_off = prog.Find("compiler with C++ ABI ");
+        if (l_off != wxNOT_FOUND && p_off != wxNOT_FOUND) {
+            int space;
+            space = lib.find(',', l_off + 22);
+            lib.erase(l_off, space - l_off);
+            space = prog.find(',', p_off + 22);
+            prog.erase(p_off, space - p_off);
+        if (lib == prog) {
+            // The only difference is the ABI version, which apparently only
+            // affect obscure cases.  We used to warn here, so at least
+            // there was an indication of what's up if there is a problem
+            // due to ABI incompatibilities, but wxLogWarning() can result
+            // in a pop up dialog with some applications, which is just too
+            // intrusive, so just quietly ignore instead.
+            //wxLogWarning(msg);
+            return false;
+        }
+    }
+    wxLogFatalError(msg);
 
         // normally wxLogFatalError doesn't return
         return false;