[PATCH] c-pragma: adding a data field to pragma_handler

Pierre p.vittet@laposte.net
Wed Jun 1 16:55:00 GMT 2011

This patch is about the pragmas.

In c-family/c-pragma.h, we declare a pragma_handler which is a function 
accepting cpp_reader as parameter.

I have changed this handler in order to accept a second parameter which 
is a void *, allowing to give extra datas to the handler. I think this 
data field might be of general use: we can have condition or data at 
register time that we want to express in the handler. I guess this is a 
common way to pass data to an handler function.

I would like your opinion on this patch! Thanks!

Pierre Vittet


2011-06-01  Pierre Vittet  <piervit@pvittet.com>

* c-pragma.h (pragma_handler,internal_pragma_handler, c_register_pragma,
	c_register_pragma_with_expansion): create internal_pragma_handler, add a
	new void * data parameter.
	* c-pragma.c (handle_pragma_pack, handle_pragma_weak,
	handle_pragma_redefine_extname, handle_pragma_visibility,
	handle_pragma_diagnostic, handle_pragma_target, handle_pragma_optimize,
	handle_pragma_push_options, handle_pragma_pop_options,
	handle_pragma_reset_options, handle_pragma_message,
	handle_pragma_float_const_decimal64, registered_pragmas,
	c_register_pragma_1, c_register_pragma, c_register_pragma_with_expansion,
	init_pragma): add support of the void * data field.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: addDataToPragmaHandler-174521.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110601/5cf71eb9/attachment.ksh>

More information about the Gcc-patches mailing list