X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f NNTP-Posting-Date: Tue, 21 Dec 2010 23:04:13 -0600 From: "Allan" Newsgroups: comp.os.msdos.djgpp References: <201012201923 DOT 11290 DOT juan DOT guerrero AT gmx DOT de> Subject: Re: error compiling bc 1.06 with readline 6.1 and flex 2.54 Date: Tue, 21 Dec 2010 23:04:18 -0600 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Message-ID: <6v-dnXAN2ZlQG4zQnZ2dnUVZ_judnZ2d@earthlink.com> Lines: 113 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.226.105.144 X-Trace: sv3-kA8L3LpZXUfLwXEM5OiqbH9EMiBczf4/nH+maT6mydwoFSuc5pY/s6gn4XvX6tSjjx+SxcEz3SppbBw!hj1brbGxYGbI1tIPGpr4QC8uHnNZnckip8y4H7AfRuAobUnFiD1zR5tBF0QyQdKYqAiy92dzGPdw!If8SPlIPDiSyx1//RHKHnqv7sIDgjnCM X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 5339 X-Original-Bytes: 5278 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Juan Manuel Guerrero" wrote in message news:201012201923 DOT 11290 DOT juan DOT guerrero AT gmx DOT de... > On Sat, 18 Dec 2010 13:17:51 -0600, Allan wrote: > > [snip] >> I got it to build by manually editing bc\scan.l; just comment out the >> (re)definition of the string pointer `readline'. > [snip] > > That is wrong. The bc-1.06 port ist 10 years old so that certain readline > declarations do no longer match the declarations used in the bc headers. > The readline function declaration in readline header is an external > declaration > and you should make match the readline declaration in the .l file with the > one > in the readline header . Below a small patch that will make compile the > bc port with djdev204 and rdln61. > > Regards, > Juan M. Guerrero > > > diff -aprNU5 bc-1.06.orig/bc/scan.l bc-1.06/bc/scan.l > --- bc-1.06.orig/bc/scan.l 2000-09-13 18:25:46 +0000 > +++ bc-1.06/bc/scan.l 2010-12-20 18:47:54 +0000 > @@ -141,11 +141,11 @@ static char *rl_line = (char *)NULL; > static char *rl_start = (char *)NULL; > static int rl_len = 0; > > /* Definitions for readline access. */ > extern FILE *rl_instream; > -_PROTOTYPE(char *readline, (char *)); > +_PROTOTYPE(char *readline, (const char *)); > > /* rl_input puts upto MAX characters into BUF with the number put in > BUF placed in *RESULT. If the yy input file is the same as > rl_instream (stdin), use readline. Otherwise, just read it. > */ > @@ -311,11 +311,11 @@ limits return(Limits); > } > } > } > [a-z][a-z0-9_]* { yylval.s_value = strcopyof(yytext); return(NAME); } > \"[^\"]*\" { > - unsigned char *look; > + char *look; > int count = 0; > yylval.s_value = strcopyof(yytext); > for (look = yytext; *look != 0; look++) > { > if (*look == '\n') line_no++; > @@ -323,11 +323,11 @@ limits return(Limits); > } > if (count != 2) yyerror ("NUL character in string."); > return(STRING); > } > {DIGIT}({DIGIT}|\\\n)*("."({DIGIT}|\\\n)*)?|"."(\\\n)*{DIGIT}({DIGIT}|\\\n)* > { > - unsigned char *src, *dst; > + char *src, *dst; > int len; > /* remove a trailing decimal point. */ > len = strlen(yytext); > if (yytext[len-1] == '.') > yytext[len-1] = 0; > diff -aprNU5 bc-1.06.orig/djgpp/config.bat bc-1.06/djgpp/config.bat > --- bc-1.06.orig/djgpp/config.bat 2000-12-23 01:40:26 +0000 > +++ bc-1.06/djgpp/config.bat 2010-12-20 18:20:30 +0000 > @@ -145,18 +145,18 @@ if errorlevel 1 goto WithoutNLS > > :WithNLS > Rem We prefer without-included-gettext because libintl.a from gettext > package > Rem is the only one that is garanteed to have been ported to DJGPP. > echo Running the ./configure script... > -sh ./configure --src=%XSRC% --enable-nls --without-included-gettext > +sh > /configure --src=%XSRC% --enable-nls --without-included-gettext --with-readline > if errorlevel 1 goto CfgError > echo Done. > goto End > > :WithoutNLS > echo Running the ./configure script... > -sh ./configure --src=%XSRC% --disable-nls > +sh ./configure --src=%XSRC% --disable-nls --with-readline > if errorlevel 1 goto CfgError > echo Done. > goto End > > :SedError > diff -aprNU5 bc-1.06.orig/lib/number.c bc-1.06/lib/number.c > --- bc-1.06.orig/lib/number.c 2000-10-03 18:34:24 +0000 > +++ bc-1.06/lib/number.c 2010-12-20 18:36:42 +0000 > @@ -33,10 +33,13 @@ > #include > #include > #include > #include > #include /* Prototypes needed for external utility routines. */ > +#if defined (HAVE_STRING_H) > +# include > +#endif > > #define bc_rt_warn rt_warn > #define bc_rt_error rt_error > #define bc_out_of_memory out_of_memory > Thanks for the correct code changes for the `.l' file and the `.c' source file. I was afraid that my "fix" did not work but there is no test suite for bc 1.06 . I will apply the patch and post back.