We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Nuklear's code:
NK_API float nk_strtof(const char *str, const char **endptr) { float float_value; double double_value; double_value = NK_STRTOD(str, endptr); float_value = (float)double_value; return float_value; }
The problem - standard library is incompatible:
// C89 double strtod(const char *restrict str, char **restrict str_end); // C++ (any version) double strtod(const char* str, char** str_end);
If I #define NK_STRTOD strtod then I'm getting the following error:
#define NK_STRTOD strtod
[...]/Nuklear/nuklear.h: In function ‘float nk_strtof(const char*, const char**)’: [...]/Nuklear/nuklear.h:6841:35: error: invalid conversion from ‘const char**’ to ‘char**’ [-fpermissive] 6841 | double_value = NK_STRTOD(str, endptr); | ^~~~~~ | | | const char** /usr/include/stdlib.h:118:27: note: initializing argument 2 of ‘double strtod(const char*, char**)’ 118 | char **__restrict __endptr) | ~~~~~~~~~~~~~~~~~~^~~~~~~~
Can you change the implementation so that it supports the standard library (without const)?
const
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Nuklear's code:
The problem - standard library is incompatible:
If I
#define NK_STRTOD strtod
then I'm getting the following error:Can you change the implementation so that it supports the standard library (without
const
)?The text was updated successfully, but these errors were encountered: