summaryrefslogtreecommitdiff
path: root/bridges
AgeCommit message (Collapse)Author
2019-02-19tdf#112689:Replace chained O(U)StringBuffer::append() with operator+Salih Sariyar
Change-Id: I4c9fc9595a498609309ce7734c312fea09680c2f Reviewed-on: https://gerrit.libreoffice.org/67586 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-02-11Revert "tdf#112689: Replace changed O(U)StringBuffer::append() with operator+"Tor Lillqvist
Sorry, but this change breaks the build: bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx(884): error C2110: '+': cannot add two pointers This reverts commit 867384792244667a33cad79a7348b34b6008822b.
2019-02-11tdf#112689: Replace changed O(U)StringBuffer::append() with operator+Omer Fatih Celik
Change-Id: I9221608db417217dd7c97c0300ecedb67fa74132 Reviewed-on: https://gerrit.libreoffice.org/67603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08The gcc3_linux_aarch64 bridge needs to call __cxa_current_exception_type, tooStephan Bergmann
...or else mapException would extract garbage from the fake exception->exceptionType std::type_info* when catching via cppu::getCaughtException the rethrown exception thrown via std::rethrow_exception in Test::testgetCaughtException in cppuhelper/qa/misc/test_misc.cxx. 6ddecf61ecada646fbd6f8809270d47289727e8a "fillUnoException not working on std::rethrow_exception exceptions" had adapted the other relevant bridges/source/cpp_uno/gcc3_*/ cases but missed the gcc3_linux_aarch64 one. Change-Id: I5a2afb11ad4abf851169bd3fd8ae647cc81c2fcd Reviewed-on: https://gerrit.libreoffice.org/67542 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-08loplugin:indentation in basctl..bridgesNoel Grandin
Change-Id: Ie4e27466c4258c6f774a3ebb82ec3a88c28fd753 Reviewed-on: https://gerrit.libreoffice.org/67525 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-30loplugin:redundantinline (clang-cl)Stephan Bergmann
Change-Id: Ib6320ddc049e93cca4c5931ad28d1873d34bd8b4 Reviewed-on: https://gerrit.libreoffice.org/67137 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16o3tl::make_unique -> std::make_unique in basctl...bridgesGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I9a20a58c68d12656359dcaa060d8ab41f621af32 Reviewed-on: https://gerrit.libreoffice.org/66262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-20Fix typoAndrea Gelmini
Change-Id: I95c7fd5a7241c120395c897af4fc2742528e2166 Reviewed-on: https://gerrit.libreoffice.org/65391 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-13Add missing "!"Stephan Bergmann
Change-Id: Ic3e50e1a64b334bee86db7456a4821fa9427370b
2018-12-13Fix getRTTI for Android x86Stephan Bergmann
First, make sure existing compiler-generated RTTI from liblo-native-code.so is found (so that catching bridge-synthesized exceptions in native code works with libc++abi, which checks type equivalence by address instead of string comparsion), by using the dlsym(RTLD_DEFAULT,...) mechanism as in the ANDROID gcc3_linux_arm bridge case. And second, if that should fail, synthesize the type_info even if the included cxxabi.h doesn't provide the relevant type declarations, by using copies from the ABI specification, as also done on other platforms. Instead of always having getRTTI fail and raiseException throw a non-synthesized css::uno::RuntimeException("no rtti for type ..."). Which explains the mystery discussed in the commit message of 312eeeee42cb4a1e356943e17305555e41afc4ef "Switch Android armeabi-v7a to libc++/libc++abi/libunwind too", why the observed misbehavior on x86 was so different from that on armeabi-v7a. Change-Id: I9308654c5c2b88b4d27e0e8e9edda1849133a161 Reviewed-on: https://gerrit.libreoffice.org/65070 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-13Adapt gcc3_linux_arm __cxa_exception to NDK 18 libc++abiStephan Bergmann
...which adds a member, and will be relevant when switching armeabi-v7a to libc++/libc++abi/libunwind (coming soon). Change-Id: I1f98f50ca299a583e73e0dbd6c8c94d973329f3a Reviewed-on: https://gerrit.libreoffice.org/64966 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-13Export RTTI symbols from liblo-native-code.so, for binary UNO bridgeStephan Bergmann
This will become important when switching armeabi-v7a to libc++/libc++abi/libunwind (coming soon) which uses address instead of string comparison when checking for type equality, so that exceptions thrown from the binary UNO bridge will need to use the exact same RTTI objects as referenced from the compiled catch clauses. Change-Id: If8bcb39212b5f5e154aee215cb5f471fe2dc4a7b Reviewed-on: https://gerrit.libreoffice.org/64965 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-13Use declarations from cxxabi.h where availableStephan Bergmann
Change-Id: Ie92c9654c7ccc5cd4acde728b35311f251f740ac Reviewed-on: https://gerrit.libreoffice.org/64963 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-11-Werror,-Wunused-variableStephan Bergmann
Change-Id: Ia6b57f0cf508686c437027e5753258169c18b0f7
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-05loplugin:unnecessaryparenStephan Bergmann
Change-Id: Ic717f68f0d107138dd18116b70f3a49588c5778f
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-03sync std::unexpected_handler across bridgesCaolán McNamara
Change-Id: I2c2b1159ee697acc1d22740f7a2167b30a7fec41 Reviewed-on: https://gerrit.libreoffice.org/64446 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-12-03ofz#11611 build failure with std::unexpected_handlerCaolán McNamara
Change-Id: I0340ce6b89dd7edb91a4a4e0c1e21aeb307f3d9f Reviewed-on: https://gerrit.libreoffice.org/64445 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-28Bin some unused declarationsTor Lillqvist
They used std::unexpected_handler so did not compile as C++17 anyway. Change-Id: I5f8bacb85cbd213dd6304d865a7b4cb7eb8f4b8f
2018-11-28Do like effe6b3d84302afce3d5095e4f376e7e3bf669e0 for iOS, tooTor Lillqvist
Change-Id: I9163e1722f163a04968df292ee8b29d472f9ac4f
2018-11-16loplugin:buriedassign in avmedia..cuiNoel Grandin
Change-Id: Id44f1e98a3aac2c417f8030de603175bf68f0dfe Reviewed-on: https://gerrit.libreoffice.org/63467 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-12Fix typosAndrea Gelmini
Change-Id: Ibb94b2b16afbcca84dd55ae51fde6fd27afede3a Reviewed-on: https://gerrit.libreoffice.org/63297 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-11-04replace double-checked locking patterns with thread safe local staticsMike Kaganski
Change-Id: I1bf67196e97411aeecc13ed4f91d1088a315e323 Reviewed-on: https://gerrit.libreoffice.org/62839 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-02fix signatures of deleted copy/assign operatorsNoel Grandin
Change-Id: Id1a0749b78a7021be3564487fb974d7084705129 Reviewed-on: https://gerrit.libreoffice.org/62718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-01gbuild: rename value OS=IOS to OS=iOSMichael Stahl
This gets rid of the horrible hack in gbuild.mk to accomodate the case-incorrect iOS platform makefiles that cannot be renamed without upsetting git on file systems that sadly lack the case sensitivity feature. Keep the macro defined to IOS though. Change-Id: I1022bfef4900da00e75fc1ccce786b20f8673234 Reviewed-on: https://gerrit.libreoffice.org/62705 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24loplugin:external (clang-cl)Stephan Bergmann
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24Simplify assertion codeStephan Bergmann
...avoiding conditional blocks and variables (that need careful #if'ing to avoid them being either undefined or unused depending on NDEBUG and OSL_DEBUG_LEVEL combintaion) Change-Id: Ica9fe3857694f5c0a6e9079dfff05f2e0554b781 Reviewed-on: https://gerrit.libreoffice.org/60926 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-18loplugin:external (macOS)Stephan Bergmann
Change-Id: Ib06572a844d2999e9ecd91e26abd98ecec06a0ae Reviewed-on: https://gerrit.libreoffice.org/60665 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-18Fix for --enable-debug --disable-assert-always-abortStephan Bergmann
...found by <https://ci.libreoffice.org//job/lo_tb_random_config_linux/1480/> Change-Id: Ia71abc74122b9935344bfe693ba1556f6980c6de Reviewed-on: https://gerrit.libreoffice.org/60668 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-18loplugin:useuniqueptr in VtableFactory::createBlockNoel Grandin
Change-Id: I6fd0495277301dfa15bb456f30b8386aea86fe60 Reviewed-on: https://gerrit.libreoffice.org/60622 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-15Re-think cppu::throwException() and the C++/UNO bridge on iOSTor Lillqvist
It seems that on iOS, where we don't have any Java, Python, BASIC, or other scripting, the only thing that would use the C++/UNO bridge functionality that invokes codeSnippet() was cppu::throwException(). codeSnippet() is part of what corresponds to the code that uses run-time-generated machine code on other platforms. We can't generate code at run-time on iOS, that has been known forever. Instead we have used some manually written assembler to handle it instead. We used to have a Perl script to generate a set of code snippets for different cases, different numbers of parameters of the called function and whatnot, but that went away at some stage some year ago. (It is unclear whether that broke the C++/UNO bridge on iOS, or whether the stuff continued to work even after that.) Anyway, this handwritten assembly, or the manual construction of internal data structures for exceptions, or something else, seemed to have bit-rotten. Exceptions thrown with cppu::throwException() were not catchable properly any longer. Instead of digging in and trying to understand what is wrong, I chose another solution. It turns out that the number of types of exception objects thrown by cppu::throwException() is fairly small. During startup of the LibreOffice code, and loading of an .odt document, only one kind of exception is thrown this way... (The lovely css::ucb:InteractiveAugmentedIOException.) So we can simply have code that checks what the type of object being thrown is, and explicitgly throws such an object then with a normal C++ throw statement. Seems to work. Sadly the cppu::getCaughtException() API still needs some inline assembly in the C++/UNO brige. That seems to work though, knock on wood. This commit also adds a small "unit test" for iOS, copied from cppuhelperm to ImplSVMain(). Ideally we should not copy code around of course, but have a separate unit test app for iOS that would somehow include relevant unit tests from source files all over the place. Later. Change-Id: Ib6d9d5b6fb8cc684ec15c97a312ca2f720e87069 Reviewed-on: https://gerrit.libreoffice.org/60506 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-09-05loplugin:simplifyconstruct in accessibility..bridgesNoel Grandin
Change-Id: I08f6a64b50f03d1b08027a2ac9e51442255d64bc Reviewed-on: https://gerrit.libreoffice.org/59976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin
where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-16-Werror,-Wmultichar (clang-cl)Stephan Bergmann
(<https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp> specifies that, for MSVC, "Multiple characters in the literal fill corresponding bytes as needed from high-order to low-order.") Change-Id: I192be65adf3bfff1a4d0f0f4862939be2736ffad Reviewed-on: https://gerrit.libreoffice.org/59154 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-16loplugin:reservedid (clang-cl)Stephan Bergmann
Change-Id: I324b93db2040efeff9d56f529df998cb8d64ec03 Reviewed-on: https://gerrit.libreoffice.org/59155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-09Don't use internal __CxxDetectRethrow: it has side effectsMike Kaganski
Since the __CxxDetectRethrow may increment __ProcessingThrow, which then must be decremented in __CxxUnregisterExceptionObject, and the latter does many other funny things with exception handling CRT machinery, we cannot use those internal functions (neither alone, nor together), or we end up breaking runtime's expectations: the runtime code checks __ProcessingThrow left and right, expecting its non-0 value to indicate "we are unwinding... possibly called from a dtor()". In this case, e.g., std::current_exception returns nullptr inside catch block. This creates our own copy of __CxxDetectRethrow, which does not mangle the global state, and just performs the same checks. This is a dirty hack, and it relies on current layout of the exception description layout - so must be synchronized in the event of changes! Change-Id: I2c475fbc2468073b796c7e9d0f4dfcd315896489 Reviewed-on: https://gerrit.libreoffice.org/58730 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-04fix arm buildCaolán McNamara
Change-Id: I9662478b41486f1fb12ffd83b5046afd48289ed7
2018-08-04fillUnoException not working on std::rethrow_exception exceptionsCaolán McNamara
used since... commit dacc1b40df67d154c96b256b0d920460f38c3d11 Date: Sat Jul 28 16:33:22 2018 +0100 ofz#9597 rethrown IOException not caught by catch IOException the adjustedPtr seems to be as expected, but the type_info not. Presumably these are thrown as 'dependent exceptions' (?) https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/eh_type.cc#L42 Change-Id: Ibd736abe941bb1d5facdb88139b3a0e6cf32cf1f Reviewed-on: https://gerrit.libreoffice.org/58477 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-03loplugin:useuniqueptr in bridgesNoel Grandin
Change-Id: I7248f8b5031e9659b2a58644952e59cc99d6a2d6 Reviewed-on: https://gerrit.libreoffice.org/58483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27Related: rhbz#1602589 add comments to coverity annotationsCaolán McNamara
Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7 Reviewed-on: https://gerrit.libreoffice.org/58093 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-23Fix typosAndrea Gelmini
Change-Id: I1cc2b1f63326d1d0e1f6e452b93af11e59a2d674 Reviewed-on: https://gerrit.libreoffice.org/57799 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-07-09Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-15loplugin:stringconcat, loplugin:sallogareas (clang-cl)Stephan Bergmann
("bridges.win64" isn't more useful than plain "bridges" here, as each platform uses only one bridges/source/cpp_uno/ sub-dir, anyway) Change-Id: Ic8c2af892cdfad98e10d43532b3bf3c892555446 Reviewed-on: https://gerrit.libreoffice.org/54351 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-07bridges (win32/64): Log method callsSamuel Mehrbrodt
Change-Id: I5177dd4fbc8f1b638ceff14c5d88d19fff8076a3 Reviewed-on: https://gerrit.libreoffice.org/53779 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-04-16loplugin:useuniqueptr in bridgesNoel Grandin
Change-Id: I7bf75ffafa63ec88e89192ed32880675c9ae1d61 Reviewed-on: https://gerrit.libreoffice.org/52883 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-10Adapt remaining cpp_uno bridges to #i114635#Stephan Bergmann
..."C++ UNO bridge should convert non-UNO exceptions into RuntimeException" (<https://bz.apache.org/ooo/show_bug.cgi?id=114635>), see <https://lists.freedesktop.org/archives/libreoffice/2018-April/079985.html> "Re: CppunitTest_sw_filters_test failing on x86 Linux, std::exception -> uno::RuntimeException". (The msvc_win32_{intel,x86-64} versions already handle non-UNO exceptions in their msc{i,x}_filterCppException functions, in a different way.) Change-Id: Ie359affed6831d16be0de3e3ff065484e28bd9c3 Reviewed-on: https://gerrit.libreoffice.org/52665 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-20iOS, simplified assemblerjan Iversen
RC of cpp_vtable_call is never used in the asm part, so remove it. Change-Id: Iabda12541fbb574a21395a8430c52a3e9f892947