summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2017-04-04ofz#770 JOHAB_73 table starts at 0xA not 0x2Caolán McNamara
the start value is out by one row Change-Id: I77ed154358516ccd47a090cf7ed45bb609bc81a3 Reviewed-on: https://gerrit.libreoffice.org/34992 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30remove type decorations on char literalsJochen Nitschke
they are only needed where type deduction fails. left them in defines for now. Change-Id: I7f002dd6bc7acc083c73b6c64076de6dd28d0b09 Reviewed-on: https://gerrit.libreoffice.org/35893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30loplugin:loopvartoosmallStephan Bergmann
Change-Id: If714cafd9f2786610a03b1f5f6466a9ea06e46e6
2017-03-30loplugin:redundantcastStephan Bergmann
(only triggers on macOS, as on Linux unistd.h declares lseek with a return type of intermediary __off_t/__off64_t typedefs) Change-Id: I967e472a050ad624a6411947b10c962ac8f66bed
2017-03-25Fix typosAndrea Gelmini
Change-Id: I5fc62060e7d01c6b492a0e91323f753cc676bf71 Reviewed-on: https://gerrit.libreoffice.org/35639 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-24Various loplugin warnings (clang-cl)Stephan Bergmann
Change-Id: I7969250f330d2df02c4ea909115b3028fdc36223
2017-03-24Handle "POSIX" in parse_locale, 2nd attemptStephan Bergmann
...with the silly errors fixed past 61ecebe0d0febe8429d965355356a9f0f34b323b "Revert 'Handle 'POSIX' in parse_locale'" Change-Id: I0b8e4de0377b92b8cb96efa13e4b39316ffbf707
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-23Revert "Handle "POSIX" in parse_locale"Stephan Bergmann
This reverts commit 646cbbfbc67b07d5f58166228bca1ac710175cd0 for now. Appears that it made CppunitTest_sal_osl fail at least on some macOS builds, for reasons not yet clear to me
2017-03-23Handle "POSIX" in parse_localeStephan Bergmann
Change-Id: Ib3ce9efd2933170777689db152d35f586f5afe2d
2017-03-22Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)Stephan Bergmann
Change-Id: I93eeb586310cb1896b067b7c665e1fdee92d47b4
2017-03-22Don't actually change OS-level locale with (unused) osl_setSystemLocaleStephan Bergmann
osl_setSystemLocale was introduced with af2938348bb539ccb27c92fe286b768d4143f662 "#88460# added osl_getProcessLocale and osl_setProcessLocale" but never actually used. So mark it as deprecated and, in the sal/osl/unx/ case, don't make it set the OS-level locale via imp_setProcessLocale (calling setlocale or setting the LC_ALL/LC_CTYPE/LANG env vars), same as in the sal/osl/w32/ case. Change-Id: I33348dba5de8ca80ca6fca210043286c0cfa9145
2017-03-22Prevent calls to rtl/character.hxx functions with (signed) char argumentsStephan Bergmann
...that would implicitly be sign extended (for plain char only if it is signed), so non-ASCII char values would trigger the isUnicodeCodePoint assert. Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91 Reviewed-on: https://gerrit.libreoffice.org/35523 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22Comment clean-up that was inadvertently missing from previous commitStephan Bergmann
Change-Id: I5eb0758f84495a8410260f61ff645a086efb1ca7
2017-03-22Use nl_langinfo_l instead of setlocale+nl_langinfoStephan Bergmann
...as the former is less of an MT nightmare (nl_langinfo_l can only conflict with calls to nl_langinfo in other threads, not with calls to nl_langinfo_l in other threads, so since this was the last remaining use of nl_langinfo in LO itself after a7cdba3a0e48360e2ed549e9d8996fe41460df70 "Use nl_langinfo_l with an explicitly created locale" things should be safer now; also, setlocale was an MT problem, of course, inadequately atempted to be addressed with that aLocaleMutex). Hopefully, all relevant platforms that support nl_langinfo also support nl_langinfo_l (where both are POSIX). Change-Id: I28a18bc4ffa930e3f2e949634dae161377e2911c
2017-03-21Argument to parse_locale is never nullStephan Bergmann
Change-Id: I610d3637f4a4520ef4eefed29851727f519de02c
2017-03-21On Linux etc., obtain locale value from env vars instead of setlocaleStephan Bergmann
setlocale has the drawbacks that it is racy and that it sets global state, so better avoid it. The way LC_ALL, LC_CTYPE, LANG are honoured is as suggested by SUSv4, then falling back to "C". Change-Id: I606ecc01d37a0a9067a90e6dcce098009094493c
2017-03-17cleanup double includes and declarationsJochen Nitschke
Change-Id: I770e09f48b1a3e8299f59a8e475ba3c18d436d7b Reviewed-on: https://gerrit.libreoffice.org/35312 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-03-16Fix typosAndrea Gelmini
Change-Id: I1488e2147fa0cd4a821eb5bfe172a58a4e396ace Reviewed-on: https://gerrit.libreoffice.org/35224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2017-03-15improve the breakpad signal handler in dbgutil buildsMarkus Mohrhard
Change-Id: I253058dbfc9e156bc778c23d491b642c538606f2 Reviewed-on: https://gerrit.libreoffice.org/35227 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-03-15workaround for breakpad signal handler on linuxMarkus Mohrhard
The breakpad signal handler is overwritten by our own signal handler during startup. As a workaround we use the same approach as in the windows code and add call the old signal handler if a crash was registered. Change-Id: I1179fd9cba851734aa1686168f231cf68de57c1a Reviewed-on: https://gerrit.libreoffice.org/35226 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-03-15tdf#106489 - Win32 version of osl_terminateProcess not "safe"Chris Sherlock
The current Win32 implementation of osl_terminateProcess calls directly upon the Win32 TerminateProcess() API function. When I looked up this function on MSDN I was a bit surprised to note that this is an asynchronous function that returns immediately before the process actually fully terminates, and does not necessarily succeed cleanly. As we are not checking that the process actually fully terminates, this is a bit of a problem, albeit one I think may well be somewhat obscure and non-obvious. In fact, it is better that we call on TerminateProcess() and use WaitForSingleObject() until the process actually fully terminates. If the termination ends abnormally, then we should pass a more appropriate exit status. Dr Dobbs magazine, bless its ancient archive, details a "safe" version of TerminateProcess(), which has been implemented it seems in dozens of projects already so it's basically at this point a pattern. The article can be found here: http://www.drdobbs.com/a-safer-alternative-to-terminateprocess/184416547 Thankfully, the flaws they point out are only valid due to the age of the article as the Windows 9x line of operating systems was still a thing way back then :-) Changes that are made: 1. If the PID is 0x0 then this can't be ended, so return an invalid status 2. We need to elevate access to the process handle to allow it to create a new thread in a potentially remote process, so we use DuplicateHandle to do so 3. The core change is to change from TerminateProcess() to ExitProcess(), I'm letting it timeout forever and the end user can kill off the process via a Windows process management tool if they need it killed entirely, hence WaitForSingleObject() has an infinite timeout. This way, the termination handler is now called and the attached dlls are notified that they are being detached from the process. Change-Id: Icfa7c60c35a088b8f9834351bc7953a910247fb8 Reviewed-on: https://gerrit.libreoffice.org/35071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-03-06drop various _MSC_VER < 1900 conditionalsCaolán McNamara
Change-Id: I68d93b260db1f542bb3b44858b61b2d30ae93530 Reviewed-on: https://gerrit.libreoffice.org/34856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-04Change sal/osl/w32/*.h -> *.hxxStephan Bergmann
...which are now only ever included from C++ code. Drop extern "C" where appropriate (i.e., generally everywhere) and fix the occasional ensuing loplugin warning. (But no further C++'ification for now.) Change-Id: I78830692888ee0ae0cac49878042effad2d6707f Reviewed-on: https://gerrit.libreoffice.org/34865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-04Change sal/osl/w32/dllentry.c -> .cxxStephan Bergmann
Change-Id: I55f8bedd9b578053413b5e3404010301d01b7961 Reviewed-on: https://gerrit.libreoffice.org/34861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.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-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03Fix typosAndrea Gelmini
Change-Id: I95fc63af11c336cde9f5bef908e1389c2fb56f02 Reviewed-on: https://gerrit.libreoffice.org/34823 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03Fix typosAndrea Gelmini
Change-Id: Iedca07be5300c68e180e0c71d2d6eb0052f5cced Reviewed-on: https://gerrit.libreoffice.org/34801 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-02Remove HAVE_CXX11_UTF16_STRING_LITERAL, always true nowStephan Bergmann
...after 84b36c704d73362d4d86dc9e9c0efa0625958347 "Drop support for MSVC 2013". Make this a fatal configuration error for now. The check should be removed completely after LO 5.4 branch-off. Change-Id: If2f196abb93607dde9ba5c4f04d219679585e633 Reviewed-on: https://gerrit.libreoffice.org/34822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-23There's no way to create an oslVolumeDeviceHandle for unxStephan Bergmann
...so the functions operating on them can all just return osl_File_E_INVAL. (The way to create an oslVolumeDeviceHandle is via osl_getVolumeInformation storing it into oslVolumeInfo.pDeviceHandle. But the unx implementation of osl_getVolumeInformation never sets that, so it'll stay at the null value that callers must initialize it to.) Change-Id: Ibabd89e8f9de0892a0e815d30b6397f869e7df70
2017-02-23Silence -Werror=format-overflowStephan Bergmann
Change-Id: I09abf54d67d0033ff3f8d61498ab094745c2081b
2017-02-23-Werror=format-truncationStephan Bergmann
Change-Id: I1b27289724389018bd4048573e8c8e4cf28eb983
2017-02-21Kill bitrot Emscripten experimentKhaled Hosny
Change-Id: I1cd5331157e684afb01e6555168ce646194c6ff2 Reviewed-on: https://gerrit.libreoffice.org/34493 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-02-21loplugin:subtlezeroinit: salStephan Bergmann
Change-Id: I70e79b6fd36c3ccff9e6906f46cecaa0f19c5a7f
2017-02-20silence coverity#1202740 Bad bit shift operationCaolán McNamara
Change-Id: I88c38a1a7eae0d1e2011c40983490efef1ff6438
2017-02-16remove unused Exist from oslCheckMode enumNoel Grandin
Change-Id: I1ad187342444c5e92b61578d2a67cce2ae5ac428
2017-02-13Fix typosAndrea Gelmini
Change-Id: Iaf6bbe81f519d49b82f624282d786c8cc18d641c Reviewed-on: https://gerrit.libreoffice.org/34199 Reviewed-by: Aleksandar Stefanović <theonewithideas@gmail.com> Tested-by: Aleksandar Stefanović <theonewithideas@gmail.com>
2017-02-10Remove MinGW supportStephan Bergmann
In OOo times, there'd originally been efforts to allow building on Windows with MinGW. Later, in LO times, this has been shifted to an attempt of cross- compiling for Windows on Linux. That attempt can be considered abandoned, and the relevant code rotting. Due to this heritage, there are now three kinds of MinGW-specific code in LO: * Code from the original OOo native Windows effort that is no longer relevant for the LO cross-compilation effort, but has never been removed properly. * Code from the original OOo native Windows effort that is re-purposed for the LO cross-compilation effort. * Code that has been added specifially for the LO cross-compilation effort. All three kinds of code are removed. (An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing --with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.) Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568 Reviewed-on: https://gerrit.libreoffice.org/34127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-10-Werror=unused-parameterStephan Bergmann
Change-Id: I63e466f8a1e2fbbf1b1bd84f491b37026909b1eb
2017-02-09-Werror,-Wunused-macrosStephan Bergmann
Change-Id: I06a6b6fa51fe437661610a4a678cd2d410bb1e4c
2017-02-09Dummy implementations of backtrace/backtrace_symbols on Android, tooStephan Bergmann
pt#2 Change-Id: I5cc280613879786bd723019d630edb5a920419b9
2017-02-09Some clean upStephan Bergmann
No more need to call sal_detail_log_report from sal_detail_log, now that it is called from SAL_DETAIL_LOG_STREAM since b3a11c8f4f307bbbb597c9c6e7e61ee93e794873 "tdf#91872: Make SAL_INFO and friends more efficient". Change-Id: Idb6cf7a4814abe29d5ba68591f39b4279267bc9b
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-09Dummy implementations of backtrace/backtrace_symbols on Android, tooStephan Bergmann
Change-Id: Ibbab23a9332c3475ab6ce5654999f040e936acfb
2017-02-09Proper -Werror,-Wunused-parameter fix for C codeStephan Bergmann
Change-Id: I2ebd350c3c39f848f5a39fa120154dc449173434
2017-02-09-Werror,-Wunused-parameterStephan Bergmann
Change-Id: I1a52e05994d6a31aa5e65bc3357f48258fb6f049
2017-02-09Implement SAL_DEBUG_BACKTRACE for LinuxStephan Bergmann
...by using glibc's backtrace_symbols(3). If this is ever implemented for other platforms, backtrace_symbols' interface may turn out to be awkward; but just use it directly for now. Also, the output from backtrace_symbols isn't too useful in itself, as for non-exported symbols it only prints soname+offset, but some addr2line postprocessing can turn that into something half-way decent. Change-Id: I58cc7912aa7d8031729fc116a82a409c1c16977a
2017-02-08Solaris C++ 5.2 compiler is no longer relevantStephan Bergmann
Change-Id: I520a58438e156661d3e01a899e97ee33d9f19102