Nameclashing with is_finite macro
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: 1. 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
Thanks, Johan
Actually, we originally named it isFinite() just for that purpose.
bob
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
- change the is_finite macro name in 2geom/isnan.h to something less clashable
Thanks, Johan
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Inkscape's isnan.h defines isFinite and isNaN:
# define isFinite(_a) (std::isfinite(_a)) # define isNaN(_a) (std::isnan(_a))
2Geom's isnan.h defines is_finite and is_nan:
# define is_finite(_a) (std::isfinite(_a)) # define is_nan(_a) (std::isnan(_a))
So changing is_finite() to isFinite() in proj_pt.h did not help :-(
I find it easier when macros are capitalized: IS_FINITE. So it is very clear it is a macro, and it can never clash with a functionname (nobody writes capital functionnames right? ;)
Thanks, Johan
-----Original Message----- From: inkscape-devel-bounces@lists.sourceforge.net [mailto:inkscape-devel-bounces@lists.sourceforge.net] On Behalf Of Bob Jamison Sent: zaterdag 10 mei 2008 16:26 To: Engelen, J.B.C. (Johan); inkscape Subject: Re: [Inkscape-devel] Nameclashing with is_finite macro
Actually, we originally named it isFinite() just for that purpose.
bob
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
Thanks, Johan
--- This SF.net email is sponsored by the 2008 JavaOne(SM)
Conference
Don't miss this year's exciting event. There's still time
to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com
/javaone _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java
.sun.com/javaone
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (2)
-
unknown@example.com
-
Bob Jamison