aboutsummaryrefslogtreecommitdiff
path: root/libcpp/directives.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.vnet.ibm.com>2011-03-21 16:21:30 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2011-03-21 16:21:30 +0000
commitf3c33d9dc88ca9b2452a9ea3d42d9a6363b66663 (patch)
treea11038042e07218234e45c1da1c876bdbdf8c2d5 /libcpp/directives.c
parentac43f774369194320ba2368b21550d4aa5ca97b9 (diff)
downloadgcc-f3c33d9dc88ca9b2452a9ea3d42d9a6363b66663.zip
gcc-f3c33d9dc88ca9b2452a9ea3d42d9a6363b66663.tar.gz
gcc-f3c33d9dc88ca9b2452a9ea3d42d9a6363b66663.tar.bz2
Make UNSPEC/UNSPECV constants use the enum; Fix 48192; Add test case for 48053
From-SVN: r171247
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r--libcpp/directives.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 85a17b1..f244ae5 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1819,7 +1819,12 @@ do_ifdef (cpp_reader *pfile)
if (node)
{
- skip = node->type != NT_MACRO;
+ /* Do not treat conditional macros as being defined. This is due to
+ the powerpc and spu ports using conditional macros for 'vector',
+ 'bool', and 'pixel' to act as conditional keywords. This messes
+ up tests like #ifndef bool. */
+ skip = (node->type != NT_MACRO
+ || ((node->flags & NODE_CONDITIONAL) != 0));
_cpp_mark_macro_used (node);
if (!(node->flags & NODE_USED))
{
@@ -1860,7 +1865,12 @@ do_ifndef (cpp_reader *pfile)
if (node)
{
- skip = node->type == NT_MACRO;
+ /* Do not treat conditional macros as being defined. This is due to
+ the powerpc and spu ports using conditional macros for 'vector',
+ 'bool', and 'pixel' to act as conditional keywords. This messes
+ up tests like #ifndef bool. */
+ skip = (node->type == NT_MACRO
+ && ((node->flags & NODE_CONDITIONAL) == 0));
_cpp_mark_macro_used (node);
if (!(node->flags & NODE_USED))
{