diff options
author | millaway <millaway> | 2002-03-18 07:50:28 +0000 |
---|---|---|
committer | millaway <millaway> | 2002-03-18 07:50:28 +0000 |
commit | ec664b3f1b616e63336a976b8322d6edf41f687a (patch) | |
tree | cf5cd71c72282f4f46781920511a241f0a22c7e9 /flex.skl | |
parent | b33a4821348885f06e55d0493ec83a3ee88b1b51 (diff) | |
download | flex-ec664b3f1b616e63336a976b8322d6edf41f687a.tar.gz |
Removed CFront 1.2 -specific code from skeleton, because CFront now defines __cplusplus properly.
Removed TurboC-specific code from skeleton.
Skeleton now includes proper C++ standard headers.
Relocated "unistd.h" code after user section 1 to allow user to overrid it.
New option "nounistd" to suppress unistd.h from being included.
Diffstat (limited to 'flex.skl')
-rw-r--r-- | flex.skl | 56 |
1 files changed, 20 insertions, 36 deletions
@@ -23,29 +23,24 @@ #define YY_FLEX_MINOR_VERSION 5 %- +/* begin standard C headers. */ #include <stdio.h> #include <errno.h> +#include <stdlib.h> +/* end standard C headers. */ %+ +/* begin standard C++ headers. */ +#include <iostream> #include <cerrno> +#include <cstdlib> +/* end standard C++ headers. */ %* - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - #ifdef __cplusplus -#include <stdlib.h> %+ #define FLEX_STD std:: -#include <iostream> %* -#include <unistd.h> /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -63,15 +58,6 @@ #endif /* __STDC__ */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - #ifdef YY_USE_CONST #define yyconst const #else @@ -402,6 +388,19 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); %% [4.0] data tables for the DFA and the user's section 1 definitions go here %e +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#ifndef YY_NO_UNISTD_H +%- +#include <unistd.h> +%+ +#include <cunistd> +%* +#endif /* !YY_NO_UNISTD_H */ + + #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif @@ -591,21 +590,6 @@ static int yy_top_state YY_PROTO(( YY_ONLY_ARG )); #define YY_NO_TOP_STATE 1 #endif -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 |