stub termcap, add extern "C"
authorYuanhui Zhang <asmwarrior@gmail.com>
Mon, 16 Mar 2015 11:28:24 +0000 (11:28 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 16 Mar 2015 11:36:00 +0000 (11:36 +0000)
Fixes linking an --enable-build-with-cxx build on mingw:

 ../readline/terminal.c:278: undefined reference to `tgetnum'
 ../readline/terminal.c:297: undefined reference to `tgetnum'
 ../readline/libreadline.a(terminal.o): In function `get_term_capabilities':
 ../readline/terminal.c:427: undefined reference to `tgetstr'
 ../readline/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
 [etc.]

gdb/ChangeLog:
2015-03-16  Yuanhui Zhang  <asmwarrior@gmail.com>
    Pedro Alves  <palves@redhat.com>

* gdb_curses.h (tgetnum): Mark with EXTERN_C.
* stub-termcap.c (tgetent, tgetnum, tgetflag, tgetstr, tputs)
(tgoto): Wrap with extern "C".

gdb/ChangeLog
gdb/gdb_curses.h
gdb/stub-termcap.c

index 54cb0b270fa2731e23e5ca11e67340b128e8df0f..eb8ef879a329596a5429324bac26e489121aaa86 100644 (file)
@@ -1,3 +1,10 @@
+2015-03-16  Yuanhui Zhang  <asmwarrior@gmail.com>
+           Pedro Alves  <palves@redhat.com>
+
+       * gdb_curses.h (tgetnum): Mark with EXTERN_C.
+       * stub-termcap.c (tgetent, tgetnum, tgetflag, tgetstr, tputs)
+       (tgoto): Wrap with extern "C".
+
 2015-03-16  Pedro Alves  <palves@redhat.com>
            Yuanhui Zhang  <asmwarrior@gmail.com>
 
index 9b3707ae6d170ba40f1efabeaf9fd20dfca98127..a89383f92ba1bf17eeb2645024d9b4484eccf471 100644 (file)
@@ -51,7 +51,7 @@
    of the termcap functions will be built from stub-termcap.c.  Readline
    provides its own extern declarations when there's no termcap.h; do the
    same here for the termcap functions used in GDB.  */
-extern int tgetnum (const char *);
+EXTERN_C int tgetnum (const char *);
 #endif
 
 /* SunOS's curses.h has a '#define reg register' in it.  Thank you Sun.  */
index cecb3fb23a454f8eb2b2850ea03682ac44507fad..5897d894237114def56ee7328a6e655084fbc2eb 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* -Wmissing-prototypes */
 extern int tgetent (char *buffer, char *termtype);
 extern int tgetnum (char *name);
@@ -32,6 +36,10 @@ extern char* tgetstr (char *name, char **area);
 extern int tputs (char *string, int nlines, int (*outfun) (int));
 extern char *tgoto (const char *cap, int col, int row);
 
+#ifdef __cplusplus
+}
+#endif
+
 /* Each of the files below is a minimal implementation of the standard
    termcap function with the same name, suitable for use in a Windows
    console window.  */
This page took 0.027015 seconds and 4 git commands to generate.