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: [patch] Don't require -DIN_GCC while compiling plugins


On Tue, May 26, 2009 at 06:20, Rafael Espindola <espindola@google.com> wrote:
> Currently a user must pass -DIN_GCC when compiling plugins out of
> tree. This is an unusual interface. It is more common to have all
> necessary definitions in a header file that is included first.
>
> Currently gcc-plugin.h almost fits the bill. The only issue is one use
> of bool and the need to define IN_GCC. This patch fixes this by
> changing the bool to int and defining IN_GCC if it was not defined
> before.
>
> The patch also updates the plugins in the testsuite to include
> gcc-plugin.h first.

It's better to have gcc-plugin.h include config.h and system.h or
document that the three files should be included in the order:
config.h, system.h ggc-plugin.h.


> 2009-05-26 ÂRafael Avila de Espindola Â<espindola@google.com>
>
> Â Â Â Â* gcc-plugin.h (IN_GCC) Define if not defined.
> Â Â Â Â(plugin_default_version_check): Return int.
> Â Â Â Â* plugin.c (plugin_default_version_check): Return int.
>
> 2009-05-26 ÂRafael Avila de Espindola Â<espindola@google.com>
>
> Â Â Â Â* g++.dg/plugin/attribute_plugin.c: Include gcc-plugin.h first.
> Â Â Â Â* g++.dg/plugin/dumb_plugin.c: Include gcc-plugin.h first.
> Â Â Â Â* g++.dg/plugin/selfassign.c: Include gcc-plugin.h first.
> Â Â Â Â* gcc.dg/plugin/selfassign.c: Include gcc-plugin.h first.

Could you also add documentation in plugin.texi describing this requirement?


Thanks.  Diego.


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