Re: [Inkscape-devel] [Lib2geom-devel] Nameclashing with is_finite macro
-----Original Message----- From: njh [mailto:njh@...1927...] Sent: zaterdag 10 mei 2008 20:25 To: Engelen, J.B.C. (Johan) Cc: lib2geom-devel@lists.sourceforge.net; inkscape-devel@lists.sourceforge.net Subject: Re: [Lib2geom-devel] Nameclashing with is_finite macro
On Sat, 10 May 2008 J.B.C.Engelen@...1578... wrote:
Hi all,
I am having troubles with the is_finite 2geom macro. In
Inkscape code,
there are cases where an is_finite function is defined
(proj_pt.h for
example). This goes okay now, only because no 2geom headers are included before that header is included. If the isnan.h header is included before proj_pt.h, the compiler will place the
is_finite macro
in the function definition and compilation will fail. (on
windows in
any case)
I see 2 options:
- change the is_finite function name in proj_pt.h 2. change the
is_finite macro name in 2geom/isnan.h to something less clashable
- Namespaces?
I think macro's don't have namespaces.
- Considering they are in fact the same function (copied),
why not add a test for existence and use the same name?
They are not the same function: proj_pt.h => "inline bool is_finite() { return pt[2] != 0; }" is not like the std:isfinite which takes an argument.
-johan
I resolved the nameclashing issue by capitalizing the macros in 2geom and updating Inkscape to the latest 2geom.
-Johan
participants (1)
-
unknown@example.com