This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PLUGINS] Add 'extern "C"' wrappers to several header files


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.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]