]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
prefix.h: Wrap up in extern "C" block.
authorLaurent GUERBY <laurent@guerby.net>
Tue, 12 Jul 2011 17:23:04 +0000 (17:23 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 12 Jul 2011 17:23:04 +0000 (17:23 +0000)
* prefix.h: Wrap up in extern "C" block.
ada/
* adadecode.c: Wrap up in extern "C" block.
* adadecode.h: Likewise.
* adaint.c: Likewise.  Remove 'const' keyword.
* adaint.h: Likewise.
* argv.c: Likewise.
* atree.h: Likewise.
* cio.c: Likewise.
* cstreams.c: Likewise.
* env.c: Likewise.
* exit.c: Likewise.
* fe.h: Likewise.
* final.c: Likewise.
* init.c: Likewise.
* initialize.c: Likewise.
* link.c: Likewise.
* namet.h: Likewise.
* nlists.h: Likewise.
* raise.c: Likewise.
* raise.h: Likewise.
* repinfo.h: Likewise.
* seh_init.c: Likewise.
* targext.c: Likewise.
* tracebak.c: Likewise.
* uintp.h: Likewise.
* urealp.h: Likewise.
* xeinfo.adb: Wrap up generated C code in extern "C" block.
* xsinfo.adb: Likewise.
* xsnamest.adb: Likewise.
* gcc-interface/gadaint.h: Wrap up in extern "C" block.
* gcc-interface/gigi.h: Wrap up some prototypes in extern "C" block.
* gcc-interface/misc.c: Likewise.
* gcc-interface/Make-lang.in (GCC_LINK): Use LINKER.
(GNAT1_C_OBJS): Remove ada/b_gnat1.o.  List ada/seh_init.o and
ada/targext.o here...
(GNAT_ADA_OBJS): ...and not here.
(GNAT1_ADA_OBJS): Add ada/b_gnat1.o.
(GNATBIND_OBJS): Reorder.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
From-SVN: r176210

35 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/adadecode.c
gcc/ada/adadecode.h
gcc/ada/adaint.c
gcc/ada/adaint.h
gcc/ada/argv.c
gcc/ada/atree.h
gcc/ada/cio.c
gcc/ada/cstreams.c
gcc/ada/env.c
gcc/ada/exit.c
gcc/ada/fe.h
gcc/ada/final.c
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/gcc-interface/gadaint.h
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/misc.c
gcc/ada/init.c
gcc/ada/initialize.c
gcc/ada/link.c
gcc/ada/namet.h
gcc/ada/nlists.h
gcc/ada/raise.c
gcc/ada/raise.h
gcc/ada/repinfo.h
gcc/ada/seh_init.c
gcc/ada/targext.c
gcc/ada/tracebak.c
gcc/ada/uintp.h
gcc/ada/urealp.h
gcc/ada/xeinfo.adb
gcc/ada/xsinfo.adb
gcc/ada/xsnamest.adb
gcc/prefix.h

index 08da4b925eca432b3ed585351d4c843756b11684..cb1a354afab4e1443b81ce8f132777506149be51 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-12  Laurent GUERBY  <laurent@guerby.net>
+           Eric Botcazou  <ebotcazou@adacore.com>
+
+       * prefix.h: Wrap up in extern "C" block.
+
 2011-07-12  Harsha Jagasia  <harsha.jagasia@amd.com>
 
        AMD bdver2 Enablement
index 833c44a2a596ba51555b686692a3a0f934f1c2a6..652f33d5b4728c59fefebf7e31686cb83fd6c1c2 100644 (file)
@@ -1,3 +1,44 @@
+2011-07-12  Laurent GUERBY  <laurent@guerby.net>
+           Eric Botcazou  <ebotcazou@adacore.com>
+
+       * adadecode.c: Wrap up in extern "C" block.
+       * adadecode.h: Likewise.
+       * adaint.c: Likewise.  Remove 'const' keyword.
+       * adaint.h: Likewise.
+       * argv.c: Likewise.
+       * atree.h: Likewise.
+       * cio.c: Likewise.
+       * cstreams.c: Likewise.
+       * env.c: Likewise.
+       * exit.c: Likewise.
+       * fe.h: Likewise.
+       * final.c: Likewise.
+       * init.c: Likewise.
+       * initialize.c: Likewise.
+       * link.c: Likewise.
+       * namet.h: Likewise.
+       * nlists.h: Likewise.
+       * raise.c: Likewise.
+       * raise.h: Likewise.
+       * repinfo.h: Likewise.
+       * seh_init.c: Likewise.
+       * targext.c: Likewise.
+       * tracebak.c: Likewise.
+       * uintp.h: Likewise.
+       * urealp.h: Likewise.
+       * xeinfo.adb: Wrap up generated C code in extern "C" block.
+       * xsinfo.adb: Likewise.
+       * xsnamest.adb: Likewise.
+       * gcc-interface/gadaint.h: Wrap up in extern "C" block.
+       * gcc-interface/gigi.h: Wrap up some prototypes in extern "C" block.
+       * gcc-interface/misc.c: Likewise.
+       * gcc-interface/Make-lang.in (GCC_LINK): Use LINKER.
+       (GNAT1_C_OBJS): Remove ada/b_gnat1.o.  List ada/seh_init.o and
+       ada/targext.o here...
+       (GNAT_ADA_OBJS): ...and not here.
+       (GNAT1_ADA_OBJS): Add ada/b_gnat1.o.
+       (GNATBIND_OBJS): Reorder.
+
 2011-07-07  Richard Henderson  <rth@redhat.com>
 
        * gcc-interface/misc.c (gnat_init_gcc_eh): Don't call
index 43f14f1279266e4853ab48f3c489150504f1213c..1c48856ebf5e8e224f102c5452f3beb082cc9b57 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *           Copyright (C) 2001-2009, Free Software Foundation, Inc.        *
+ *           Copyright (C) 2001-2011, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -352,6 +352,10 @@ __gnat_decode (const char *coded_name, char *ada_name, int verbose)
     }
 }
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef IN_GCC
 char *
 ada_demangle (const char *coded_name)
@@ -402,3 +406,7 @@ get_encoding (const char *coded_name, char *encoding)
 
   *dest_index = '\0';
 }
+
+#ifdef __cplusplus
+}
+#endif
index 8ae890726db5b5cc8af4441a66671f3c65d5f221..73dda238a093ca08fda91a0940d0e6e7c852d63e 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *           Copyright (C) 2001-2009, Free Software Foundation, Inc.        *
+ *           Copyright (C) 2001-2011, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* This function will return the Ada name from the encoded form.
    The Ada coding is done in exp_dbug.ads and this is the inverse function.
    see exp_dbug.ads for full encoding rules, a short description is added
@@ -51,3 +55,7 @@ extern void get_encoding (const char *, char *);
    function used in the binutils and GDB. Always consider using __gnat_decode
    instead of ada_demangle. Caller must free the pointer returned.  */
 extern char *ada_demangle (const char *);
+
+#ifdef __cplusplus
+}
+#endif
index bea33f60f2cac8457783a032f2555d969b3ac376..dbd76a5e0c7ffde2b51a2de4e53eaaa5e353bde5 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2010, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
    package Osint.  Many of the subprograms in OS_Lib import standard
    library calls directly. This file contains all other routines.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __vxworks
 
 /* No need to redefine exit here.  */
@@ -291,9 +295,9 @@ const char *__gnat_library_template = GNAT_LIBRARY_TEMPLATE;
 /* This variable is used in hostparm.ads to say whether the host is a VMS
    system.  */
 #ifdef VMS
-const int __gnat_vmsp = 1;
+int __gnat_vmsp = 1;
 #else
-const int __gnat_vmsp = 0;
+int __gnat_vmsp = 0;
 #endif
 
 #if defined (VMS)
@@ -324,7 +328,7 @@ const int __gnat_vmsp = 0;
 #endif
 
 /* Used for Ada bindings */
-const int __gnat_size_of_file_attributes = sizeof (struct file_attributes);
+int __gnat_size_of_file_attributes = sizeof (struct file_attributes);
 
 /* Reset the file attributes as if no system call had been performed */
 void __gnat_stat_to_attr (int fd, char* name, struct file_attributes* attr);
@@ -3686,3 +3690,7 @@ void *__gnat_lwp_self (void)
    return (void *) syscall (__NR_gettid);
 }
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index e9ef42c6b2b74642f10c22ed88e02fde5fe71118..3ceecaac63a762494afaa92892ea211e9587da10 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *          Copyright (C) 1992-2010, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <sys/stat.h>
 #include <stdio.h>
 
@@ -262,3 +266,7 @@ extern int    get_gcc_version                      (void);
 
 extern int    __gnat_binder_supports_auto_init     (void);
 extern int    __gnat_sals_init_using_constructors  (void);
+
+#ifdef __cplusplus
+}
+#endif
index b827b030f1eab9380e148d5f78ea6d0481e5df31..29f163972eafc8edc692b96b543066e2e20a549f 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *         Copyright (C) 1992-2009, Free Software Foundation, Inc.          *
+ *         Copyright (C) 1992-2011, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  ****************************************************************************/
 
 /* Routines for accessing command line arguments from both the runtime
-   library and from the compiler itself. In the former case, gnat_argc
+   library and from the compiler itself.  In the former case, gnat_argc
    and gnat_argv are the original argc and argv values as stored by the
    binder generated main program, and these routines are accessed from
-   the Ada.Command_Line package. In the compiler case, gnat_argc and
+   the Ada.Command_Line package.  In the compiler case, gnat_argc and
    gnat_argv are the values as modified by toplev, and these routines
-   are accessed from the Osint package. */
+   are accessed from the Osint package.  */
 
 /* Also routines for accessing the environment from the runtime library.
    Gnat_envp is the original envp value as stored by the binder generated
    main program, and these routines are accessed from the
-   Ada.Command_Line.Environment package. */
+   Ada.Command_Line.Environment package.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifdef IN_RTS
 #include "tconfig.h"
@@ -116,3 +120,7 @@ __gnat_fill_env (char *a, int i)
   if (gnat_envp != NULL)
     strncpy (a, gnat_envp[i], strlen (gnat_envp[i]));
 }
+
+#ifdef __cplusplus
+}
+#endif
index 4cef407ebd5dce680ade0f8e4f46164b59f710bc..553e60f1e3b67f9bdd49d8ac6ba6547e1ce0d272 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *          Copyright (C) 1992-2010, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
    atree.adb and must be kept synchronized with changes in these files.
 
    Note that only routines for reading the tree are included, since the tree
-   transformer is not supposed to modify the tree in any way. */
+   transformer is not supposed to modify the tree in any way.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Structure used for the first part of the node in the case where we have
    an Nkind.  */
@@ -734,3 +738,6 @@ extern Node_Id Current_Error_Node;
 #define Flag253(N)     (Nodes_Ptr[(N) - First_Node_Id + 4].U.NK.flag71)
 #define Flag254(N)     (Nodes_Ptr[(N) - First_Node_Id + 4].U.NK.flag72)
 
+#ifdef __cplusplus
+}
+#endif
index 277af096547d33c752a94183b1d1aea9a12d8818..73e54270f0d690f084220d0e5016d9abb056ae85 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2009, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef IN_RTS
 #include "tconfig.h"
 #include "tsystem.h"
@@ -129,3 +133,7 @@ mktemp (char *template)
   return tmpnam (NULL);
 }
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index 9dea9a4f13e68765a1fdf553bd7e066d3cb4e510..3477cf4e6165e66208ba6fc81c3093595f84d617 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *              Auxiliary C functions for Interfaces.C.Streams              *
  *                                                                          *
