From: Perl 5 Porters Date: Sun, 17 Mar 1996 10:31:40 +0000 (+0000) Subject: perl 5.002_01: perl.h X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=728e280303ae3d3b605c94069c3edec14b19d24e;p=p5sagit%2Fp5-mst-13.2.git perl 5.002_01: perl.h Provide hook for single-statement macro definitions which keeps different C compilers happy; add $^O and local patch list --- diff --git a/perl.h b/perl.h index cf12d63..bfb9210 100644 --- a/perl.h +++ b/perl.h @@ -10,6 +10,29 @@ #define H_PERL 1 #define OVERLOAD +/* + * STMT_START { statements; } STMT_END; + * can be used as a single statement, as in + * if (x) STMT_START { ... } STMT_END; else ... + * + * Trying to select a version that gives no warnings... + */ +#if !(defined(STMT_START) && defined(STMT_END)) +# if defined(__GNUC__) && !defined(__STRICT_ANSI__) +# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ +# define STMT_END ) +# else + /* Now which other defined()s do we need here ??? */ +# if (VOIDFLAGS) && (defined(sun) || defined(__sun__)) +# define STMT_START if (1) +# define STMT_END else (void)0 +# else +# define STMT_START do +# define STMT_END while (0) +# endif +# endif +#endif + #include "embed.h" #define VOIDUSED 1 @@ -283,7 +306,7 @@ #else # define FIXSTATUS(sts) (U_L(sts)) # define SHIFTSTATUS(sts) (sts) -# define SETERRNO(errcode,vmserrcode) {set_errno(errcode); set_vaxc_errno(vmserrcode);} +# define SETERRNO(errcode,vmserrcode) STMT_START {set_errno(errcode); set_vaxc_errno(vmserrcode);} STMT_END #endif #ifndef MSDOS @@ -861,6 +884,7 @@ EXT char ** origenviron; EXT U32 origalen; EXT U32 * profiledata; EXT int maxo INIT(MAXO);/* Number of ops */ +EXT char * osname; /* operating system */ EXT XPV* xiv_arenaroot; /* list of allocated xiv areas */ EXT IV ** xiv_root; /* free xiv list--shared by interpreters */ @@ -1207,6 +1231,7 @@ IEXT SV * Iparsehook; IEXT char * Icddir; IEXT bool Iminus_c; IEXT char Ipatchlevel[10]; +IEXT char ** Ilocalpatches; IEXT SV * Inrs; IEXT char * Isplitstr IINIT(" "); IEXT bool Ipreprocess;