This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PLUGINS] Add 'extern "C"' wrappers to several header files
- From: Gabriel Dos Reis <dosreis at gmail dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: Duncan Sands <baldrick at free dot fr>, Ian Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 22 Jul 2009 11:09:59 -0500
- Subject: Re: [PLUGINS] Add 'extern "C"' wrappers to several header files
- References: <4A65D339.6040101@free.fr> <b798aad50907220526r2e4dae34qb2ee38e35b1a622a@mail.gmail.com>
- Reply-to: gdr at integrable-solutions dot net
On Wed, Jul 22, 2009 at 7:26 AM, Diego Novillo<dnovillo@google.com> wrote:
> On Tue, Jul 21, 2009 at 10:39, Duncan Sands<baldrick@free.fr> wrote:
>
>> include header files like this:
>> ?extern "C" {
>> ?#include "flags.h"
>> ?}
>
> Yes. ?I ran into this problem recently trying to build a C++ plugin.
> Thanks for fixing it.
>
>
>> ? ? ? ?* coretypes.h: Wrap in 'extern "C"' when included by C++.
>> ? ? ? ?* diagnostic.h: Likewise.
>> ? ? ? ?* except.h: Likewise.
>> ? ? ? ?* flags.h: Likewise.
>> ? ? ? ?* gcc-plugin.h: Likewise.
>> ? ? ? ?* gimple.h: Likewise.
>> ? ? ? ?* input.h: Likewise.
>> ? ? ? ?* machmode.h: Likewise.
>> ? ? ? ?* output.h: Likewise.
>> ? ? ? ?* real.h: Likewise.
>> ? ? ? ?* rtl.h: Likewise.
>> ? ? ? ?* target.h: Likewise.
>> ? ? ? ?* toplev.h: Likewise.
>> ? ? ? ?* tree-flow.h: Likewise.
>> ? ? ? ?* tree-pass.h: Likewise.
>> ? ? ? ?* tree.h: Likewise.
>> ? ? ? ?* vec.h: Likewise.
>> ? ? ? ?* configure.ac: Likewise in generated plugin-version.h.
>> ? ? ? ?* configure: Likewise.
>> ? ? ? ?* genflags.c: Likewise in generated insn-flags.h.
>> ? ? ? ?* genpreds.c: Likewise in generated tm-preds.h.
>> ? ? ? ?* opth-gen.awk: Likewise in generated options.h.
>
> OK.
>
> Ian, wouldn't you have needed this for --enable-build-with-cxx?
No. You don't really want that patch if you --enable-build-with-cxx.
The point is that when --enable-build-with-cxx, functions are compiled
with the C++ calling convention. You want that patch only for the
external packages used by GCC, not for the functions internal to GCC.
>
>
> Diego.
>