-
Notifications
You must be signed in to change notification settings - Fork 29
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
Implement C complex API in C++ #8
Comments
@BatchDrake I'm confused. I can compile the code without any compiler errors!
What's your macOS version? (I have update all Macbooks I have access to, so I can't test with older versions) |
Sorry my bad. Ignore the previous comment. |
Don't worry! For testing purposes in these early stages, I suggest you generate a file with a bunch of random |
I was thinking of changing the header like this:
and
What do you think about it? If you agree I can test it thoroughly, change the file and send a pull request. |
Looks good! According to the C++ API (https://en.cppreference.com/w/cpp/numeric/complex) those methods are just fine. Moreover,
|
FYI I'm working on resolving an issue on default g++ in macOS:
Have you observed a similar behaviour? (just import
|
The problem with that definition is that it will break in g++-9.2.1 (Debian) using C++-14:
I guess something similar will happen with the latest versions of the language. Could you share which version of the language are you using? (just print the value of Also, I see the type is Additionally, Try to define |
The default g++ without any compiler flags:
Ok this resolves the issue and now the output of the |
In systems relying on clang for compiling C++ programs (like MacOS X), the complex C API in
complex.h
is not exposed. This makes sigutils and suscan's headers useless for C++ programs.In order to fix this,
SU_C_*
macros in<sigutils/types.h>
(likeSU_C_EXP
orSU_C_ABS
) should be conditionally defined. A candidate test predicate could bedefined(__cplusplus) && defined(__APPLE__)
). If this condition is met, all types and macros are defined based on the C++'s typestd::complex<float>
. Of course, compatibility betweenfloat _Complex
andstd::complex<float>
must be guaranteed.The text was updated successfully, but these errors were encountered: