summaryrefslogtreecommitdiffstats
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-07 06:26:32 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-07 06:26:32 +0000
commit198b48a003250a3678f6fa816a016a196e81e6bb (patch)
tree6aed42053a56ed0593bc263de6125d7efc67c493 /gcc/cpphash.h
parentb177c3c29498a92c2ec45ef0f4daaeba896c20ba (diff)
downloadppe42-gcc-198b48a003250a3678f6fa816a016a196e81e6bb.tar.gz
ppe42-gcc-198b48a003250a3678f6fa816a016a196e81e6bb.zip
* cpptrad.c (struct block, BLOCK_HEADER_LEN, BLOCK_LEN,
scan_parameters, save_replacement_text, replacement_length): New. (scan_out_logical_line): Take a macro and save parameters if non-NULL. (_cpp_logical_line_trad): Update. (_cpp_create_trad_definition): Update to handle function-like macros. * cpplex.c (new_buff): Update. (struct dummy, DEFAULT_ALIGNMENT, CPP_ALIGN): Move... * cpphash.h: ...here. (CPP_ALIGN2, _cpp_save_parameter): New. * cppmacro.c (save_parameter): Rename, export. (parse_params): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54331 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index e508b80ddcf..38ba244769a 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -50,6 +50,21 @@ typedef unsigned char uchar;
efficiency, and partly to limit runaway recursion. */
#define CPP_STACK_MAX 200
+/* Host alignment handling. */
+struct dummy
+{
+ char c;
+ union
+ {
+ double d;
+ int *p;
+ } u;
+};
+
+#define DEFAULT_ALIGNMENT offsetof (struct dummy, u)
+#define CPP_ALIGN2(size, align) (((size) + ((align) - 1)) & ~((align) - 1))
+#define CPP_ALIGN(size) CPP_ALIGN2 (size, DEFAULT_ALIGNMENT)
+
/* Each macro definition is recorded in a cpp_macro structure.
Variadic macros cannot occur with traditional cpp. */
struct cpp_macro
@@ -428,7 +443,8 @@ extern bool _cpp_create_definition PARAMS ((cpp_reader *, cpp_hashnode *));
extern void _cpp_pop_context PARAMS ((cpp_reader *));
extern void _cpp_push_text_context PARAMS ((cpp_reader *, cpp_hashnode *,
const uchar *, const uchar*));
-extern bool _cpp_create_trad_definition PARAMS ((cpp_reader *, cpp_macro *));
+extern bool _cpp_save_parameter PARAMS ((cpp_reader *, cpp_macro *,
+ cpp_hashnode *));
/* In cpphash.c */
extern void _cpp_init_hashtable PARAMS ((cpp_reader *, hash_table *));
@@ -483,6 +499,7 @@ extern void _cpp_overlay_buffer PARAMS ((cpp_reader *pfile, const uchar *,
size_t));
extern cpp_hashnode *_cpp_lex_identifier_trad PARAMS ((cpp_reader *));
extern void _cpp_set_trad_context PARAMS ((cpp_reader *));
+extern bool _cpp_create_trad_definition PARAMS ((cpp_reader *, cpp_macro *));
/* Utility routines and macros. */
#define DSC(str) (const uchar *)str, sizeof str - 1
OpenPOWER on IntegriCloud