JohnCremona / eclib

The eclib package includes mwrank (for 2-descent on elliptic curves over Q) and modular symbol code used to create the elliptic curve database.
GNU General Public License v2.0
21 stars 15 forks source link

Avoid name clash with iszero macro in math.h. #38

Closed jamesjer closed 6 years ago

jamesjer commented 6 years ago

TS 18661-1 [1][2] introduced a macro named iszero, which is already present in math.h in recent versions of glibc. Since it is a macro, the definition and uses of eclib's iszero method in its Point class are expanded, leading to compilation failure. This patch ensures the macro is not defined where it will cause trouble.

References: [1] https://www.iso.org/standard/63146.html [2] A draft version can be read here: http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1778.pdf

JohnCremona commented 6 years ago

Thanks for the report. My plan is instead to rename the iszero() method to is_zero().

jamesjer commented 6 years ago

Okay. That's probably the better plan, but I didn't want to tinker with eclib's API.

JohnCremona commented 6 years ago

I changed the method name in the includes branch.

JohnCremona commented 6 years ago

Closing since PR#35 fixes this and more.