guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build failures - compiling TeXmacs under guile 2.0.5


From: Jan Synacek
Subject: Re: Build failures - compiling TeXmacs under guile 2.0.5
Date: Mon, 28 May 2012 09:02:13 +0200
User-agent: Mutt/1.5.21 (2011-07-01)

On 05/25/12 at 05:51pm, Ludovic Courtès wrote:
> Hi!
> 
> Jan Synacek <address@hidden> skribis:
> 
> >   Guile/Glue/glue.cpp:233:31: error: cannot convert ‘SCM {aka
> >   scm_unused_struct*}’ to ‘const char*’ for argument ‘1’ to 
> > ‘scm_unused_struct*
> >   scm_str2string(const char*)’
> 
> [...]
> 
> > glue.cpp:233 looks like this:
> >     char* _r= scm_scm2str (s, &len_r); // my comment - s is declared as SCM
> 
> Indeed, scm_str2string expects a ‘const char *’, not an ‘SCM’.
> 
> But what is the definition of ‘scm_scm2str’?  It must be in TeXmacs.

It's a macro:

#define scm_scm2str gh_scm2newstr

I added additional

#define gh_scm2newstr(a, b) scm_str2string((a))

to 'bridge' it. It's quite ugly I must say, plus I'm not really sure if it
doesn't break anything else. And I can't make c++ to cast SCM to char *,
even with reinterpret_cast, as SCM is not a pointer.

Can you please suggest a way (if there is a generic one) to fix these kinds of
old->new api problems?

> 
> >   Guile/Glue/glue.cpp:1267:46: error: invalid conversion from ‘FN {aka
> >   scm_unused_struct* (*)()}’ to ‘scm_t_subr {aka void*}’ [-fpermissive]
> 
> [...]
> 
> >    scm_new_procedure ("tree?", (FN) treeP, 1, 0, 0);
> 
> Yes, FN should be defined like this:
> 
>   typedef scm_t_subr FN;
> 
> or:
> 
>   #define FN scm_t_subr
> 
> Can you check whether that solves the problem?

This seems to have helped.

> 
> Thanks,
> Ludo’.

Thanks,
Jan
-- 
Jan Synacek
Software Engineer, BaseOS team Brno, Red Hat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]