summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx6
-rw-r--r--sal/qa/rtl/oustring/rtl_OUString2.cxx15
-rw-r--r--sal/rtl/ustring.cxx15
3 files changed, 2 insertions, 34 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index cb3422de16d0..124f323630bf 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3017,10 +3017,8 @@ void ExceptionType::dumpHdlFile(
if (name_ == "com.sun.star.uno.Exception")
{
// LIBO_INTERNAL_ONLY implies GCC >= 7, which we need for this
- // Merely checking __has_include is not enough because some systems have the header,
- // but do not have a new enough Clang 9 supporting __builtin_FILE/LINE/FUNCTION as used by
- // that libstdc++ header.
- includes.addCustom("#if defined LIBO_INTERNAL_ONLY && ((defined __GNUC__ && !defined __clang__) || (defined __clang__ && __clang_major__ >= 9)) && __has_include(<experimental/source_location>)");
+ // libstdc++ header.
+ includes.addCustom("#if defined LIBO_INTERNAL_ONLY && (defined __GNUC__ || defined __clang__) && __has_include(<experimental/source_location>)");
includes.addCustom("#define LIBO_USE_SOURCE_LOCATION");
includes.addCustom("#endif");
includes.addCustom("#if defined LIBO_USE_SOURCE_LOCATION");
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index b633af15626c..bff3a0d145f1 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -38,23 +38,8 @@ namespace rtl_OUString
namespace {
-// Avoid -fsanitize=undefined warning e.g. "runtime error: value 1e+99 is
-// outside the range of representable values of type 'float'" with Clang prior to
-// <https://github.com/llvm/llvm-project/commit/9e52c43090f8cd980167bbd2719878ae36bcf6b5> "Treat the
-// range of representable values of floating-point types as [-inf, +inf] not as [-max, +max]"
-// (ENABLE_RUNTIME_OPTIMIZATIONS is an approximation for checking whether building is done without
-// -fsanitize=undefined):
float doubleToFloat(double x) {
-#if !defined __clang__ || __clang_major__ >= 9 || ENABLE_RUNTIME_OPTIMIZATIONS
return static_cast<float>(x);
-#else
- return
- x < -std::numeric_limits<float>::max()
- ? -std::numeric_limits<float>::infinity()
- : x > std::numeric_limits<float>::max()
- ? std::numeric_limits<float>::infinity()
- : static_cast<float>(x);
-#endif
}
}
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index ed039c4685da..6bc595b7f3bf 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -97,23 +97,8 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * pStr, double d)
namespace {
-// Avoid -fsanitize=undefined warning e.g. "runtime error: value 1e+99 is
-// outside the range of representable values of type 'float'" with Clang prior to
-// <https://github.com/llvm/llvm-project/commit/9e52c43090f8cd980167bbd2719878ae36bcf6b5> "Treat the
-// range of representable values of floating-point types as [-inf, +inf] not as [-max, +max]"
-// (ENABLE_RUNTIME_OPTIMIZATIONS is an approximation for checking whether building is done without
-// -fsanitize=undefined):
float doubleToFloat(double x) {
-#if !defined __clang__ || __clang_major__ >= 9 || ENABLE_RUNTIME_OPTIMIZATIONS
return static_cast<float>(x);
-#else
- return
- x < -std::numeric_limits<float>::max()
- ? -std::numeric_limits<float>::infinity()
- : x > std::numeric_limits<float>::max()
- ? std::numeric_limits<float>::infinity()
- : static_cast<float>(x);
-#endif
}
}