summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-01 05:47:20 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-01 05:47:20 +0000
commit74b36562c33e22c776deb43412890eb13c23064d (patch)
tree3b2a132932c7507b3015e25cfed307df6d200eca /include
parent3d5f43a06dd26a3ece3abb10b620b9d090d4a2d8 (diff)
downloadppe42-gcc-74b36562c33e22c776deb43412890eb13c23064d.tar.gz
ppe42-gcc-74b36562c33e22c776deb43412890eb13c23064d.zip
* ansidecl.h: Add extern "C" when compiling with C++. Treat C++
the way we treat an ISO C compiler. Don't define inline as a macdro when compiling with C++. * dyn-string.h: Add header guard DYN_STRING_H. Add extern "C" when compiling with C++. * fibheap.h: Add extern "C" when compiling with C++. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog9
-rw-r--r--include/ansidecl.h15
-rw-r--r--include/dyn-string.h15
-rw-r--r--include/fibheap.h11
4 files changed, 45 insertions, 5 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index a6cf609fe19..273b59c2a18 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-31 Ian Lance Taylor <iant@google.com>
+
+ * ansidecl.h: Add extern "C" when compiling with C++. Treat C++
+ the way we treat an ISO C compiler. Don't define inline as a
+ macdro when compiling with C++.
+ * dyn-string.h: Add header guard DYN_STRING_H. Add extern "C"
+ when compiling with C++.
+ * fibheap.h: Add extern "C" when compiling with C++.
+
2009-04-22 Taras Glek <tglek@mozilla.com>
* hashtab.h: Update GTY annotations to new syntax.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index c19955a98a6..c83b8c039d9 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -1,5 +1,6 @@
/* ANSI and traditional C compatability macros
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004, 2005, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -114,6 +115,10 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef _ANSIDECL_H
#define _ANSIDECL_H 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Every source file includes this file,
so they will all get the switch for lint. */
/* LINTLIBRARY */
@@ -136,7 +141,7 @@ So instead we use the macro below and test it against specific values. */
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif /* GCC_VERSION */
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))
+#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
@@ -173,7 +178,7 @@ So instead we use the macro below and test it against specific values. */
/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
it too, but it's not in C89. */
#undef inline
-#if __STDC_VERSION__ > 199901L
+#if __STDC_VERSION__ > 199901L || defined(__cplusplus)
/* it's a keyword */
#else
# if GCC_VERSION >= 2007
@@ -390,4 +395,8 @@ So instead we use the macro below and test it against specific values. */
#define __extension__
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ansidecl.h */
diff --git a/include/dyn-string.h b/include/dyn-string.h
index 44e33deba3a..2b147271e5f 100644
--- a/include/dyn-string.h
+++ b/include/dyn-string.h
@@ -1,5 +1,6 @@
/* An abstract string datatype.
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005, 2009
+ Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GCC.
@@ -19,6 +20,12 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1301, USA. */
+#ifndef DYN_STRING_H
+#define DYN_STRING_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef struct dyn_string
{
@@ -58,3 +65,9 @@ extern int dyn_string_append_cstr (dyn_string_t, const char *);
extern int dyn_string_append_char (dyn_string_t, int);
extern int dyn_string_substring (dyn_string_t, dyn_string_t, int, int);
extern int dyn_string_eq (dyn_string_t, dyn_string_t);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined (DYN_STRING_H) */
diff --git a/include/fibheap.h b/include/fibheap.h
index 348c4ae2638..a3d09dd9db8 100644
--- a/include/fibheap.h
+++ b/include/fibheap.h
@@ -1,5 +1,6 @@
/* A Fibonacci heap datatype.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009
+ Free Software Foundation, Inc.
Contributed by Daniel Berlin (dan@cgsoftware.com).
This file is part of GCC.
@@ -42,6 +43,10 @@ Boston, MA 02110-1301, USA. */
#include "ansidecl.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef long fibheapkey_t;
typedef struct fibheap
@@ -83,4 +88,8 @@ extern void *fibheap_delete_node (fibheap_t, fibnode_t);
extern void fibheap_delete (fibheap_t);
extern fibheap_t fibheap_union (fibheap_t, fibheap_t);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FIBHEAP_H_ */
OpenPOWER on IntegriCloud