]> granicus.if.org Git - flex/commitdiff
Keeping tests up to date with m4 changes.
authorJohn Millaway <john43@users.sourceforge.net>
Fri, 14 Mar 2003 06:30:50 +0000 (06:30 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Fri, 14 Mar 2003 06:30:50 +0000 (06:30 +0000)
Proper wait for all children.

main.c
tests/test-table-opts/scanner.l

diff --git a/main.c b/main.c
index 3717b5ab21a1b1b3c075284577d86db40265d105..b5474487672152fd955b8946c161596ed684563c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -160,7 +160,8 @@ int flex_main (argc, argv)
        if (exit_status){
         fflush(stdout);
         fclose(stdout);
-        wait(0);
+        while (wait(0) > 0){
+        }
                return exit_status - 1;
     }
 
@@ -367,7 +368,7 @@ void check_options ()
                char   *pname = 0;
                int     nbytes = 0;
 
-               action_define ("YY_TABLES_EXTERNAL", 1);
+               buf_m4_define (&m4defs_buf, "M4_YY_TABLES_EXTERNAL", NULL);
 
                if (!tablesfilename) {
                        nbytes = strlen (prefix) +
index 18e776b60f6c10aa1cb394d8904fe19f6364bc29..5b3255fcd6fc4b02c190d9c409a0925b949fe044 100644 (file)
@@ -53,7 +53,8 @@ m4_ifdef( [[M4_YY_REENTRANT]],
     yylex_init(&yyscanner);
 ]])
 
-#ifdef YY_TABLES_EXTERNAL
+m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
+[[
     if((fp  = fopen(argv[1],"r"))== NULL)
         yy_fatal_error("could not open tables file for reading" M4_YY_CALL_LAST_ARG);
 
@@ -61,7 +62,7 @@ m4_ifdef( [[M4_YY_REENTRANT]],
         yy_fatal_error("yytables_fload returned < 0" M4_YY_CALL_LAST_ARG);
     if(M4_YY_TABLES_VERIFY)
         exit(0);
-#endif
+]])
     
     if(argc > 2){
         if((fp  = fopen(argv[2],"r"))== NULL)
@@ -71,9 +72,10 @@ m4_ifdef( [[M4_YY_REENTRANT]],
     while(yylex(M4_YY_CALL_ONLY_ARG) != 0)
         ;
         
-#ifdef YY_TABLES_EXTERNAL
+m4_ifdef( [[YY_TABLES_EXTERNAL]],
+[[
     yytables_destroy(M4_YY_CALL_ONLY_ARG);
-#endif
+]])
     yylex_destroy(M4_YY_CALL_ONLY_ARG);
 
     if(argc < 0) /* silence the compiler */