- *          Copyright (C) 1992-2010, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
-/* Routines required for implementing routines in Interfaces.C.Streams */
+/* Routines required for implementing routines in Interfaces.C.Streams.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifdef __vxworks
 #include "vxWorks.h"
@@ -242,3 +246,7 @@ __gnat_full_name (char *nam, char *buffer)
 
   return buffer;
 }
+
+#ifdef __cplusplus
+}
+#endif
index c53678ab8316b4f081740c65918a13fe704b604b..acd928ce86bb540dc6ee1afa3b10e3a0d0796b62 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *            Copyright (C) 2005-2010, Free Software Foundation, Inc.       *
+ *            Copyright (C) 2005-2011, Free Software Foundation, Inc.       *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 #define _BSD
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef IN_RTS
 #include "tconfig.h"
 #include "tsystem.h"
@@ -323,3 +327,7 @@ void __gnat_clearenv (void) {
   clearenv ();
 #endif
 }
+
+#ifdef __cplusplus
+}
+#endif
index 92873c15ce002b66e8e3311fef0bd4e32d5307bd..47983e87ef7ee86875f7e4ef1f37db1b03ab68ef 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2009 Free Software Foundation, Inc.          *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __alpha_vxworks
 #include "vxWorks.h"
 #endif
@@ -44,7 +48,7 @@
 
 #include "adaint.h"
 
-/* Routine used by Ada.Command_Line.Set_Exit_Status */
+/* Routine used by Ada.Command_Line.Set_Exit_Status */
 
 int gnat_exit_status = 0;
 
@@ -53,3 +57,7 @@ __gnat_set_exit_status (int i)
 {
   gnat_exit_status = i;
 }
+
+#ifdef __cplusplus
+}
+#endif
index e9adbfffc9292efd339de77da912657446d69a05..18b14611e38e1a78324831ef683f34770f5afad4 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *          Copyright (C) 1992-2010, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 /* This file contains definitions to access front-end functions and
    variables used by gigi.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* comperr:  */
 
 #define Compiler_Abort comperr__compiler_abort
@@ -251,3 +255,7 @@ extern void Set_Has_No_Elaboration_Code     (Node_Id, Boolean);
 extern Boolean Backend_Overflow_Checks_On_Target;
 extern Boolean Stack_Check_Probes_On_Target;
 extern Boolean Stack_Check_Limits_On_Target;
+
+#ifdef __cplusplus
+}
+#endif
index bfd519e4036237280d1c4595dffc4778c1ccc9bf..b49b3deaf8b2f6c7a614d4db8a787cfba854f146 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2009 Free Software Foundation, Inc.          *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern void __gnat_finalize (void);
 
 /* This routine is called at the extreme end of execution of an Ada program
    (the call is generated by the binder). The standard routine does nothing
    at all, the intention is that this be replaced by system specific code
-   where finalization is required. */
+   where finalization is required.  */
 
 void
 __gnat_finalize (void)
 {
 }
+
+#ifdef __cplusplus
+}
+#endif
index d4344cc0f395e17c98d924affdd5e201bed298ff..c471508767c278ad6af3600d7f6f017d74678401 100644 (file)
@@ -104,19 +104,19 @@ ADA_TOOLS_FLAGS_TO_PASS=\
        "GNATLINK=../../gnatlink"       \
        "GNATBIND=../../gnatbind"
 
-GCC_LINK=$(CC) -static-libgcc $(LDFLAGS)
+GCC_LINK=$(LINKER) $(ALL_LINKERFLAGS) -static-libgcc $(LDFLAGS)
 
 # Lists of files for various purposes.
 
 # Languages-specific object files for Ada.
+
 # Object files for gnat1 from C sources.
-GNAT1_C_OBJS = ada/b_gnat1.o ada/adadecode.o ada/adaint.o ada/cstreams.o \
- ada/cio.o ada/targtyps.o ada/decl.o ada/misc.o ada/utils.o ada/utils2.o \
- ada/trans.o ada/cuintp.o ada/argv.o ada/raise.o ada/init.o ada/tracebak.o \
- ada/initialize.o ada/env.o
+GNAT1_C_OBJS = ada/adadecode.o ada/adaint.o ada/argv.o ada/cio.o \
+ ada/cstreams.o ada/env.o ada/init.o ada/initialize.o ada/raise.o \
+ ada/seh_init.o ada/targext.o ada/tracebak.o ada/cuintp.o ada/decl.o \
+ ada/misc.o ada/utils.o ada/utils2.o ada/trans.o ada/targtyps.o
 
 # Object files from Ada sources that are used by gnat1
-
 GNAT_ADA_OBJS =        \
  ada/a-charac.o        \
  ada/a-chlat1.o        \
@@ -270,7 +270,6 @@ GNAT_ADA_OBJS =     \
  ada/scng.o    \
  ada/scos.o    \
  ada/sdefault.o        \
