[gjs/msvc.fixes] gi/js-value-inl.h: Cast parameter to std::isnan() to float
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/msvc.fixes] gi/js-value-inl.h: Cast parameter to std::isnan() to float
- Date: Fri, 12 Mar 2021 08:53:53 +0000 (UTC)
commit 9ef3a1994ade95c00d1c4967269cb9f27b66dbd7
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Mar 12 16:52:53 2021 +0800
gi/js-value-inl.h: Cast parameter to std::isnan() to float
This way, we avoid ambiguity compiler errors...
gi/js-value-inl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gi/js-value-inl.h b/gi/js-value-inl.h
index 7a73b72e..01fde1e5 100644
--- a/gi/js-value-inl.h
+++ b/gi/js-value-inl.h
@@ -214,7 +214,7 @@ GJS_JSAPI_RETURN_CONVENTION inline bool js_value_to_c_checked(
static_cast<T>(std::numeric_limits<WantedType>::lowest()));
if constexpr (std::is_integral_v<WantedType>)
- *out_of_range |= std::isnan(*out);
+ *out_of_range |= std::isnan(static_cast<float>(*out));
}
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]