diff options
Diffstat (limited to 'usr/src/lib/libpp')
33 files changed, 114 insertions, 77 deletions
diff --git a/usr/src/lib/libpp/Makefile.com b/usr/src/lib/libpp/Makefile.com index 8ed741ebdf..ebdedc2806 100644 --- a/usr/src/lib/libpp/Makefile.com +++ b/usr/src/lib/libpp/Makefile.com @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -84,10 +84,11 @@ CPPFLAGS = \ $(DTEXTDOM) $(DTS_ERRNO) \ -I. \ -I$(ROOT)/usr/include/ast \ + -I$(ROOT)/usr/include \ -D_PACKAGE_ast \ '-DUSAGE_LICENSE=\ "[-author?Glenn Fowler <gsf@research.att.com>]"\ - "[-copyright?Copyright (c) 1986-2008 AT&T Intellectual Property]"\ + "[-copyright?Copyright (c) 1986-2009 AT&T Intellectual Property]"\ "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\ "[--catalog?libpp]"' @@ -100,8 +101,8 @@ CFLAGS64 += \ pics/ppcall.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppcontrol.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppcpp.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED -pics/pplex.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppexpr.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED +pics/pplex.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppop.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppsearch.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppsearch.o := CERRWARN += -_gcc=-Wno-sequence-point diff --git a/usr/src/lib/libpp/common/RELEASE b/usr/src/lib/libpp/common/RELEASE index 80a3c89a48..0e09f6089d 100644 --- a/usr/src/lib/libpp/common/RELEASE +++ b/usr/src/lib/libpp/common/RELEASE @@ -1,3 +1,12 @@ +09-02-02 pp.probe,probe.win32: check for compiler supplied __FUNCTION__ +09-02-02 ppop.c: include pp_default.h/probe at end of builtin script +09-01-20 probe.win32: elide #pragma comment.*linker.*manifest +09-01-06 ppcall.c: fix macro definition overwrite bug -- I know +09-01-05 ppcontrol.c: fix multiple include guard for #include outside guard +08-12-07 pp.h,ppdata.c: fix ancient pptype and ppctype[] off by one +08-11-15 ppsearch.c: '\\' => '/' in first step; msvc complains about '\\' in #line!! +08-10-31 ppsearch.c: relax pp:nomultiple pedantry +08-10-30 pplex.c: handle =#x S_CHRB|SPLICE bug 08-05-11 ppproto.c: fix proto test 10 regression 07-09-21 ppproto.c: add "Public Domain" to the noticed list 07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] diff --git a/usr/src/lib/libpp/common/gentab.sh b/usr/src/lib/libpp/common/gentab.sh index d843868970..5000d3ab90 100644 --- a/usr/src/lib/libpp/common/gentab.sh +++ b/usr/src/lib/libpp/common/gentab.sh @@ -1,7 +1,7 @@ ######################################################################## # # # This software is part of the ast package # -# Copyright (c) 1986-2008 AT&T Intellectual Property # +# Copyright (c) 1986-2009 AT&T Intellectual Property # # and is licensed under the # # Common Public License, Version 1.0 # # by AT&T Intellectual Property # diff --git a/usr/src/lib/libpp/common/pp.h b/usr/src/lib/libpp/common/pp.h index 08eee17b16..c8c30ae074 100644 --- a/usr/src/lib/libpp/common/pp.h +++ b/usr/src/lib/libpp/common/pp.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -82,7 +82,7 @@ #define ppsymset(t,n) (struct ppsymbol*)hashlook(t,n,HASH_CREATE|HASH_SIZE(sizeof(struct ppsymbol)),NiL) #if CHAR_MIN < 0 -#define pptype (ppctype-(CHAR_MIN)+1) +#define pptype (ppctype-(CHAR_MIN)) #else #define pptype (ppctype) #endif diff --git a/usr/src/lib/libpp/common/pp.probe b/usr/src/lib/libpp/common/pp.probe index 285f23da71..5d18c26eda 100644 --- a/usr/src/lib/libpp/common/pp.probe +++ b/usr/src/lib/libpp/common/pp.probe @@ -2,7 +2,7 @@ # Glenn Fowler # AT&T Research # -# @(#)pp.probe (AT&T Research) 2006-09-05 +# @(#)pp.probe (AT&T Research) 2009-02-02 # # C probe for libpp # @@ -25,6 +25,7 @@ architecture= cpu= model= machine= +undef_predef= # # path cleanup @@ -575,6 +576,13 @@ do echo "#include <sys/$i.h>" > t.$src eval sys_$i=$x done +echo "char* fun() { return (char*)__FUNCTION__; } +int main() { return !fun(); }" > fun.$src +rm -f fun.exe +if $cc -o fun.exe fun.$src && test -x fun.exe +then undef_predef="$undef_predef __FUNCTION__" +fi + case "`grep -c '__STDC__[-0 ]*[=!]=[ ]*0' $usrinclude/stdio.h 2>/dev/null`" in 0) ;; *) hostedtransition=1 ;; @@ -1033,6 +1041,13 @@ case $so:$dynamic:$static in *) echo "#define #dialect(dynamic)" ;; esac echo +case $undef_predef in +?*) for m in $undef_predef + do echo "#undef $m" + done + echo + ;; +esac case $plusplus in ?*) echo "#pragma pp:plusplus" ;; esac diff --git a/usr/src/lib/libpp/common/ppargs.c b/usr/src/lib/libpp/common/ppargs.c index 52da340da3..567b216512 100644 --- a/usr/src/lib/libpp/common/ppargs.c +++ b/usr/src/lib/libpp/common/ppargs.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -27,7 +27,7 @@ */ static const char usage[] = -"[-?\n@(#)$Id: cpp (AT&T Research) 2007-03-11 $\n]" +"[-?\n@(#)$Id: cpp (AT&T Research) 2009-02-02 $\n]" USAGE_LICENSE "[+NAME?cpp - C language preprocessor]" "[+DESCRIPTION?\bcpp\b is the preprocessor for all C language dialects. It is" diff --git a/usr/src/lib/libpp/common/ppbuiltin.c b/usr/src/lib/libpp/common/ppbuiltin.c index 4e58af0251..e33d2641d4 100644 --- a/usr/src/lib/libpp/common/ppbuiltin.c +++ b/usr/src/lib/libpp/common/ppbuiltin.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppcall.c b/usr/src/lib/libpp/common/ppcall.c index b06a5961f9..2c18530e6e 100644 --- a/usr/src/lib/libpp/common/ppcall.c +++ b/usr/src/lib/libpp/common/ppcall.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -51,6 +51,7 @@ ppcall(register struct ppsymbol* sym, int tok) int last_line; long old_state; char* last_file; + char* old_next; char* old_token; struct ppmacstk* mp; struct ppinstk* old_in; @@ -183,6 +184,7 @@ ppcall(register struct ppsymbol* sym, int tok) for (p = pp.in->nextchr; isspace(*p); p++); if ((c = *p) != '(' && c != '/' && c != 0 && c != MARK) goto disable; + old_next = (c == MARK) ? pp.in->nextchr : NiL; old_token = pp.token; mp = pp.macp->next; if ((pp.token = (char*)&mp->arg[mac->arity + 1]) > pp.maxmac) @@ -200,24 +202,29 @@ ppcall(register struct ppsymbol* sym, int tok) if (c != '(') { pp.state = old_state; - if (c) + if (old_next) + pp.in->nextchr = old_next; + else { - p = pp.toknxt; - while (p > pp.token) - ungetchr(*--p); + if (c) + { + p = pp.toknxt; + while (p > pp.token) + ungetchr(*--p); #if COMPATIBLE - if ((pp.state & (COMPATIBILITY|STRICT)) == (COMPATIBILITY|STRICT)) - error(1, "%s: macro arguments omitted", sym->name); + if ((pp.state & (COMPATIBILITY|STRICT)) == (COMPATIBILITY|STRICT)) + error(1, "%s: macro arguments omitted", sym->name); #endif - if (c == T_ID && !(pp.state & HIDDEN)) - ungetchr(' '); - } - if (pp.hidden != old_hidden) - { - ungetchr('\n'); - error_info.line--; - if (pp.hidden && !--pp.hidden) - pp.state &= ~HIDDEN; + if (c == T_ID && !(pp.state & HIDDEN)) + ungetchr(' '); + } + if (pp.hidden != old_hidden) + { + ungetchr('\n'); + error_info.line--; + if (pp.hidden && !--pp.hidden) + pp.state &= ~HIDDEN; + } } pp.token = old_token; goto disable; diff --git a/usr/src/lib/libpp/common/ppcomment.c b/usr/src/lib/libpp/common/ppcomment.c index 75e5f1e843..8099e46dac 100644 --- a/usr/src/lib/libpp/common/ppcomment.c +++ b/usr/src/lib/libpp/common/ppcomment.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppcontext.c b/usr/src/lib/libpp/common/ppcontext.c index 7bba261a5f..f87a2fff33 100644 --- a/usr/src/lib/libpp/common/ppcontext.c +++ b/usr/src/lib/libpp/common/ppcontext.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppcontrol.c b/usr/src/lib/libpp/common/ppcontrol.c index fff96641f3..10fb841965 100644 --- a/usr/src/lib/libpp/common/ppcontrol.c +++ b/usr/src/lib/libpp/common/ppcontrol.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -450,6 +450,7 @@ ppcontrol(void) } pp.state &= ~DISABLE; pp.state |= HEADER|STRIP; + pp.in->flags |= IN_noguard; switch (c = pplex()) { case T_STRING: @@ -1468,11 +1469,12 @@ ppcontrol(void) { case T_STRING: s = error_info.file; - if (*(p = pp.token)) pathcanon(p, 0); + if (*(p = pp.token)) + pathcanon(p, 0); fp = ppsetfile(p); error_info.file = fp->name; if (error_info.line == 1) - ppmultiple(fp, INC_TEST); + ppmultiple(fp, INC_IGNORE); switch (c = pplex()) { case '\n': @@ -1953,8 +1955,8 @@ ppcontrol(void) break; case X_MULTIPLE: n = 1; - if (pp.in->type == IN_FILE) - ppmultiple(ppsetfile(error_info.file), i0 ? INC_CLEAR : INC_TEST); + if (pp.in->type == IN_FILE || pp.in->type == IN_RESCAN) + ppmultiple(ppsetfile(error_info.file), i0 ? INC_CLEAR : INC_IGNORE); break; case X_NATIVE: setoption(NATIVE, i0); diff --git a/usr/src/lib/libpp/common/ppcpp.c b/usr/src/lib/libpp/common/ppcpp.c index e9bdae545a..a886799950 100644 --- a/usr/src/lib/libpp/common/ppcpp.c +++ b/usr/src/lib/libpp/common/ppcpp.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppdata.c b/usr/src/lib/libpp/common/ppdata.c index 555773e334..f06f64feb7 100644 --- a/usr/src/lib/libpp/common/ppdata.c +++ b/usr/src/lib/libpp/common/ppdata.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -48,7 +48,7 @@ * only within macro bodies */ -static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2007-06-12 $\0\n"; +static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2009-02-02 $\0\n"; #include "pplib.h" @@ -176,4 +176,4 @@ struct ppglobals pp = /* the rest are implicitly initialized */ }; -char ppctype[UCHAR_MAX]; +char ppctype[UCHAR_MAX+1]; diff --git a/usr/src/lib/libpp/common/pperror.c b/usr/src/lib/libpp/common/pperror.c index e7f575a908..531a08a57d 100644 --- a/usr/src/lib/libpp/common/pperror.c +++ b/usr/src/lib/libpp/common/pperror.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppexpr.c b/usr/src/lib/libpp/common/ppexpr.c index 219b707cb5..225034b97d 100644 --- a/usr/src/lib/libpp/common/ppexpr.c +++ b/usr/src/lib/libpp/common/ppexpr.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppfsm.c b/usr/src/lib/libpp/common/ppfsm.c index 42a7f4ef1a..05b28a64ef 100644 --- a/usr/src/lib/libpp/common/ppfsm.c +++ b/usr/src/lib/libpp/common/ppfsm.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppfsm.h b/usr/src/lib/libpp/common/ppfsm.h index ac471e0e80..4640bcebc2 100644 --- a/usr/src/lib/libpp/common/ppfsm.h +++ b/usr/src/lib/libpp/common/ppfsm.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppincref.c b/usr/src/lib/libpp/common/ppincref.c index 5d4362cb9d..6080d3ed54 100644 --- a/usr/src/lib/libpp/common/ppincref.c +++ b/usr/src/lib/libpp/common/ppincref.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppinput.c b/usr/src/lib/libpp/common/ppinput.c index 0fac34d9e1..b940fa9fe9 100644 --- a/usr/src/lib/libpp/common/ppinput.c +++ b/usr/src/lib/libpp/common/ppinput.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppkey.c b/usr/src/lib/libpp/common/ppkey.c index 8bb10531fd..6953a01908 100644 --- a/usr/src/lib/libpp/common/ppkey.c +++ b/usr/src/lib/libpp/common/ppkey.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppkey.h b/usr/src/lib/libpp/common/ppkey.h index d87543fed2..6c8515fe8f 100644 --- a/usr/src/lib/libpp/common/ppkey.h +++ b/usr/src/lib/libpp/common/ppkey.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/pplex.c b/usr/src/lib/libpp/common/pplex.c index a421393b60..4fd2bbae0b 100644 --- a/usr/src/lib/libpp/common/pplex.c +++ b/usr/src/lib/libpp/common/pplex.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -2036,7 +2036,7 @@ ppcpp(void) SYNCIN(); PUSH_QUOTE(pp.macp->arg[c - ARGOFFSET], pp.macp->line); CACHEIN(); - bp = ip - 1; + *(bp = ip - 1) = '"'; if (st & (COLLECTING|EOF2NL|JOINING)) rp = fsm[START]; if (state = rp[c = '"']) goto fsm_next; goto fsm_get; diff --git a/usr/src/lib/libpp/common/pplib.h b/usr/src/lib/libpp/common/pplib.h index a450eb63a9..5738078f3a 100644 --- a/usr/src/lib/libpp/common/pplib.h +++ b/usr/src/lib/libpp/common/pplib.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppline.c b/usr/src/lib/libpp/common/ppline.c index 62e56c3a73..5bd0014bde 100644 --- a/usr/src/lib/libpp/common/ppline.c +++ b/usr/src/lib/libpp/common/ppline.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppmacref.c b/usr/src/lib/libpp/common/ppmacref.c index efe97e63ce..4b54d66bd0 100644 --- a/usr/src/lib/libpp/common/ppmacref.c +++ b/usr/src/lib/libpp/common/ppmacref.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppmisc.c b/usr/src/lib/libpp/common/ppmisc.c index 22a989ada4..f4dea77f5c 100644 --- a/usr/src/lib/libpp/common/ppmisc.c +++ b/usr/src/lib/libpp/common/ppmisc.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppop.c b/usr/src/lib/libpp/common/ppop.c index 61f9983469..16c0260cd2 100644 --- a/usr/src/lib/libpp/common/ppop.c +++ b/usr/src/lib/libpp/common/ppop.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -841,8 +841,6 @@ ppop(int op, ...) if (!(pp.ppdefault = pathprobe(pp.path, NiL, "C", pp.pass, pp.probe ? pp.probe : PPPROBE, 0))) error(1, "cannot determine default definitions for %s", pp.probe ? pp.probe : PPPROBE); } - if (pp.ppdefault) - sfprintf(sp, "#%s \"%s\"\n", dirname(INCLUDE), pp.ppdefault); if (pp.probe) pp.lastdir->next->type = c; } @@ -908,9 +906,6 @@ ppop(int op, ...) ); sfprintf(sp, "\ -#%s __STDC__\n\ -#%s __STDC__ #(STDC)\n\ -#%s\n\ #%s #%s(%s)\n\ #%s %s:%s\n\ #%s %s:%s\n\ @@ -918,9 +913,6 @@ ppop(int op, ...) #%s\n\ #%s\n\ " - , dirname(IFNDEF) - , dirname(DEFINE) - , dirname(ENDIF) , dirname(IF) , keyname(X_OPTION) , keyname(X_STRICT) @@ -978,6 +970,18 @@ ppop(int op, ...) , pp.pass , keyname(X_BUILTIN) ); + if (pp.ppdefault && *pp.ppdefault) + sfprintf(sp, "#%s \"%s\"\n", dirname(INCLUDE), pp.ppdefault); + sfprintf(sp, +"\ +#%s !defined(__STDC__) && (!#option(compatibility) || #option(transition))\n\ +#%s __STDC__ #(STDC)\n\ +#%s\n\ +" + , dirname(IF) + , dirname(DEFINE) + , dirname(ENDIF) + ); t = sfstruse(sp); debug((-9, "\n/* begin initialization */\n%s/* end initialization */", t)); ppcomment = pp.comment; diff --git a/usr/src/lib/libpp/common/pppragma.c b/usr/src/lib/libpp/common/pppragma.c index bb442471e3..99d3dfa388 100644 --- a/usr/src/lib/libpp/common/pppragma.c +++ b/usr/src/lib/libpp/common/pppragma.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppprintf.c b/usr/src/lib/libpp/common/ppprintf.c index d1c1f9707a..4a7f09e8ba 100644 --- a/usr/src/lib/libpp/common/ppprintf.c +++ b/usr/src/lib/libpp/common/ppprintf.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppproto.c b/usr/src/lib/libpp/common/ppproto.c index b3e6794921..147aecf87c 100644 --- a/usr/src/lib/libpp/common/ppproto.c +++ b/usr/src/lib/libpp/common/ppproto.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppsearch.c b/usr/src/lib/libpp/common/ppsearch.c index 83b956bca9..9730ad177f 100644 --- a/usr/src/lib/libpp/common/ppsearch.c +++ b/usr/src/lib/libpp/common/ppsearch.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -82,7 +82,7 @@ ppmultiple(register struct ppfile* fp, register struct ppsymbol* test) { if (status != INC_CLEAR) { - if (status != INC_TEST && status->macro || !(pp.mode & ALLMULTIPLE) && !(pp.state & STRICT)) + if (status == INC_TEST || status->macro) { if ((pp.mode & (ALLMULTIPLE|LOADING)) == LOADING) fp->guard = INC_IGNORE; @@ -96,6 +96,8 @@ ppmultiple(register struct ppfile* fp, register struct ppsymbol* test) } if ((pp.mode & (ALLMULTIPLE|LOADING)) == LOADING) test = INC_IGNORE; + else + return 1; } fp->guard = test; return 1; @@ -605,8 +607,14 @@ ppsearch(char* file, int type, int flags) pp.include = 0; fd = -1; - dospath = 0; chop = 0; + if (s = strchr(file, '\\')) + { + do *s++ = '/'; while (s = strchr(s, '\\')); + dospath = 1; + } + else + dospath = 0; again: pathcanon(file, 0); if (chop) @@ -757,15 +765,6 @@ ppsearch(char* file, int type, int flags) switch (dospath) { - case 0: - if (s = strchr(file, '\\')) - { - do *s++ = '/'; while (s = strchr(s, '\\')); - pathcanon(file, 0); - dospath = 1; - goto again; - } - /*FALLTHROUGH*/ case 1: if (ppisid(file[0]) && file[1] == ':' && file[2] == '/') { diff --git a/usr/src/lib/libpp/common/ppsym.c b/usr/src/lib/libpp/common/ppsym.c index 5fa4d7ff23..1fd5ea9105 100644 --- a/usr/src/lib/libpp/common/ppsym.c +++ b/usr/src/lib/libpp/common/ppsym.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/pptrace.c b/usr/src/lib/libpp/common/pptrace.c index a10117f4bd..d46e50e23d 100644 --- a/usr/src/lib/libpp/common/pptrace.c +++ b/usr/src/lib/libpp/common/pptrace.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * |