Hi all,
recently there was a discussion about name clashes involving is_finite(). The problem appeared to be solved but now I ran into it (or something similar?) again. Namely, adding the line
#include "live_effects/effect.h"
to object-edit.cpp yielded the following compile error:
object-edit.cpp: In function ‘void sp_spiral_outer_set(SPItem*, const NR::Point&, const NR::Point&, guint)’: object-edit.cpp:1121: error: ‘isFinite’ was not declared in this scope
When I additionally changed the line
#include "isnan.h"
to
#include "2geom/isnan.h"
and replaced isFinite() with IS_FINITE(), compilation worked fine again. Thus it seems that there is some kind of clashing between isnan.h and 2geom/isnan.h. Has anyone else seen this and what should be done to avoid further difficulties in the future?
Max
-----Original Message----- From: inkscape-devel-bounces@lists.sourceforge.net [mailto:inkscape-devel-bounces@lists.sourceforge.net] On Behalf Of Maximilian Albert Sent: zondag 18 mei 2008 15:45 To: inkscape; lib2geom-devel@lists.sourceforge.net Subject: [Inkscape-devel] isFinite() problem again
Hi all,
recently there was a discussion about name clashes involving is_finite(). The problem appeared to be solved but now I ran into it (or something similar?) again. Namely, adding the line
#include "live_effects/effect.h"
to object-edit.cpp yielded the following compile error:
object-edit.cpp: In function ‘void sp_spiral_outer_set(SPItem*, const NR::Point&, const NR::Point&, guint)’: object-edit.cpp:1121: error: ‘isFinite’ was not declared in this scope
The problem was that 2Geom did not put its "#ifndef __ISNAN_H__ #define __ISNAN_H__" in its own namespace; i.e. the defines to check whether 2geom/isnan.h was already included or not. Inkscape's isnan.h uses the same defined name to check this, so...
I updated to latest 2geom, now the problem should be solved.
Still, one cannot include 2geom files *after* including Inkscape's isnan.h; a permanent solution is to capitalize the macros in Inkscape's isnan.h.
Cheers, Johan
On 19/05/2008, at 12:09 AM, J.B.C.Engelen@...1578... wrote:
The problem was that 2Geom did not put its "#ifndef __ISNAN_H__ #define __ISNAN_H__" in its own namespace; i.e. the defines to check whether 2geom/ isnan.h was already included or not. Inkscape's isnan.h uses the same defined name to check this, so...
I updated to latest 2geom, now the problem should be solved.
Still, one cannot include 2geom files *after* including Inkscape's isnan.h; a permanent solution is to capitalize the macros in Inkscape's isnan.h.
I'm pretty sure that when lib2geom was started, it just took Inkscape's current isnan.h. Since these definitions are equivalent, isn't the right thing to avoid these clashes just to remove Inkscape's isnan.h completely, and just use the lib2geom one everywhere?
Cheers, Michael
------ Michael Wybrow Clayton School of Information Technology Monash University, Wellington Road, Clayton, Vic 3800, Australia Phone: +613 9905 2479
-----Original Message----- From: Michael Wybrow [mailto:mjwybrow@...400...] On Behalf Of Michael Wybrow Sent: zondag 18 mei 2008 23:29 To: Engelen, J.B.C. (Johan) Cc: Anhalter42@...173...; inkscape-devel@lists.sourceforge.net; lib2geom-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] isFinite() problem again
On 19/05/2008, at 12:09 AM, J.B.C.Engelen@...1578... wrote:
The problem was that 2Geom did not put its "#ifndef __ISNAN_H__ #define __ISNAN_H__" in its own namespace; i.e. the defines to check whether
2geom/ isnan.h
was already included or not. Inkscape's isnan.h uses the
same defined
name to check this, so...
I updated to latest 2geom, now the problem should be solved.
Still, one cannot include 2geom files *after* including Inkscape's isnan.h; a permanent solution is to capitalize the macros in Inkscape's isnan.h.
I'm pretty sure that when lib2geom was started, it just took Inkscape's current isnan.h. Since these definitions are equivalent, isn't the right thing to avoid these clashes just to remove Inkscape's isnan.h completely, and just use the lib2geom one everywhere?
The problem is that both files evolved a bit, and the definitions have gotten different names and such. If the files would be exactly the same, there wouldn't be a problem :)
For me, it's okay to start using 2geom's isnan.h. But perhaps there are good arguments not to do it.
Johan
participants (3)
-
unknown@example.com
-
Maximilian Albert
-
Michael Wybrow