develooper Front page | perl.perl5.porters | Postings from October 2008

Re: fix for failed Gconvert detection under C++

Thread Previous
From:
H.Merijn Brand
Date:
October 28, 2008 05:55
Subject:
Re: fix for failed Gconvert detection under C++
Message ID:
20081028135536.64b92c79@pc09.procura.nl
On Tue, 28 Oct 2008 22:24:05 +1100, Tony Cook <tony@develop-help.com>
wrote:

> For example:
> 
> http://www.nntp.perl.org/group/perl.daily-build.reports/2008/10/msg61028.html
> 
> The problem being that the test try.c isn't valid C++.
> 
> The attached patch:
> 
> - changes the K&R function definition into a prototype, since other
>   test code uses prototypes
> 
> - moves detection of string.h further up, so $i_string can be included
>   if available for strcmp ().
> 
> - fixes the stdlib define in the test code
> 
> I guess this will need some re-work into metaconfig.

Yes. Next time, please propose the diff without the `moved' blocks, as
that will happen automatically when I do it the right way. Now it just
hides the real change.

That will leave the change below, which looks quite good. Very nice
catch about the #define! (Hint, please find more of thos for me to
fix :)

Will apply later today.

> --- perl-master/Configure	2008-10-28 05:36:47.000000000 +1100
> +++ work/Configure	2008-10-28 21:32:50.000000000 +1100
> @@ -9673,15 +9713,18 @@
>  
>  #include <stdio.h>
>  
> -#define I_STDLIB $i_stdlib
> +#$i_stdlib I_STDLIB
>  #ifdef I_STDLIB
>  #include <stdlib.h>
>  #endif
>  
> +#$i_string I_STRING
> +#ifdef I_STRING
> +#include <string.h>
> +#endif
> +
>  int
> -checkit(expect, got)
> -char *expect;
> -char *got;
> +checkit(char *expect, char *got)
>  {
>      if (strcmp(expect, got)) {
>  		printf("%s oddity:  Expected %s, got %s\n",


-- 
H.Merijn Brand          Amsterdam Perl Mongers  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About