]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix MinGW build with source-highlight
authorEli Zaretskii <eliz@gnu.org>
Tue, 12 Mar 2019 17:47:23 +0000 (19:47 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 12 Mar 2019 17:47:23 +0000 (19:47 +0200)
gdb/ChangeLog
2019-03-12  Eli Zaretskii  <eliz@gnu.org>

PR/24325
* source-cache.c: #undef open and close, to avoid unresolved
externals during linking.

gdb/ChangeLog
gdb/source-cache.c

index 8d72d38cea4bf7c2dbd3a49549e786bbb85da6a4..4e592a38f4034d6409a430f6773bdba63dacd682 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-12  Eli Zaretskii  <eliz@gnu.org>
+
+       PR/24325
+       * source-cache.c: #undef open and close, to avoid unresolved
+       externals during linking.
+
 2019-03-12  Tom Tromey  <tromey@adacore.com>
 
        * remote.c (magic_null_ptid, not_sent_ptid, any_thread_ptid): Now
index 097c8a3ae12e520fad4fb833be58405f84867f70..435de2ac6efab83e547230d8463a1bf0b72fce45 100644 (file)
 #include "cli/cli-style.h"
 
 #ifdef HAVE_SOURCE_HIGHLIGHT
+/* If Gnulib redirects 'open' and 'close' to its replacements
+   'rpl_open' and 'rpl_close' via cpp macros, including <fstream>
+   below with those macros in effect will cause unresolved externals
+   when GDB is linked.  Happens, e.g., in the MinGW build.  */
+#undef open
+#undef close
 #include <fstream>
 #include <sstream>
 #include <srchilite/sourcehighlight.h>