- ada/seh_init.o        \
  ada/sem.o     \
  ada/sem_aggr.o        \
  ada/sem_attr.o        \
@@ -320,7 +319,6 @@ GNAT_ADA_OBJS =     \
  ada/switch.o  \
  ada/system.o  \
  ada/table.o   \
- ada/targext.o \
  ada/targparm.o        \
  ada/tbuild.o  \
  ada/tree_gen.o        \
@@ -338,24 +336,24 @@ GNAT_ADA_OBJS =   \
  ada/widechar.o
 
 # Object files for gnat executables
-GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
+GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o ada/b_gnat1.o
 
 GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS)
 
 GNATBIND_OBJS = \
  ada/adaint.o     \
  ada/argv.o       \
- ada/exit.o       \
  ada/cio.o        \
  ada/cstreams.o   \
  ada/env.o        \
+ ada/exit.o       \
  ada/final.o      \
  ada/init.o       \
  ada/initialize.o \
- ada/seh_init.o   \
  ada/link.o       \
- ada/targext.o    \
  ada/raise.o      \
+ ada/seh_init.o   \
+ ada/targext.o    \
  ada/tracebak.o   \
  ada/ada.o        \
  ada/a-clrefi.o   \
index 57503f069fed61cbc91ec050c025b27da2b2c27d..ce27a14d01751e0735a4de536e47efae8432a34f 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *             Copyright (C) 2010, Free Software Foundation, Inc.           *
+ *           Copyright (C) 2010-2011, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 #ifndef GCC_ADAINT_H
 #define GCC_ADAINT_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern char *__gnat_to_canonical_file_spec (char *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GCC_ADAINT_H */
index c1f1217a59441d4c2d71715be6cb19e9b94cfa27..8ef609796fb16ec24255bfbc12d2c6cd39dcbeb3 100644 (file)
@@ -199,6 +199,10 @@ struct File_Info_Type
   Nat Num_Source_Lines;
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* This is the main program of the back-end.  It sets up all the table
    structures and then generates code.  */
 extern void gigi (Node_Id gnat_root, int max_gnat_node,
@@ -218,6 +222,10 @@ extern void gigi (Node_Id gnat_root, int max_gnat_node,
                   Entity_Id standard_exception_type,
                   Int gigi_operating_mode);
 
+#ifdef __cplusplus
+}
+#endif
+
 /* GNAT_NODE is the root of some GNAT tree.  Return the root of the
    GCC tree corresponding to that GNAT tree.  Normally, no code is generated;
    we just return an equivalent tree which is used elsewhere to generate
@@ -929,6 +937,11 @@ extern int fp_size_to_prec (int size);
 /* These functions return the basic data type sizes and related parameters
    about the target machine.  */
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern Pos get_target_bits_per_unit (void);
 extern Pos get_target_bits_per_word (void);
 extern Pos get_target_char_size (void);
@@ -953,6 +966,10 @@ extern Nat get_target_strict_alignment (void);
 extern Nat get_target_double_float_alignment (void);
 extern Nat get_target_double_scalar_alignment (void);
 
+#ifdef __cplusplus
+}
+#endif
+
 /* Let code know whether we are targetting VMS without need of
    intrusive preprocessor directives.  */
 #ifndef TARGET_ABI_OPEN_VMS
index 92426fd48b9943c4b5dab981a10a9f3385737a4c..62e7ac7769bcb528e298d1bdf95d54821de405fc 100644 (file)
@@ -68,12 +68,20 @@ const char **save_argv;
 extern int gnat_argc;
 extern char **gnat_argv;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Declare functions we use as part of startup.  */
 extern void __gnat_initialize (void *);
 extern void __gnat_install_SEH_handler (void *);
 extern void adainit (void);
 extern void _ada_gnat1drv (void);
 
+#ifdef __cplusplus
+}
+#endif
+
 /* The parser for the language.  For us, we process the GNAT tree.  */
 
 static void
index 9b6370e1a5779b4153634aaaa91ebe33c2464e78..888ec208ca1fbe47c33ae0e7ab316107343d73d9 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2010, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
     installed by this file are used to catch the resulting signals that come
     from these probes failing (i.e. touching protected pages).  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* This file should be kept synchronized with 2sinit.ads, 2sinit.adb,
    s-init-ae653-cert.adb and s-init-xi-sparc.adb.  All these files implement
    the required functionality for different targets.  */
