[Issue 23867] New: ImportC: undefined identifier `__builtin_isnan`
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 29 14:17:00 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23867
Issue ID: 23867
Summary: ImportC: undefined identifier `__builtin_isnan`
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: lance at lancebachmeier.com
The failing C code is
if (ISNAN(df) || df <= 0.0) ML_WARN_return_NAN;
The ISNAN macro is defined with these lines
/* If isnan is a macro, as C99 specifies, the C++
math header will undefine it. This happens on macOS */
# ifdef __cplusplus
int R_isnancpp(double); /* in mlutils.c */
# define ISNAN(x) R_isnancpp(x)
# else
# define ISNAN(x) (isnan(x)!=0)
# endif
Looking at the gcc preprocessor output, this
if (ISNAN(df) || df <= 0.0)
expands to
if ((__builtin_isnan (Rf_df)!=0) || Rf_df <= 0.0)
--
More information about the Digitalmars-d-bugs
mailing list