summaryrefslogtreecommitdiff
path: root/gcc/c-pragma.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-23 23:25:40 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-23 23:25:40 +0000
commit68bf2ad934202d583d12eff842fdeb4114f9c783 (patch)
treec218ffe339a9fcc74872e3e0827398246b77ded8 /gcc/c-pragma.c
parentae21cabb6d56d24385469959a35d824e26ae3dfe (diff)
downloadgcc-68bf2ad934202d583d12eff842fdeb4114f9c783.tar.gz
gcc:
2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91117 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r--gcc/c-pragma.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 24c166658b4..91efc4aa384 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -627,13 +627,20 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
#endif
-/* Front-end wrapper for pragma registration to avoid dragging
+/* Front-end wrappers for pragma registration to avoid dragging
cpplib.h in almost everywhere. */
void
c_register_pragma (const char *space, const char *name,
void (*handler) (struct cpp_reader *))
{
- cpp_register_pragma (parse_in, space, name, handler);
+ cpp_register_pragma (parse_in, space, name, handler, 0);
+}
+
+void
+c_register_pragma_with_expansion (const char *space, const char *name,
+ void (*handler) (struct cpp_reader *))
+{
+ cpp_register_pragma (parse_in, space, name, handler, 1);
}
/* Set up front-end pragmas. */
@@ -641,8 +648,12 @@ void
init_pragma (void)
{
#ifdef HANDLE_PRAGMA_PACK
+#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
+ c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
+#else
c_register_pragma (0, "pack", handle_pragma_pack);
#endif
+#endif
#ifdef HANDLE_PRAGMA_WEAK
c_register_pragma (0, "weak", handle_pragma_weak);
#endif