There are lots of VMS and TURBOC and I don't even know what turds in
lex. This firebombs some of the larger, more visible targets.

Fun fact: /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */

Index: flexdef.h
===================================================================
RCS file: /cvs/src/usr.bin/lex/flexdef.h,v
retrieving revision 1.7
diff -u -p -r1.7 flexdef.h
--- flexdef.h   3 Feb 2004 21:20:17 -0000       1.7
+++ flexdef.h   17 Dec 2014 22:31:21 -0000
@@ -40,37 +40,11 @@
 
 #include "config.h"
 
-#ifdef __TURBOC__
-#define HAVE_STRING_H 1
-#define MS_DOS 1
-#ifndef __STDC__
-#define __STDC__ 1
-#endif
- #pragma warn -pro
- #pragma warn -rch
- #pragma warn -use
- #pragma warn -aus
- #pragma warn -par
- #pragma warn -pia
-#endif
-
-#ifdef HAVE_STRING_H
 #include <string.h>
-#else
-#include <strings.h>
-#endif
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
 
-#ifdef STDC_HEADERS
 #include <stdlib.h>
-#else
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
 
 
 /* As an aid for the internationalization patch to flex, which
@@ -95,18 +69,6 @@
 #endif
 #endif
 
-#ifdef VMS
-#ifndef __VMS_POSIX
-#define unlink remove
-#define SHORT_FILE_NAMES
-#endif
-#endif
-
-#ifdef MS_DOS
-#define SHORT_FILE_NAMES
-#endif
-
-
 /* Maximum line length we'll have to deal with. */
 #define MAXLINE 2048
 
@@ -125,7 +87,6 @@
 #ifndef isascii
 #define isascii(c) ((c) <= 0177)
 #endif
-
 
 #define true 1
 #define false 0
Index: initscan.c
===================================================================
RCS file: /cvs/src/usr.bin/lex/initscan.c,v
retrieving revision 1.14
diff -u -p -r1.14 initscan.c
--- initscan.c  4 Nov 2013 17:03:32 -0000       1.14
+++ initscan.c  17 Dec 2014 22:33:56 -0000
@@ -13,15 +13,6 @@
 
 #include <stdio.h>
 
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
 #ifdef __cplusplus
 
 #include <stdlib.h>
@@ -42,15 +33,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
Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/lex/main.c,v
retrieving revision 1.14
diff -u -p -r1.14 main.c
--- main.c      16 Mar 2014 18:38:30 -0000      1.14
+++ main.c      17 Dec 2014 22:32:54 -0000
@@ -48,11 +48,6 @@ void flexinit PROTO((int, char**));
 void readin PROTO((void));
 void set_up_initial_allocations PROTO((void));
 
-#ifdef NEED_ARGV_FIXUP
-extern void argv_fixup PROTO((int *, char ***));
-#endif
-
-
 /* these globals are all defined and commented in flexdef.h */
 int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
 int interactive, caseins, lex_compat, do_yylineno, useecs, fulltbl, usemecs;
@@ -117,14 +112,6 @@ static const char outfile_template[] = "
 static const char backing_name[] = "lex.bck";
 #endif
 
-#ifdef THINK_C
-#include <console.h>
-#endif
-
-#ifdef MS_DOS
-extern unsigned _stklen = 16384;
-#endif
-
 static char outfile_path[MAXLINE];
 static int outfile_created = 0;
 static char *skelname = NULL;
@@ -136,13 +123,6 @@ char **argv;
        {
        int i;
 
-#ifdef THINK_C
-       argc = ccommand( &argv );
-#endif
-#ifdef NEED_ARGV_FIXUP
-       argv_fixup( &argc, &argv );
-#endif
-
        flexinit( argc, argv );
 
        readin();
@@ -973,17 +953,8 @@ _( "Variable trailing context rules enta
                {
                if ( do_stdinit )
                        {
-                       outn( "#ifdef VMS" );
-                       outn( "#ifndef __VMS_POSIX" );
-                       outn( yy_nostdinit );
-                       outn( "#else" );
-                       outn( yy_stdinit );
-                       outn( "#endif" );
-                       outn( "#else" );
                        outn( yy_stdinit );
-                       outn( "#endif" );
                        }
-
                else
                        outn( yy_nostdinit );
                }
Index: parse.y
===================================================================
RCS file: /cvs/src/usr.bin/lex/parse.y,v
retrieving revision 1.8
diff -u -p -r1.8 parse.y
--- parse.y     4 Jun 2003 17:34:44 -0000       1.8
+++ parse.y     17 Dec 2014 22:30:19 -0000
@@ -43,46 +43,7 @@
 /* $Header: /cvs/src/usr.bin/lex/parse.y,v 1.8 2003/06/04 17:34:44 millert Exp 
$ */
 
 
-/* Some versions of bison are broken in that they use alloca() but don't
- * declare it properly.  The following is the patented (just kidding!)
- * #ifdef chud to fix the problem, courtesy of Francois Pinard.
- */
-#ifdef YYBISON
-/* AIX requires this to be the first thing in the file.  What a piece.  */
-# ifdef _AIX
- #pragma alloca
-# endif
-#endif
-
 #include "flexdef.h"
-
-/* The remainder of the alloca() cruft has to come after including flexdef.h,
- * so HAVE_ALLOCA_H is (possibly) defined.
- */
-#ifdef YYBISON
-# ifdef __GNUC__
-#  ifndef alloca
-#   define alloca __builtin_alloca
-#  endif
-# else
-#  if HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef __hpux
-void *alloca ();
-#   else
-#    ifdef __TURBOC__
-#     include <malloc.h>
-#    else
-char *alloca ();
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
-/* Bletch, ^^^^ that was ugly! */
-
 
 int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, rulelen;
 int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;

Reply via email to