@@ -2403,3 +2407,7 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
 }
 
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index e2ad904e9b22a4a627a766f8316f84f04ad8b535..90f35a0a9b439771232f811d6d7c7c3d2e07e8ab 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2009, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 /*  This unit provides default implementation for __gnat_initialize ()
     which is called before the elaboration of the partition. It is provided
     in a separate file/object so that users can replace it easily.
-    The default implementation should be null on most targets. */
+    The default implementation should be null on most targets.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* The following include is here to meet the published VxWorks requirement
-   that the __vxworks header appear before any other include. */
+   that the __vxworks header appear before any other include.  */
 #ifdef __vxworks
 #include "vxWorks.h"
 #endif
@@ -359,3 +363,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
 }
 
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index 62dd683f1c79fc97ad90d96d1dde39acb9a75cd1..a4722d2d3ab57dc027796b0d4a0a8d3675560f76 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2009, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
-/*  This file contains host-specific parameters describing the behavior     */
-/*  of the linker. It is used by gnatlink as well as all tools that use     */
-/*  Mlib.                                                                   */
+/*  This file contains host-specific parameters describing the behavior of the
+    linker.  It is used by gnatlink as well as all tools that use Mlib.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include <string.h>
 
@@ -254,3 +257,7 @@ const char *__gnat_object_library_extension = ".a";
 unsigned char __gnat_separate_run_path_options = 0;
 const char *__gnat_default_libgcc_subdir = "lib";
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index 6182c8b01fef0103d80c11073996c3e3b5407978..ec2b488a5effd2fbb93fc2089a0f081daf31fb15 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *            Copyright (C) 1992-2008, Free Software Foundation, Inc.       *
+ *            Copyright (C) 1992-2011, Free Software Foundation, Inc.       *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  ****************************************************************************/
 
 /* This is the C file that corresponds to the Ada package specification
-   Namet. It was created manually from files namet.ads and namet.adb.  */
+   Namet.  It was created manually from files namet.ads and namet.adb.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Structure defining a names table entry.  */
 
@@ -127,3 +131,7 @@ extern Source_File_Index Get_Source_File_Index (Source_Ptr);
 extern Logical_Line_Number Get_Logical_Line_Number (Source_Ptr);
 extern Column_Number Get_Column_Number (Source_Ptr);
 extern Source_Ptr Instantiation (Source_File_Index);
+
+#ifdef __cplusplus
+}
+#endif
index 1dd9394e924f58db68b601c11c64913234804f68..3b9e6726d35b60c3462073fddcb3ef7ab632e7a1 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *            Copyright (C) 1992-2008, Free Software Foundation, Inc.       *
+ *            Copyright (C) 1992-2011, Free Software Foundation, Inc.       *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
    nlists.adb and must be kept synchronized with changes in these files.
 
    Note that only routines for reading the tree are included, since the
-   tree transformer is not supposed to modify the tree in any way. */
+   tree transformer is not supposed to modify the tree in any way.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*  The following is the structure used for the list headers table */
 
@@ -128,3 +132,7 @@ List_Containing (Node_Id Node)
 {
   return Nodes_Ptr[Node - First_Node_Id].V.NX.link;
 }
+
+#ifdef __cplusplus
+}
+#endif
index 1f087783b6702f358574d761a63307ee37264cb5..35b0e988ee114610f000209391ecefc8cdfbc99d 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *             Copyright (C) 1992-2009, Free Software Foundation, Inc.      *
+ *             Copyright (C) 1992-2011, Free Software Foundation, Inc.      *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 /* Shared routines to support exception handling.  __gnat_unhandled_terminate
    is shared between all exception handling mechanisms.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef IN_RTS
 #include "tconfig.h"
 #include "tsystem.h"
@@ -79,3 +83,7 @@ __gnat_unhandled_terminate (void)
   /* Default termination handling */
   __gnat_os_exit (1);
 }
+
+#ifdef __cplusplus
+}
+#endif
index 1ccc37bca01f494800029a8f92d13ec761140962..d8c245f09836e7a7e3dfcdfb3f0e002a9e4e3bf0 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *          Copyright (C) 1992-2009, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* C counterparts of what System.Standard_Library defines.  */
 
 typedef unsigned Exception_Code;
@@ -60,3 +64,7 @@ extern void __gnat_install_SEH_handler  (void *);
 extern void __gnat_adjust_context_for_raise (int, void *);
 
 extern int gnat_exit_status;
+
+#ifdef __cplusplus
+}
+#endif
index 668f520ffa08eecadb38290bc9aaefd5512f5a3d..8d5ee6d652d9da15e83c9f8dda15437f50cb0727 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *          Copyright (C) 1999-2009 Free Software Foundation, Inc.          *
+ *          Copyright (C) 1999-2011, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 
 /* This file corresponds to the Ada file repinfo.ads.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef Uint Node_Ref;
 typedef Uint Node_Ref_Or_Val;
 typedef char TCode;
@@ -75,3 +79,7 @@ typedef char TCode;
 #define Create_Node repinfo__create_node
 extern Node_Ref Create_Node    (TCode, Node_Ref_Or_Val,
                                 Node_Ref_Or_Val, Node_Ref_Or_Val);
+
+#ifdef __cplusplus
+}
+#endif
index 012692a7ae5dea31582935f075cde0366a24cd2f..2ce99f3a0c278d1a00907745573426ceaaa3fd31 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *           Copyright (C) 2005-2009, Free Software Foundation, Inc.        *
+ *           Copyright (C) 2005-2011, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 /*  This unit contains support for SEH (Structured Exception Handling).
     Right now the only implementation is for Win32.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef IN_RTS
 #include "tconfig.h"
 #include "tsystem.h"
@@ -311,3 +315,7 @@ void __gnat_install_SEH_handler (void *eh ATTRIBUTE_UNUSED)
 {
 }
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index b37cc28c6be1c111f27a3829aa752f857ede18e0..df4286c0d27b8e06edef37c1afcbb85503abea0a 100644 (file)
  *                                                                          *
  ****************************************************************************/
 
-/*  This file contains target-specific parameters describing the file       */
-/*  extension for object and executable files. It is used by the compiler,  */
-/*  binder and tools.                                                       */
+/*  This file contains target-specific parameters describing the file
+    extension for object and executable files.  It is used by the compiler,
+    binder and tools.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifdef IN_RTS
 #include "tconfig.h"
@@ -54,3 +58,7 @@
 const char *__gnat_target_object_extension = TARGET_OBJECT_SUFFIX;
 const char *__gnat_target_executable_extension = TARGET_EXECUTABLE_SUFFIX;
 const char *__gnat_target_debuggable_extension = TARGET_EXECUTABLE_SUFFIX;
+
+#ifdef __cplusplus
+}
+#endif
index c16741de7ec4ff0c92778dae3c9b07f0dc414e65..6764cd42755607efe4cbcf8eaab13fd83c195f16 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *                     Copyright (C) 2000-2010, AdaCore                     *
+ *            Copyright (C) 2000-2011, Free Software Foundation, Inc.       *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
    Alpha/VMS
 */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __alpha_vxworks
 #include "vxWorks.h"
 #endif
@@ -513,3 +517,7 @@ __gnat_backtrace (void **array ATTRIBUTE_UNUSED,
 #endif
 
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index 630fcd18e06d2ff375aaf7732e31eb6f66763d2a..b950a88cbfb388f25d74e29f75ed03575f763d7d 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *            Copyright (C) 1992-2010, Free Software Foundation, Inc.       *
+ *            Copyright (C) 1992-2011, Free Software Foundation, Inc.       *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
-/* This file corresponds to the Ada package specification Uintp. It was
-   created manually from the files uintp.ads and uintp.adb  */
+/* This file corresponds to the Ada package specification Uintp.  It was
+   created manually from the files uintp.ads and uintp.adb.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Support for universal integer arithmetic */
 
@@ -94,3 +98,7 @@ extern struct Uint_Entry *uintp__uints__table;
 
 #define Udigits_Ptr uintp__udigits__table
 extern int *uintp__udigits__table;
+
+#ifdef __cplusplus
+}
+#endif
index 90e5d7c65bee7ed5957c5f8ad61a0ac73381c73a..fbb87608133a0dd1504ceb97efcf4643ab1e006d 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *            Copyright (C) 1992-2007, Free Software Foundation, Inc.       *
+ *            Copyright (C) 1992-2011, Free Software Foundation, Inc.       *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  ****************************************************************************/
 
-/* This file corresponds to the Ada package specification Urealp. It was
-   created manually from the files urealp.ads and urealp.adb  */
+/* This file corresponds to the Ada package specification Urealp.  It was
+   created manually from the files urealp.ads and urealp.adb.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Support for universal real arithmetic.  */
 
@@ -48,3 +52,7 @@ enum Rounding_Mode {Floor = 0, Ceiling = 1, Round = 2, Round_Even = 3};
 #define Machine eval_fat__machine
 extern Ureal Machine           (Entity_Id, Ureal, enum Rounding_Mode,
                                 Node_Id);
+
+#ifdef __cplusplus
+}
+#endif
index ba9ded9d5cc1892d9e332798fb46e783aafca1cf..cce58315fe22474eaa79d7b5fc2fae4fdf0f56a8 100644 (file)
@@ -276,6 +276,10 @@ begin
 
    Put_Line (Ofile, "");
 
+   Put_Line (Ofile, "#ifdef __cplusplus");
+   Put_Line (Ofile, "extern ""C"" {");
+   Put_Line (Ofile, "#endif");
+
    --  Find and record pragma Inlines
 
    loop
@@ -492,6 +496,11 @@ begin
    end loop;
 
    Put_Line (Ofile, "");
+
+   Put_Line (Ofile, "#ifdef __cplusplus");
+   Put_Line (Ofile, "}");
+   Put_Line (Ofile, "#endif");
+
    Put_Line
      (Ofile,
       "/* End of einfo.h (C version of Einfo package specification) */");
index 3bf6011ffc076906e4966f4d4beb28592b58243d..869ae873f292a95d63cda481927fdb2a8b1f3f27 100644 (file)
@@ -162,6 +162,11 @@ begin
    end loop;
 
    Put_Line (Ofile, "");
+
+   Put_Line (Ofile, "#ifdef __cplusplus");
+   Put_Line (Ofile, "extern ""C"" {");
+   Put_Line (Ofile, "#endif");
+
    NKV := 0;
 
    --  Loop through node kind codes
@@ -248,6 +253,9 @@ exception
    when Done =>
       Close (InS);
       Put_Line (Ofile, "");
+      Put_Line (Ofile, "#ifdef __cplusplus");
+      Put_Line (Ofile, "}");
+      Put_Line (Ofile, "#endif");
       Close (Ofile);
       Set_Exit_Status (0);
 
index 7dd3ca29883c8a5a3b398fefaaf8c03f011073f7..d044fb1130e1d65d832a6e320e885776830f4cae 100644 (file)
@@ -194,6 +194,10 @@ begin
    Create (OutB, Out_File, "snames.nb");
    Create (OutH, Out_File, "snames.nh");
 
+   Put_Line (OutH, "#ifdef __cplusplus");
+   Put_Line (OutH, "extern ""C"" {");
+   Put_Line (OutH, "#endif");
+
    Anchored_Mode := True;
    Val := 0;
 
@@ -274,4 +278,8 @@ begin
       Line := Get_Line (InH);
       Put_Line (OutH, Line);
    end loop;
+
+   Put_Line (OutH, "#ifdef __cplusplus");
+   Put_Line (OutH, "}");
+   Put_Line (OutH, "#endif");
 end XSnamesT;
index c6d9ae597011a58c75a8a2a7041e0523970e51c1..5bafe20900d36dfb05a743bcd91840c45c72affc 100644 (file)
@@ -21,10 +21,20 @@ License along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_PREFIX_H
 #define GCC_PREFIX_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These functions are called by the Ada frontend with C convention.  */
+
 /* Update PATH using KEY if PATH starts with PREFIX.  The returned
    string is always malloc-ed, and the caller is responsible for
    freeing it.  */
 extern char *update_path (const char *path, const char *key);
 extern void set_std_prefix (const char *, int);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* ! GCC_PREFIX_H */