Peter Rosin skrev 2011-12-21 10:58:
> Hi!
> 
> Below is a patch that makes the lex library detection and
> the yytext-pointer tests not stumble when the system does
> not provide a unistd.h include.
> 
> Ok to push?
> 
> Cheers,
> Peter
> 
> --------------------8<---------------------
> 
> * lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL):
> Don't require unistd.h to be present, which it isn't
> with, e.g., MSVC.
> ---
>  ChangeLog                |    7 +++++++
>  lib/autoconf/programs.m4 |    4 ++++
>  2 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 0f67f89..732e388 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,10 @@
> +2011-12-21  Peter Rosin  <[email protected]>
> +
> +     Fix LEXLIB and YYTEXT_POINTER on non-ANSI systems.
> +     * lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL):
> +     Don't require unistd.h to be present, which it isn't
> +     with, e.g., MSVC.
> +
>  2011-12-07  Paul Eggert  <[email protected]>
>  
>       AC_LANG_BOOL_COMPILE_TRY(C): port to g++ with warnings
> diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
> index fb3d8b9..0e97070 100644
> --- a/lib/autoconf/programs.m4
> +++ b/lib/autoconf/programs.m4
> @@ -719,6 +719,10 @@ fi])
>  # declares yytext as a char * by default.
>  m4_define([_AC_PROG_LEX_YYTEXT_DECL],
>  [cat >conftest.l <<_ACEOF[
> +%{
> +/* avoid non-ANSI #include of unistd.h */
> +#define YY_NO_UNISTD_H 1
> +%}
>  %%
>  a { ECHO; }
>  b { REJECT; }

Ping?

Cheers,
Peter

Reply via email to