Makefile.fetch
| 1
RepositoryModule_host.mk
| 1
bin/find-german-comments
| 1
bin/find-headers-to-move-inside-modules.py
| 2
configure.ac
| 1
dev/null
|binary
download.lst
| 5
external/Module_external.mk
| 1
external/onlineupdate/CustomTarget_generated.mk
| 42
external/onlineupdate/Executable_mar.mk
| 63
external/onlineupdate/Executable_mbsdiff.mk
| 17
external/onlineupdate/Executable_test_updater_dialog.mk
| 23
external/onlineupdate/Executable_update_service.mk
| 81
external/onlineupdate/Executable_updater.mk
| 140
external/onlineupdate/Makefile
| 2
external/onlineupdate/Module_onlineupdate.mk
| 1
external/onlineupdate/README.md
| 7
external/onlineupdate/StaticLibrary_libmar.mk
| 45
external/onlineupdate/StaticLibrary_libmarverify.mk
| 23
external/onlineupdate/StaticLibrary_updatehelper.mk
| 70
external/onlineupdate/UnpackedTarball_onlineupdate.mk
| 21
external/onlineupdate/WinResTarget_updater.mk
| 15
external/onlineupdate/generate-sources.sh
| 196
external/onlineupdate/gtk3deprecated.patch
| 11
external/onlineupdate/lo.patch
| 21
external/onlineupdate/workben/test_dialog.cxx
| 4
include/onlineupdate/mar.h
| 198
include/onlineupdate/mar_cmdline.h
| 110
include/onlineupdate/mar_private.h
| 79
include/onlineupdate/mozilla/Assertions.h
| 503 -
include/onlineupdate/mozilla/Attributes.h
| 481 -
include/onlineupdate/mozilla/Compiler.h
| 110
include/onlineupdate/mozilla/Likely.h
| 23
include/onlineupdate/mozilla/MacroArgs.h
| 105
include/onlineupdate/mozilla/TypeTraits.h
| 1116 --
include/onlineupdate/mozilla/Types.h
| 134
include/onlineupdate/mozilla/nsTraceRefcnt.h
| 67
onlineupdate/CustomTarget_generated.mk
| 3
onlineupdate/Executable_mar.mk
| 51
onlineupdate/Executable_update_service.mk
| 62
onlineupdate/Executable_updater.mk
| 95
onlineupdate/StaticLibrary_libmar.mk
| 29
onlineupdate/StaticLibrary_updatehelper.mk
| 37
onlineupdate/WinResTarget_updater.mk
| 15
onlineupdate/astyle.options
| 7
onlineupdate/inc/Char16.h
| 194
onlineupdate/inc/bspatch.h
| 95
onlineupdate/inc/types.hxx
| 25
onlineupdate/source/libmar/README
| 6
onlineupdate/source/libmar/sign/Makefile.in
| 10
onlineupdate/source/libmar/sign/mar_sign.c
| 1160 --
onlineupdate/source/libmar/sign/nss_secutil.c
| 238
onlineupdate/source/libmar/sign/nss_secutil.h
| 40
onlineupdate/source/libmar/src/Makefile.in
| 13
onlineupdate/source/libmar/src/mar_create.c
| 398
onlineupdate/source/libmar/src/mar_extract.c
| 85
onlineupdate/source/libmar/src/mar_read.c
| 572 -
onlineupdate/source/libmar/tool/Makefile.in
| 23
onlineupdate/source/libmar/tool/mar.c
| 463 -
onlineupdate/source/libmar/verify/MacVerifyCrypto.cpp
| 414
onlineupdate/source/libmar/verify/cryptox.c
| 282
onlineupdate/source/libmar/verify/cryptox.h
| 172
onlineupdate/source/libmar/verify/mar_verify.c
| 466 -
onlineupdate/source/mbsdiff/bsdiff.cxx
| 405
onlineupdate/source/service/certificatecheck.cxx
| 292
onlineupdate/source/service/certificatecheck.hxx
| 22
onlineupdate/source/service/maintenanceservice.cxx
| 438
onlineupdate/source/service/maintenanceservice.hxx
| 10
onlineupdate/source/service/registrycertificates.cxx
| 181
onlineupdate/source/service/registrycertificates.hxx
| 13
onlineupdate/source/service/resource.hxx
| 20
onlineupdate/source/service/servicebase.cxx
| 97
onlineupdate/source/service/servicebase.hxx
| 21
onlineupdate/source/service/serviceinstall.cxx
| 850 -
onlineupdate/source/service/serviceinstall.hxx
| 21
onlineupdate/source/service/windowsHelper.hxx
| 48
onlineupdate/source/service/workmonitor.cxx
| 770 -
onlineupdate/source/service/workmonitor.hxx
| 5
onlineupdate/source/update/common/errors.h
| 96
onlineupdate/source/update/common/pathhash.cxx
| 153
onlineupdate/source/update/common/pathhash.h
| 19
onlineupdate/source/update/common/readstrings.cxx
| 267
onlineupdate/source/update/common/readstrings.h
| 38
onlineupdate/source/update/common/sources.mozbuild
| 19
onlineupdate/source/update/common/uachelper.cxx
| 237
onlineupdate/source/update/common/uachelper.h
| 23
onlineupdate/source/update/common/updatedefines.h
| 135
onlineupdate/source/update/common/updatehelper.cxx
| 807 -
onlineupdate/source/update/common/updatehelper.h
| 34
onlineupdate/source/update/common/updatelogging.cxx
| 85
onlineupdate/source/update/common/updatelogging.h
| 47
onlineupdate/source/update/common/win_dirent.h
| 31
onlineupdate/source/update/updater/Makefile.in
| 28
onlineupdate/source/update/updater/archivereader.cxx
| 349
onlineupdate/source/update/updater/archivereader.h
| 39
onlineupdate/source/update/updater/bspatch.cxx
| 198
onlineupdate/source/update/updater/gen_cert_header.py
| 42
onlineupdate/source/update/updater/launchchild_osx.mm
| 138
onlineupdate/source/update/updater/loaddlls.cxx
| 119
onlineupdate/source/update/updater/macbuild/Contents/Info.plist
| 35
onlineupdate/source/update/updater/macbuild/Contents/PkgInfo
| 1
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
| 7
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
| 19
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib
| 22
onlineupdate/source/update/updater/progressui-unused/progressui_gonk.cxx
| 52
onlineupdate/source/update/updater/progressui-unused/progressui_osx.mm
| 141
onlineupdate/source/update/updater/progressui.h
| 36
onlineupdate/source/update/updater/progressui_gtk.cxx
| 147
onlineupdate/source/update/updater/progressui_gtk_icon.h
| 205
onlineupdate/source/update/updater/progressui_null.cxx
| 27
onlineupdate/source/update/updater/progressui_win.cxx
| 348
onlineupdate/source/update/updater/resource.h
| 29
onlineupdate/source/update/updater/updater-common.build
| 119
onlineupdate/source/update/updater/updater-xpcshell/Makefile.in
| 32
onlineupdate/source/update/updater/updater-xpcshell/moz.build
| 13
onlineupdate/source/update/updater/updater.cxx
| 4594 ----------
onlineupdate/source/update/updater/updater.exe.comctl32.manifest
| 38
onlineupdate/source/update/updater/updater.exe.manifest
| 26
onlineupdate/source/update/updater/updater.rc
| 137
onlineupdate/source/update/updater/updater.svg
| 1
onlineupdate/source/update/updater/win_dirent.cxx
| 89
onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cxx
| 429
onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.h
| 174
solenv/clang-format/excludelist
| 59
solenv/qa/python/gbuildtojson.py
| 2
125 files changed, 772 insertions(+), 20782 deletions(-)
New commits:
commit e34e4640823dd729bb9d530cbe1d187d991f8532
Author: Stephan Bergmann <[email protected]>
AuthorDate: Fri Dec 8 16:39:43 2023 +0100
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Dec 15 13:04:12 2023 +0100
Turn onlineupdate into external/onlineupdate
...and update to latest Mozilla sources.
Originally, this was a non-external onlineupdate module (plus correspsonding
top-level include/onlineupdate/ directory) that apparently contained sources
originally copied from Mozilla and subsequently modified in-place (plus,
mixed
in, presumably some sources that were not copied from Mozilla but were our
own
inventions). To clean up this mess, this has been turned into a proper
external/onlineupdate module with a tarball containing the pristine external
Mozilla sources.
The sources for the
onlineupdate-c003be8b9727672e7d30972983b375f4c200233f.tar.xz
tarball are taken, somewhat arbitrarily, from a recent
<https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f>
("Bug 1867784 - Force reflow all kids in the last column balancing reflow.
r=layout-reviewers,dholbert") trunk state, by running
`external/onlineupdate/generate-sources.sh ~/github.com/mozilla/gecko-dev`
on a
Fedora 39 machine.
The layout of the tarball still mostly follows the old onlineupdate/ layout,
even if that deviates heavily from the actual source layout at
<https://github.com/mozilla/gecko-dev/>. (And some files, which apparently
are
not needed, anyway, lacked sources, see the "Missing source for" in
external/onlineupdate/generate-sources.sh. And win_dirent.h/.cpp has
meanwhile
been superseded by updateutils_win.h/.cpp.) Merely newly included source
files
are laid out in the tarball according to the actual source layout.
Any LO-specific modifications are made via patch files (rather than
modifying
the sources inline, as was done in the past): external/onlineupdate/lo.patch
contains whatever modifications are needed to adapt the functionality, while
external/onlineupdate/gtk3deprecated.patch fixes
>
workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/progressui_gtk.cpp:97:21:
error: use of undeclared identifier 'gtk_vbox_new'; did you mean 'gtk_box_new'?
> 97 | GtkWidget* vbox = gtk_vbox_new(TRUE, 6);
> | ^~~~~~~~~~~~
> | gtk_box_new
to not use the deprecated gtk_vbox_new, which is hidden because we include
-DGTK_DISABLE_DEPRECATED in our GTK3_CFLAGS as per our configure.ac.
On Windows, the definition of __BYTE_ORDER__ etc. is needed because
workdir/UnpackedTarball/onlineupdate/include/mozilla/ says "Our supported
compilers provide architecture-independent macros for this", but MSVC
doesn't
actually, so define here what would implicitly be defined by GCC.
Similarly, on
Windows -U_WIN32_WINNT is needed to undo -D_WIN32_WINNT=0x0601 in
solenv/gbuild/platform/windows.mk, which would cause
>
workdir\UnpackedTarball\onlineupdate\include\mozilla/WinHeaderOnlyUtils.h(537):
error C2065: 'FILE_ID_INFO': undeclared identifier
etc., despite the #include <windws.h> there.
Curiously, the original gb_CustomTarget_CustomTarget,onlineupdate/generated
from
onlineupdate/CustomTarget_generated.mk had to be renamed to
gb_CustomTarget_CustomTarget,external/onlineupdate/generated when the file
was
moved to external/onlineupdate/CustomTarget_generated.mk, as otherwise a
top-level `make CustomTarget_onlineupdate/generated` would have failed with
"No
rule to make target..." Also, as there is no gb_CustomTarget_use_unpacked,
its
effect has been poorly mimicked for now in
external/onlineupdate/CustomTarget_generated.mk.
Similarly, as there is no gb_WinResTarget_use_unpacked, its effect has been
poorly mimicked for now in external/onlineupdate/WinResTarget_updater.mk.
The original onlineupdate/workben/test_dialog.cxx, which is actually code
written by us, has been moved to
external/onlineupdate/workben/test_dialog.cxx.
The original onlineupdate/qa/ sources (which were apparently not used
during the
build) have been preserved for now as external/onlineupdate/qa/, for
documentation purposes.
The original onlineupdate/astyle.options (which was apparently not used
during
the build) has been removed.
Change-Id: I5ea606202e7837269e7b128e45af2f0b8c277f9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160492
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
(cherry picked from commit 90255d8931af23e3b81a0d921699632bf323af29)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160804
diff --git a/Makefile.fetch b/Makefile.fetch
index d445898c94c6..3956cd4d2af0 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -207,6 +207,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk
$(SRCDIR)/download.lst $(S
$(call fetch_Optional,NSS,NSS_TARBALL) \
$(call fetch_Optional_pack,NUMBERTEXT_EXTENSION_PACK) \
$(call fetch_Optional,ODFGEN,ODFGEN_TARBALL) \
+ $(call fetch_Optional,ONLINEUPDATE,ONLINEUPDATE_TARBALL) \
$(call fetch_Optional,OPENLDAP,OPENLDAP_TARBALL) \
$(call fetch_Optional,OPENSSL,OPENSSL_TARBALL) \
$(call fetch_Optional,ORCUS,ORCUS_TARBALL) \
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 2fbee39dc610..b25350ee2c3e 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -112,7 +112,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
$(call gb_Helper_optional,ODK,odk) \
offapi \
officecfg \
- onlineupdate \
oovbaapi \
oox \
$(call gb_Helper_optional,OPENCL,opencl) \
diff --git a/bin/find-german-comments b/bin/find-german-comments
index 175af6f22420..f4ad23d9d2c1 100755
--- a/bin/find-german-comments
+++ b/bin/find-german-comments
@@ -304,7 +304,6 @@ class Parser:
"o3tl" : 1,
"odk" : 1,
"officecfg" : 1,
- "onlineupdate" : 1,
"opencl" : 1,
"oox" : 1,
"package" : 1,
diff --git a/bin/find-headers-to-move-inside-modules.py
b/bin/find-headers-to-move-inside-modules.py
index 9ec0f623128d..67060ee29fbd 100755
--- a/bin/find-headers-to-move-inside-modules.py
+++ b/bin/find-headers-to-move-inside-modules.py
@@ -21,8 +21,6 @@ with a.stdout as txt:
if header.startswith(b"sal/"): continue
if header.startswith(b"salhelper/"): continue
if header.startswith(b"uno/"): continue
- # these are direct copies of mozilla code
- if header.startswith(b"onlineupdate/mozilla/"): continue
headerSet.add(header)
headerSetUnused = headerSet.copy()
diff --git a/configure.ac b/configure.ac
index eb21856d6041..8cacd9a673e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13644,6 +13644,7 @@ AC_MSG_CHECKING([whether to enable mar online update])
ENABLE_ONLINE_UPDATE_MAR=
if test "$enable_online_update_mar" = yes; then
AC_MSG_RESULT([yes])
+ BUILD_TYPE="$BUILD_TYPE ONLINEUPDATE"
ENABLE_ONLINE_UPDATE_MAR="TRUE"
AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
else
diff --git a/download.lst b/download.lst
index bb9ff13fd2d3..14171f07c1f7 100644
--- a/download.lst
+++ b/download.lst
@@ -493,6 +493,11 @@ OFFICEOTRON_JAR :=
8249374c274932a21846fa7629c2aa9b-officeotron-0.7.4-master.jar
# three static lines
# so that git cherry-pick
# will not run into conflicts
+ONLINEUPDATE_SHA256SUM :=
cfd00948425424d7934f5f3e26c830eda9ebbf2d18e13656bd20e4f6cd99e4ac
+ONLINEUPDATE_TARBALL :=
onlineupdate-c003be8b9727672e7d30972983b375f4c200233f.tar.xz
+# three static lines
+# so that git cherry-pick
+# will not run into conflicts
OPENLDAP_SHA256SUM :=
082e998cf542984d43634442dbe11da860759e510907152ea579bdc42fe39ea0
OPENLDAP_TARBALL := openldap-2.6.6.tgz
# three static lines
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 11588c51dcf0..4d505991822a 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -85,6 +85,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,OPENSSL,openssl) \
$(call gb_Helper_optional,ORCUS,liborcus) \
$(call gb_Helper_optional,PAGEMAKER,libpagemaker) \
+ $(if $(ENABLE_ONLINE_UPDATE_MAR),onlineupdate) \
$(call gb_Helper_optional,PDFIUM,pdfium) \
$(call gb_Helper_optional,POPPLER,poppler) \
$(call gb_Helper_optional,POSTGRESQL,postgresql) \
diff --git a/external/onlineupdate/CustomTarget_generated.mk
b/external/onlineupdate/CustomTarget_generated.mk
new file mode 100644
index 000000000000..dba8274497e6
--- /dev/null
+++ b/external/onlineupdate/CustomTarget_generated.mk
@@ -0,0 +1,42 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,external/onlineupdate/generated))
+
+onlineupdate_INC := $(call
gb_CustomTarget_get_workdir,external/onlineupdate/generated)/onlineupdate
+
+# For debug purposes, ONLINEUPDATE_MAR_CERTIFICATEDER can be empty, but
gen_cert_header.py always
+# expects an existing certificate-der=... pathname, so as a hack fall back to
the generated
+# update.ini itself as the pathname of the certificate DER file (though that
will cause
+# gen_cert_header.py to generate nonsense data, of course):
+$(call gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini: | \
+ $(call gb_CustomTarget_get_workdir,onlineupdate/generated)/.dir
+ printf '[Updater]\ncertificate-der=%s\n' '$(or
$(ONLINEUPDATE_MAR_CERTIFICATEDER),$@)' > $@
+
+$(onlineupdate_INC)/primaryCert.h : \
+ $(call gb_ExternalExecutable_get_dependencies,python) \
+ $(call
gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini \
+ | $(call gb_UnpackedTarball_get_target,onlineupdate)
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1)
+ mkdir -p $(dir $@)
+ $(call gb_ExternalExecutable_get_command,python) $(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/gen_cert_header.py
"primaryCertData" $(call
gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini >
$(onlineupdate_INC)/primaryCert.h
+
+$(onlineupdate_INC)/secondaryCert.h : \
+ $(call gb_ExternalExecutable_get_dependencies,python) \
+ $(call
gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini \
+ | $(call gb_UnpackedTarball_get_target,onlineupdate)
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1)
+ mkdir -p $(dir $@)
+ $(call gb_ExternalExecutable_get_command,python) $(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/gen_cert_header.py
"secondaryCertData" $(call
gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini >
$(onlineupdate_INC)/secondaryCert.h
+
+$(call gb_CustomTarget_get_target,external/onlineupdate/generated) : \
+ $(onlineupdate_INC)/primaryCert.h \
+ $(onlineupdate_INC)/secondaryCert.h \
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/onlineupdate/Executable_mar.mk
b/external/onlineupdate/Executable_mar.mk
new file mode 100644
index 000000000000..bcfd2f4a7f97
--- /dev/null
+++ b/external/onlineupdate/Executable_mar.mk
@@ -0,0 +1,63 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Executable_Executable,mar))
+
+$(eval $(call gb_Executable_use_unpacked,mar,onlineupdate))
+
+$(eval $(call gb_Executable_set_include,mar,\
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/src/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/verify/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/sign/ \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Executable_use_static_libraries,mar,\
+ libmar \
+ libmarverify \
+))
+
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_Executable_add_defs,mar,\
+ -DXP_WIN \
+))
+
+$(eval $(call gb_Executable_add_libs,mar,\
+ ws2_32.lib \
+ Crypt32.lib \
+))
+
+endif
+
+$(eval $(call gb_Executable_use_externals,mar,\
+ nss3 \
+))
+
+$(eval $(call gb_Executable_add_defs,mar,\
+ -DMAR_NSS \
+))
+
+$(eval $(call gb_Executable_add_defs,mar,\
+
-DMOZ_APP_VERSION=\"$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\"
\
+ -DMAR_CHANNEL_ID=\"LOOnlineUpdater\" \
+))
+
+$(eval $(call gb_Executable_add_generated_cobjects,mar,\
+ UnpackedTarball/onlineupdate/nsprpub/lib/libc/src/strdup \
+ UnpackedTarball/onlineupdate/nsprpub/lib/libc/src/strlen \
+
UnpackedTarball/onlineupdate/onlineupdate/source/libmar/sign/nss_secutil \
+ UnpackedTarball/onlineupdate/onlineupdate/source/libmar/sign/mar_sign \
+ UnpackedTarball/onlineupdate/onlineupdate/source/libmar/tool/mar \
+))
+
+$(eval $(call gb_Executable_set_warnings_disabled,mar))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/onlineupdate/Executable_mbsdiff.mk
b/external/onlineupdate/Executable_mbsdiff.mk
similarity index 57%
rename from onlineupdate/Executable_mbsdiff.mk
rename to external/onlineupdate/Executable_mbsdiff.mk
index 9c528a58b9ff..a41729909586 100644
--- a/onlineupdate/Executable_mbsdiff.mk
+++ b/external/onlineupdate/Executable_mbsdiff.mk
@@ -9,8 +9,11 @@
$(eval $(call gb_Executable_Executable,mbsdiff))
+$(eval $(call gb_Executable_use_unpacked,mbsdiff,onlineupdate))
+
$(eval $(call gb_Executable_set_include,mbsdiff,\
- -I$(SRCDIR)/onlineupdate/inc \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/inc \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/updater \
$$(INCLUDE) \
))
@@ -20,13 +23,21 @@ $(eval $(call gb_Executable_use_externals,mbsdiff,\
ifeq ($(OS),WNT)
+
+$(eval $(call gb_Executable_add_defs,mbsdiff, \
+ -DXP_WIN \
+))
+
$(eval $(call gb_Executable_add_libs,mbsdiff,\
ws2_32.lib \
))
+
endif
-$(eval $(call gb_Executable_add_cxxobjects,mbsdiff,\
- onlineupdate/source/mbsdiff/bsdiff \
+$(eval $(call gb_Executable_add_generated_cobjects,mbsdiff,\
+ UnpackedTarball/onlineupdate/onlineupdate/source/mbsdiff/bsdiff \
))
+$(eval $(call gb_Executable_set_warnings_disabled,mbsdiff))
+
# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/onlineupdate/Executable_test_updater_dialog.mk
b/external/onlineupdate/Executable_test_updater_dialog.mk
similarity index 61%
rename from onlineupdate/Executable_test_updater_dialog.mk
rename to external/onlineupdate/Executable_test_updater_dialog.mk
index 1f95c21e20d1..9c9c0038c8da 100644
--- a/onlineupdate/Executable_test_updater_dialog.mk
+++ b/external/onlineupdate/Executable_test_updater_dialog.mk
@@ -9,11 +9,16 @@
$(eval $(call gb_Executable_Executable,test_updater_dialog))
+$(eval $(call gb_Executable_use_unpacked,test_updater_dialog,onlineupdate))
+
$(eval $(call gb_Executable_set_include,test_updater_dialog,\
- -I$(SRCDIR)/onlineupdate/inc \
- -I$(SRCDIR)/onlineupdate/source/update/common \
- -I$(SRCDIR)/onlineupdate/source/update/updater/xpcom/glue \
- -I$(SRCDIR)/onlineupdate/source/update/updater \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/inc \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/common \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/xpcom/glue
\
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/common \
$$(INCLUDE) \
$(if $(filter-out WNT,$(OS)),$$(GTK3_CFLAGS) ) \
))
@@ -23,6 +28,11 @@ $(eval $(call
gb_Executable_use_static_libraries,test_updater_dialog,\
))
ifeq ($(OS),WNT)
+
+$(eval $(call gb_Executable_add_defs,test_updater_dialog, \
+ -DXP_WIN \
+))
+
$(eval $(call gb_Executable_add_libs,test_updater_dialog,\
Ws2_32.lib \
Gdi32.lib \
@@ -57,9 +67,12 @@ $(eval $(call gb_Executable_add_libs,test_updater_dialog,\
endif
$(eval $(call gb_Executable_add_exception_objects,test_updater_dialog,\
- onlineupdate/workben/test_dialog \
+ external/onlineupdate/workben/test_dialog \
))
+# external/onlineupdate/workben/test_dialog.cxx #include's lots of external
.cpp code:
+$(eval $(call gb_Executable_set_warnings_not_errors,test_updater_dialog))
+
ifeq ($(OS),WNT)
$(eval $(call gb_Executable_add_defs,test_updater_dialog,-DUNICODE))
endif
diff --git a/external/onlineupdate/Executable_update_service.mk
b/external/onlineupdate/Executable_update_service.mk
new file mode 100644
index 000000000000..2fe188bbc024
--- /dev/null
+++ b/external/onlineupdate/Executable_update_service.mk
@@ -0,0 +1,81 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Executable_Executable,update_service))
+
+$(eval $(call gb_Executable_use_unpacked,update_service,onlineupdate))
+
+$(eval $(call gb_Executable_set_targettype_gui,update_service,YES))
+
+$(eval $(call gb_Executable_set_include,update_service,\
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/inc \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/src/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/verify/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/sign/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/common/ \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/common \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/xre \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/xpcom/base \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/xpcom/string \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Executable_use_static_libraries,update_service,\
+ updatehelper \
+ windows_process \
+))
+
+$(eval $(call gb_Executable_add_libs,update_service,\
+ ws2_32.lib \
+ Crypt32.lib \
+ shell32.lib \
+ wintrust.lib \
+ version.lib \
+ wtsapi32.lib \
+ userenv.lib \
+ shlwapi.lib \
+ ole32.lib \
+ rpcrt4.lib \
+ comctl32.lib \
+ shlwapi.lib \
+ kernel32.lib \
+ advapi32.lib \
+))
+
+$(eval $(call gb_Executable_add_ldflags,update_service,\
+ /ENTRY:wmainCRTStartup \
+))
+
+$(eval $(call gb_Executable_set_generated_cxx_suffix,update_service,cpp))
+
+$(eval $(call gb_Executable_add_generated_exception_objects,update_service,\
+
UnpackedTarball/onlineupdate/onlineupdate/source/service/maintenanceservice \
+ UnpackedTarball/onlineupdate/onlineupdate/source/service/servicebase \
+ UnpackedTarball/onlineupdate/onlineupdate/source/service/serviceinstall
\
+ UnpackedTarball/onlineupdate/onlineupdate/source/service/workmonitor \
+))
+
+$(eval $(call gb_Executable_add_cxxflags,update_service,-Zc:strictStrings-))
+
+$(eval $(call gb_Executable_add_defs,update_service, \
+ -DMOZ_MAINTENANCE_SERVICE \
+ -DNS_NO_XPCOM \
+ -DUNICODE \
+ -DXP_WIN \
+ $(if $(filter AARCH64 INTEL X86_64,$(CPUNAME)),-D__BYTE_ORDER__=1234) \
+ -D__ORDER_BIG_ENDIAN__=4321 \
+ -D__ORDER_LITTLE_ENDIAN__=1234 \
+ -U_WIN32_WINNT \
+))
+
+$(eval $(call gb_Executable_set_warnings_disabled,update_service))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/external/onlineupdate/Executable_updater.mk
b/external/onlineupdate/Executable_updater.mk
new file mode 100644
index 000000000000..0aa0bbe2c9b3
--- /dev/null
+++ b/external/onlineupdate/Executable_updater.mk
@@ -0,0 +1,140 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Executable_Executable,updater))
+
+$(eval $(call gb_Executable_use_unpacked,updater,onlineupdate))
+
+$(eval $(call gb_Executable_set_include,updater,\
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/inc \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/common \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/xpcom/glue
\
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/service \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/modules/xz-embedded/src \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/common \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/updater \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/xre \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/xpcom/base \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/xpcom/string \
+ $$(INCLUDE) \
+ $(if $(filter-out WNT,$(OS)),$$(GTK3_CFLAGS) ) \
+))
+
+$(eval $(call
gb_Executable_use_custom_headers,updater,external/onlineupdate/generated))
+
+$(eval $(call gb_Executable_use_static_libraries,updater,\
+ libmar \
+ libmarverify \
+ updatehelper \
+ $(if $(filter WNT,$(OS)), \
+ windows_process )\
+))
+
+$(eval $(call gb_Executable_use_externals,updater,\
+ bzip2 \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Executable_add_libs,updater,\
+ Ws2_32.lib \
+ Gdi32.lib \
+ Comctl32.lib \
+ Shell32.lib \
+ Shlwapi.lib \
+ Crypt32.lib \
+ Ole32.lib \
+ Rpcrt4.lib \
+ wintrust.lib \
+))
+
+$(eval $(call gb_Executable_set_targettype_gui,updater,YES))
+
+$(eval $(call gb_Executable_add_nativeres,updater,updaterres))
+
+$(eval $(call gb_Executable_add_ldflags,updater,\
+ /ENTRY:wmainCRTStartup \
+))
+
+$(eval $(call gb_Executable_add_defs,updater,\
+ -DVERIFY_MAR_SIGNATURE \
+ -DNS_NO_XPCOM \
+ -DMOZ_MAINTENANCE_SERVICE \
+ -DXP_WIN \
+ -DXZ_USE_CRC64 \
+ -DXZ_DEC_X86 \
+ -DXZ_DEC_POWERPC \
+ -DXZ_DEC_IA64 \
+ -DXZ_DEC_ARM \
+ -DXZ_DEC_ARMTHUMB \
+ -DXZ_DEC_SPARC \
+ $(if $(filter AARCH64 INTEL X86_64,$(CPUNAME)),-D__BYTE_ORDER__=1234) \
+ -D__ORDER_BIG_ENDIAN__=4321 \
+ -D__ORDER_LITTLE_ENDIAN__=1234 \
+ -U_WIN32_WINNT \
+))
+
+else
+
+$(eval $(call gb_Executable_add_defs,updater,\
+ -DVERIFY_MAR_SIGNATURE \
+ -DNSS3 \
+ -DNS_NO_XPCOM \
+ -DXP_UNIX \
+ -DXZ_USE_CRC64 \
+ -DXZ_DEC_X86 \
+ -DXZ_DEC_POWERPC \
+ -DXZ_DEC_IA64 \
+ -DXZ_DEC_ARM \
+ -DXZ_DEC_ARMTHUMB \
+ -DXZ_DEC_SPARC \
+))
+
+$(eval $(call gb_Executable_use_externals,updater,\
+ nss3 \
+))
+
+$(eval $(call gb_Executable_add_libs,updater,\
+ $(GTK3_LIBS) \
+))
+
+endif
+
+$(eval $(call gb_Executable_set_generated_cxx_suffix,updater,cpp))
+
+$(eval $(call gb_Executable_add_generated_exception_objects,updater,\
+
UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/archivereader \
+ UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/bspatch
\
+ $(if $(filter-out
WNT,$(OS)),UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/progressui_gtk)
\
+ UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater
\
+ $(if $(filter WNT,$(OS)),\
+
UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/loaddlls \
+
UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/progressui_win
)\
+))
+
+$(eval $(call gb_Executable_add_generated_cobjects,updater, \
+ UnpackedTarball/onlineupdate/modules/xz-embedded/src/xz_crc32 \
+ UnpackedTarball/onlineupdate/modules/xz-embedded/src/xz_crc64 \
+ UnpackedTarball/onlineupdate/modules/xz-embedded/src/xz_dec_bcj \
+ UnpackedTarball/onlineupdate/modules/xz-embedded/src/xz_dec_lzma2 \
+ UnpackedTarball/onlineupdate/modules/xz-embedded/src/xz_dec_stream \
+))
+
+$(eval $(call gb_Executable_set_warnings_disabled,updater))
+
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_Executable_add_cxxflags,updater,-Zc:strictStrings-))
+
+$(eval $(call gb_Executable_add_defs,updater,-DUNICODE))
+
+endif
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/onlineupdate/Makefile b/external/onlineupdate/Makefile
similarity index 86%
rename from onlineupdate/Makefile
rename to external/onlineupdate/Makefile
index 0997e628485b..569ad8a0ba7a 100644
--- a/onlineupdate/Makefile
+++ b/external/onlineupdate/Makefile
@@ -9,6 +9,6 @@
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
-include $(module_directory)/../solenv/gbuild/partial_build.mk
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:
diff --git a/onlineupdate/Module_onlineupdate.mk
b/external/onlineupdate/Module_onlineupdate.mk
similarity index 95%
rename from onlineupdate/Module_onlineupdate.mk
rename to external/onlineupdate/Module_onlineupdate.mk
index 58e1d3de4531..8b5a09efc0ae 100644
--- a/onlineupdate/Module_onlineupdate.mk
+++ b/external/onlineupdate/Module_onlineupdate.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,onlineupdate))
ifneq ($(ENABLE_ONLINE_UPDATE_MAR),)
$(eval $(call gb_Module_add_targets,onlineupdate,\
+ UnpackedTarball_onlineupdate \
StaticLibrary_libmar \
StaticLibrary_libmarverify \
StaticLibrary_updatehelper \
diff --git a/onlineupdate/README.md b/external/onlineupdate/README.md
similarity index 87%
rename from onlineupdate/README.md
rename to external/onlineupdate/README.md
index 0162776a618c..ac4a7e65ba3d 100644
--- a/onlineupdate/README.md
+++ b/external/onlineupdate/README.md
@@ -2,11 +2,8 @@
Online update implementation based on Mozilla's MAR format + update mechanism
-Parts of this code are copied from the mozilla repository, and adapted to
-LibreOffice needs:
-
-`firefox/modules/libmar` -> `onlineupdate/source/libmar`
-`firefox/toolkit/mozapps/update` -> `onlineupdate/source/update`
+The source code has been extracted from <https://github.com/mozilla/gecko-dev>
with
+external/onlineupdate/generate-sources.sh.
The source/service directory contains the code for the silent windows updater
that avoids the
repeated administrator check for an update.
diff --git a/external/onlineupdate/StaticLibrary_libmar.mk
b/external/onlineupdate/StaticLibrary_libmar.mk
new file mode 100644
index 000000000000..836b50038784
--- /dev/null
+++ b/external/onlineupdate/StaticLibrary_libmar.mk
@@ -0,0 +1,45 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,libmar))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,libmar,onlineupdate))
+
+$(eval $(call gb_StaticLibrary_set_include,libmar,\
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/src/ \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/other-licenses/nsis/Contrib/CityHash/cityhash
\
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,libmar,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libmar,\
+ UnpackedTarball/onlineupdate/onlineupdate/source/libmar/src/mar_create \
+ UnpackedTarball/onlineupdate/onlineupdate/source/libmar/src/mar_extract
\
+ UnpackedTarball/onlineupdate/onlineupdate/source/libmar/src/mar_read \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,libmar, \
+
UnpackedTarball/onlineupdate/other-licenses/nsis/Contrib/CityHash/cityhash/city
\
+))
+
+$(eval $(call gb_StaticLibrary_use_static_libraries,\
+ libmarverify \
+))
+
+$(eval $(call gb_StaticLibrary_set_warnings_disabled,libmar))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_defs,libmar, \
+ -DXP_WIN \
+))
+endif
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/onlineupdate/StaticLibrary_libmarverify.mk
b/external/onlineupdate/StaticLibrary_libmarverify.mk
similarity index 51%
rename from onlineupdate/StaticLibrary_libmarverify.mk
rename to external/onlineupdate/StaticLibrary_libmarverify.mk
index 62e13b686a33..9915fcb66256 100644
--- a/onlineupdate/StaticLibrary_libmarverify.mk
+++ b/external/onlineupdate/StaticLibrary_libmarverify.mk
@@ -9,12 +9,22 @@
$(eval $(call gb_StaticLibrary_StaticLibrary,libmarverify))
+$(eval $(call gb_StaticLibrary_use_unpacked,libmarverify,onlineupdate))
+
$(eval $(call gb_StaticLibrary_set_include,libmarverify,\
- -I$(SRCDIR)/onlineupdate/source/libmar/src/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/src/ \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
$$(INCLUDE) \
))
-ifneq ($(OS),WNT)
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_StaticLibrary_add_defs,libmarverify, \
+ -DXP_WIN \
+))
+
+else
+
$(eval $(call gb_StaticLibrary_add_defs,libmarverify,\
-DMAR_NSS \
))
@@ -22,13 +32,14 @@ $(eval $(call gb_StaticLibrary_add_defs,libmarverify,\
$(eval $(call gb_StaticLibrary_use_externals,libmarverify,\
nss3 \
))
+
endif
-$(eval $(call gb_StaticLibrary_add_cobjects,libmarverify,\
- onlineupdate/source/libmar/verify/mar_verify \
- onlineupdate/source/libmar/verify/cryptox \
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libmarverify,\
+
UnpackedTarball/onlineupdate/onlineupdate/source/libmar/verify/mar_verify \
+ UnpackedTarball/onlineupdate/onlineupdate/source/libmar/verify/cryptox \
))
-$(eval $(call gb_StaticLibrary_set_warnings_not_errors,libmarverify))
+$(eval $(call gb_StaticLibrary_set_warnings_disabled,libmarverify))
# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/external/onlineupdate/StaticLibrary_updatehelper.mk
b/external/onlineupdate/StaticLibrary_updatehelper.mk
new file mode 100644
index 000000000000..742d4d1c648d
--- /dev/null
+++ b/external/onlineupdate/StaticLibrary_updatehelper.mk
@@ -0,0 +1,70 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,updatehelper))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,updatehelper,onlineupdate))
+
+$(eval $(call gb_StaticLibrary_set_include,updatehelper,\
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/inc/ \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/service \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/common \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/mfbt/double-conversion \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/common \
+ -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/xpcom/base \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_defs,updatehelper,\
+ -DMOZ_MAINTENANCE_SERVICE \
+ -DNSS3 \
+ -DVERIFY_MAR_SIGNATURE \
+ -DXP_$(if $(filter WNT,$(OS)),WIN,UNIX) \
+ $(if $(filter WNT,$(OS)),-U_WIN32_WINNT) \
+))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,updatehelper,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,updatehelper,\
+ UnpackedTarball/onlineupdate/mozglue/misc/Printf \
+
UnpackedTarball/onlineupdate/onlineupdate/source/update/common/readstrings \
+ UnpackedTarball/onlineupdate/toolkit/mozapps/update/common/updatecommon
\
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,updatehelper,\
+ UnpackedTarball/onlineupdate/onlineupdate/source/update/common/pathhash
\
+
UnpackedTarball/onlineupdate/onlineupdate/source/update/common/uachelper \
+
UnpackedTarball/onlineupdate/onlineupdate/source/update/common/updatehelper \
+
UnpackedTarball/onlineupdate/onlineupdate/source/service/certificatecheck \
+
UnpackedTarball/onlineupdate/onlineupdate/source/service/registrycertificates \
+
UnpackedTarball/onlineupdate/toolkit/mozapps/update/common/updateutils_win \
+))
+endif
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,updatehelper,cc))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,updatehelper, \
+
UnpackedTarball/onlineupdate/mfbt/double-conversion/double-conversion/bignum \
+
UnpackedTarball/onlineupdate/mfbt/double-conversion/double-conversion/bignum-dtoa
\
+
UnpackedTarball/onlineupdate/mfbt/double-conversion/double-conversion/cached-powers
\
+
UnpackedTarball/onlineupdate/mfbt/double-conversion/double-conversion/double-to-string
\
+
UnpackedTarball/onlineupdate/mfbt/double-conversion/double-conversion/fast-dtoa
\
+
UnpackedTarball/onlineupdate/mfbt/double-conversion/double-conversion/fixed-dtoa
\
+))
+
+$(eval $(call gb_StaticLibrary_set_warnings_disabled,updatehelper))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_cxxflags,updatehelper,-Zc:strictStrings-))
+endif
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab: */
diff --git a/external/onlineupdate/UnpackedTarball_onlineupdate.mk
b/external/onlineupdate/UnpackedTarball_onlineupdate.mk
new file mode 100644
index 000000000000..e7f9a0cb76f9
--- /dev/null
+++ b/external/onlineupdate/UnpackedTarball_onlineupdate.mk
@@ -0,0 +1,21 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column:
100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,onlineupdate))
+
+$(eval $(call
gb_UnpackedTarball_set_tarball,onlineupdate,$(ONLINEUPDATE_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,onlineupdate,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,onlineupdate, \
+ external/onlineupdate/gtk3deprecated.patch \
+ external/onlineupdate/lo.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/onlineupdate/WinResTarget_updater.mk
b/external/onlineupdate/WinResTarget_updater.mk
new file mode 100644
index 000000000000..edb2db7483e6
--- /dev/null
+++ b/external/onlineupdate/WinResTarget_updater.mk
@@ -0,0 +1,15 @@
+$(eval $(call gb_WinResTarget_WinResTarget,updaterres))
+
+$(call gb_WinResTarget_get_target,updaterres,updaterres): | \
+ $(call gb_UnpackedTarball_get_target,onlineupdate)
+
+$(eval $(call gb_WinResTarget_set_include,updaterres,\
+ $$(INCLUDE) \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/common \
+ -I$(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater \
+))
+
+$(call gb_WinResTarget_get_clean_target,updaterres): \
+ RCFILE := $(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/updater.rc
+$(call gb_WinResTarget_get_target,updaterres): \
+ RCFILE := $(call
gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/updater.rc
diff --git a/external/onlineupdate/generate-sources.sh
b/external/onlineupdate/generate-sources.sh
new file mode 100755
index 000000000000..bc39603c156b
--- /dev/null
+++ b/external/onlineupdate/generate-sources.sh
@@ -0,0 +1,196 @@
+#!/bin/sh
+set -ex
+
+source=${1?}
+tag=${2-$(git -C "${source?}" describe --abbrev=40 --always)}
+
+tmpdir=$(mktemp -d)
+
+copyto() {
+ (cd "${tmpdir?}" && mkdir -p $(dirname "${1?}"))
+ cp "${source?}"/"${2?}" "${tmpdir?}"/"${1?}"
+}
+
+# Copy sources according to the old onlineupdate/ target layout:
+
+copyto include/onlineupdate/mar.h modules/libmar/src/mar.h
+copyto include/onlineupdate/mar_cmdline.h modules/libmar/src/mar_cmdline.h
+copyto include/onlineupdate/mar_private.h modules/libmar/src/mar_private.h
+copyto include/onlineupdate/mozilla/Assertions.h mfbt/Assertions.h
+copyto include/onlineupdate/mozilla/Attributes.h mfbt/Attributes.h
+copyto include/onlineupdate/mozilla/Compiler.h mfbt/Compiler.h
+copyto include/onlineupdate/mozilla/Likely.h mfbt/Likely.h
+copyto include/onlineupdate/mozilla/MacroArgs.h mfbt/MacroArgs.h
+copyto include/onlineupdate/mozilla/Types.h mfbt/Types.h
+copyto include/onlineupdate/mozilla/nsTraceRefcnt.h xpcom/base/nsTraceRefcnt.h
+copyto include/mozilla/Char16.h mfbt/Char16.h
+copyto onlineupdate/inc/bspatch.h
toolkit/mozapps/update/updater/bspatch/bspatch.h
+copyto onlineupdate/source/libmar/README modules/libmar/README
+copyto onlineupdate/source/libmar/sign/mar_sign.c
modules/libmar/sign/mar_sign.c
+copyto onlineupdate/source/libmar/sign/nss_secutil.c
modules/libmar/sign/nss_secutil.c
+copyto onlineupdate/source/libmar/sign/nss_secutil.h
modules/libmar/sign/nss_secutil.h
+copyto onlineupdate/source/libmar/src/mar_create.c
modules/libmar/src/mar_create.c
+copyto onlineupdate/source/libmar/src/mar_extract.c
modules/libmar/src/mar_extract.c
+copyto onlineupdate/source/libmar/src/mar_read.c modules/libmar/src/mar_read.c
+copyto onlineupdate/source/libmar/tool/mar.c modules/libmar/tool/mar.c
+copyto onlineupdate/source/libmar/verify/MacVerifyCrypto.cpp
modules/libmar/verify/MacVerifyCrypto.cpp
+copyto onlineupdate/source/libmar/verify/cryptox.c
modules/libmar/verify/cryptox.c
+copyto onlineupdate/source/libmar/verify/cryptox.h
modules/libmar/verify/cryptox.h
+copyto onlineupdate/source/libmar/verify/mar_verify.c
modules/libmar/verify/mar_verify.c
+copyto onlineupdate/source/mbsdiff/bsdiff.c other-licenses/bsdiff/bsdiff.c
+copyto onlineupdate/source/service/certificatecheck.cpp
toolkit/mozapps/update/common/certificatecheck.cpp
+copyto onlineupdate/source/service/certificatecheck.h
toolkit/mozapps/update/common/certificatecheck.h
+copyto onlineupdate/source/service/maintenanceservice.cpp
toolkit/components/maintenanceservice/maintenanceservice.cpp
+copyto onlineupdate/source/service/maintenanceservice.h
toolkit/components/maintenanceservice/maintenanceservice.h
+copyto onlineupdate/source/service/registrycertificates.cpp
toolkit/mozapps/update/common/registrycertificates.cpp
+copyto onlineupdate/source/service/registrycertificates.h
toolkit/mozapps/update/common/registrycertificates.h
+copyto onlineupdate/source/service/resource.h
toolkit/components/maintenanceservice/resource.h
+copyto onlineupdate/source/service/servicebase.cpp
toolkit/components/maintenanceservice/servicebase.cpp
+copyto onlineupdate/source/service/servicebase.h
toolkit/components/maintenanceservice/servicebase.h
+copyto onlineupdate/source/service/serviceinstall.cpp
toolkit/components/maintenanceservice/serviceinstall.cpp
+copyto onlineupdate/source/service/serviceinstall.h
toolkit/components/maintenanceservice/serviceinstall.h
+copyto onlineupdate/source/service/workmonitor.cpp
toolkit/components/maintenanceservice/workmonitor.cpp
+copyto onlineupdate/source/service/workmonitor.h
toolkit/components/maintenanceservice/workmonitor.h
+# Renamed target from onlineupdate/source/update/common/errors.h:
+copyto onlineupdate/source/update/common/updatererrors.h
toolkit/mozapps/update/common/updatererrors.h
+copyto onlineupdate/source/update/common/pathhash.cpp
toolkit/mozapps/update/common/pathhash.cpp
+copyto onlineupdate/source/update/common/pathhash.h
toolkit/mozapps/update/common/pathhash.h
+copyto onlineupdate/source/update/common/readstrings.cpp
toolkit/mozapps/update/common/readstrings.cpp
+copyto onlineupdate/source/update/common/readstrings.h
toolkit/mozapps/update/common/readstrings.h
+copyto onlineupdate/source/update/common/uachelper.cpp
toolkit/mozapps/update/common/uachelper.cpp
+copyto onlineupdate/source/update/common/uachelper.h
toolkit/mozapps/update/common/uachelper.h
+copyto onlineupdate/source/update/common/updatedefines.h
toolkit/mozapps/update/common/updatedefines.h
+copyto onlineupdate/source/update/common/updatehelper.cpp
toolkit/mozapps/update/common/updatehelper.cpp
+copyto onlineupdate/source/update/common/updatehelper.h
toolkit/mozapps/update/common/updatehelper.h
+copyto onlineupdate/source/update/updater/Makefile.in
toolkit/mozapps/update/updater/Makefile.in
+copyto onlineupdate/source/update/updater/archivereader.cpp
toolkit/mozapps/update/updater/archivereader.cpp
+copyto onlineupdate/source/update/updater/archivereader.h
toolkit/mozapps/update/updater/archivereader.h
+copyto onlineupdate/source/update/updater/bspatch.cpp
toolkit/mozapps/update/updater/bspatch/bspatch.cpp
+copyto onlineupdate/source/update/updater/gen_cert_header.py
toolkit/mozapps/update/updater/gen_cert_header.py
+copyto onlineupdate/source/update/updater/launchchild_osx.mm
toolkit/mozapps/update/updater/launchchild_osx.mm
+copyto onlineupdate/source/update/updater/loaddlls.cpp
toolkit/mozapps/update/updater/loaddlls.cpp
+# Renamed target from
onlineupdate/source/update/updater/macbuild/Contents/Info.plist:
+copyto onlineupdate/source/update/updater/macbuild/Contents/Info.plist.in
toolkit/mozapps/update/updater/macbuild/Contents/Info.plist.in
+copyto onlineupdate/source/update/updater/macbuild/Contents/PkgInfo
toolkit/mozapps/update/updater/macbuild/Contents/PkgInfo
+copyto
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
+copyto
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
+copyto
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib
toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib
+copyto
onlineupdate/source/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
+copyto
onlineupdate/source/update/updater/macbuild/Contents/Resources/updater.icns
toolkit/mozapps/update/updater/macbuild/Contents/Resources/updater.icns
+copyto onlineupdate/source/update/updater/progressui-unused/progressui_osx.mm
toolkit/mozapps/update/updater/progressui_osx.mm
+copyto onlineupdate/source/update/updater/progressui.h
toolkit/mozapps/update/updater/progressui.h
+copyto onlineupdate/source/update/updater/progressui_gtk.cpp
toolkit/mozapps/update/updater/progressui_gtk.cpp
+copyto onlineupdate/source/update/updater/progressui_null.cpp
toolkit/mozapps/update/updater/progressui_null.cpp
+copyto onlineupdate/source/update/updater/progressui_win.cpp
toolkit/mozapps/update/updater/progressui_win.cpp
+copyto onlineupdate/source/update/updater/resource.h
toolkit/mozapps/update/updater/resource.h
+copyto onlineupdate/source/update/updater/updater-common.build
toolkit/mozapps/update/updater/updater-common.build
+copyto onlineupdate/source/update/updater/updater-xpcshell/Makefile.in
toolkit/mozapps/update/updater/updater-xpcshell/Makefile.in
+copyto onlineupdate/source/update/updater/updater-xpcshell/moz.build
toolkit/mozapps/update/updater/updater-xpcshell/moz.build
+copyto onlineupdate/source/update/updater/updater.cpp
toolkit/mozapps/update/updater/updater.cpp
+copyto onlineupdate/source/update/updater/updater.exe.comctl32.manifest
toolkit/mozapps/update/updater/updater.exe.comctl32.manifest
+copyto onlineupdate/source/update/updater/updater.exe.manifest
toolkit/mozapps/update/updater/updater.exe.manifest
+copyto onlineupdate/source/update/updater/updater.ico
toolkit/mozapps/update/updater/updater.ico
+copyto onlineupdate/source/update/updater/updater.png
toolkit/mozapps/update/updater/updater.png
+copyto onlineupdate/source/update/updater/updater.rc
toolkit/mozapps/update/updater/updater.rc
+copyto onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cpp
xpcom/base/nsVersionComparator.cpp
+copyto onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.h
xpcom/base/nsVersionComparator.h
+
+# Missing source for include/onlineupdate/mozilla/TypeTraits.h
+# Missing source for onlineupdate/source/libmar/sign/Makefile.in
+# Missing source for onlineupdate/source/libmar/src/Makefile.in
+# Missing source for onlineupdate/source/libmar/tool/Makefile.in
+# Missing source for onlineupdate/source/service/windowsHelper.hxx
+# Missing source for onlineupdate/source/update/common/sources.mozbuild
+# Missing source for onlineupdate/source/update/common/updatelogging.cxx
+# Missing source for onlineupdate/source/update/common/updatelogging.h
+# Missing source for
onlineupdate/source/update/updater/progressui-unused/progressui_gonk.cxx
+# Missing source for onlineupdate/source/update/updater/progressui_gtk_icon.h
+# Missing source for onlineupdate/source/update/updater/updater.svg
+
+# Copy additional sources according to the actual source layout:
+
+copyto include/mozilla/Alignment.h mfbt/Alignment.h
+copyto include/mozilla/AllocPolicy.h mfbt/AllocPolicy.h
+copyto include/mozilla/ArrayUtils.h mfbt/ArrayUtils.h
+copyto include/mozilla/Atomics.h mfbt/Atomics.h
+copyto include/mozilla/Casting.h mfbt/Casting.h
+copyto include/mozilla/CheckedInt.h mfbt/CheckedInt.h
+copyto include/mozilla/CmdLineAndEnvUtils.h toolkit/xre/CmdLineAndEnvUtils.h
+copyto include/mozilla/CompactPair.h mfbt/CompactPair.h
+copyto include/mozilla/DebugOnly.h mfbt/DebugOnly.h
+copyto include/mozilla/DynamicallyLinkedFunctionPtr.h
mozglue/misc/DynamicallyLinkedFunctionPtr.h
+copyto include/mozilla/EndianUtils.h mfbt/EndianUtils.h
+copyto include/mozilla/Fuzzing.h mfbt/Fuzzing.h
+copyto include/mozilla/HashFunctions.h mfbt/HashFunctions.h
+copyto include/mozilla/IntegerPrintfMacros.h mozglue/misc/IntegerPrintfMacros.h
+copyto include/mozilla/IntegerTypeTraits.h mfbt/IntegerTypeTraits.h
+copyto include/mozilla/MathAlgorithms.h mfbt/MathAlgorithms.h
+copyto include/mozilla/Maybe.h mfbt/Maybe.h
+copyto include/mozilla/MaybeStorageBase.h mfbt/MaybeStorageBase.h
+copyto include/mozilla/MemoryChecking.h mfbt/MemoryChecking.h
+copyto include/mozilla/MemoryReporting.h mfbt/MemoryReporting.h
+copyto include/mozilla/OperatorNewExtensions.h mfbt/OperatorNewExtensions.h
+copyto include/mozilla/Poison.h mfbt/Poison.h
+copyto include/mozilla/Printf.h mozglue/misc/Printf.h
+copyto include/mozilla/ReentrancyGuard.h mfbt/ReentrancyGuard.h
+copyto include/mozilla/Result.h mfbt/Result.h
+copyto include/mozilla/ResultVariant.h mfbt/ResultVariant.h
+copyto include/mozilla/Span.h mfbt/Span.h
+copyto include/mozilla/Sprintf.h mozglue/misc/Sprintf.h
+copyto include/mozilla/StaticAnalysisFunctions.h mfbt/StaticAnalysisFunctions.h
+copyto include/mozilla/TemplateLib.h mfbt/TemplateLib.h
+copyto include/mozilla/ThreadSafety.h mfbt/ThreadSafety.h
+copyto include/mozilla/TypedEnumBits.h mfbt/TypedEnumBits.h
+copyto include/mozilla/UniquePtr.h mfbt/UniquePtr.h
+copyto include/mozilla/UniquePtrExtensions.h mfbt/UniquePtrExtensions.h
+copyto include/mozilla/Variant.h mfbt/Variant.h
+copyto include/mozilla/Vector.h mfbt/Vector.h
+copyto include/mozilla/WinHeaderOnlyUtils.h widget/windows/WinHeaderOnlyUtils.h
+copyto include/mozilla/WrappingOperations.h mfbt/WrappingOperations.h
+copyto include/mozilla/fallible.h mfbt/fallible.h
+copyto mfbt/double-conversion/double-conversion/bignum-dtoa.cc
mfbt/double-conversion/double-conversion/bignum-dtoa.cc
+copyto mfbt/double-conversion/double-conversion/bignum-dtoa.h
mfbt/double-conversion/double-conversion/bignum-dtoa.h
+copyto mfbt/double-conversion/double-conversion/bignum.cc
mfbt/double-conversion/double-conversion/bignum.cc
+copyto mfbt/double-conversion/double-conversion/bignum.h
mfbt/double-conversion/double-conversion/bignum.h
+copyto mfbt/double-conversion/double-conversion/cached-powers.cc
mfbt/double-conversion/double-conversion/cached-powers.cc
+copyto mfbt/double-conversion/double-conversion/cached-powers.h
mfbt/double-conversion/double-conversion/cached-powers.h
+copyto mfbt/double-conversion/double-conversion/diy-fp.h
mfbt/double-conversion/double-conversion/diy-fp.h
+copyto mfbt/double-conversion/double-conversion/double-to-string.cc
mfbt/double-conversion/double-conversion/double-to-string.cc
+copyto mfbt/double-conversion/double-conversion/double-to-string.h
mfbt/double-conversion/double-conversion/double-to-string.h
+copyto mfbt/double-conversion/double-conversion/fast-dtoa.cc
mfbt/double-conversion/double-conversion/fast-dtoa.cc
+copyto mfbt/double-conversion/double-conversion/fast-dtoa.h
mfbt/double-conversion/double-conversion/fast-dtoa.h
+copyto mfbt/double-conversion/double-conversion/fixed-dtoa.cc
mfbt/double-conversion/double-conversion/fixed-dtoa.cc
+copyto mfbt/double-conversion/double-conversion/fixed-dtoa.h
mfbt/double-conversion/double-conversion/fixed-dtoa.h
+copyto mfbt/double-conversion/double-conversion/ieee.h
mfbt/double-conversion/double-conversion/ieee.h
+copyto mfbt/double-conversion/double-conversion/utils.h
mfbt/double-conversion/double-conversion/utils.h
+copyto modules/xz-embedded/src/xz.h modules/xz-embedded/src/xz.h
+copyto modules/xz-embedded/src/xz_config.h modules/xz-embedded/src/xz_config.h
+copyto modules/xz-embedded/src/xz_crc32.c modules/xz-embedded/src/xz_crc32.c
+copyto modules/xz-embedded/src/xz_crc64.c modules/xz-embedded/src/xz_crc64.c
+copyto modules/xz-embedded/src/xz_dec_bcj.c
modules/xz-embedded/src/xz_dec_bcj.c
+copyto modules/xz-embedded/src/xz_dec_lzma2.c
modules/xz-embedded/src/xz_dec_lzma2.c
+copyto modules/xz-embedded/src/xz_dec_stream.c
modules/xz-embedded/src/xz_dec_stream.c
+copyto modules/xz-embedded/src/xz_lzma2.h modules/xz-embedded/src/xz_lzma2.h
+copyto modules/xz-embedded/src/xz_private.h
modules/xz-embedded/src/xz_private.h
+copyto modules/xz-embedded/src/xz_stream.h modules/xz-embedded/src/xz_stream.h
+copyto mozglue/misc/Printf.cpp mozglue/misc/Printf.cpp
+copyto nsprpub/lib/libc/src/strdup.c nsprpub/lib/libc/src/strdup.c
+copyto nsprpub/lib/libc/src/strlen.c nsprpub/lib/libc/src/strlen.c
+copyto other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp
other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp
+copyto other-licenses/nsis/Contrib/CityHash/cityhash/city.h
other-licenses/nsis/Contrib/CityHash/cityhash/city.h
+copyto toolkit/mozapps/update/common/commonupdatedir.h
toolkit/mozapps/update/common/commonupdatedir.h
+copyto toolkit/mozapps/update/common/updatecommon.cpp
toolkit/mozapps/update/common/updatecommon.cpp
+copyto toolkit/mozapps/update/common/updatecommon.h
toolkit/mozapps/update/common/updatecommon.h
+copyto toolkit/mozapps/update/common/updateutils_win.cpp
toolkit/mozapps/update/common/updateutils_win.cpp
+copyto toolkit/mozapps/update/common/updateutils_win.h
toolkit/mozapps/update/common/updateutils_win.h
+copyto toolkit/mozapps/update/updater/crctable.h
toolkit/mozapps/update/updater/crctable.h
+copyto toolkit/xre/nsWindowsRestart.cpp toolkit/xre/nsWindowsRestart.cpp
+copyto xpcom/base/nsAlgorithm.h xpcom/base/nsAlgorithm.h
+copyto xpcom/base/nsAutoRef.h xpcom/base/nsAutoRef.h
+copyto xpcom/base/nsWindowsHelpers.h xpcom/base/nsWindowsHelpers.h
+copyto xpcom/string/nsCharTraits.h xpcom/string/nsCharTraits.h
+copyto xpcom/string/nsUTF8Utils.h xpcom/string/nsUTF8Utils.h
+
+LC_ALL=C tar -c --format=gnu --sort=name --owner=0 --group=0
--mode=go=rX,u=rwX \
+ --mtime '2023-12-11 00:00:00+0' --xz -f onlineupdate-"${tag?}".tar.xz -C
"${tmpdir?}" .
+rm -r "${tmpdir?}"
diff --git a/external/onlineupdate/gtk3deprecated.patch
b/external/onlineupdate/gtk3deprecated.patch
new file mode 100644
index 000000000000..fb73634d50b0
--- /dev/null
+++ b/external/onlineupdate/gtk3deprecated.patch
@@ -0,0 +1,11 @@
+--- onlineupdate/source/update/updater/progressui_gtk.cpp
++++ onlineupdate/source/update/updater/progressui_gtk.cpp
+@@ -94,7 +94,7 @@
+ gtk_window_set_icon(GTK_WINDOW(sWin), sPixbuf);
+ g_object_unref(sPixbuf);
+
+- GtkWidget* vbox = gtk_vbox_new(TRUE, 6);
++ GtkWidget* vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+ sLabel = gtk_label_new(sStrings.info.get());
+ gtk_misc_set_alignment(GTK_MISC(sLabel), 0.0f, 0.0f);
+ sProgressBar = gtk_progress_bar_new();
diff --git a/external/onlineupdate/lo.patch b/external/onlineupdate/lo.patch
new file mode 100644
index 000000000000..bad31b0aacfc
--- /dev/null
+++ b/external/onlineupdate/lo.patch
@@ -0,0 +1,21 @@
+--- onlineupdate/source/update/updater/progressui_gtk.cpp
++++ onlineupdate/source/update/updater/progressui_gtk.cpp
+@@ -5,6 +5,7 @@
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ #include <gtk/gtk.h>
++#include <string.h>
+ #include <unistd.h>
+ #include "mozilla/Sprintf.h"
+ #include "mozilla/Atomics.h"
+@@ -52,8 +53,8 @@
+ char ini_path[PATH_MAX];
+ SprintfLiteral(ini_path, "%s.ini", (*pargv)[0]);
+ if (ReadStrings(ini_path, &sStrings) != OK) {
+- sEnableUI = false;
+- return -1;
++ sStrings.title.reset(strdup("LibreOffice Update"));
++ sStrings.info.reset(strdup("Please wait while we update your
installation."));
+ }
+
+ char icon_path[PATH_MAX];
diff --git a/onlineupdate/qa/lang_packs/Makefile
b/external/onlineupdate/qa/lang_packs/Makefile
similarity index 100%
rename from onlineupdate/qa/lang_packs/Makefile
rename to external/onlineupdate/qa/lang_packs/Makefile
diff --git a/onlineupdate/qa/lang_packs/update_en_signed.mar
b/external/onlineupdate/qa/lang_packs/update_en_signed.mar
similarity index 100%
rename from onlineupdate/qa/lang_packs/update_en_signed.mar
rename to external/onlineupdate/qa/lang_packs/update_en_signed.mar
diff --git a/onlineupdate/qa/lang_packs/update_signed.mar
b/external/onlineupdate/qa/lang_packs/update_signed.mar
similarity index 100%
rename from onlineupdate/qa/lang_packs/update_signed.mar
rename to external/onlineupdate/qa/lang_packs/update_signed.mar
diff --git a/onlineupdate/qa/lang_packs/updater_lang.zip
b/external/onlineupdate/qa/lang_packs/updater_lang.zip
similarity index 100%
rename from onlineupdate/qa/lang_packs/updater_lang.zip
rename to external/onlineupdate/qa/lang_packs/updater_lang.zip
diff --git a/onlineupdate/qa/replace_request/Makefile
b/external/onlineupdate/qa/replace_request/Makefile
similarity index 100%
rename from onlineupdate/qa/replace_request/Makefile
rename to external/onlineupdate/qa/replace_request/Makefile
diff --git a/onlineupdate/qa/replace_request/README
b/external/onlineupdate/qa/replace_request/README
similarity index 100%
rename from onlineupdate/qa/replace_request/README
rename to external/onlineupdate/qa/replace_request/README
diff --git a/onlineupdate/qa/replace_request/updater.zip
b/external/onlineupdate/qa/replace_request/updater.zip
similarity index 100%
rename from onlineupdate/qa/replace_request/updater.zip
rename to external/onlineupdate/qa/replace_request/updater.zip
diff --git a/onlineupdate/qa/single_step/Makefile
b/external/onlineupdate/qa/single_step/Makefile
similarity index 100%
rename from onlineupdate/qa/single_step/Makefile
rename to external/onlineupdate/qa/single_step/Makefile
diff --git a/onlineupdate/qa/single_step/complete_signed.mar
b/external/onlineupdate/qa/single_step/complete_signed.mar
similarity index 100%
rename from onlineupdate/qa/single_step/complete_signed.mar
rename to external/onlineupdate/qa/single_step/complete_signed.mar
diff --git a/onlineupdate/qa/single_step/incremental_signed.mar
b/external/onlineupdate/qa/single_step/incremental_signed.mar
similarity index 100%
rename from onlineupdate/qa/single_step/incremental_signed.mar
rename to external/onlineupdate/qa/single_step/incremental_signed.mar
diff --git a/onlineupdate/qa/single_step/single_step.zip
b/external/onlineupdate/qa/single_step/single_step.zip
similarity index 100%
rename from onlineupdate/qa/single_step/single_step.zip
rename to external/onlineupdate/qa/single_step/single_step.zip
diff --git a/onlineupdate/workben/test_dialog.cxx
b/external/onlineupdate/workben/test_dialog.cxx
similarity index 91%
rename from onlineupdate/workben/test_dialog.cxx
rename to external/onlineupdate/workben/test_dialog.cxx
index ba9f258df913..4c956410d8c0 100644
--- a/onlineupdate/workben/test_dialog.cxx
+++ b/external/onlineupdate/workben/test_dialog.cxx
@@ -1,9 +1,9 @@
#include "progressui.h"
#if defined(_WIN32)
-#include "progressui_win.cxx"
+#include "progressui_win.cpp"
#else
-#include "progressui_gtk.cxx"
+#include "progressui_gtk.cpp"
#endif
#include <thread>
diff --git a/include/onlineupdate/mar.h b/include/onlineupdate/mar.h
deleted file mode 100644
index 0e21efb920a5..000000000000
--- a/include/onlineupdate/mar.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef MAR_H__
-#define MAR_H__
-
-#include "mozilla/Assertions.h"
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* We have a MAX_SIGNATURES limit so that an invalid MAR will never
- * waste too much of either updater's or signmar's time.
- * It is also used at various places internally and will affect memory usage.
- * If you want to increase this value above 9 then you need to adjust parsing
- * code in tool/mar.c.
-*/
-#define MAX_SIGNATURES 8
-#ifdef __cplusplus
-static_assert(MAX_SIGNATURES <= 9, "too many signatures");
-#else
-MOZ_STATIC_ASSERT(MAX_SIGNATURES <= 9, "too many signatures");
-#endif
-
-struct ProductInformationBlock {
- const char *MARChannelID;
- const char *productVersion;
-};
-
-/**
- * The MAR item data structure.
- */
-typedef struct MarItem_ {
- struct MarItem_ *next; /* private field */
- uint32_t offset; /* offset into archive */
- uint32_t length; /* length of data in bytes */
- uint32_t flags; /* contains file mode bits */
- char name[1]; /* file path */
-} MarItem;
-
-#define TABLESIZE 256
-
-struct MarFile_ {
- FILE *fp;
- MarItem *item_table[TABLESIZE];
-};
-
-typedef struct MarFile_ MarFile;
-
-/**
- * Signature of callback function passed to mar_enum_items.
- * @param mar The MAR file being visited.
- * @param item The MAR item being visited.
- * @param data The data parameter passed by the caller of mar_enum_items.
- * @return A non-zero value to stop enumerating.
- */
-typedef int (* MarItemCallback)(MarFile *mar, const MarItem *item, void *data);
-
-/**
- * Open a MAR file for reading.
- * @param path Specifies the path to the MAR file to open. This path must
- * be compatible with fopen.
- * @return NULL if an error occurs.
- */
-MarFile *mar_open(const char *path);
-
-#ifdef _WIN32
-MarFile *mar_wopen(const wchar_t *path);
-#endif
-
-/**
- * Close a MAR file that was opened using mar_open.
- * @param mar The MarFile object to close.
- */
-void mar_close(MarFile *mar);
-
-/**
- * Find an item in the MAR file by name.
- * @param mar The MarFile object to query.
- * @param item The name of the item to query.
- * @return A const reference to a MAR item or NULL if not found.
- */
-const MarItem *mar_find_item(MarFile *mar, const char *item);
-
-/**
- * Enumerate all MAR items via callback function.
- * @param mar The MAR file to enumerate.
- * @param callback The function to call for each MAR item.
- * @param data A caller specified value that is passed along to the
- * callback function.
- * @return 0 if the enumeration ran to completion. Otherwise, any
- * non-zero return value from the callback is returned.
- */
-int mar_enum_items(MarFile *mar, MarItemCallback callback, void *data);
-
-/**
- * Read from MAR item at given offset up to bufsize bytes.
- * @param mar The MAR file to read.
- * @param item The MAR item to read.
- * @param offset The byte offset relative to the start of the item.
- * @param buf A pointer to a buffer to copy the data into.
- * @param bufsize The length of the buffer to copy the data into.
- * @return The number of bytes written or a negative value if an
- * error occurs.
- */
-int mar_read(MarFile *mar, const MarItem *item, int offset, char *buf,
- int bufsize);
-
-/**
- * Create a MAR file from a set of files.
- * @param dest The path to the file to create. This path must be
- * compatible with fopen.
- * @param numfiles The number of files to store in the archive.
- * @param files The list of null-terminated file paths. Each file
- * path must be compatible with fopen.
- * @param infoBlock The information to store in the product information block.
- * @return A non-zero value if an error occurs.
- */
-int mar_create(const char *dest,
- int numfiles,
- char **files,
- struct ProductInformationBlock *infoBlock);
-
-/**
- * Extract a MAR file to the current working directory.
- * @param path The path to the MAR file to extract. This path must be
- * compatible with fopen.
- * @return A non-zero value if an error occurs.
- */
-int mar_extract(const char *path);
-
-#define MAR_MAX_CERT_SIZE (16*1024) // Way larger than necessary
-
-/* Read the entire file (not a MAR file) into a newly-allocated buffer.
- * This function does not write to stderr. Instead, the caller should
- * write whatever error messages it sees fit. The caller must free the returned
- * buffer using free().
- *
- * @param filePath The path to the file that should be read.
- * @param maxSize The maximum valid file size.
- * @param data On success, *data will point to a newly-allocated buffer
- * with the file's contents in it.
- * @param size On success, *size will be the size of the created buffer.
- *
- * @return 0 on success, -1 on error
- */
-int mar_read_entire_file(const char * filePath,
- uint32_t maxSize,
- /*out*/ const uint8_t * *data,
- /*out*/ uint32_t *size);
-
-/**
- * Verifies a MAR file by verifying each signature with the corresponding
- * certificate. That is, the first signature will be verified using the first
- * certificate given, the second signature will be verified using the second
- * certificate given, etc. The signature count must exactly match the number of
- * certificates given, and all signature verifications must succeed.
- * We do not check that the certificate was issued by any trusted authority.
- * We assume it to be self-signed. We do not check whether the certificate
- * is valid for this usage.
- *
- * @param mar The already opened MAR file.
- * @param certData Pointer to the first element in an array of
certificate
- * file data.
- * @param certDataSizes Pointer to the first element in an array for size of
- * the cert data.
- * @param certCount The number of elements in certData and certDataSizes
- * @return 0 on success
- * a negative number if there was an error
- * a positive number if the signature does not verify
- */
-int mar_verify_signatures(MarFile *mar,
- const uint8_t * const *certData,
- const uint32_t *certDataSizes,
- uint32_t certCount);
-
-/**
- * Reads the product info block from the MAR file's additional block section.
- * The caller is responsible for freeing the fields in infoBlock
- * if the return is successful.
- *
- * @param infoBlock Out parameter for where to store the result to
- * @return 0 on success, -1 on failure
-*/
-int
-mar_read_product_info_block(MarFile *mar,
- struct ProductInformationBlock *infoBlock);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MAR_H__ */
diff --git a/include/onlineupdate/mar_cmdline.h
b/include/onlineupdate/mar_cmdline.h
deleted file mode 100644
index ef6867f06fc3..000000000000
--- a/include/onlineupdate/mar_cmdline.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef MAR_CMDLINE_H__
-#define MAR_CMDLINE_H__
-
-/* We use NSPR here just to import the definition of uint32_t */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ProductInformationBlock;
-
-/**
- * Determines MAR file information.
- *
- * @param path The path of the MAR file to check.
- * @param hasSignatureBlock Optional out parameter specifying if the MAR
- * file has a signature block or not.
- * @param numSignatures Optional out parameter for storing the number
- * of signatures in the MAR file.
- * @param hasAdditionalBlocks Optional out parameter specifying if the MAR
- * file has additional blocks or not.
- * @param offsetAdditionalBlocks Optional out parameter for the offset to the
- * first additional block. Value is only valid if
- * hasAdditionalBlocks is not equal to 0.
- * @param numAdditionalBlocks Optional out parameter for the number of
- * additional blocks. Value is only valid if
- * has_additional_blocks is not equal to 0.
- * @return 0 on success and non-zero on failure.
- */
-int get_mar_file_info(const char *path,
- int *hasSignatureBlock,
- uint32_t *numSignatures,
- int *hasAdditionalBlocks,
- uint32_t *offsetAdditionalBlocks,
- uint32_t *numAdditionalBlocks);
-
-/**
- * Reads the product info block from the MAR file's additional block section.
- * The caller is responsible for freeing the fields in infoBlock
- * if the return is successful.
- *
- * @param infoBlock Out parameter for where to store the result to
- * @return 0 on success, -1 on failure
-*/
-int
-read_product_info_block(char *path,
- struct ProductInformationBlock *infoBlock);
-
-/**
- * Refreshes the product information block with the new information.
- * The input MAR must not be signed or the function call will fail.
- *
- * @param path The path to the MAR file whose product info block
- * should be refreshed.
- * @param infoBlock Out parameter for where to store the result to
- * @return 0 on success, -1 on failure
-*/
-int
-refresh_product_info_block(const char *path,
- struct ProductInformationBlock *infoBlock);
-
-/**
- * Writes out a copy of the MAR at src but with the signature block stripped.
- *
- * @param src The path of the source MAR file
- * @param dest The path of the MAR file to write out that
- has no signature block
- * @return 0 on success
- * -1 on error
-*/
-int
-strip_signature_block(const char *src, const char * dest);
-
-/**
- * Extracts a signature from a MAR file, base64 encodes it, and writes it out
- *
- * @param src The path of the source MAR file
- * @param sigIndex The index of the signature to extract
- * @param dest The path of file to write the signature to
- * @return 0 on success
- * -1 on error
-*/
-int
-extract_signature(const char *src, uint32_t sigIndex, const char * dest);
-
-/**
- * Imports a base64 encoded signature into a MAR file
- *
- * @param src The path of the source MAR file
- * @param sigIndex The index of the signature to import
- * @param base64SigFile A file which contains the signature to import
- * @param dest The path of the destination MAR file with replaced
signature
- * @return 0 on success
- * -1 on error
-*/
-int
-import_signature(const char *src,
- uint32_t sigIndex,
- const char * base64SigFile,
- const char *dest);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MAR_CMDLINE_H__ */
diff --git a/include/onlineupdate/mar_private.h
b/include/onlineupdate/mar_private.h
deleted file mode 100644
index 319564b749a4..000000000000
--- a/include/onlineupdate/mar_private.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef MAR_PRIVATE_H__
-#define MAR_PRIVATE_H__
-
-#include "limits.h"
-#include "mozilla/Assertions.h"
-#include <stdint.h>
-
-#define BLOCKSIZE 4096
-#define ROUND_UP(n, incr) (((n) / (incr) + 1) * (incr))
-
-#define MAR_ID "MAR1"
-#define MAR_ID_SIZE 4
-
-/* The signature block comes directly after the header block
- which is 16 bytes */
-#define SIGNATURE_BLOCK_OFFSET 16
-
-/* Make sure the file is less than 500MB. We do this to protect against
- invalid MAR files. */
-#define MAX_SIZE_OF_MAR_FILE ((int64_t)1824288000)
-
-/* Existing code makes assumptions that the file size is
- smaller than LONG_MAX. */
-MOZ_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX),
- "max mar file size is too big");
-
-/* We store at most the size up to the signature block + 4
- bytes per BLOCKSIZE bytes */
-MOZ_STATIC_ASSERT(sizeof(BLOCKSIZE) <
- (SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t)),
- "BLOCKSIZE is too big");
-
-/* The maximum size of any signature supported by current and future
- implementations of the signmar program. */
-#define MAX_SIGNATURE_LENGTH 2048
-
-/* Each additional block has a unique ID.
- The product information block has an ID of 1. */
-#define PRODUCT_INFO_BLOCK_ID 1
-
-#define MAR_ITEM_SIZE(namelen) (3*sizeof(uint32_t) + (namelen) + 1)
-
-/* Product Information Block (PIB) constants */
-#define PIB_MAX_MAR_CHANNEL_ID_SIZE 63
-#define PIB_MAX_PRODUCT_VERSION_SIZE 31
-
-/* The mar program is compiled as a host bin so we don't have access to NSPR at
- runtime. For that reason we use ntohl, htonl, and define HOST_TO_NETWORK64
- instead of the NSPR equivalents. */
-#ifdef _WIN32
-#include <winsock2.h>
-#define ftello _ftelli64
-#define fseeko _fseeki64
-#else
-#define _FILE_OFFSET_BITS 64
-#include <netinet/in.h>
-#include <unistd.h>
-#endif
-
-#include <stdio.h>
-
-#define HOST_TO_NETWORK64(x) ( \
- ((((uint64_t) x) & 0xFF) << 56) | \
- ((((uint64_t) x) >> 8) & 0xFF) << 48) | \
- (((((uint64_t) x) >> 16) & 0xFF) << 40) | \
- (((((uint64_t) x) >> 24) & 0xFF) << 32) | \
- (((((uint64_t) x) >> 32) & 0xFF) << 24) | \
- (((((uint64_t) x) >> 40) & 0xFF) << 16) | \
- (((((uint64_t) x) >> 48) & 0xFF) << 8) | \
- (((uint64_t) x) >> 56)
-#define NETWORK_TO_HOST64 HOST_TO_NETWORK64
-
-#endif /* MAR_PRIVATE_H__ */
diff --git a/include/onlineupdate/mozilla/Assertions.h
b/include/onlineupdate/mozilla/Assertions.h
deleted file mode 100644
index 54aab582a90c..000000000000
--- a/include/onlineupdate/mozilla/Assertions.h
+++ /dev/null
@@ -1,503 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implementations of runtime and static assertion macros for C and C++. */
-
-#ifndef mozilla_Assertions_h
-#define mozilla_Assertions_h
-
-#if defined(MOZILLA_INTERNAL_API) && defined(__cplusplus)
-#define MOZ_DUMP_ASSERTION_STACK
-#endif
-
-#include "Attributes.h"
-#include "Compiler.h"
-#include "Likely.h"
-#include "MacroArgs.h"
-#ifdef MOZ_DUMP_ASSERTION_STACK
-#include "nsTraceRefcnt.h"
-#endif
-
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _WIN32
- /*
- * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which
- * further depends on <windef.h>. We hardcode these few definitions
manually
- * because those headers clutter the global namespace with a significant
- * number of undesired macros and symbols.
- */
-# ifdef __cplusplus
-extern "C" {
-# endif
-__declspec(dllimport) int __stdcall
-TerminateProcess(void* hProcess, unsigned int uExitCode);
-__declspec(dllimport) void* __stdcall GetCurrentProcess(void);
-# ifdef __cplusplus
-}
-# endif
-#else
-# include <signal.h>
-#endif
-#ifdef ANDROID
-# include <android/log.h>
-#endif
-
-/*
- * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.
- * In C++11, static_assert is provided by the compiler to the same effect.
- * This can be useful when you make certain assumptions about what must hold
for
- * optimal, or even correct, behavior. For example, you might assert that the
- * size of a struct is a multiple of the target architecture's word size:
- *
- * struct S { ... };
- * // C
- * MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,
- * "S should be a multiple of word size for efficiency");
- * // C++11
- * static_assert(sizeof(S) % sizeof(size_t) == 0,
- * "S should be a multiple of word size for efficiency");
- *
- * This macro can be used in any location where both an extern declaration and
a
- * typedef could be used.
- */
-#ifndef __cplusplus
- /*
- * Some of the definitions below create an otherwise-unused typedef. This
- * triggers compiler warnings with some versions of gcc, so mark the
typedefs
- * as permissibly-unused to disable the warnings.
- */
-# if defined(__GNUC__)
-# define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
-# else
-# define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */
-# endif
-# define MOZ_STATIC_ASSERT_GLUE1(x, y) x##y
-# define MOZ_STATIC_ASSERT_GLUE(x, y) MOZ_STATIC_ASSERT_GLUE1(x, y)
-# if defined(__SUNPRO_CC)
- /*
- * The Sun Studio C++ compiler is buggy when declaring, inside a function,
- * another extern'd function with an array argument whose length contains
a
- * sizeof, triggering the error message "sizeof expression not accepted as
- * size of array parameter". This bug (6688515, not public yet) would hit
- * defining moz_static_assert as a function, so we always define an extern
- * array for Sun Studio.
- *
- * We include the line number in the symbol name in a best-effort attempt
- * to avoid conflicts (see below).
- */
-# define MOZ_STATIC_ASSERT(cond, reason) \
- extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond)
? 1 : -1]
-# elif defined(__COUNTER__)
- /*
- * If there was no preferred alternative, use a compiler-agnostic version.
- *
- * Note that the non-__COUNTER__ version has a bug in C++: it can't be
used
- * in both |extern "C"| and normal C++ in the same translation unit.
(Alas
- * |extern "C"| isn't allowed in a function.) The only affected compiler
- * we really care about is gcc 4.2. For that compiler and others like it,
- * we include the line number in the function name to do the best we can
to
- * avoid conflicts. These should be rare: a conflict would require use of
- * MOZ_STATIC_ASSERT on the same line in separate files in the same
- * translation unit, *and* the uses would have to be in code with
- * different linkage, *and* the first observed use must be in C++-linkage
- * code.
- */
-# define MOZ_STATIC_ASSERT(cond, reason) \
- typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert,
__COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE
-# else
-# define MOZ_STATIC_ASSERT(cond, reason) \
- extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int
arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE
-# endif
-
-#define MOZ_STATIC_ASSERT_IF(cond, expr, reason) MOZ_STATIC_ASSERT(!(cond) ||
(expr), reason)
-#else
-#define MOZ_STATIC_ASSERT_IF(cond, expr, reason) static_assert(!(cond) ||
(expr), reason)
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Prints |aStr| as an assertion failure (using aFilename and aLine as the
- * location of the assertion) to the standard debug-output channel.
- *
- * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method. This
- * method is primarily for internal use in this header, and only secondarily
- * for use in implementing release-build assertions.
- */
-static MOZ_COLD MOZ_ALWAYS_INLINE void
-MOZ_ReportAssertionFailure(const char* aStr, const char* aFilename, int aLine)
- MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
-{
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_FATAL, "MOZ_Assert",
- "Assertion failure: %s, at %s:%d\n",
- aStr, aFilename, aLine);
-#else
- fprintf(stderr, "Assertion failure: %s, at %s:%d\n", aStr, aFilename, aLine);
-#if defined (MOZ_DUMP_ASSERTION_STACK) && !defined(MOZILLA_XPCOMRT_API)
- nsTraceRefcnt::WalkTheStack(stderr);
-#endif
- fflush(stderr);
-#endif
-}
-
-static MOZ_COLD MOZ_ALWAYS_INLINE void
-MOZ_ReportCrash(const char* aStr, const char* aFilename, int aLine)
- MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
-{
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_FATAL, "MOZ_CRASH",
- "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
-#else
- fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
-#if defined(MOZ_DUMP_ASSERTION_STACK) && !defined(MOZILLA_XPCOMRT_API)
- nsTraceRefcnt::WalkTheStack(stderr);
-#endif
- fflush(stderr);
-#endif
-}
-
-/**
- * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH(). You should
- * call MOZ_CRASH instead.
- */
-#if defined(_MSC_VER)
- /*
- * On MSVC use the __debugbreak compiler intrinsic, which produces an inline
- * (not nested in a system function) breakpoint. This distinctively invokes
- * Breakpad without requiring system library symbols on all stack-processing
- * machines, as a nested breakpoint would require.
- *
- * We use TerminateProcess with the exit code aborting would generate
- * because we don't want to invoke atexit handlers, destructors, library
- * unload handlers, and so on when our process might be in a compromised
- * state.
- *
- * We don't use abort() because it'd cause Windows to annoyingly pop up the
- * process error dialog multiple times. See bug 345118 and bug 426163.
- *
- * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the
- * compiler doesn't hassle us to provide a return statement after a
- * MOZ_REALLY_CRASH() call.
- *
- * (Technically these are Windows requirements, not MSVC requirements. But
- * practically you need MSVC for debugging, and we only ship builds created
- * by MSVC, so doing it this way reduces complexity.)
- */
-
-__declspec(noreturn) __inline void MOZ_NoReturn() {}
-
-# ifdef __cplusplus
-# define MOZ_REALLY_CRASH() \
- do { \
- ::__debugbreak(); \
- *((volatile int*) NULL) = __LINE__; \
- ::TerminateProcess(::GetCurrentProcess(), 3); \
- ::MOZ_NoReturn(); \
- } while (0)
-# else
-# define MOZ_REALLY_CRASH() \
- do { \
- __debugbreak(); \
- *((volatile int*) NULL) = __LINE__; \
- TerminateProcess(GetCurrentProcess(), 3); \
- MOZ_NoReturn(); \
- } while (0)
-# endif
-#else
-# ifdef __cplusplus
-# define MOZ_REALLY_CRASH() \
- do { \
- *((volatile int*) NULL) = __LINE__; \
- ::abort(); \
- } while (0)
-# else
-# define MOZ_REALLY_CRASH() \
- do { \
- *((volatile int*) NULL) = __LINE__; \
- abort(); \
- } while (0)
-# endif
-#endif
-
-/*
- * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a
- * Breakpad-compatible way, in both debug and release builds.
- *
- * MOZ_CRASH is a good solution for "handling" failure cases when you're
- * unwilling or unable to handle them more cleanly -- for OOM, for likely
memory
- * corruption, and so on. It's also a good solution if you need safe behavior
- * in release builds as well as debug builds. But if the failure is one that
- * should be debugged and fixed, MOZ_ASSERT is generally preferable.
- *
- * The optional explanation-string, if provided, must be a string literal
- * explaining why we're crashing. This argument is intended for use with
- * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's
- * obvious why we're crashing.
- *
- * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an
- * explanation-string, we print the string to stderr. Otherwise, we don't
- * print anything; this is because we want MOZ_CRASH to be 100% safe in release
- * builds, and it's hard to print to stderr safely when memory might have been
- * corrupted.
- */
-#ifndef DEBUG
-# define MOZ_CRASH(...) MOZ_REALLY_CRASH()
-#else
-# define MOZ_CRASH(...) \
- do { \
- MOZ_ReportCrash("" __VA_ARGS__, __FILE__, __LINE__); \
- MOZ_REALLY_CRASH(); \
- } while (0)
-#endif
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-/*
- * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy
in
- * debug builds. If it is, execution continues. Otherwise, an error message
- * including the expression and the explanation-string (if provided) is
printed,
- * an attempt is made to invoke any existing debugger, and execution halts.
- * MOZ_ASSERT is fatal: no recovery is possible. Do not assert a condition
- * which can correctly be false.
- *
- * The optional explanation-string, if provided, must be a string literal
- * explaining the assertion. It is intended for use with assertions whose
- * correctness or rationale is non-obvious, and for assertions where the "real"
- * condition being tested is best described prosaically. Don't provide an
- * explanation if it's not actually helpful.
- *
- * // No explanation needed: pointer arguments often must not be NULL.
- * MOZ_ASSERT(arg);
- *
- * // An explanation can be helpful to explain exactly how we know an
- * // assertion is valid.
- * MOZ_ASSERT(state == WAITING_FOR_RESPONSE,
- * "given that <thingA> and <thingB>, we must have...");
- *
- * // Or it might disambiguate multiple identical (save for their location)
- * // assertions of the same expression.
- * MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),
- * "we already set [[PrimitiveThis]] for this Boolean object");
- * MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),
- * "we already set [[PrimitiveThis]] for this String object");
- *
- * MOZ_ASSERT has no effect in non-debug builds. It is designed to catch bugs
- * *only* during debugging, not "in the field". If you want the latter, use
- * MOZ_RELEASE_ASSERT, which applies to non-debug builds as well.
- *
- * MOZ_DIAGNOSTIC_ASSERT works like MOZ_RELEASE_ASSERT in Nightly/Aurora and
- * MOZ_ASSERT in Beta/Release - use this when a condition is potentially rare
- * enough to require real user testing to hit, but is not security-sensitive.
- * This can cause user pain, so use it sparingly. If a MOZ_DIAGNOSTIC_ASSERT
- * is firing, it should promptly be converted to a MOZ_ASSERT while the failure
- * is being investigated, rather than letting users suffer.
- */
-
-/*
- * Implement MOZ_VALIDATE_ASSERT_CONDITION_TYPE, which is used to guard against
- * accidentally passing something unintended in lieu of an assertion condition.
- */
-
-#ifdef __cplusplus
-# include "TypeTraits.h"
-namespace mozilla {
-namespace detail {
-
-template<typename T>
-struct IsFunction
-{
- static const bool value = false;
-};
-
-template<typename R, typename... A>
-struct IsFunction<R(A...)>
-{
- static const bool value = true;
-};
-
-template<typename T>
-struct AssertionConditionType
-{
- typedef typename RemoveReference<T>::Type ValueT;
- static_assert(!IsArray<ValueT>::value,
- "Expected boolean assertion condition, got an array or a "
- "string!");
- static_assert(!IsFunction<ValueT>::value,
- "Expected boolean assertion condition, got a function! Did "
- "you intend to call that function?");
- static_assert(!IsFloatingPoint<ValueT>::value,
- "It's often a bad idea to assert that a floating-point number "
- "is nonzero, because such assertions tend to intermittently "
- "fail. Shouldn't your code gracefully handle this case instead
"
- "of asserting? Anyway, if you really want to do that, write an
"
- "explicit boolean condition, like !!x or x!=0.");
-
- static const bool isValid = true;
-};
-
-} // namespace detail
-} // namespace mozilla
-# define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x) \
-
static_assert(mozilla::detail::AssertionConditionType<decltype(x)>::isValid, \
- "invalid assertion condition")
-#else
-# define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x)
-#endif
-
-/* First the single-argument form. */
-#define MOZ_ASSERT_HELPER1(expr) \
- do { \
- MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
- if (MOZ_UNLIKELY(!(expr))) { \
- MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \
- MOZ_REALLY_CRASH(); \
- } \
- } while (0)
-/* Now the two-argument form. */
-#define MOZ_ASSERT_HELPER2(expr, explain) \
- do { \
- MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
- if (MOZ_UNLIKELY(!(expr))) { \
- MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \
- MOZ_REALLY_CRASH(); \
- } \
- } while (0)
-
-#define MOZ_RELEASE_ASSERT_GLUE(a, b) a b
-#define MOZ_RELEASE_ASSERT(...) \
- MOZ_RELEASE_ASSERT_GLUE( \
- MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
- (__VA_ARGS__))
-
-#ifdef DEBUG
-# define MOZ_ASSERT(...) MOZ_RELEASE_ASSERT(__VA_ARGS__)
-#else
-# define MOZ_ASSERT(...) do { } while (0)
-#endif /* DEBUG */
-
-#ifdef RELEASE_BUILD
-# define MOZ_DIAGNOSTIC_ASSERT MOZ_ASSERT
-#else
-# define MOZ_DIAGNOSTIC_ASSERT MOZ_RELEASE_ASSERT
-#endif
-
-/*
- * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is
- * true.
- *
- * MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));
- *
- * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds. It is
- * designed to catch bugs during debugging, not "in the field".
- */
-#ifdef DEBUG
-# define MOZ_ASSERT_IF(cond, expr) \
- do { \
- if (cond) { \
- MOZ_ASSERT(expr); \
- } \
- } while (0)
-#else
-# define MOZ_ASSERT_IF(cond, expr) do { } while (0)
-#endif
-
-/*
- * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that
- * it is undefined behavior for execution to reach this point. No guarantees
- * are made about what will happen if this is reached at runtime. Most code
- * should use MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE because it has extra
- * asserts.
- */
-#if defined(__clang__) || defined(__GNUC__)
-# define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()
-#elif defined(_MSC_VER)
-# define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)
-#else
-# ifdef __cplusplus
-# define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()
-# else
-# define MOZ_ASSUME_UNREACHABLE_MARKER() abort()
-# endif
-#endif
-
-/*
- * MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE([reason]) tells the compiler that it
- * can assume that the macro call cannot be reached during execution. This
lets
- * the compiler generate better-optimized code under some circumstances, at the
- * expense of the program's behavior being undefined if control reaches the
- * MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE.
- *
- * In Gecko, you probably should not use this macro outside of performance- or
- * size-critical code, because it's unsafe. If you don't care about code size
- * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.
- *
- * SpiderMonkey is a different beast, and there it's acceptable to use
- * MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE more widely.
- *
- * Note that MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE is noreturn, so it's valid
- * not to return a value following a MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE
- * call.
- *
- * Example usage:
- *
- * enum ValueType {
- * VALUE_STRING,
- * VALUE_INT,
- * VALUE_FLOAT
- * };
- *
- * int ptrToInt(ValueType type, void* value) {
- * {
- * // We know for sure that type is either INT or FLOAT, and we want this
- * // code to run as quickly as possible.
- * switch (type) {
- * case VALUE_INT:
- * return *(int*) value;
- * case VALUE_FLOAT:
- * return (int) *(float*) value;
- * default:
- * MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unexpected ValueType");
- * }
- * }
- */
-
-/*
- * Unconditional assert in debug builds for (assumed) unreachable code paths
- * that have a safe return without crashing in release builds.
- */
-#define MOZ_ASSERT_UNREACHABLE(reason) \
- MOZ_ASSERT(false, "MOZ_ASSERT_UNREACHABLE: " reason)
-
-#define MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE(reason) \
- do { \
- MOZ_ASSERT_UNREACHABLE(reason); \
- MOZ_ASSUME_UNREACHABLE_MARKER(); \
- } while (0)
-
-/*
- * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the
provided
- * expression, in debug builds and in release builds both. Then, in debug
- * builds only, the value of the expression is asserted either true or false
- * using MOZ_ASSERT.
- */
-#ifdef DEBUG
-# define MOZ_ALWAYS_TRUE(expr) MOZ_ASSERT((expr))
-# define MOZ_ALWAYS_FALSE(expr) MOZ_ASSERT(!(expr))
-#else
-# define MOZ_ALWAYS_TRUE(expr) ((void)(expr))
-# define MOZ_ALWAYS_FALSE(expr) ((void)(expr))
-#endif
-
-#undef MOZ_DUMP_ASSERTION_STACK
-
-#endif /* mozilla_Assertions_h */
diff --git a/include/onlineupdate/mozilla/Attributes.h
b/include/onlineupdate/mozilla/Attributes.h
deleted file mode 100644
index 74b77a38d082..000000000000
--- a/include/onlineupdate/mozilla/Attributes.h
+++ /dev/null
@@ -1,481 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implementations of various class and method modifier attributes. */
-
-#ifndef mozilla_Attributes_h
-#define mozilla_Attributes_h
-
-#include "Compiler.h"
-
-/*
- * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the
- * method decorated with it must be inlined, even if the compiler thinks
- * otherwise. This is only a (much) stronger version of the inline hint:
- * compilers are not guaranteed to respect it (although they're much more
likely
- * to do so).
- *
- * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the
- * compiler to inline even in DEBUG builds. It should be used very rarely.
- */
-#if defined(_MSC_VER)
-# define MOZ_ALWAYS_INLINE_EVEN_DEBUG __forceinline
-#elif defined(__GNUC__)
-# define MOZ_ALWAYS_INLINE_EVEN_DEBUG __attribute__((always_inline))
inline
-#else
-# define MOZ_ALWAYS_INLINE_EVEN_DEBUG inline
-#endif
-
-#if !defined(DEBUG)
-# define MOZ_ALWAYS_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG
-#elif defined(_MSC_VER) && !defined(__cplusplus)
-# define MOZ_ALWAYS_INLINE __inline
-#else
-# define MOZ_ALWAYS_INLINE inline
-#endif
-
-#if defined(_MSC_VER)
-/*
- * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality
- * without warnings (functionality used by the macros below). These modes are
- * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or,
more
- * standardly, by checking whether __cplusplus has a C++11 or greater value.
- * Current versions of g++ do not correctly set __cplusplus, so we check both
- * for forward compatibility.
- *
- * Even though some versions of MSVC support explicit conversion operators, we
- * don't indicate support for them here, due to
- *
http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug
- */
-# define MOZ_HAVE_NEVER_INLINE __declspec(noinline)
-# define MOZ_HAVE_NORETURN __declspec(noreturn)
-# ifdef __clang__
- /* clang-cl probably supports constexpr and explicit conversions. */
-# if __has_extension(cxx_constexpr)
-# define MOZ_HAVE_CXX11_CONSTEXPR
-# endif
-# if __has_extension(cxx_explicit_conversions)
-# define MOZ_HAVE_EXPLICIT_CONVERSION
-# endif
-# endif
-#elif defined(__clang__)
- /*
- * Per Clang documentation, "Note that marketing version numbers should not
- * be used to check for language features, as different vendors use
different
- * numbering schemes. Instead, use the feature checking macros."
- */
-# ifndef __has_extension
-# define __has_extension __has_feature /* compatibility, for older versions
of clang */
-# endif
-# if __has_extension(cxx_constexpr)
-# define MOZ_HAVE_CXX11_CONSTEXPR
-# endif
-# if __has_extension(cxx_explicit_conversions)
-# define MOZ_HAVE_EXPLICIT_CONVERSION
-# endif
-# if __has_attribute(noinline)
-# define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
-# endif
-# if __has_attribute(noreturn)
-# define MOZ_HAVE_NORETURN __attribute__((noreturn))
-# endif
-#elif defined(__GNUC__)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) &&
__cplusplus >= 201103L)
-# define MOZ_HAVE_CXX11_CONSTEXPR
-# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
-# define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
-# endif
-# define MOZ_HAVE_EXPLICIT_CONVERSION
-# endif
-# define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
-# define MOZ_HAVE_NORETURN __attribute__((noreturn))
-#endif
-
-/*
- * When built with clang analyzer (a.k.a scan-build), define MOZ_HAVE_NORETURN
- * to mark some false positives
- */
-#ifdef __clang_analyzer__
-# if __has_extension(attribute_analyzer_noreturn)
-# define MOZ_HAVE_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
-# endif
-#endif
-
-/*
- * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a
- * function at compile time. A constexpr function cannot examine any values
- * except its arguments and can have no side effects except its return value.
- * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's
- * value may be computed at compile time. It should be preferred to just
- * marking variables as MOZ_CONSTEXPR because if the compiler does not support
- * constexpr it will fall back to making the variable const, and some compilers
- * do not accept variables being marked both const and constexpr.
- */
-#ifdef MOZ_HAVE_CXX11_CONSTEXPR
-# define MOZ_CONSTEXPR constexpr
-# define MOZ_CONSTEXPR_VAR constexpr
-# ifdef MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
-# define MOZ_CONSTEXPR_TMPL constexpr
-# else
-# define MOZ_CONSTEXPR_TMPL
-# endif
-#else
-# define MOZ_CONSTEXPR /* no support */
-# define MOZ_CONSTEXPR_VAR const
-# define MOZ_CONSTEXPR_TMPL
-#endif
-
-/*
- * MOZ_EXPLICIT_CONVERSION is a specifier on a type conversion
- * overloaded operator that declares that a C++11 compiler should restrict
- * this operator to allow only explicit type conversions, disallowing
- * implicit conversions.
- *
- * Example:
- *
- * template<typename T>
- * class Ptr
- * {
- * T* mPtr;
- * MOZ_EXPLICIT_CONVERSION operator bool() const
- * {
- * return mPtr != nullptr;
- * }
- * };
- *
- */
-#ifdef MOZ_HAVE_EXPLICIT_CONVERSION
-# define MOZ_EXPLICIT_CONVERSION explicit
-#else
-# define MOZ_EXPLICIT_CONVERSION /* no support */
-#endif
-
-/*
- * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the
- * method decorated with it must never be inlined, even if the compiler would
- * otherwise choose to inline the method. Compilers aren't absolutely
- * guaranteed to support this, but most do.
- */
-#if defined(MOZ_HAVE_NEVER_INLINE)
-# define MOZ_NEVER_INLINE MOZ_HAVE_NEVER_INLINE
-#else
-# define MOZ_NEVER_INLINE /* no support */
-#endif
-
-/*
- * MOZ_NORETURN, specified at the start of a function declaration, indicates
- * that the given function does not return. (The function definition does not
- * need to be annotated.)
- *
- * MOZ_NORETURN void abort(const char* msg);
- *
- * This modifier permits the compiler to optimize code assuming a call to such
a
- * function will never return. It also enables the compiler to avoid spurious
- * warnings about not initializing variables, or about any other
seemingly-dodgy
- * operations performed after the function returns.
- *
- * This modifier does not affect the corresponding function's linking behavior.
- */
-#if defined(MOZ_HAVE_NORETURN)
-# define MOZ_NORETURN MOZ_HAVE_NORETURN
-#else
-# define MOZ_NORETURN /* no support */
-#endif
-
-/**
- * MOZ_COLD tells the compiler that a function is "cold", meaning infrequently
- * executed. This may lead it to optimize for size more aggressively than
speed,
- * or to allocate the body of the function in a distant part of the text
segment
- * to help keep it from taking up unnecessary icache when it isn't in use.
- *
- * Place this attribute at the very beginning of a function definition. For
- * example, write
- *
- * MOZ_COLD int foo();
- *
- * or
- *
- * MOZ_COLD int foo() { return 42; }
- */
-#if defined(__GNUC__) || defined(__clang__)
-# define MOZ_COLD __attribute__ ((cold))
-#else
-# define MOZ_COLD
-#endif
-
-/**
- * MOZ_NONNULL tells the compiler that some of the arguments to a function are
- * known to be non-null. The arguments are a list of 1-based argument indexes
- * identifying arguments which are known to be non-null.
- *
- * Place this attribute at the very beginning of a function definition. For
- * example, write
- *
- * MOZ_NONNULL(1, 2) int foo(char *p, char *q);
- */
-#if defined(__GNUC__) || defined(__clang__)
-# define MOZ_NONNULL(...) __attribute__ ((nonnull(__VA_ARGS__)))
-#else
-# define MOZ_NONNULL(...)
-#endif
-
-/*
- * MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS, specified at the end of a function
... etc. - the rest is truncated