summaryrefslogtreecommitdiff
path: root/jurt
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-03-02 23:40:06 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-03-03 17:34:35 +0100
commit657d8c3e323c7353ce6fa1170532cb6e33d4b74f (patch)
treef024255d34e607e572472d5a9340de261f307d1c /jurt
parent131d5cdbb9526477864ea3bd839deab0e544b821 (diff)
Use thread_local statics in dtoa.c to be thread-safe
We don't use MULTIPLE_THREADS for that to avoid performance penalty due to locking and memory allocation. Use dtoa.cxx stub to compile dtoa.c as C++, to allow using thread_local keyword in MSVC, which still implements pre-C99. Also don't expose dtoa() and other symbols - make them static. And define IEEE_MC68k, not IEEE_8087 on big endian platforms. Change-Id: Ie59fe0cf057b043556a5ac15ec6b11a1a5b41f47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89629 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'jurt')
-rw-r--r--jurt/Library_jpipe.mk5
-rw-r--r--jurt/source/pipe/staticsalhack.cxx1
2 files changed, 5 insertions, 1 deletions
diff --git a/jurt/Library_jpipe.mk b/jurt/Library_jpipe.mk
index 334f6b16e1fc..2c1b2f5f380c 100644
--- a/jurt/Library_jpipe.mk
+++ b/jurt/Library_jpipe.mk
@@ -46,6 +46,11 @@ $(eval $(call gb_Library_add_cobjects,jpipe, \
jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection \
))
+# see external/dtoa/StaticLibrary_dtoa.mk
+$(eval $(call gb_Library_add_defs,jpipe,\
+ $(if $(filter little,$(ENDIANNESS)),-DIEEE_8087,-DIEEE_MC68k)\
+))
+
$(eval $(call gb_Library_add_exception_objects,jpipe, \
jurt/source/pipe/staticsalhack \
))
diff --git a/jurt/source/pipe/staticsalhack.cxx b/jurt/source/pipe/staticsalhack.cxx
index fa9547a9e0b8..2bcc53e85e9a 100644
--- a/jurt/source/pipe/staticsalhack.cxx
+++ b/jurt/source/pipe/staticsalhack.cxx
@@ -76,7 +76,6 @@ extern "C" ImplTextEncodingData const * sal_getFullTextEncodingData(
std::abort();
}
-#define IEEE_8087 // see external/dtoa/StaticLibrary_dtoa.mk
#pragma clang diagnostic ignored "-Weverything"
extern "C" {
#include <src/dtoa.c> // workdir/UnpackedTarball/dtoa/src/dtoa.c