From: John Millaway Date: Fri, 14 Mar 2003 06:30:50 +0000 (+0000) Subject: Keeping tests up to date with m4 changes. X-Git-Tag: flex-2-5-34~35^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab89ff7ddb89f9482263f60df3f18f2b1597d835;p=flex Keeping tests up to date with m4 changes. Proper wait for all children. --- diff --git a/main.c b/main.c index 3717b5a..b547448 100644 --- 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) + diff --git a/tests/test-table-opts/scanner.l b/tests/test-table-opts/scanner.l index 18e776b..5b3255f 100644 --- a/tests/test-table-opts/scanner.l +++ b/tests/test-table-opts/scanner.l @@ -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 */