Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion to C++ headers: cmath, cfloat etc. #452

Open
chipbarnaby opened this issue Dec 14, 2023 · 0 comments
Open

Conversion to C++ headers: cmath, cfloat etc. #452

chipbarnaby opened this issue Dec 14, 2023 · 0 comments
Assignees

Comments

@chipbarnaby
Copy link
Contributor

chipbarnaby commented Dec 14, 2023

C++ applications should #include <cxxxx> as opposed to the C compatibility <xxxx.h>. That is, c<cmath>, not <math.h>.

Branch cmath makes the math.h -> cmath change.

Confused use of both in CSE caused results changes when vendor #includes were altered. Prior to fixes, cnglob.h included <math.h>. If a vendor include internally used cmath, compilation changes could result, e.g. for pow(), because math.h and cmath declare different overloads.

All CSE uses have been changed to cmath.

Lingering used of math.h that should be investigated / fixed --

D:\cse\vendor\kiva\src\libkiva\Functions.hpp(11):#include <math.h>
D:\cse\vendor\kiva\src\libkiva\Mesher.hpp(11):#include <math.h> <<<<<< also #include <cmath>
D:\cse\vendor\penumbra\vendor\glfw\src\input.c(35):#include <math.h>
D:\cse\vendor\penumbra\vendor\glfw\src\monitor.c(33):#include <math.h>
D:\cse\vendor\penumbra\vendor\glfw\src\win32_joystick.c(33):#include <math.h>
D:\cse\vendor\penumbra\vendor\libtess2\Source\geom.c(36):#include <math.h>
D:\cse\vendor\penumbra\vendor\libtess2\Source\tess.c(40):#include <math.h>

Other C-compatibility headers should be replaced incrementally (one at a time).

@chipbarnaby chipbarnaby changed the title cmath followup Conversion to C++ headers: cmath, cfloat etc. Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants