ksh/ksh93-gcc.dif
2011-07-14 16:34:09 +00:00

42 lines
1.4 KiB
Plaintext

--- src/lib/libpp/ppsearch.c
+++ src/lib/libpp/ppsearch.c 2011-07-12 12:08:08.640426463 +0000
@@ -107,6 +107,14 @@ ppmultiple(register struct ppfile* fp, r
* search for file using directories in dp
*/
+#define stupidgcc(flag) \
+({ \
+ char *name = NiL; \
+ if (!(fp->flags & INC_MEMBER(flag)) && (xp = fp->bound[flag])) \
+ name = xp->name; \
+ name; \
+})
+
static int
search(register struct ppfile* fp, register struct ppdirs* dp, int type, int flags)
{
@@ -146,10 +154,10 @@ search(register struct ppfile* fp, regis
(fp->flags & INC_BOUND(INC_STANDARD)) ? "STANDARD|" : "",
dp ? (dp->index == INC_PREFIX ? "pre" : dp->index == INC_LOCAL ? "lcl" : dp->index == INC_VENDOR ? "vnd" : "std") : NiL,
dp ? dp->name : NiL,
- !(fp->flags & INC_MEMBER(INC_PREFIX)) && (xp = fp->bound[INC_PREFIX]) ? xp->name : NiL,
- !(fp->flags & INC_MEMBER(INC_LOCAL)) && (xp = fp->bound[INC_LOCAL]) ? xp->name : NiL,
- !(fp->flags & INC_MEMBER(INC_VENDOR)) && (xp = fp->bound[INC_VENDOR]) ? xp->name : NiL,
- !(fp->flags & INC_MEMBER(INC_STANDARD)) && (xp = fp->bound[INC_STANDARD]) ? xp->name : NiL,
+ stupidgcc(INC_PREFIX),
+ stupidgcc(INC_LOCAL),
+ stupidgcc(INC_VENDOR),
+ stupidgcc(INC_STANDARD),
error_info.file
));
if (flags & SEARCH_HOSTED)
@@ -578,6 +586,8 @@ if (pp.test & 0x0010) error(1, "SEARCH#%
return -1;
}
+#undef stupidgcc
+
/*
* search for an include file
* if (flags&SEARCH_INCLUDE) then