summaryrefslogtreecommitdiff
path: root/sal/inc
AgeCommit message (Collapse)Author
2023-08-30tdf#146619 Remove unused includes from sal/osl/unxGabor Kelemen
Change-Id: Icc9cd3410cde2589ea51385c651243e11cc2f1d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155855 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-14tdf#146619 Remove unused includes from sal/ [headers]Gabor Kelemen
Change-Id: I8fae71e5053950441a2e0920590264c2cb858924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155546 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-06-16tdf#143148: Use pragma once instead of include guardsVenetia Furtado
Change-Id: I83c7405c61edd2c92ad624064326ba9c9e971313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153164 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-02-24Unify osl_{g,s}etThreadTextEncoding implementation across platformsMike Kaganski
... using a static thread_local variable, as already was used on Windows; this replaces the non-Windows implementation based on pthread_setspecific and friends. Change-Id: Iba42510dea90a9e7d1983ba4af674667055f6dfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147624 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-10osl signalshared : use std::mutex instead of oslMutex.Arnaud Versini
It also avoids possible double signal init and deinit. Change-Id: I4a24a011ee82d885e7a42abedea6a9fd96d3cab3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-26-FIIntrin.h in CC/CXX is no longer needed for my clang-cl buildStephan Bergmann
...at least with Clang 14 trunk now (but I didn't check which llvm commit would be responsible for that, and which version of LLVM that appeared in first). That also means the -D_CRT_RAND_S hack in CXX is no longer needed either. (See the mail thread starting at <https://lists.llvm.org/pipermail/cfe-dev/2015-November/046012.html> "[cfe-dev] clang-cl question".) Change-Id: If1b1b4fa17782161c3b72ac68fdef28b0e044a31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125859 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-19[API CHANGE] Do not call getaddrinfo if we just want the hostnameSamuel Mehrbrodt
Similiar to afc41a467fdfabb2cd0879be3e4f1879a1d1dc91 , don't call getaddrinfo in getLocalHostname which calls DNS. This causes a lag when creating the lockfile on opening a document if the network is flaky/disabled. See tdf#97931 and tdf#47179 for some problems caused by this. For the one case where it is expected to call DNS, add a separate function to restore the old behavior. The (semantic) [API CHANGE] is in osl_getLocalHostname, it does no longer return a FQDN. Change-Id: I43455715a474ff6770351d1ce007c28aeb08f32e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107554 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-03-09Make sal/config.h the first in pchMike Kaganski
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-21tdf#123936 Formatting files in module sal with clang-formatPhilipp Hofer
Change-Id: I04a773e8fd565f57dc0eb887fb4714b6edbb35e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105699 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-05-10compact namespace in sal..svgioNoel Grandin
Change-Id: I7e70614ea5a1cb1a1dc0ef8e9fb6fd48e85c3562 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-17Better handling of non--UTF-8 filesystem pathnames in sal/osl/unx/Stephan Bergmann
The idea is to internally in sal/osl/unx/ use OString instead of OUString to represent pathnames, so that the OString carries the actual bytes that make up the pathname. At the boundary of translating between pathname OStrings and file URL OUStrings, translate sequences of bytes that are valid according to osl_getThreadTextEncoding() into UTF-8 and translate other bytes into individual (percent-encoded) bytes in the file URL. This change required duplicating some of the internal functionality in sal/osl/unx/ for both OString and OUString, and to make part of sal/rtl/uri.cxx accessible from sal/osl/unx/ via new sal/inc/uri_internal.hxx. Change-Id: Id1ebaebe9e7f2d21f350f6b1a07849edee54331f Reviewed-on: https://gerrit.libreoffice.org/78798 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-12regenerate PCH headersLuboš Luňák
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-08-01Remove "officially dead now" rtl_cache slab allocator mechanismStephan Bergmann
...after <https://gerrit.libreoffice.org/#/c/58263/> "the custom SAL allocator is no longer used" got merged. According to my July 31, 2018 comment there: "However, [...] this change is effectively a final coffin nail for the 'rtl_cache' mechanism. It could be argued that the alleged benefits of that mechanism (if it were still working) might be real (at least on some platforms; which would need measurements), and that it should be made working again (by reverting the effects of both ce906b8096081dee15dc8cc96e570d5b0b587955 'skip tricky allocators on G_SLICE=always-malloc' and bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 'Disable custom allocator' on rtl_cache_alloc/free again). But it could just as well be argued that the 'rtl_cache' mechanism is effectively gone for long enough now (since end of November, 2017, with bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 'Disable custom allocator') without any (apparent) negative consequences, so that it can be removed for good with this change." Change-Id: I8c1e45d494fc22555a9e675ab27be9e6e404abde Reviewed-on: https://gerrit.libreoffice.org/58369 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-31the custom SAL allocator is no longer usedNoel Grandin
ever since commit bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 Date: Wed Nov 15 16:52:44 2017 +0530 Disable custom allocator which makes FORCE_SYSALLOC redundant which makes SYS_ALLOC redundant Change-Id: I42e1d651473e7601e2280d9fb0662c89808c88f6 Reviewed-on: https://gerrit.libreoffice.org/58263 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-12-28rtl: support start/stop threads around pre-initAshod Nakashian
This is necessary to avoid having extra threads while forking. After forking, the second stage of pre-init is started and so we start the stopped rtl threads. The comment for rtl_alloc_preInit_phase_t has more details. Change-Id: I1a3f7be74d4b04d0b2fc4a72b02124c2faa3c047 Reviewed-on: https://gerrit.libreoffice.org/47060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-09-22Fresh run of bin/update_pch.shMike Kaganski
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06 Reviewed-on: https://gerrit.libreoffice.org/42565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-04-16try to fix werror + pch build on linuxMarkus Mohrhard
This should fix RandomConfig tb run #396 Change-Id: Idd7984e3c4225b08db50b2451112135aaf2e1890 Reviewed-on: https://gerrit.libreoffice.org/36584 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-03-04Change sal/osl/w32/*.c -> *.cxxStephan Bergmann
...and fix any ensuing errors/warnings, but no further C++'ification. Not sure whether any parts of dllentry.c would need to be extern "C", so leaving that one alone for now. TODO: Put definition of _CRT_RAND_S into bin/update_pch, so it doesn't get removed again from sal/inc/pch/precompiled_sal.hxx. (For the surrounding #ifndef see 244d22a3d27b303d44f59296a19dc4cb31fd429d "Work around -Werror,-Wunused-macros with clang-cl".) Change-Id: I2ada3717845eb0be0c559465d68e00e3a7720156 Reviewed-on: https://gerrit.libreoffice.org/34860 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-09Fold sal_detail_log_backtrace into sal_detail_logStephan Bergmann
...the latter is LO-privately exported from sal, so it should be OK to add one more parameter to it. Change-Id: If6bf3458433aac2cc8b4e0cbd1602306051a777b Reviewed-on: https://gerrit.libreoffice.org/34080 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-07Clean up C-style interface nonsenseStephan Bergmann
Change-Id: Ie9a1e106f5270fd307d211fa334449c698acf25d Reviewed-on: https://gerrit.libreoffice.org/34010 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-10rename SAL_DEBUG_TRACE to SAL_DEBUG_BACKTRACENoel Grandin
since "trace" is such a generic term, this makes it easier to actually find the feature when you need it. And add feature to limit stack depth of the reported backtrace. Change-Id: Iab3e4ceb2e8480e7b5e2b920eb6c5d7631e21c43 Reviewed-on: https://gerrit.libreoffice.org/31752 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09New loplugin:externvar: salStephan Bergmann
Change-Id: Iefc33784f21e7a0b88c8d6308618926e38ab8554
2016-12-16-Werror,-Wstrict-prototypes (clang-cl)Stephan Bergmann
(sal/inc/rtllifecycle.h only hits on Windows as that is the only platform that happens to actually include it in a C compilation unit, sal/osl/w32/dllentry.c) Change-Id: I2878b52daf713ea45eaa2968cc5d2686b86abfe6
2016-06-20switch to EHs on windowsMarkus Mohrhard
This seems to be a good idea based on several discussions in the project. In the end catching SEH exceptions is just going to cause strange platform dependent bahavior. This patch is based on on http://thread.gmane.org/gmane.comp.documentfoundation.libreoffice.scm/39102/focus=55516 and includes some additional cleanup of the sal signal code. Change-Id: Iedc998e37e6495afec445eccb60fa1c2b1a7defd Reviewed-on: https://gerrit.libreoffice.org/26497 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-13tdf#94306 remove unused boost dependenciesJochen Nitschke
remove <boost/noncopyable.hpp> in pch and remove boost from makefile if it was the only boost entry. Change-Id: Icb945ae59c137571f4f63807601738eea5c3e831 Reviewed-on: https://gerrit.libreoffice.org/24061 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-07Drop pointless "internal" directory level for already internal include filesTor Lillqvist
Change-Id: I496fdbab3e17c806c2d16513412c4c1b9120bc3c
2016-03-31Fix Windows part of 97858ca008fd8cf405e52795c8db415ef6c5afb3Stephan Bergmann
"tdf#93548 Refactor sal signal to reduce code duplication" Change-Id: Ib0a872fb6023b6989c7931f4d57d911ddf76936f
2016-03-29tdf#93548 Refactor sal signal to reduce code duplicationAleksas Pantechovskis
Change-Id: Iff331a48fadc23da8b24f9ca3a841000313a03dd Reviewed-on: https://gerrit.libreoffice.org/23477 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-03sal: replace boost::bind with C++11 lambdasMichael Stahl
Change-Id: If8e16b7805b5b25dafe053e35cd98079abbea83c
2016-01-11PCH support on LinuxAshod Nakashian
Fixes and improvements to support Precompiled Headers on Linux. Change-Id: I8145c146b0dba56c7a4d0fdf9c330164b67ada53 Reviewed-on: https://gerrit.libreoffice.org/21307 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2015-12-02sal: add SAL_DEBUG_TRACE debugging API for Windows, with UNX stub.Michael Meeks
Change-Id: I2fdbc2ac10f483eee154bdf69479ba217a91ef7f Reviewed-on: https://gerrit.libreoffice.org/19605 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-15Fast PCH generator and optimized PCH filesAshod Nakashian
Ported update_pch.sh to Python with improved performance and features. The new script is invoked from the same update_pch.sh which calls it for each library in parallel, although it can be invoked directly. The ported script (update_pch) updates all PCH files in ~15 seconds where the old script took ~4500 seconds. In addition, the new script supports 3-tiered headers (system, module, and local) and is very flexible to support other improvement. It has a per-library optimal configuration settings that can be updated using another new scripts (update_pch_autotune.sh) which finds optimal per-PCH settings. PCH files have been generated using the new scripts which builds significantly faster (2-3x, depending on module and configuration) and the intermediate binaries are noticably smaller (by several GBs). The new script stamps each generated PCH file with the command that generated it to make it trivial for users to update them, and also adds the command to invoke another script (update_pch_bisect) that helps find missing headers or conflicting headers that may break the build after updating the PCH. Finally update_pch has built-in unit-tests for makefile parsing and other core functionality. Change-Id: Ib933b50e50374d7e2e7e3e95ba8799b0cc8a27fa Reviewed-on: https://gerrit.libreoffice.org/19965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-20add an internal api to osl to collect 'native' random numbersNorbert Thiebaud
use /dev/urandom on unixes and rand_s() on windows Change-Id: Iccd6e01706f16d82f23cda0f0a410953c32fbc02 Reviewed-on: https://gerrit.libreoffice.org/15473 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-02-14Related: tdf#63690 - remove rtl_logfileThorsten Behrens
This was unused since the earlier cleanup. Change-Id: Ia56641c4242037a0ce501e43939b8dc862499f0e
2015-02-05Updated all precompiled headers.Ashod Nakashian
Change-Id: I955c8ac4dbe002d23531df7eb10fb4444d6b5157 Reviewed-on: https://gerrit.libreoffice.org/14292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-27Make osl_getExecutableFile work even without a prior osl_setCommandArgsStephan Bergmann
After 2ad716f406e0fdb9b9294876c64ae92fecbf5e27 "Revert 'pyuno: set up fake command line in getComponentContext(),'" e.g. PythonTest_sw_python would fail on Windows, where WinSalGraphics::GetDevFontList (vcl/win/source/gdi/salgdi3.cxx) calls osl_getExecutableFile and is itself called in a python process where osl_setCommandArgs has not been set up. This patch makes osl_getExecutableFile on all platforms if osl_setCommandArgs has not (yet) been set fall back to the code that was osl_bootstrap_getExecutableFile_Impl (which was called from sal/rtl/bootstrap.cxx, which can now call osl_getExecutableFile). Change-Id: I6c1bb59205041b3208c830a8b8406e28128b4566
2014-08-13update_pchThomas Arnhold
Change-Id: Ic1dae7aac2f4367b4196ba3128c0aea9be1fbbda
2014-05-28update_pchThomas Arnhold
Change-Id: I5316693452427ed76a7738b090de023b110caa40
2014-05-15Resolves: #i124896# [API CHANGE] remove obsoleted rtl/allocator.hxxHerbert Dürr
remove obsoleted sal-module-internal custom STL allocator The SAL module avoided the heavy dependency on the stlport4-libraries by using a custom allocator for its internal STL containers. With stlport4 removed these dependencies are gone and the SAL-internal custom allocator is obsoleted. (cherry picked from commit c6e0325df6efce45dbb2616a32b7745c449c6c58) Conflicts: include/osl/diagnose.hxx include/rtl/allocator.hxx sal/osl/w32/procimpl.cxx sal/qa/osl/process/osl_process.cxx sal/rtl/bootstrap.cxx sal/rtl/source/hash.cxx sal/rtl/source/unload.cxx Change-Id: I8515382828eda36aba1fec5f23e0f2a89aef7a33
2014-05-15Resolves fdo#70681: fixincludeguards.pl: all that's leftThomas Arnhold
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5 Reviewed-on: https://gerrit.libreoffice.org/9360 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-04-14update_pchThomas Arnhold
Change-Id: I099bff66a7796a5cf18e37e445467bdfb33de602
2014-04-04Clean up unreferenced functionsStephan Bergmann
Change-Id: Id9cb4dbeb6b3313974b881efd6a7c43cb5e314ce
2014-02-27Ensure that numeric array storage is aligned to 256-byte boundary.Kohei Yoshida
OpenCL devices require this else we would get a performance hit. Change-Id: I6b1db6320fa84f933b6446022a0fd02ba267bf21
2013-09-05update pchThomas Arnhold
Change-Id: I6d5e8d3fd69189935a3338fee19b60022f70a7eb
2013-04-25update pchThomas Arnhold
Change-Id: I67e73438312f2a672e71762ee6707ec5d425bb47
2013-04-24move sal_inc headers to include/David Tardon
Change-Id: I840c681b7c500640d3983e05e9895f3fa8bb1313 Reviewed-on: https://gerrit.libreoffice.org/3501 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-24move URE headers to include/David Tardon
Change-Id: Ib48a12e902f2311c295b2007f08f44dee28f431d Reviewed-on: https://gerrit.libreoffice.org/3499 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>