tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
authorBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2011 12:30:17 +0000 (13:30 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2011 12:30:17 +0000 (13:30 +0100)
* lib/termios.in.h: In C++ mode, on HP-UX, include <sys/termios.h> with
C linkage.
* doc/posix-functions/tcgetsid.texi: Mention the HP-UX 11.00 bug.

ChangeLog
doc/posix-functions/tcgetsid.texi
lib/termios.in.h

index 1ba0366..370d22f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-02  Bruno Haible  <bruno@clisp.org>
+
+       tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
+       * lib/termios.in.h: In C++ mode, on HP-UX, include <sys/termios.h> with
+       C linkage.
+       * doc/posix-functions/tcgetsid.texi: Mention the HP-UX 11.00 bug.
+
 2011-01-01  Ben Pfaff  <blp@cs.stanford.edu>
 
        Rename uc_is_grapheme_cluster_break() to uc_is_grapheme_break()
index 1bcc4d0..745b446 100644 (file)
@@ -14,6 +14,10 @@ MacOS X 10.3, FreeBSD 6.0, OpenBSD 4.5, Cygwin, mingw, Interix 3.5, BeOS.
 @item
 This function is not declared on some platforms:
 OSF/1 5.1.
+@item
+The declaration of this function in C++ compilation units has C++ linkage, not
+C linkage, on some platforms:
+HP-UX 11.00.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 6d4a2a7..cc749d0 100644 (file)
 #endif
 @PRAGMA_COLUMNS@
 
+/* On HP-UX 11.00, some of the function declarations in <sys/termio.h>,
+   included by <termios.h>, are not protected by extern "C".  Enforce
+   "C" linkage for these functions nevertheless.  */
+#if defined __hpux && defined __cplusplus
+# include <sys/types.h>
+# include <sys/ioctl.h>
+extern "C" {
+# include <sys/termio.h>
+}
+#endif
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_TERMIOS_H@
 # @INCLUDE_NEXT@ @NEXT_TERMIOS_H@