summaryrefslogtreecommitdiff
path: root/bridges
AgeCommit message (Collapse)AuthorFilesLines
2018-11-28Do like effe6b3d84302afce3d5095e4f376e7e3bf669e0 for iOS, tooTor Lillqvist1-1/+1
Change-Id: I9163e1722f163a04968df292ee8b29d472f9ac4f
2018-11-16loplugin:buriedassign in avmedia..cuiNoel Grandin2-7/+8
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 Gelmini1-1/+1
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 Kaganski22-286/+59
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 Grandin5-14/+14
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 Stahl1-2/+2
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 Bergmann1-1/+1
...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 Bergmann3-6/+39
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 Bergmann1-13/+8
...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 Bergmann1-1/+1
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 Bergmann1-2/+2
...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 Grandin1-7/+6
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 Bergmann3-4/+4
...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 Lillqvist1-0/+4
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 Grandin1-2/+1
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 Grandin3-11/+11
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 Bergmann2-2/+2
(<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 Bergmann2-6/+6
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 Kaganski3-13/+116
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 McNamara2-2/+2
Change-Id: I9662478b41486f1fb12ffd83b5046afd48289ed7
2018-08-04fillUnoException not working on std::rethrow_exception exceptionsCaolán McNamara60-156/+209
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 Grandin3-52/+4
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 McNamara3-6/+6
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 Gelmini1-3/+3
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 Kelemen3-0/+3
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 Bergmann1-5/+5
("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 Mehrbrodt2-0/+17
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 Grandin2-9/+9
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 Bergmann18-88/+379
..."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 Iversen2-34/+17
RC of cpp_vtable_call is never used in the asm part, so remove it. Change-Id: Iabda12541fbb574a21395a8430c52a3e9f892947
2018-03-17iOS, balanced return stackjan Iversen1-21/+19
stack balenced for entering and exiting _privateSnippetExecutor Change-Id: I381c487d3412a39b113e9725807fd018b2b4036a
2018-03-17iOS update unwind abi to v. 26jan Iversen1-7/+9
Change-Id: Id149b6a17dec8e6030d78e235c7451b2244152d1
2018-03-16iOS, solved call stack problem.jan Iversen2-6/+9
Stack was not corrupted, but the call stack was not intact when passing the assembler code. Change-Id: If07909dce2b4a73634a130e5f50e84312115b845
2018-03-16iOS, added description of __cxa_throwjan Iversen1-0/+3
Change-Id: I6a537957528a0d2de989b347bde1167e21544236
2018-03-15iOS, move assembler constants to C++jan Iversen2-13/+5
Change-Id: Iad94a2e2e55bb158d2ac42e3a67a6d94f84ffedd
2018-03-15iOS, simplified bridge assembler code.jan Iversen2-160/+134
Use x14 and x15 as function and offset instead of having x15 as a pointer to 2 words. Change-Id: I1cb3af4e86e3abe1b56fba2509eda31af0435885
2018-03-15iOS, solved corrupted stack in cpp -> unojan Iversen2-36/+38
Solved problem in assembler code, so the call chain is correct. There are still something missing for uno to work correctly Change-Id: Ieb3b3d6b15153576159e07b52ced0efedd135713
2018-03-11iOS, calling cpp_vtable_call does not corrupt stackjan Iversen1-2/+2
Changing bl -> b (jump long to jump) allowed cpp_vtable_call to work without corrumping the stack. However return still corrumpts the stack. Change-Id: I3437a73139b65af13dcf6fa0c959bb1c847564b9
2018-03-11iOS, moved privateSnippetExecutor from asm to C function.jan Iversen2-44/+36
move asm code to C as first step towards reducing the asm code. Since iOS does not permit java/python or anything else than the compiled C++ code, the throw should be done simpler. Apart from that this is the first step in solving a stack corruption problem in the throw code Change-Id: I4f3d3a3ba3f55fb46131d9a8eeb0deebf179d95f
2018-03-11iOS, removed unneeded #ifdef arm64jan Iversen1-3/+0
Change-Id: Ie568c461ae834b33b9220c4b9fb42ec66b5e7ce0
2018-03-11iOS, revert bed135e02bf7db2ef8c29747bbf79f26da71e9cajan Iversen2-3/+1
using USE_DOUBLE_MMAP worked well on the device, but caused problems with the simulator, that depends on the GCC3_MAC* implementation. Change-Id: Ifbc1d48b3642567029c5271054a545eaacaf18ed
2018-03-11iOS, removed perl script in bridgesjan Iversen3-74/+204
The perl script just generated static asm code, this code is now included directly in ios64_helper.s Change-Id: I3ebc6f85865287e1a1d11f82be72fc2407bcb40f
2018-03-11iOS, typo in function decl.jan Iversen1-0/+2
Change-Id: I269f5323ed0f984cfe9d28636a9cae84a863e7a6
2018-03-11iOS, activate USE_DOUBLE_MMAPjan Iversen1-1/+1
If not activated code assumes dymanic behaivour. Change-Id: I6b2807f4a2402a7adfa0839454586b425ee1ae29
2018-03-11bridges,iOS removed suport for x86 and arm.jan Iversen2-473/+0
Only arm64 is supported, code is more readable Change-Id: I6940b0d03dc26c9c8f10c1cb105a7564471f2ca5
2018-03-05Make LibreOffice buildable on Haiku.Kacper Kasper2-2/+3
* Obviously VCL wiring is missing, but most components do build. Change-Id: Ie853ada1423a8f4c2b647be59cd47a7730c42978 Reviewed-on: https://gerrit.libreoffice.org/50293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-21iOS, solved problem with -I for asm modulejan Iversen1-2/+3
Change-Id: I9e699eea04231eeeff4146657124ee4f0e68412d
2018-02-20iOS, remove throw definitionjan Iversen1-6/+0
clean cpp_uno part. Change-Id: Ief08e4cf596b375243ae215d8dc2e1cdb5830ac1
2018-02-19Buildsystem changes to recognize Haiku.Kacper Kasper1-3/+3
Change-Id: I219d556f8e124cfe426cc1ac3c54da34eb7ef790 Reviewed-on: https://gerrit.libreoffice.org/49925 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-17iOS, add custom include for codesnippets.Sjan Iversen1-0/+4
Change-Id: I285838f6f3e8ec57a63239f71a403809154c47e2