diff options
Diffstat (limited to 'external')
854 files changed, 45704 insertions, 13509 deletions
diff --git a/external/IAccessible2/ExternalProject_IAccessible2.mk b/external/IAccessible2/ExternalProject_IAccessible2.mk new file mode 100644 index 000000000000..0ef6c8fc6014 --- /dev/null +++ b/external/IAccessible2/ExternalProject_IAccessible2.mk @@ -0,0 +1,26 @@ +# -*- 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_ExternalProject_ExternalProject,IAccessible2)) + +$(eval $(call gb_ExternalProject_register_targets,IAccessible2,\ + build \ +)) + +# run IAccessible2's 'concatidl.sh' script that creates the merged .idl file, +# 'ia2_api_all.idl' +$(call gb_ExternalProject_get_state_target,IAccessible2,build) : + $(call gb_Trace_StartRange,IAccessible2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + cd $(call gb_UnpackedTarball_get_dir,IAccessible2)\ + && ./concatidl.sh\ + ) + $(call gb_Trace_EndRange,IAccessible2,EXTERNAL) + +# vim: set noet sw=4 ts=4: diff --git a/external/IAccessible2/Module_IAccessible2.mk b/external/IAccessible2/Module_IAccessible2.mk new file mode 100644 index 000000000000..a1013ec83512 --- /dev/null +++ b/external/IAccessible2/Module_IAccessible2.mk @@ -0,0 +1,17 @@ +# -*- 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_Module_Module,IAccessible2)) + +$(eval $(call gb_Module_add_targets,IAccessible2,\ + UnpackedTarball_IAccessible2 \ + ExternalProject_IAccessible2 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/IAccessible2/README b/external/IAccessible2/README new file mode 100644 index 000000000000..511880d77d31 --- /dev/null +++ b/external/IAccessible2/README @@ -0,0 +1,5 @@ +IAccessible2 is an accessibility API which complements Microsoft's earlier work on MSAA. + +It is used for LibreOffice's Windows accessibility bridge in the winaccessibility module. + +IAccessible2 is available from [ https://github.com/LinuxA11y/IAccessible2/ ]. diff --git a/external/IAccessible2/UnpackedTarball_IAccessible2.mk b/external/IAccessible2/UnpackedTarball_IAccessible2.mk new file mode 100644 index 000000000000..b24988aece7c --- /dev/null +++ b/external/IAccessible2/UnpackedTarball_IAccessible2.mk @@ -0,0 +1,14 @@ +# -*- 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,IAccessible2)) + +$(eval $(call gb_UnpackedTarball_set_tarball,IAccessible2,$(IACCESSIBLE2_TARBALL))) + +# vim: set noet sw=4 ts=4: diff --git a/external/Module_external.mk b/external/Module_external.mk index 1c722a325c2d..e60765634ab5 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -16,8 +16,7 @@ endif $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,XMLSEC,xmlsec) \ $(call gb_Helper_optional,ABW,libabw) \ - $(call gb_Helper_optional,APACHE_COMMONS,apache-commons) \ - $(call gb_Helper_optional,APR,apr) \ + $(call gb_Helper_optional,ARGON2,argon2) \ $(call gb_Helper_optional,BOOST,boost) \ $(call gb_Helper_optional,BOX2D,box2d) \ $(call gb_Helper_optional,BREAKPAD,breakpad) \ @@ -30,8 +29,8 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,LIBCMIS,libcmis) \ $(call gb_Helper_optional,COINMP,coinmp) \ $(call gb_Helper_optional,CPPUNIT,cppunit) \ - $(call gb_Helper_optional,CT2N,ct2n) \ $(call gb_Helper_optional,CURL,curl) \ + $(call gb_Helper_optional,DRAGONBOX,dragonbox) \ dtoa \ $(call gb_Helper_optional,EBOOK,libebook) \ $(call gb_Helper_optional,EPM,epm) \ @@ -43,6 +42,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,FONTCONFIG,fontconfig) \ $(call gb_Helper_optional,FREEHAND,libfreehand) \ $(call gb_Helper_optional,FREETYPE,freetype) \ + $(call gb_Helper_optional,FROZEN,frozen) \ $(call gb_Helper_optional,GLM,glm) \ $(call gb_Helper_optional,GPGMEPP,gpgmepp) \ $(call gb_Helper_optional,GRAPHITE,graphite) \ @@ -50,10 +50,11 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,HSQLDB,hsqldb) \ $(call gb_Helper_optional,HUNSPELL,hunspell) \ $(call gb_Helper_optional,HYPHEN,hyphen) \ + $(if $(filter WNT,$(OS)),IAccessible2) \ $(call gb_Helper_optional,ICU,icu) \ + $(call gb_Helper_optional,JAVA_WEBSOCKET,java_websocket) \ $(call gb_Helper_optional,JFREEREPORT,jfreereport) \ $(call gb_Helper_optional,LIBJPEG_TURBO,libjpeg-turbo) \ - $(call gb_Helper_optional,LANGUAGETOOL,languagetool) \ $(call gb_Helper_optional,LCMS2,lcms2) \ $(call gb_Helper_optional,LIBASSUAN,libassuan) \ $(call gb_Helper_optional,LIBATOMIC_OPS,libatomic_ops) \ @@ -64,6 +65,8 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,LIBLANGTAG,liblangtag) \ $(call gb_Helper_optional,LIBNUMBERTEXT,libnumbertext) \ $(call gb_Helper_optional,LIBPNG,libpng) \ + $(call gb_Helper_optional,LIBTIFF,libtiff) \ + $(call gb_Helper_optional,LIBWEBP,libwebp) \ $(call gb_Helper_optional,LIBXML2,libxml2) \ $(call gb_Helper_optional,LIBXSLT,libxslt) \ $(call gb_Helper_optional,LPSOLVE,lpsolve) \ @@ -77,28 +80,26 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,MSPUB,libmspub) \ $(call gb_Helper_optional,MWAW,libmwaw) \ $(call gb_Helper_optional,MYTHES,mythes) \ - $(call gb_Helper_optional,NEON,neon) \ $(call gb_Helper_optional,NSS,nss) \ $(call gb_Helper_optional,ODFGEN,libodfgen) \ $(call gb_Helper_optional,OPENLDAP,openldap) \ $(call gb_Helper_optional,OPENSSL,openssl) \ $(call gb_Helper_optional,ORCUS,liborcus) \ - $(call gb_Helper_optional,OWNCLOUD_ANDROID_LIB,owncloud-android-lib) \ $(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) \ $(call gb_Helper_optional,PYTHON,python3) \ $(call gb_Helper_optional,QXP,libqxp) \ - $(call gb_Helper_optional,QRCODEGEN,qrcodegen) \ + $(call gb_Helper_optional,ZXCVBN,zxcvbn-c) \ + $(call gb_Helper_optional,ZXING,zxing) \ $(call gb_Helper_optional,REDLAND,redland) \ $(call gb_Helper_optional,REVENGE,librevenge) \ $(call gb_Helper_optional,RHINO,rhino) \ - $(call gb_Helper_optional,SERF,serf) \ $(call gb_Helper_optional,SKIA,skia) \ $(call gb_Helper_optional,STAROFFICE,libstaroffice) \ $(if $(filter WNT,$(OS)),twain_dsm) \ - $(call gb_Helper_optional,UCPP,ucpp) \ $(call gb_Helper_optional,VISIO,libvisio) \ $(call gb_Helper_optional,WPD,libwpd) \ $(call gb_Helper_optional,WPG,libwpg) \ diff --git a/external/README b/external/README.md index 1f245df45bd1..29a2c9098a4e 100644 --- a/external/README +++ b/external/README.md @@ -1 +1,3 @@ +# External Projects + External projects bundled with LibreOffice. diff --git a/external/apache-commons/ExternalPackage_apache_commons_logging.mk b/external/apache-commons/ExternalPackage_apache_commons_logging.mk deleted file mode 100644 index 2bff13b93c66..000000000000 --- a/external/apache-commons/ExternalPackage_apache_commons_logging.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,apache_commons_logging,apache_commons_logging)) - -$(eval $(call gb_ExternalPackage_use_external_project,apache_commons_logging,apache_commons_logging)) - -$(eval $(call gb_ExternalPackage_add_file,apache_commons_logging,$(LIBO_SHARE_JAVA_FOLDER)/commons-logging-$(COMMONS_LOGGING_VERSION).jar,target/commons-logging-$(COMMONS_LOGGING_VERSION).jar)) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/ExternalProject_apache_commons_logging.mk b/external/apache-commons/ExternalProject_apache_commons_logging.mk deleted file mode 100644 index 7c689d18c443..000000000000 --- a/external/apache-commons/ExternalProject_apache_commons_logging.mk +++ /dev/null @@ -1,32 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,apache_commons_logging)) - -$(eval $(call gb_ExternalProject_register_targets,apache_commons_logging,\ - build \ -)) - -$(call gb_ExternalProject_get_state_target,apache_commons_logging,build) : - $(call gb_Trace_StartRange,apache_commons_logging,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ - ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \ - $(ICECREAM_RUN) "$(ANT)" \ - $(if $(verbose),-v,-q) \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - -Dant.build.javac.source=$(JAVA_SOURCE_VER) \ - -Dant.build.javac.target=$(JAVA_TARGET_VER) \ - $(if $(debug),-Dcompile.debug="true",-Dcompile.debug="false") \ - compile build-jar \ - ) - $(call gb_Trace_EndRange,apache_commons_logging,EXTERNAL) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/README b/external/apache-commons/README deleted file mode 100644 index 18944aca4af7..000000000000 --- a/external/apache-commons/README +++ /dev/null @@ -1 +0,0 @@ -Java library; used for logging in Extensions, from [http://commons.apache.org/] diff --git a/external/apache-commons/UnpackedTarball_apache_commons_logging.mk b/external/apache-commons/UnpackedTarball_apache_commons_logging.mk deleted file mode 100644 index 1d5ad3dc2d9d..000000000000 --- a/external/apache-commons/UnpackedTarball_apache_commons_logging.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,apache_commons_logging)) - -$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_logging,$(APACHE_COMMONS_LOGGING_TARBALL),,apache-commons)) - -$(eval $(call gb_UnpackedTarball_fix_end_of_line,apache_commons_logging,\ - build.xml \ -)) - -$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_logging,\ - external/apache-commons/patches/logging.patch \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/patches/logging.patch b/external/apache-commons/patches/logging.patch deleted file mode 100644 index c225e5a30338..000000000000 --- a/external/apache-commons/patches/logging.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- misc/commons-logging-1.1.1-src/build.xml 2007-11-22 00:27:52.000000000 +0100 -+++ misc/build/commons-logging-1.1.1-src/build.xml 2008-06-24 14:23:56.316301736 +0200 -@@ -129,12 +129,6 @@ - - <!-- ========== Compiler Defaults ========================================= --> - -- <!-- Version of java class files to generate. --> -- <property name="target.version" value="1.2"/> -- -- <!-- Version of java source to accept --> -- <property name="source.version" value="1.2"/> -- - <!-- Should Java compilations set the 'debug' compiler option? --> - <property name="compile.debug" value="true"/> - -@@ -283,6 +277,10 @@ - classpathref="compile.classpath" - classname="org.apache.avalon.framework.logger.Logger"/> - -+ <available property="servlet-api.present" -+ classpathref="compile.classpath" -+ classname="javax.servlet.ServletContextListener"/> -+ - <available file="${log4j12.jar}" property="log4j12.present"/> - <available file="${log4j13.jar}" property="log4j13.present"/> - <available file="${build.home}/docs" property="maven.generated.docs.present"/> -@@ -362,8 +360,8 @@ - debug="${compile.debug}" - deprecation="${compile.deprecation}" - optimize="${compile.optimize}" -- source="${source.version}" -- target="${target.version}"> -+ source="${ant.build.javac.source}" -+ target="${ant.build.javac.target}"> - - <classpath refid="compile.classpath"/> - -@@ -373,6 +371,8 @@ - unless="logkit.present"/> - <exclude name="org/apache/commons/logging/impl/AvalonLogger.java" - unless="avalon-framework.present"/> -+ <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java" -+ unless="servlet-api.present"/> - </javac> - </target> - diff --git a/external/apr/ExternalProject_apr.mk b/external/apr/ExternalProject_apr.mk deleted file mode 100644 index 1c94480e5ab7..000000000000 --- a/external/apr/ExternalProject_apr.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,apr)) - -$(eval $(call gb_ExternalProject_register_targets,apr,\ - build \ -)) - -$(eval $(call gb_ExternalProject_use_nmake,apr,build)) - -ifeq ($(COM),MSC) -$(call gb_ExternalProject_get_state_target,apr,build): - $(call gb_Trace_StartRange,apr,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - nmake -nologo -f apr.mak \ - CFG="apr - Win32 $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)" \ - RECURSE=0 \ - ) - $(call gb_Trace_EndRange,apr,EXTERNAL) - -else -$(call gb_ExternalProject_get_state_target,apr,build): - $(call gb_Trace_StartRange,apr,EXTERNAL) - +$(call gb_ExternalProject_run,build,\ - $(if $(ENABLE_MACOSX_SANDBOX),ac_cv_func_fdatasync=no) \ - ./configure \ - --enable-static --disable-shared \ - --with-pic \ - $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\ - && $(MAKE) libapr-1.la \ - ) - $(call gb_Trace_EndRange,apr,EXTERNAL) - -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/apr/ExternalProject_apr_util.mk b/external/apr/ExternalProject_apr_util.mk deleted file mode 100644 index a311f32e8e01..000000000000 --- a/external/apr/ExternalProject_apr_util.mk +++ /dev/null @@ -1,45 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,apr_util)) - -$(eval $(call gb_ExternalProject_use_external_project,apr_util,apr)) - -$(eval $(call gb_ExternalProject_register_targets,apr_util,\ - build \ -)) - -$(eval $(call gb_ExternalProject_use_nmake,apr_util,build)) - -ifeq ($(COM),MSC) -$(call gb_ExternalProject_get_state_target,apr_util,build): - $(call gb_Trace_StartRange,apr_util,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - nmake -nologo -f aprutil.mak \ - CFG="aprutil - Win32 $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)" \ - RECURSE=0 \ - ) - $(call gb_Trace_EndRange,apr_util,EXTERNAL) - -else -$(call gb_ExternalProject_get_state_target,apr_util,build): - $(call gb_Trace_StartRange,apr_util,EXTERNAL) - +$(call gb_ExternalProject_run,build,\ - ./configure \ - --enable-static --disable-shared \ - --with-pic \ - $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\ - --with-apr=$(call gb_UnpackedTarball_get_dir,apr)/apr-1-config \ - && $(MAKE) libaprutil-1.la \ - ) - $(call gb_Trace_EndRange,apr_util,EXTERNAL) - -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/apr/README b/external/apr/README deleted file mode 100644 index 778bdfdf692f..000000000000 --- a/external/apr/README +++ /dev/null @@ -1,5 +0,0 @@ -The mission of the Apache Portable Runtime (APR) project is to create -and maintain software libraries that provide a predictable and consistent -interface to underlying platform-specific implementations. - -From [http://apr.apache.org/]. diff --git a/external/apr/exit.patch b/external/apr/exit.patch deleted file mode 100644 index 5db6a94717cb..000000000000 --- a/external/apr/exit.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- configure -+++ configure -@@ -23549,6 +23549,7 @@ - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include <stdio.h> -+#include <stdlib.h> - #include <sys/types.h> - #ifdef WIN32 - #define binmode "b" -@@ -23910,6 +23910,7 @@ - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include <stdio.h> -+#include <stdlib.h> - #include <sys/types.h> - #ifdef WIN32 - #define binmode "b" -@@ -24347,6 +24347,7 @@ - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include <stdio.h> -+#include <stdlib.h> - #include <sys/types.h> - #include <sys/uio.h> - #ifdef WIN32 diff --git a/external/apr/uuid.patch b/external/apr/uuid.patch deleted file mode 100644 index 53c75f13cf15..000000000000 --- a/external/apr/uuid.patch +++ /dev/null @@ -1,241 +0,0 @@ ---- configure -+++ configure -@@ -26343,235 +26343,9 @@ - - echo "${nl}Checking for OS UUID Support..." - --for ac_header in uuid.h uuid/uuid.h sys/uuid.h --do : -- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` --ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -- cat >>confdefs.h <<_ACEOF --#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 --_ACEOF -- break --fi -- --done -- -- --apr_revert_save_LIBS=$LIBS -- --# Prefer the flavor(s) that live in libc; --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_create" >&5 --$as_echo_n "checking for library containing uuid_create... " >&6; } --if ${ac_cv_search_uuid_create+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_func_search_save_LIBS=$LIBS --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char uuid_create (); --int --main () --{ --return uuid_create (); -- ; -- return 0; --} --_ACEOF --for ac_lib in '' uuid; do -- if test -z "$ac_lib"; then -- ac_res="none required" -- else -- ac_res=-l$ac_lib -- LIBS="-l$ac_lib $ac_func_search_save_LIBS" -- fi -- if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_search_uuid_create=$ac_res --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext -- if ${ac_cv_search_uuid_create+:} false; then : -- break --fi --done --if ${ac_cv_search_uuid_create+:} false; then : -- --else -- ac_cv_search_uuid_create=no --fi --rm conftest.$ac_ext --LIBS=$ac_func_search_save_LIBS --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_create" >&5 --$as_echo "$ac_cv_search_uuid_create" >&6; } --ac_res=$ac_cv_search_uuid_create --if test "$ac_res" != no; then : -- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -- --fi -- --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate" >&5 --$as_echo_n "checking for library containing uuid_generate... " >&6; } --if ${ac_cv_search_uuid_generate+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_func_search_save_LIBS=$LIBS --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char uuid_generate (); --int --main () --{ --return uuid_generate (); -- ; -- return 0; --} --_ACEOF --for ac_lib in '' uuid; do -- if test -z "$ac_lib"; then -- ac_res="none required" -- else -- ac_res=-l$ac_lib -- LIBS="-l$ac_lib $ac_func_search_save_LIBS" -- fi -- if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_search_uuid_generate=$ac_res --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext -- if ${ac_cv_search_uuid_generate+:} false; then : -- break --fi --done --if ${ac_cv_search_uuid_generate+:} false; then : -- --else -- ac_cv_search_uuid_generate=no --fi --rm conftest.$ac_ext --LIBS=$ac_func_search_save_LIBS --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate" >&5 --$as_echo "$ac_cv_search_uuid_generate" >&6; } --ac_res=$ac_cv_search_uuid_generate --if test "$ac_res" != no; then : -- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -- --fi -- --if test "$ac_cv_search_uuid_create" = "none required" -o \ -- "$ac_cv_search_uuid_generate" = "none required"; then -- LIBS=$apr_revert_save_LIBS --fi -- --for ac_func in uuid_create uuid_generate --do : -- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` --ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -- cat >>confdefs.h <<_ACEOF --#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 --_ACEOF -- --fi --done -- -- --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for os uuid usability" >&5 --$as_echo_n "checking for os uuid usability... " >&6; } --if ${apr_cv_osuuid+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- --# Ensure this test closely mirrors misc/unix/rand.c! --uuid_includes=" --#if defined(HAVE_SYS_TYPES_H) --#include <sys/types.h> --#endif --#if defined(HAVE_UNISTD_H) --#include <unistd.h> --#endif --#if defined(HAVE_UUID_H) --#include <uuid.h> --#elif defined(HAVE_UUID_UUID_H) --#include <uuid/uuid.h> --#elif defined(HAVE_SYS_UUID_H) --#include <sys/uuid.h> --#endif --" -- apr_cv_osuuid=no -- if test $ac_cv_func_uuid_create = yes; then -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ --$uuid_includes --int --main () --{ -- -- uuid_t g; -- uint32_t s; -- uuid_create(&g, &s); -- if (s == uuid_s_ok) s = 0; -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- apr_cv_osuuid=yes --else -- apr_cv_func_uuid_create=no --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- fi -- if test $ac_cv_func_uuid_generate = yes; then -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ --$uuid_includes --int --main () --{ -- -- uuid_t g; -- uuid_generate(g); -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- apr_cv_osuuid=yes --else -- apr_cv_func_uuid_generate=no --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- fi -- --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_osuuid" >&5 --$as_echo "$apr_cv_osuuid" >&6; } -- --if test $apr_cv_osuuid = yes; then -- osuuid="1" --else -- osuuid="0" -- LIBS=$apr_revert_save_LIBS --fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo no >&6; } -+osuuid="0" - - - diff --git a/external/apr/windows.build.patch.1 b/external/apr/windows.build.patch.1 deleted file mode 100644 index 929910beaccb..000000000000 --- a/external/apr/windows.build.patch.1 +++ /dev/null @@ -1,53 +0,0 @@ -diff -ur apr_util.org/aprutil.mak apr_util/aprutil.mak ---- apr_util.org/aprutil.mak 2014-03-05 16:40:02.385701779 +0100 -+++ apr_util/aprutil.mak 2014-03-05 16:40:49.409702332 +0100 -@@ -210,8 +210,6 @@ - "$(INTDIR)\apr_uri.obj" \ - "$(INTDIR)\xlate.obj" \ - "$(INTDIR)\apr_xml.obj" \ -- "..\apr-iconv\LibR\apriconv-1.lib" \ -- ".\xml\expat\lib\LibR\xml.lib" - - "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< -@@ -406,8 +404,6 @@ - "$(INTDIR)\apr_uri.obj" \ - "$(INTDIR)\xlate.obj" \ - "$(INTDIR)\apr_xml.obj" \ -- "..\apr-iconv\LibD\apriconv-1.lib" \ -- ".\xml\expat\lib\LibD\xml.lib" - - "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< -@@ -602,8 +598,6 @@ - "$(INTDIR)\apr_uri.obj" \ - "$(INTDIR)\xlate.obj" \ - "$(INTDIR)\apr_xml.obj" \ -- "..\apr-iconv\x64\LibR\apriconv-1.lib" \ -- ".\xml\expat\lib\x64\LibR\xml.lib" - - "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< -@@ -798,8 +792,6 @@ - "$(INTDIR)\apr_uri.obj" \ - "$(INTDIR)\xlate.obj" \ - "$(INTDIR)\apr_xml.obj" \ -- "..\apr-iconv\x64\LibD\apriconv-1.lib" \ -- ".\xml\expat\lib\x64\LibD\xml.lib" - - "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< -diff -ur apr_util.org/include/apu.hw apr_util/include/apu.hw ---- apr_util.org/include/apu.hw 2014-03-05 16:40:02.377701779 +0100 -+++ apr_util/include/apu.hw 2014-03-05 16:40:38.769702207 +0100 -@@ -138,8 +138,8 @@ - #define APU_HAVE_NSS 0 - #endif - --#define APU_HAVE_APR_ICONV 1 --#define APU_HAVE_ICONV 0 -+#undef APU_HAVE_APR_ICONV -+#undef APU_HAVE_ICONV - #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) - - #endif /* APU_H */ diff --git a/external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch b/external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch new file mode 100644 index 000000000000..538b41e3ec9f --- /dev/null +++ b/external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch @@ -0,0 +1,32 @@ +From 48829f87ebafbb9938d23a8f0bff4d11d770690e Mon Sep 17 00:00:00 2001 +From: Patrick Steinhardt <ps@pks.im> +Date: Thu, 20 Feb 2020 17:37:32 +0100 +Subject: [PATCH] Fix possible compiler error due to undefined _MSC_VER + +In order to determine how to set up the ARGON2_PUBLIC and ARGON2_LOCAL +macros, we check for various different environments via preprocessor +defines. For Microsoft Visual Studio, we check that the macro _MSC_VER +evaluates to non-zero via `#elif _MSC_VER`. This may raise a compile +error when compiling with "-Werror=undef" if the variable isn't defined. + +Fix the issue by using `#elif defined(_MSC_VER)` instead. +--- + include/argon2.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/argon2.h b/include/argon2.h +index fc8682c..1b471f6 100644 +--- a/include/argon2.h ++++ b/include/argon2.h +@@ -30,7 +30,7 @@ extern "C" { + #ifdef A2_VISCTL + #define ARGON2_PUBLIC __attribute__((visibility("default"))) + #define ARGON2_LOCAL __attribute__ ((visibility ("hidden"))) +-#elif _MSC_VER ++#elif defined(_MSC_VER) + #define ARGON2_PUBLIC __declspec(dllexport) + #define ARGON2_LOCAL + #else +-- +2.43.0 + diff --git a/external/argon2/0002-Add-WinARM64-vcxproj-config.patch b/external/argon2/0002-Add-WinARM64-vcxproj-config.patch new file mode 100644 index 000000000000..4a33df9f0d7c --- /dev/null +++ b/external/argon2/0002-Add-WinARM64-vcxproj-config.patch @@ -0,0 +1,235 @@ +diff -ur argon2.org/vs2015/Argon2OptDll/Argon2OptDll.vcxproj argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +--- argon2.org/vs2015/Argon2OptDll/Argon2OptDll.vcxproj 2023-12-23 01:00:49.231059537 +0100 ++++ argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj 2023-12-23 01:02:40.375527010 +0100 +@@ -13,6 +13,14 @@ + <Configuration>ReleaseStatic</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> ++ <ProjectConfiguration Include="Debug|ARM64"> ++ <Configuration>Debug</Configuration> ++ <Platform>AMR64</Platform> ++ </ProjectConfiguration> ++ <ProjectConfiguration Include="Release|ARM64"> ++ <Configuration>Release</Configuration> ++ <Platform>AMR64</Platform> ++ </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> +@@ -50,6 +54,17 @@ + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> ++ <ConfigurationType>DynamicLibrary</ConfigurationType> ++ <UseDebugLibraries>true</UseDebugLibraries> ++ <CharacterSet>MultiByte</CharacterSet> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> ++ <ConfigurationType>DynamicLibrary</ConfigurationType> ++ <UseDebugLibraries>false</UseDebugLibraries> ++ <WholeProgramOptimization>true</WholeProgramOptimization> ++ <CharacterSet>MultiByte</CharacterSet> ++ </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> +@@ -84,6 +94,12 @@ + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|AMR64'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|AMR64'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> +@@ -107,6 +120,16 @@ + <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> + <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> + </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> ++ <OutDir>$(SolutionDir)vs2015\build\</OutDir> ++ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> ++ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> ++ <OutDir>$(SolutionDir)vs2015\build\</OutDir> ++ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> ++ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> ++ </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'"> + <OutDir>$(SolutionDir)vs2015\build\</OutDir> + <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> +@@ -158,6 +176,29 @@ + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> ++ <ClCompile> ++ <WarningLevel>Level3</WarningLevel> ++ <Optimization>Disabled</Optimization> ++ <SDLCheck>true</SDLCheck> ++ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> ++ <ClCompile> ++ <WarningLevel>Level3</WarningLevel> ++ <Optimization>MaxSpeed</Optimization> ++ <FunctionLevelLinking>true</FunctionLevelLinking> ++ <IntrinsicFunctions>false</IntrinsicFunctions> ++ <SDLCheck>true</SDLCheck> ++ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ <Link> ++ <EnableCOMDATFolding>true</EnableCOMDATFolding> ++ <OptimizeReferences>true</OptimizeReferences> ++ <GenerateDebugInformation>true</GenerateDebugInformation> ++ </Link> ++ </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> +@@ -209,7 +242,6 @@ + <ClInclude Include="..\..\include\argon2.h" /> + <ClInclude Include="..\..\src\blake2\blake2-impl.h" /> + <ClInclude Include="..\..\src\blake2\blake2.h" /> +- <ClInclude Include="..\..\src\blake2\blamka-round-opt.h" /> + <ClInclude Include="..\..\src\blake2\blamka-round-ref.h" /> + <ClInclude Include="..\..\src\core.h" /> + <ClInclude Include="..\..\src\encoding.h" /> +@@ -221,7 +253,7 @@ + <ClCompile Include="..\..\src\blake2\blake2b.c" /> + <ClCompile Include="..\..\src\core.c" /> + <ClCompile Include="..\..\src\encoding.c" /> +- <ClCompile Include="..\..\src\opt.c" /> ++ <ClCompile Include="..\..\src\ref.c" /> + <ClCompile Include="..\..\src\thread.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> +Only in argon2/vs2015/Argon2OptDll: Argon2OptDll.vcxproj~ +diff -ur argon2.org/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +--- argon2.org/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj 2023-12-23 01:00:49.231059537 +0100 ++++ argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj 2023-12-23 01:02:12.518576081 +0100 +@@ -17,6 +17,14 @@ + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> ++ <ProjectConfiguration Include="Debug|ARM64"> ++ <Configuration>Debug</Configuration> ++ <Platform>ARM64</Platform> ++ </ProjectConfiguration> ++ <ProjectConfiguration Include="Release|ARM64"> ++ <Configuration>Release</Configuration> ++ <Platform>ARM64</Platform> ++ </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> +@@ -51,6 +55,17 @@ + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> ++ <ConfigurationType>Application</ConfigurationType> ++ <UseDebugLibraries>true</UseDebugLibraries> ++ <CharacterSet>MultiByte</CharacterSet> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> ++ <ConfigurationType>Application</ConfigurationType> ++ <UseDebugLibraries>false</UseDebugLibraries> ++ <WholeProgramOptimization>true</WholeProgramOptimization> ++ <CharacterSet>MultiByte</CharacterSet> ++ </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> +@@ -85,6 +95,12 @@ + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> +@@ -108,6 +121,16 @@ + <OutDir>$(SolutionDir)vs2015\build\</OutDir> + <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> + </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> ++ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> ++ <OutDir>$(SolutionDir)vs2015\build\</OutDir> ++ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> ++ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> ++ <OutDir>$(SolutionDir)vs2015\build\</OutDir> ++ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir> ++ </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'"> + <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> + <OutDir>$(SolutionDir)vs2015\build\</OutDir> +@@ -162,6 +180,29 @@ + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> ++ <ClCompile> ++ <WarningLevel>Level3</WarningLevel> ++ <Optimization>Disabled</Optimization> ++ <SDLCheck>true</SDLCheck> ++ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> ++ <ClCompile> ++ <WarningLevel>Level3</WarningLevel> ++ <Optimization>MaxSpeed</Optimization> ++ <FunctionLevelLinking>true</FunctionLevelLinking> ++ <IntrinsicFunctions>false</IntrinsicFunctions> ++ <SDLCheck>true</SDLCheck> ++ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ <Link> ++ <EnableCOMDATFolding>true</EnableCOMDATFolding> ++ <OptimizeReferences>true</OptimizeReferences> ++ <GenerateDebugInformation>true</GenerateDebugInformation> ++ </Link> ++ </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> +@@ -214,7 +247,7 @@ + <ClCompile Include="..\..\src\blake2\blake2b.c" /> + <ClCompile Include="..\..\src\core.c" /> + <ClCompile Include="..\..\src\encoding.c" /> +- <ClCompile Include="..\..\src\opt.c" /> ++ <ClCompile Include="..\..\src\ref.c" /> + <ClCompile Include="..\..\src\test.c" /> + <ClCompile Include="..\..\src\thread.c" /> + </ItemGroup> +@@ -222,7 +255,6 @@ + <ClInclude Include="..\..\include\argon2.h" /> + <ClInclude Include="..\..\src\blake2\blake2-impl.h" /> + <ClInclude Include="..\..\src\blake2\blake2.h" /> +- <ClInclude Include="..\..\src\blake2\blamka-round-opt.h" /> + <ClInclude Include="..\..\src\blake2\blamka-round-ref.h" /> + <ClInclude Include="..\..\src\core.h" /> + <ClInclude Include="..\..\src\encoding.h" /> +@@ -232,4 +264,4 @@ + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +-</Project> +\ No newline at end of file ++</Project> +Only in argon2/vs2015/Argon2OptTestCI: Argon2OptTestCI.vcxproj~ diff --git a/external/argon2/ExternalPackage_argon2.mk b/external/argon2/ExternalPackage_argon2.mk new file mode 100644 index 000000000000..6542d7925440 --- /dev/null +++ b/external/argon2/ExternalPackage_argon2.mk @@ -0,0 +1,18 @@ +# -*- 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_ExternalPackage_ExternalPackage,argon2,argon2)) + +$(eval $(call gb_ExternalPackage_use_external_project,argon2,argon2)) + +ifeq ($(COM),MSC) +$(eval $(call gb_ExternalPackage_add_file,argon2,$(LIBO_LIB_FOLDER)/Argon2OptDll.dll,vs2015/build/Argon2OptDll.dll)) +endif # $(COM) + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/ExternalProject_argon2.mk b/external/argon2/ExternalProject_argon2.mk new file mode 100644 index 000000000000..7e521096af22 --- /dev/null +++ b/external/argon2/ExternalProject_argon2.mk @@ -0,0 +1,54 @@ +# -*- 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_ExternalProject_ExternalProject,argon2)) + +$(eval $(call gb_ExternalProject_register_targets,argon2,\ + build \ +)) + +ifeq ($(COM),MSC) + +# .vcxproj needs manual SolutionDir to find header; there is a .sln file but it +# expects "x86" where we pass "Win32" + +$(call gb_ExternalProject_get_state_target,argon2,build): + $(call gb_Trace_StartRange,argon2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + MSBuild.exe vs2015/Argon2OptDll/Argon2OptDll.vcxproj \ + /p:SolutionDir="$(call gb_UnpackedTarball_get_dir,argon2)/" \ + $(gb_MSBUILD_CONFIG_AND_PLATFORM) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ + $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ + && MSBuild.exe vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj \ + /p:SolutionDir="$(call gb_UnpackedTarball_get_dir,argon2)/" \ + $(gb_MSBUILD_CONFIG_AND_PLATFORM) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ + $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ + $(if $(CROSS_COMPILING),,&& vs2015/build/Argon2OptTestCI.exe) \ + ) + $(call gb_Trace_EndRange,argon2,EXTERNAL) + +else # $(COM) + +# clear MAKEFILES because Makefile relies on built-in rules + +$(call gb_ExternalProject_get_state_target,argon2,build): + $(call gb_Trace_StartRange,argon2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + CFLAGS="$(CFLAGS) $(if $(filter-out WNT MACOSX,$(OS)),-fvisibility=hidden) -fPIC" \ + MAKEFLAGS= $(MAKE) \ + OPTTARGET=$(if $(filter X86_64,$(CPUNAME)),x86-64,forcefail) \ + $(if $(CROSS_COMPILING),,&& $(MAKE) test) \ + ) + $(call gb_Trace_EndRange,argon2,EXTERNAL) + +endif # $(COM) + +# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/Makefile b/external/argon2/Makefile index e4968cf85fb6..e4968cf85fb6 100644 --- a/external/apache-commons/Makefile +++ b/external/argon2/Makefile diff --git a/external/argon2/Module_argon2.mk b/external/argon2/Module_argon2.mk new file mode 100644 index 000000000000..5be66c0309bc --- /dev/null +++ b/external/argon2/Module_argon2.mk @@ -0,0 +1,18 @@ +# -*- 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_Module_Module,argon2)) + +$(eval $(call gb_Module_add_targets,argon2,\ + UnpackedTarball_argon2 \ + ExternalProject_argon2 \ + ExternalPackage_argon2 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/README b/external/argon2/README new file mode 100644 index 000000000000..e3198017e375 --- /dev/null +++ b/external/argon2/README @@ -0,0 +1,5 @@ +Argon2 password hashing function + +This is used in ODF encryption as key derivation function. + +[https://github.com/P-H-C/phc-winner-argon2] diff --git a/external/argon2/UnpackedTarball_argon2.mk b/external/argon2/UnpackedTarball_argon2.mk new file mode 100644 index 000000000000..c795a1562974 --- /dev/null +++ b/external/argon2/UnpackedTarball_argon2.mk @@ -0,0 +1,22 @@ +# -*- 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,argon2)) + +$(eval $(call gb_UnpackedTarball_set_tarball,argon2,$(ARGON2_TARBALL))) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,argon2,1)) + +$(eval $(call gb_UnpackedTarball_add_patches,argon2,\ + external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch \ + $(if $(filter WNT_AARCH64,$(OS)_$(CPUNAME)),external/argon2/0002-Add-WinARM64-vcxproj-config.patch) \ + external/argon2/private-symbols.patch.0 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/private-symbols.patch.0 b/external/argon2/private-symbols.patch.0 new file mode 100644 index 000000000000..5b4985e510af --- /dev/null +++ b/external/argon2/private-symbols.patch.0 @@ -0,0 +1,192 @@ +--- src/blake2/blake2.h ++++ src/blake2/blake2.h +@@ -67,15 +67,15 @@ + }; + + /* Streaming API */ +-ARGON2_LOCAL int blake2b_init(blake2b_state *S, size_t outlen); +-ARGON2_LOCAL int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key, ++ARGON2_LOCAL int argon2_blake2b_init(blake2b_state *S, size_t outlen); ++static int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key, + size_t keylen); +-ARGON2_LOCAL int blake2b_init_param(blake2b_state *S, const blake2b_param *P); +-ARGON2_LOCAL int blake2b_update(blake2b_state *S, const void *in, size_t inlen); +-ARGON2_LOCAL int blake2b_final(blake2b_state *S, void *out, size_t outlen); ++static int blake2b_init_param(blake2b_state *S, const blake2b_param *P); ++ARGON2_LOCAL int argon2_blake2b_update(blake2b_state *S, const void *in, size_t inlen); ++ARGON2_LOCAL int argon2_blake2b_final(blake2b_state *S, void *out, size_t outlen); + + /* Simple API */ +-ARGON2_LOCAL int blake2b(void *out, size_t outlen, const void *in, size_t inlen, ++static int blake2b(void *out, size_t outlen, const void *in, size_t inlen, + const void *key, size_t keylen); + + /* Argon2 Team - Begin Code */ +--- src/blake2/blake2b.c ++++ src/blake2/blake2b.c +@@ -88,7 +88,7 @@ + } + + /* Sequential blake2b initialization */ +-int blake2b_init(blake2b_state *S, size_t outlen) { ++int argon2_blake2b_init(blake2b_state *S, size_t outlen) { + blake2b_param P; + + if (S == NULL) { +@@ -156,7 +156,7 @@ + uint8_t block[BLAKE2B_BLOCKBYTES]; + memset(block, 0, BLAKE2B_BLOCKBYTES); + memcpy(block, key, keylen); +- blake2b_update(S, block, BLAKE2B_BLOCKBYTES); ++ argon2_blake2b_update(S, block, BLAKE2B_BLOCKBYTES); + /* Burn the key from stack */ + clear_internal_memory(block, BLAKE2B_BLOCKBYTES); + } +@@ -221,7 +221,7 @@ + #undef ROUND + } + +-int blake2b_update(blake2b_state *S, const void *in, size_t inlen) { ++int argon2_blake2b_update(blake2b_state *S, const void *in, size_t inlen) { + const uint8_t *pin = (const uint8_t *)in; + + if (inlen == 0) { +@@ -261,7 +261,7 @@ + return 0; + } + +-int blake2b_final(blake2b_state *S, void *out, size_t outlen) { ++int argon2_blake2b_final(blake2b_state *S, void *out, size_t outlen) { + uint8_t buffer[BLAKE2B_OUTBYTES] = {0}; + unsigned int i; + +@@ -314,15 +314,15 @@ + goto fail; + } + } else { +- if (blake2b_init(&S, outlen) < 0) { ++ if (argon2_blake2b_init(&S, outlen) < 0) { + goto fail; + } + } + +- if (blake2b_update(&S, in, inlen) < 0) { ++ if (argon2_blake2b_update(&S, in, inlen) < 0) { + goto fail; + } +- ret = blake2b_final(&S, out, outlen); ++ ret = argon2_blake2b_final(&S, out, outlen); + + fail: + clear_internal_memory(&S, sizeof(S)); +@@ -352,18 +352,18 @@ + } while ((void)0, 0) + + if (outlen <= BLAKE2B_OUTBYTES) { +- TRY(blake2b_init(&blake_state, outlen)); +- TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes))); +- TRY(blake2b_update(&blake_state, in, inlen)); +- TRY(blake2b_final(&blake_state, out, outlen)); ++ TRY(argon2_blake2b_init(&blake_state, outlen)); ++ TRY(argon2_blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes))); ++ TRY(argon2_blake2b_update(&blake_state, in, inlen)); ++ TRY(argon2_blake2b_final(&blake_state, out, outlen)); + } else { + uint32_t toproduce; + uint8_t out_buffer[BLAKE2B_OUTBYTES]; + uint8_t in_buffer[BLAKE2B_OUTBYTES]; +- TRY(blake2b_init(&blake_state, BLAKE2B_OUTBYTES)); +- TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes))); +- TRY(blake2b_update(&blake_state, in, inlen)); +- TRY(blake2b_final(&blake_state, out_buffer, BLAKE2B_OUTBYTES)); ++ TRY(argon2_blake2b_init(&blake_state, BLAKE2B_OUTBYTES)); ++ TRY(argon2_blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes))); ++ TRY(argon2_blake2b_update(&blake_state, in, inlen)); ++ TRY(argon2_blake2b_final(&blake_state, out_buffer, BLAKE2B_OUTBYTES)); + memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2); + out += BLAKE2B_OUTBYTES / 2; + toproduce = (uint32_t)outlen - BLAKE2B_OUTBYTES / 2; +--- src/core.c ++++ src/core.c +@@ -544,31 +544,31 @@ + return; + } + +- blake2b_init(&BlakeHash, ARGON2_PREHASH_DIGEST_LENGTH); ++ argon2_blake2b_init(&BlakeHash, ARGON2_PREHASH_DIGEST_LENGTH); + + store32(&value, context->lanes); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + store32(&value, context->outlen); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + store32(&value, context->m_cost); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + store32(&value, context->t_cost); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + store32(&value, context->version); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + store32(&value, (uint32_t)type); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + store32(&value, context->pwdlen); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + if (context->pwd != NULL) { +- blake2b_update(&BlakeHash, (const uint8_t *)context->pwd, ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)context->pwd, + context->pwdlen); + + if (context->flags & ARGON2_FLAG_CLEAR_PASSWORD) { +@@ -578,18 +578,18 @@ + } + + store32(&value, context->saltlen); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + if (context->salt != NULL) { +- blake2b_update(&BlakeHash, (const uint8_t *)context->salt, ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)context->salt, + context->saltlen); + } + + store32(&value, context->secretlen); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + if (context->secret != NULL) { +- blake2b_update(&BlakeHash, (const uint8_t *)context->secret, ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)context->secret, + context->secretlen); + + if (context->flags & ARGON2_FLAG_CLEAR_SECRET) { +@@ -599,14 +599,14 @@ + } + + store32(&value, context->adlen); +- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); + + if (context->ad != NULL) { +- blake2b_update(&BlakeHash, (const uint8_t *)context->ad, ++ argon2_blake2b_update(&BlakeHash, (const uint8_t *)context->ad, + context->adlen); + } + +- blake2b_final(&BlakeHash, blockhash, ARGON2_PREHASH_DIGEST_LENGTH); ++ argon2_blake2b_final(&BlakeHash, blockhash, ARGON2_PREHASH_DIGEST_LENGTH); + } + + int initialize(argon2_instance_t *instance, argon2_context *context) { diff --git a/external/beanshell/ExternalProject_beanshell.mk b/external/beanshell/ExternalProject_beanshell.mk index 450ac2b706dd..604b3571fe44 100644 --- a/external/beanshell/ExternalProject_beanshell.mk +++ b/external/beanshell/ExternalProject_beanshell.mk @@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,beanshell,\ $(call gb_ExternalProject_get_state_target,beanshell,build) : $(call gb_Trace_StartRange,beanshell,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/boost/0001-Fix-usage-of-deprecated-Boost.Bind-features.patch.2 b/external/boost/0001-Fix-usage-of-deprecated-Boost.Bind-features.patch.2 deleted file mode 100644 index 583a9d905214..000000000000 --- a/external/boost/0001-Fix-usage-of-deprecated-Boost.Bind-features.patch.2 +++ /dev/null @@ -1,48 +0,0 @@ -From d1c8825a45a0717e1ad79583d3283b0e5e32831e Mon Sep 17 00:00:00 2001 -From: Andrey Semashev <Lastique@users.noreply.github.com> -Date: Tue, 28 Apr 2020 22:03:04 +0300 -Subject: [PATCH] Fix usage of deprecated Boost.Bind features - -This fixes deprecation warnings generated by boost/bind.hpp. - -Also, use a more actual include path for ref.hpp. ---- - include/boost/property_tree/json_parser/detail/parser.hpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/include/boost/property_tree/json_parser/detail/parser.hpp b/include/boost/property_tree/json_parser/detail/parser.hpp -index 5554990..6cf6363 100644 ---- a/include/boost/property_tree/json_parser/detail/parser.hpp -+++ b/include/boost/property_tree/json_parser/detail/parser.hpp -@@ -3,8 +3,8 @@ - - #include <boost/property_tree/json_parser/error.hpp> - --#include <boost/ref.hpp> --#include <boost/bind.hpp> -+#include <boost/core/ref.hpp> -+#include <boost/bind/bind.hpp> - #include <boost/format.hpp> - - #include <iterator> -@@ -214,7 +214,7 @@ namespace boost { namespace property_tree { - void process_codepoint(Sentinel end, EncodingErrorFn error_fn) { - encoding.transcode_codepoint(cur, end, - boost::bind(&Callbacks::on_code_unit, -- boost::ref(callbacks), _1), -+ boost::ref(callbacks), boost::placeholders::_1), - error_fn); - } - -@@ -517,7 +517,7 @@ namespace boost { namespace property_tree { - void feed(unsigned codepoint) { - encoding.feed_codepoint(codepoint, - boost::bind(&Callbacks::on_code_unit, -- boost::ref(callbacks), _1)); -+ boost::ref(callbacks), boost::placeholders::_1)); - } - - Callbacks& callbacks; --- -2.29.2 - diff --git a/external/boost/StaticLibrary_boost_date_time.mk b/external/boost/StaticLibrary_boost_date_time.mk index 2045243590e5..9e92272fa2f8 100644 --- a/external/boost/StaticLibrary_boost_date_time.mk +++ b/external/boost/StaticLibrary_boost_date_time.mk @@ -18,13 +18,6 @@ $(eval $(call gb_StaticLibrary_add_defs,boost_date_time,\ -DBOOST_ALL_NO_LIB \ )) -# Needed when building against MSVC in C++17 mode, as -# workdir/UnpackedTarball/boost/boost/numeric/conversion/detail/converter.hpp uses -# std::unary_function: -$(eval $(call gb_StaticLibrary_add_defs,boost_date_time, \ - -D_HAS_AUTO_PTR_ETC=1 \ -)) - $(eval $(call gb_StaticLibrary_use_external,boost_date_time,boost_headers)) $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boost_date_time,cpp)) diff --git a/external/boost/StaticLibrary_boost_filesystem.mk b/external/boost/StaticLibrary_boost_filesystem.mk index 483e0a79b6ca..000827e78243 100644 --- a/external/boost/StaticLibrary_boost_filesystem.mk +++ b/external/boost/StaticLibrary_boost_filesystem.mk @@ -16,8 +16,14 @@ $(eval $(call gb_StaticLibrary_set_warnings_disabled,boost_filesystem)) # disable "auto link" "feature" on MSVC $(eval $(call gb_StaticLibrary_add_defs,boost_filesystem,\ -DBOOST_ALL_NO_LIB \ + $(if $(filter-out MACOSX WNT,$(OS)),-DBOOST_FILESYSTEM_HAS_POSIX_AT_APIS) \ )) +# See workdir/UnpackedTarball/boost/libs/filesystem/build/Jamfile.v2: +ifeq ($(HAVE_CXX20_ATOMIC_REF),) +$(eval $(call gb_StaticLibrary_add_defs,boost_filesystem,-DBOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF)) +endif + $(eval $(call gb_StaticLibrary_use_external,boost_filesystem,boost_headers)) $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boost_filesystem,cpp)) diff --git a/external/boost/StaticLibrary_boost_locale.mk b/external/boost/StaticLibrary_boost_locale.mk index 5481097728bd..1193867a6d0e 100644 --- a/external/boost/StaticLibrary_boost_locale.mk +++ b/external/boost/StaticLibrary_boost_locale.mk @@ -18,11 +18,9 @@ $(eval $(call gb_StaticLibrary_add_defs,boost_locale,\ -DBOOST_ALL_NO_LIB -DBOOST_LOCALE_NO_WINAPI_BACKEND -DBOOST_LOCALE_NO_POSIX_BACKEND -DBOOST_USE_WINDOWS_H \ )) -# Needed when building against MSVC resp. libc++ in C++17 mode, as Boost 1.65.1 -# workdir/UnpackedTarball/boost/boost/locale/generator.hpp contains "std::auto_ptr<data> d;": -$(eval $(call gb_StaticLibrary_add_defs,boost_locale, \ - -D_HAS_AUTO_PTR_ETC=1 \ - -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR \ +$(eval $(call gb_StaticLibrary_set_include,boost_locale, \ + -I$(call gb_UnpackedTarball_get_dir,boost)/libs/locale/src \ + $$(INCLUDE) \ )) $(eval $(call gb_StaticLibrary_use_external,boost_locale,boost_headers)) @@ -30,35 +28,36 @@ $(eval $(call gb_StaticLibrary_use_external,boost_locale,boost_headers)) $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boost_locale,cpp)) $(eval $(call gb_StaticLibrary_add_generated_exception_objects,boost_locale,\ - UnpackedTarball/boost/libs/locale/src/encoding/codepage \ - UnpackedTarball/boost/libs/locale/src/shared/date_time \ - UnpackedTarball/boost/libs/locale/src/shared/format \ - UnpackedTarball/boost/libs/locale/src/shared/formatting \ - UnpackedTarball/boost/libs/locale/src/shared/generator \ - UnpackedTarball/boost/libs/locale/src/shared/ids \ - UnpackedTarball/boost/libs/locale/src/shared/localization_backend \ - UnpackedTarball/boost/libs/locale/src/shared/message \ - UnpackedTarball/boost/libs/locale/src/shared/mo_lambda \ - UnpackedTarball/boost/libs/locale/src/std/codecvt \ - UnpackedTarball/boost/libs/locale/src/std/collate \ - UnpackedTarball/boost/libs/locale/src/std/converter \ - UnpackedTarball/boost/libs/locale/src/std/numeric \ - UnpackedTarball/boost/libs/locale/src/std/std_backend \ - UnpackedTarball/boost/libs/locale/src/util/codecvt_converter \ - UnpackedTarball/boost/libs/locale/src/util/default_locale \ - UnpackedTarball/boost/libs/locale/src/util/gregorian \ - UnpackedTarball/boost/libs/locale/src/util/info \ - UnpackedTarball/boost/libs/locale/src/util/locale_data \ + UnpackedTarball/boost/libs/locale/src/boost/locale/encoding/codepage \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/date_time \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/format \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/formatting \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/generator \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/ids \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/localization_backend \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/message \ + UnpackedTarball/boost/libs/locale/src/boost/locale/shared/mo_lambda \ + UnpackedTarball/boost/libs/locale/src/boost/locale/std/codecvt \ + UnpackedTarball/boost/libs/locale/src/boost/locale/std/collate \ + UnpackedTarball/boost/libs/locale/src/boost/locale/std/converter \ + UnpackedTarball/boost/libs/locale/src/boost/locale/std/numeric \ + UnpackedTarball/boost/libs/locale/src/boost/locale/std/std_backend \ + UnpackedTarball/boost/libs/locale/src/boost/locale/util/codecvt_converter \ + UnpackedTarball/boost/libs/locale/src/boost/locale/util/default_locale \ + UnpackedTarball/boost/libs/locale/src/boost/locale/util/encoding \ + UnpackedTarball/boost/libs/locale/src/boost/locale/util/gregorian \ + UnpackedTarball/boost/libs/locale/src/boost/locale/util/info \ + UnpackedTarball/boost/libs/locale/src/boost/locale/util/locale_data \ )) ifeq ($(OS),WNT) $(eval $(call gb_StaticLibrary_add_generated_exception_objects,boost_locale,\ - UnpackedTarball/boost/libs/locale/src/win32/collate \ - UnpackedTarball/boost/libs/locale/src/win32/converter \ - UnpackedTarball/boost/libs/locale/src/win32/lcid \ - UnpackedTarball/boost/libs/locale/src/win32/numeric \ - UnpackedTarball/boost/libs/locale/src/win32/win_backend \ + UnpackedTarball/boost/libs/locale/src/boost/locale/win32/collate \ + UnpackedTarball/boost/libs/locale/src/boost/locale/win32/converter \ + UnpackedTarball/boost/libs/locale/src/boost/locale/win32/lcid \ + UnpackedTarball/boost/libs/locale/src/boost/locale/win32/numeric \ + UnpackedTarball/boost/libs/locale/src/boost/locale/win32/win_backend \ )) endif diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk index bdacdcd9856e..1d555de9861e 100644 --- a/external/boost/UnpackedTarball_boost.mk +++ b/external/boost/UnpackedTarball_boost.mk @@ -12,31 +12,27 @@ boost_patches := #https://svn.boost.org/trac/boost/ticket/6142 boost_patches += boost.6142.warnings.patch.1 -# https://svn.boost.org/trac/boost/ticket/9903 -boost_patches += boost.utility.Wundef.warnings.patch - boost_patches += boost.noiconv.patch +boost_patches += boost.between.warning.patch +boost_patches += boost.fallback.encoding.patch boost_patches += rtti.patch.0 # https://svn.boost.org/trac/boost/ticket/11505 boost_patches += boost_1_59_0.mpl.config.wundef.patch -# https://svn.boost.org/trac/boost/ticket/11501 -boost_patches += boost_1_59_0.property_tree.wreturn-type.patch boost_patches += clang-cl.patch.0 -boost_patches += boost_1_60_0.undef.warning.patch boost_patches += boost_1_63_0.undef.warning.patch.1 - -boost_patches += boost-android-unified.patch.1 - boost_patches += windows-no-utf8-locales.patch.0 boost_patches += msvc2017.patch.0 -# Included in boost-1.76.0: -boost_patches += 0001-Fix-usage-of-deprecated-Boost.Bind-features.patch.2 +boost_patches += boost-ios.patch.0 + +boost_patches += boost.file_iterator.sharing_win.patch + +boost_patches += Wundef.patch.0 $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost)) @@ -46,6 +42,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,boost,3)) $(eval $(call gb_UnpackedTarball_add_patches,boost,\ $(foreach patch,$(boost_patches),external/boost/$(patch)) \ + external/boost/boost-emscripten-nowasm.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/boost/Wundef.patch.0 b/external/boost/Wundef.patch.0 new file mode 100644 index 000000000000..8cb546464373 --- /dev/null +++ b/external/boost/Wundef.patch.0 @@ -0,0 +1,33 @@ +--- boost/config/workaround.hpp ++++ boost/config/workaround.hpp +@@ -264,6 +264,10 @@ + #else + #define BOOST_CLANG_VERSION_WORKAROUND_GUARD 0 + #endif ++ ++#if !defined BOOST_LIBSTDCXX_VERSION_WORKAROUND_GUARD ++#define BOOST_LIBSTDCXX_VERSION_WORKAROUND_GUARD 0 ++#endif + + // Always define to zero, if it's used it'll be defined my MPL: + #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 +--- boost/locale/detail/facet_id.hpp ++++ boost/locale/detail/facet_id.hpp +@@ -12,7 +12,7 @@ + + /// \cond INTERNAL + namespace boost { namespace locale { namespace detail { +-#if BOOST_CLANG_VERSION >= 40900 ++#if defined BOOST_CLANG_VERSION && BOOST_CLANG_VERSION >= 40900 + # pragma clang diagnostic push + # pragma clang diagnostic ignored "-Wundefined-var-template" + #endif +@@ -25,7 +25,7 @@ + struct BOOST_LOCALE_DECL facet_id { + static std::locale::id id; + }; +-#if BOOST_CLANG_VERSION >= 40900 ++#if defined BOOST_CLANG_VERSION && BOOST_CLANG_VERSION >= 40900 + # pragma clang diagnostic pop + #endif + }}} // namespace boost::locale::detail diff --git a/external/boost/boost-android-unified.patch.1 b/external/boost/boost-android-unified.patch.1 deleted file mode 100644 index 6488bf619e2b..000000000000 --- a/external/boost/boost-android-unified.patch.1 +++ /dev/null @@ -1,22 +0,0 @@ ---- a/boost/type_traits/detail/is_function_cxx_11.hpp -+++ b/boost/type_traits/detail/is_function_cxx_11.hpp -@@ -18,7 +18,7 @@ - template <class T> - struct is_function : public false_type {}; - --#if defined(__cpp_noexcept_function_type) && !defined(BOOST_TT_NO_DEDUCED_NOEXCEPT_PARAM) -+#if defined(__cpp_noexcept_function_type) && !defined(BOOST_TT_NO_DEDUCED_NOEXCEPT_PARAM) && !(defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080) - #define BOOST_TT_NOEXCEPT_PARAM , bool NE - #define BOOST_TT_NOEXCEPT_DECL noexcept(NE) - #else ---- a/boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp -+++ b/boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp -@@ -31,7 +31,7 @@ - template <class T> - struct is_member_function_pointer<T const volatile> : public is_member_function_pointer<T> {}; - --#if defined(BOOST_TT_NO_DEDUCED_NOEXCEPT_PARAM) -+#if defined(BOOST_TT_NO_DEDUCED_NOEXCEPT_PARAM) || (defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080) - // MSVC can't handle noexcept(b) as a deduced template parameter - // so we will have to write everything out :( - #define BOOST_TT_NOEXCEPT_PARAM diff --git a/external/boost/boost-emscripten-nowasm.patch.0 b/external/boost/boost-emscripten-nowasm.patch.0 new file mode 100644 index 000000000000..39723351e380 --- /dev/null +++ b/external/boost/boost-emscripten-nowasm.patch.0 @@ -0,0 +1,11 @@ +--- boost/config/detail/select_platform_config.hpp.orig 2021-11-13 18:32:09.446182220 +0100 ++++ boost/config/detail/select_platform_config.hpp 2021-11-13 18:32:57.734041110 +0100 +@@ -89,7 +89,7 @@ + // Nuxi CloudABI: + # define BOOST_PLATFORM_CONFIG "boost/config/platform/cloudabi.hpp" + +-#elif defined (__wasm__) ++#elif defined (__wasm__) && !defined (__EMSCRIPTEN__) + // Web assembly: + # define BOOST_PLATFORM_CONFIG "boost/config/platform/wasm.hpp" + diff --git a/external/boost/boost-ios.patch.0 b/external/boost/boost-ios.patch.0 new file mode 100644 index 000000000000..9457bf8c71d1 --- /dev/null +++ b/external/boost/boost-ios.patch.0 @@ -0,0 +1,27 @@ +# -*- Mode: Diff -*- +--- libs/filesystem/src/operations.cpp ++++ libs/filesystem/src/operations.cpp +@@ -492,7 +492,11 @@ + int err = invoke_statx(basedir_fd, p.c_str(), AT_NO_AUTOMOUNT, STATX_TYPE | STATX_MODE, &path_stat); + #elif defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS) + struct ::stat path_stat; ++#ifdef AT_NO_AUTOMOUNT + int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, AT_NO_AUTOMOUNT); ++#else ++ int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, 0); ++#endif + #else + struct ::stat path_stat; + int err = ::stat(p.c_str(), &path_stat); +@@ -553,7 +553,11 @@ + int err = invoke_statx(basedir_fd, p.c_str(), AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT, STATX_TYPE | STATX_MODE, &path_stat); + #elif defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS) + struct ::stat path_stat; ++#ifdef AT_NO_AUTOMOUNT + int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT); ++#else ++ int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, AT_SYMLINK_NOFOLLOW); ++#endif + #else + struct ::stat path_stat; + int err = ::lstat(p.c_str(), &path_stat); diff --git a/external/boost/boost.between.warning.patch b/external/boost/boost.between.warning.patch new file mode 100644 index 000000000000..d000e261d7d6 --- /dev/null +++ b/external/boost/boost.between.warning.patch @@ -0,0 +1,13 @@ +diff -ru boost.orig/boost/libs/locale/src/encoding/codepage.cpp boost/boost/libs/locale/src/encoding/codepage.cpp +--- foo/misc/boost.orig/libs/locale/src/encoding/codepage.cpp ++++ foo/misc/boost/libs/locale/src/boost/locale/encoding/codepage.cpp +@@ -52,6 +52,9 @@ + } + #endif + #endif ++ // ensures we get a sensible warning in boost's gettext results about a real mismatch. ++ if (to_charset == from_charset) ++ return std::string(begin, end - begin); + throw invalid_charset_error(std::string(to_charset) + " or " + from_charset); + } + diff --git a/external/boost/boost.fallback.encoding.patch b/external/boost/boost.fallback.encoding.patch new file mode 100644 index 000000000000..8aa5ed6d1276 --- /dev/null +++ b/external/boost/boost.fallback.encoding.patch @@ -0,0 +1,11 @@ +--- foo/misc/boost.orig/libs/locale/src/util/locale_data.cpp.new 2022-02-17 22:41:27.730549039 +0000 ++++ foo/misc/boost/libs/locale/src/boost/locale/util/locale_data.cpp +@@ -50,6 +50,8 @@ + bool locale_data::parse(const std::string& locale_name) + { + reset(); ++ encoding_ = "UTF-8"; ++ utf8_ = true; + return parse_from_lang(locale_name); + } + diff --git a/external/boost/boost.file_iterator.sharing_win.patch b/external/boost/boost.file_iterator.sharing_win.patch new file mode 100644 index 000000000000..b3b8bea3f3ff --- /dev/null +++ b/external/boost/boost.file_iterator.sharing_win.patch @@ -0,0 +1,158 @@ +--- foo/misc/boost/boost/spirit/home/classic/iterator/impl/file_iterator.ipp.orig ++++ foo/misc/boost/boost/spirit/home/classic/iterator/impl/file_iterator.ipp +@@ -181,67 +181,28 @@ public: + {} + + explicit mmap_file_iterator(std::string const& fileName) +- : m_filesize(0), m_curChar(0) +- { +- HANDLE hFile = ::CreateFileA( ++ : mmap_file_iterator(::CreateFileA( + fileName.c_str(), + GENERIC_READ, +- FILE_SHARE_READ, ++ FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_FLAG_SEQUENTIAL_SCAN, + NULL +- ); +- +- if (hFile == INVALID_HANDLE_VALUE) +- return; +- +- // Store the size of the file, it's used to construct +- // the end iterator +- m_filesize = ::GetFileSize(hFile, NULL); ++ )) ++ {} + +- HANDLE hMap = ::CreateFileMapping( +- hFile, ++ explicit mmap_file_iterator(std::wstring const& fileName) ++ : mmap_file_iterator(::CreateFileW( ++ fileName.c_str(), ++ GENERIC_READ, ++ FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, +- PAGE_READONLY, +- 0, 0, ++ OPEN_EXISTING, ++ FILE_FLAG_SEQUENTIAL_SCAN, + NULL +- ); +- +- if (hMap == NULL) +- { +- ::CloseHandle(hFile); +- return; +- } +- +- LPVOID pMem = ::MapViewOfFile( +- hMap, +- FILE_MAP_READ, +- 0, 0, 0 +- ); +- +- if (pMem == NULL) +- { +- ::CloseHandle(hMap); +- ::CloseHandle(hFile); +- return; +- } +- +- // We hold both the file handle and the memory pointer. +- // We can close the hMap handle now because Windows holds internally +- // a reference to it since there is a view mapped. +- ::CloseHandle(hMap); +- +- // It seems like we can close the file handle as well (because +- // a reference is hold by the filemap object). +- ::CloseHandle(hFile); +- +- // Store the handles inside the shared_ptr (with the custom destructors) +- m_mem.reset(static_cast<CharT*>(pMem), ::UnmapViewOfFile); +- +- // Start of the file +- m_curChar = m_mem.get(); +- } ++ )) ++ {} + + mmap_file_iterator(const mmap_file_iterator& iter) + { *this = iter; } +@@ -290,6 +251,59 @@ private: + boost::shared_ptr<CharT> m_mem; + std::size_t m_filesize; + CharT* m_curChar; ++ ++ explicit mmap_file_iterator(HANDLE hFile) ++ : m_filesize(0), m_curChar(0) ++ { ++ if (hFile == INVALID_HANDLE_VALUE) ++ return; ++ ++ // Store the size of the file, it's used to construct ++ // the end iterator ++ m_filesize = ::GetFileSize(hFile, NULL); ++ ++ HANDLE hMap = ::CreateFileMapping( ++ hFile, ++ NULL, ++ PAGE_READONLY, ++ 0, 0, ++ NULL ++ ); ++ ++ if (hMap == NULL) ++ { ++ ::CloseHandle(hFile); ++ return; ++ } ++ ++ LPVOID pMem = ::MapViewOfFile( ++ hMap, ++ FILE_MAP_READ, ++ 0, 0, 0 ++ ); ++ ++ if (pMem == NULL) ++ { ++ ::CloseHandle(hMap); ++ ::CloseHandle(hFile); ++ return; ++ } ++ ++ // We hold both the file handle and the memory pointer. ++ // We can close the hMap handle now because Windows holds internally ++ // a reference to it since there is a view mapped. ++ ::CloseHandle(hMap); ++ ++ // It seems like we can close the file handle as well (because ++ // a reference is hold by the filemap object). ++ ::CloseHandle(hFile); ++ ++ // Store the handles inside the shared_ptr (with the custom destructors) ++ m_mem.reset(static_cast<CharT*>(pMem), ::UnmapViewOfFile); ++ ++ // Start of the file ++ m_curChar = m_mem.get(); ++ } + }; + + #endif // BOOST_SPIRIT_FILEITERATOR_WINDOWS +--- foo/misc/boost/boost/spirit/home/classic/iterator/file_iterator.hpp.orig ++++ foo/misc/boost/boost/spirit/home/classic/iterator/file_iterator.hpp +@@ -170,6 +170,12 @@ public: + : base_t(adapted_t(fileName)) + {} + ++#ifdef BOOST_SPIRIT_FILEITERATOR_WINDOWS ++ file_iterator(std::wstring const& fileName) ++ : base_t(adapted_t(fileName)) ++ {} ++#endif ++ + file_iterator(const base_t& iter) + : base_t(iter) + {} diff --git a/external/boost/boost.noiconv.patch b/external/boost/boost.noiconv.patch index 1bce0414d4ba..12e5d2059cea 100644 --- a/external/boost/boost.noiconv.patch +++ b/external/boost/boost.noiconv.patch @@ -1,51 +1,51 @@ diff -ru boost.orig/boost/libs/locale/src/encoding/codepage.cpp boost/boost/libs/locale/src/encoding/codepage.cpp --- foo/misc/boost.orig/libs/locale/src/encoding/codepage.cpp -+++ foo/misc/boost/libs/locale/src/encoding/codepage.cpp -@@ -39,6 +39,7 @@ - char const *from_charset, - method_type how) - { -+ #if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV) - hold_ptr<converter_between> cvt; - #ifdef BOOST_LOCALE_WITH_ICONV - cvt.reset(new iconv_between()); -@@ -55,6 +56,7 @@ - if(cvt->open(to_charset,from_charset,how)) - return cvt->convert(begin,end); - #endif -+ #endif - throw invalid_charset_error(std::string(to_charset) + " or " + from_charset); - } ++++ foo/misc/boost/libs/locale/src/boost/locale/encoding/codepage.cpp +@@ -29,6 +29,7 @@ + const std::string& from_charset, + method_type how) + { ++#if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV) + #ifdef BOOST_LOCALE_WITH_ICONV + { + impl::iconv_between cvt; +@@ -50,6 +51,7 @@ + return cvt.convert(begin, end); + } + #endif ++#endif + throw invalid_charset_error(std::string(to_charset) + " or " + from_charset); + } -@@ -65,6 +67,7 @@ - char const *charset, - method_type how) - { -+ #if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV) - hold_ptr<converter_to_utf<CharType> > cvt; - #ifdef BOOST_LOCALE_WITH_ICONV - cvt.reset(new iconv_to_utf<CharType>()); -@@ -81,6 +84,7 @@ - if(cvt->open(charset,how)) - return cvt->convert(begin,end); - #endif -+ #endif - throw invalid_charset_error(charset); - } +@@ -56,6 +58,7 @@ + template<typename CharType> + std::basic_string<CharType> to_utf(const char* begin, const char* end, const std::string& charset, method_type how) + { ++#if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV) + #ifdef BOOST_LOCALE_WITH_ICONV + { + impl::iconv_to_utf<CharType> cvt; +@@ -77,6 +80,7 @@ + return cvt.convert(begin, end); + } + #endif ++#endif + throw invalid_charset_error(charset); + } -@@ -91,6 +95,7 @@ - char const *charset, - method_type how) - { -+ #if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV) - hold_ptr<converter_from_utf<CharType> > cvt; - #ifdef BOOST_LOCALE_WITH_ICONV - cvt.reset(new iconv_from_utf<CharType>()); -@@ -107,6 +112,7 @@ - if(cvt->open(charset,how)) - return cvt->convert(begin,end); - #endif -+ #endif - throw invalid_charset_error(charset); - } +@@ -83,6 +87,7 @@ + template<typename CharType> + std::string from_utf(const CharType* begin, const CharType* end, const std::string& charset, method_type how) + { ++#if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV) + #ifdef BOOST_LOCALE_WITH_ICONV + { + impl::iconv_from_utf<CharType> cvt; +@@ -104,6 +109,7 @@ + return cvt.convert(begin, end); + } + #endif ++#endif + throw invalid_charset_error(charset); + } diff --git a/external/boost/boost.utility.Wundef.warnings.patch b/external/boost/boost.utility.Wundef.warnings.patch deleted file mode 100644 index 034709e26033..000000000000 --- a/external/boost/boost.utility.Wundef.warnings.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- foo/foo/foo/boost/utility/result_of.hpp -+++ foo/foo/foo/boost/utility/result_of.hpp -@@ -72,7 +72,7 @@ - // There doesn't seem to be any other way to turn this off such that the presence of - // the user-defined operator,() below doesn't cause spurious warning all over the place, - // so unconditionally turn it off. --#if BOOST_MSVC -+#if defined(BOOST_MSVC) && BOOST_MSVC - # pragma warning(disable: 4913) // user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used - #endif - diff --git a/external/boost/boost_1_59_0.property_tree.wreturn-type.patch b/external/boost/boost_1_59_0.property_tree.wreturn-type.patch deleted file mode 100644 index 1673e4bd8669..000000000000 --- a/external/boost/boost_1_59_0.property_tree.wreturn-type.patch +++ /dev/null @@ -1,14 +0,0 @@ -aka MSVC warning C4715: not all control paths return a value - -diff -ru boost.org/boost/property_tree/json_parser/detail/standard_callbacks.hpp boost/boost/property_tree/json_parser/detail/standard_callbacks.hpp ---- foo/misc/boost.org/boost/property_tree/json_parser/detail/standard_callbacks.hpp 2015-07-07 14:20:48.000000000 +0200 -+++ foo/misc/boost/boost/property_tree/json_parser/detail/standard_callbacks.hpp 2015-07-22 08:35:07.764263463 +0200 -@@ -128,7 +128,7 @@ - } - case object: - default: -- BOOST_ASSERT(false); // must start with string, i.e. call new_value -+ std::abort(); - case key: { - l.t->push_back(std::make_pair(key_buffer, Ptree())); - l.k = object; diff --git a/external/boost/boost_1_60_0.undef.warning.patch b/external/boost/boost_1_60_0.undef.warning.patch deleted file mode 100644 index 1e72d4e17a90..000000000000 --- a/external/boost/boost_1_60_0.undef.warning.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/b/boost/boost/config/workaround.hpp -+++ a/b/boost/boost/config/workaround.hpp -@@ -237,6 +237,13 @@ - #else - #define BOOST_INTEL_WORKAROUND_GUARD 0 - #endif -+ -+#ifndef __clang_major__ -+#define __clang_major___WORKAROUND_GUARD 1 -+#else -+#define __clang_major___WORKAROUND_GUARD 0 -+#endif -+ - // Always define to zero, if it's used it'll be defined my MPL: - #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 - diff --git a/external/boost/boost_1_63_0.undef.warning.patch.1 b/external/boost/boost_1_63_0.undef.warning.patch.1 index 2773138e2765..cdf0d820e203 100644 --- a/external/boost/boost_1_63_0.undef.warning.patch.1 +++ b/external/boost/boost_1_63_0.undef.warning.patch.1 @@ -2,11 +2,11 @@ diff -up boost/boost/math/special_functions/fpclassify.hpp.dt boost/boost/math/s --- boost/boost/math/special_functions/fpclassify.hpp.dt 2017-02-03 07:59:18.805415876 +0100 +++ boost/boost/math/special_functions/fpclassify.hpp 2017-02-03 08:00:45.046494362 +0100 @@ -134,7 +134,7 @@ inline bool is_nan_helper(T, const boost - inline bool is_nan_helper(__float128 f, const boost::true_type&) { return ::isnanq(f); } - inline bool is_nan_helper(__float128 f, const boost::false_type&) { return ::isnanq(f); } + inline bool is_nan_helper(__float128 f, const std::true_type&) { return ::isnanq(f); } + inline bool is_nan_helper(__float128 f, const std::false_type&) { return ::isnanq(f); } #elif defined(BOOST_GNU_STDLIB) && BOOST_GNU_STDLIB && \ - _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC + _GLIBCXX_USE_C99_MATH && (!defined(_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) || !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) - inline bool is_nan_helper(__float128 f, const boost::true_type&) { return std::isnan(static_cast<double>(f)); } - inline bool is_nan_helper(__float128 f, const boost::false_type&) { return std::isnan(static_cast<double>(f)); } + inline bool is_nan_helper(__float128 f, const std::true_type&) { return std::isnan(static_cast<double>(f)); } + inline bool is_nan_helper(__float128 f, const std::false_type&) { return std::isnan(static_cast<double>(f)); } #else diff --git a/external/boost/include/boost/algorithm/string.hpp b/external/boost/include/boost/algorithm/string.hpp index da77bb9a1192..791fdb2309c3 100644 --- a/external/boost/include/boost/algorithm/string.hpp +++ b/external/boost/include/boost/algorithm/string.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/algorithm/string/classification.hpp b/external/boost/include/boost/algorithm/string/classification.hpp new file mode 100644 index 000000000000..89b311109938 --- /dev/null +++ b/external/boost/include/boost/algorithm/string/classification.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/algorithm/string/classification.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/algorithm/string/join.hpp b/external/boost/include/boost/algorithm/string/join.hpp new file mode 100644 index 000000000000..4bf26b211d3f --- /dev/null +++ b/external/boost/include/boost/algorithm/string/join.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/algorithm/string/join.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/algorithm/string/predicate.hpp b/external/boost/include/boost/algorithm/string/predicate.hpp index b650c15d0f18..d67e07cf935d 100644 --- a/external/boost/include/boost/algorithm/string/predicate.hpp +++ b/external/boost/include/boost/algorithm/string/predicate.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/algorithm/string/replace.hpp b/external/boost/include/boost/algorithm/string/replace.hpp new file mode 100644 index 000000000000..5a8e0052a80b --- /dev/null +++ b/external/boost/include/boost/algorithm/string/replace.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/algorithm/string/replace.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/algorithm/string/split.hpp b/external/boost/include/boost/algorithm/string/split.hpp new file mode 100644 index 000000000000..687fae94864a --- /dev/null +++ b/external/boost/include/boost/algorithm/string/split.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/algorithm/string/split.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/algorithm/string/trim.hpp b/external/boost/include/boost/algorithm/string/trim.hpp new file mode 100644 index 000000000000..11662ccf6315 --- /dev/null +++ b/external/boost/include/boost/algorithm/string/trim.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/algorithm/string/trim.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/noncopyable.hpp b/external/boost/include/boost/any.hpp index 8c57e4df64c4..617491ae8ce1 100644 --- a/external/boost/include/boost/noncopyable.hpp +++ b/external/boost/include/boost/any.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" @@ -27,5 +27,5 @@ #pragma GCC diagnostic ignored "-Wunused-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" -#include_next <boost/noncopyable.hpp> +#include_next <boost/any.hpp> #pragma GCC diagnostic pop diff --git a/external/boost/include/boost/archive/iterators/base64_from_binary.hpp b/external/boost/include/boost/archive/iterators/base64_from_binary.hpp index b5f4f71463f8..6f717c89ccc4 100644 --- a/external/boost/include/boost/archive/iterators/base64_from_binary.hpp +++ b/external/boost/include/boost/archive/iterators/base64_from_binary.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/archive/iterators/binary_from_base64.hpp b/external/boost/include/boost/archive/iterators/binary_from_base64.hpp index 9f4311a6f58c..a12b0fb1b234 100644 --- a/external/boost/include/boost/archive/iterators/binary_from_base64.hpp +++ b/external/boost/include/boost/archive/iterators/binary_from_base64.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/archive/iterators/remove_whitespace.hpp b/external/boost/include/boost/archive/iterators/remove_whitespace.hpp index e8783de5f3e8..8a3909ec3307 100644 --- a/external/boost/include/boost/archive/iterators/remove_whitespace.hpp +++ b/external/boost/include/boost/archive/iterators/remove_whitespace.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/archive/iterators/transform_width.hpp b/external/boost/include/boost/archive/iterators/transform_width.hpp index 4efa46f64986..5ffa69741c04 100644 --- a/external/boost/include/boost/archive/iterators/transform_width.hpp +++ b/external/boost/include/boost/archive/iterators/transform_width.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/bind.hpp b/external/boost/include/boost/bind/bind.hpp index 5e7c698542f5..2eee648dad05 100644 --- a/external/boost/include/boost/bind.hpp +++ b/external/boost/include/boost/bind/bind.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" @@ -27,5 +27,5 @@ #pragma GCC diagnostic ignored "-Wunused-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" -#include_next <boost/bind.hpp> +#include_next <boost/bind/bind.hpp> #pragma GCC diagnostic pop diff --git a/external/boost/include/boost/cast.hpp b/external/boost/include/boost/cast.hpp index 513ffd2d3a1e..f0d932072836 100644 --- a/external/boost/include/boost/cast.hpp +++ b/external/boost/include/boost/cast.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/circular_buffer.hpp b/external/boost/include/boost/circular_buffer.hpp index 2971bef5947e..ca246bb11558 100644 --- a/external/boost/include/boost/circular_buffer.hpp +++ b/external/boost/include/boost/circular_buffer.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/math/common_factor_rt.hpp b/external/boost/include/boost/container/deque.hpp index 72ae2ec67247..527c24908ae0 100644 --- a/external/boost/include/boost/math/common_factor_rt.hpp +++ b/external/boost/include/boost/container/deque.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" @@ -27,5 +27,5 @@ #pragma GCC diagnostic ignored "-Wunused-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" -#include_next <boost/math/common_factor_rt.hpp> +#include_next <boost/container/deque.hpp> #pragma GCC diagnostic pop diff --git a/external/boost/include/boost/container/flat_map.hpp b/external/boost/include/boost/container/flat_map.hpp new file mode 100644 index 000000000000..32bcfddd7714 --- /dev/null +++ b/external/boost/include/boost/container/flat_map.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/container/flat_map.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/container/small_vector.hpp b/external/boost/include/boost/container/small_vector.hpp new file mode 100644 index 000000000000..64329c24f39f --- /dev/null +++ b/external/boost/include/boost/container/small_vector.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/container/small_vector.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/core/noinit_adaptor.hpp b/external/boost/include/boost/core/noinit_adaptor.hpp new file mode 100644 index 000000000000..f512adf53f52 --- /dev/null +++ b/external/boost/include/boost/core/noinit_adaptor.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/core/noinit_adaptor.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/cstdint.hpp b/external/boost/include/boost/cstdint.hpp index a1200b795e1b..3ac17c91e18c 100644 --- a/external/boost/include/boost/cstdint.hpp +++ b/external/boost/include/boost/cstdint.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/current_function.hpp b/external/boost/include/boost/current_function.hpp index 94a8060a2a4d..f8e044e4e6a8 100644 --- a/external/boost/include/boost/current_function.hpp +++ b/external/boost/include/boost/current_function.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/date_time.hpp b/external/boost/include/boost/date_time.hpp index ae191390b15b..e99ef34d23f6 100644 --- a/external/boost/include/boost/date_time.hpp +++ b/external/boost/include/boost/date_time.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/date_time/gregorian/greg_date.hpp b/external/boost/include/boost/date_time/gregorian/greg_date.hpp new file mode 100644 index 000000000000..379fe2c70ae5 --- /dev/null +++ b/external/boost/include/boost/date_time/gregorian/greg_date.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/date_time/gregorian/greg_date.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/date_time/posix_time/posix_time.hpp b/external/boost/include/boost/date_time/posix_time/posix_time.hpp index 23623bfd0e98..b8f2e564c8cf 100644 --- a/external/boost/include/boost/date_time/posix_time/posix_time.hpp +++ b/external/boost/include/boost/date_time/posix_time/posix_time.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/enable_shared_from_this.hpp b/external/boost/include/boost/enable_shared_from_this.hpp new file mode 100644 index 000000000000..936f06e34482 --- /dev/null +++ b/external/boost/include/boost/enable_shared_from_this.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/enable_shared_from_this.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/filesystem.hpp b/external/boost/include/boost/filesystem.hpp index 3096c1bc7152..702766e04d40 100644 --- a/external/boost/include/boost/filesystem.hpp +++ b/external/boost/include/boost/filesystem.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/filesystem/path.hpp b/external/boost/include/boost/filesystem/path.hpp index 6a00d52cb641..c713c721d2de 100644 --- a/external/boost/include/boost/filesystem/path.hpp +++ b/external/boost/include/boost/filesystem/path.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/io/ios_state.hpp b/external/boost/include/boost/format.hpp index 75f26690b4f7..a944343ab858 100644 --- a/external/boost/include/boost/io/ios_state.hpp +++ b/external/boost/include/boost/format.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" @@ -27,5 +27,5 @@ #pragma GCC diagnostic ignored "-Wunused-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" -#include_next <boost/io/ios_state.hpp> +#include_next <boost/format.hpp> #pragma GCC diagnostic pop diff --git a/external/boost/include/boost/logic/tribool.hpp b/external/boost/include/boost/function.hpp index cbb8993dba96..65166d58027d 100644 --- a/external/boost/include/boost/logic/tribool.hpp +++ b/external/boost/include/boost/function.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" @@ -27,5 +27,5 @@ #pragma GCC diagnostic ignored "-Wunused-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" -#include_next <boost/logic/tribool.hpp> +#include_next <boost/function.hpp> #pragma GCC diagnostic pop diff --git a/external/boost/include/boost/functional/hash.hpp b/external/boost/include/boost/functional/hash.hpp index b7cf8109d2a3..9b0741dce22e 100644 --- a/external/boost/include/boost/functional/hash.hpp +++ b/external/boost/include/boost/functional/hash.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/fusion/adapted/std_pair.hpp b/external/boost/include/boost/fusion/adapted/std_pair.hpp index dc53069f2ec9..a0f70a517676 100644 --- a/external/boost/include/boost/fusion/adapted/std_pair.hpp +++ b/external/boost/include/boost/fusion/adapted/std_pair.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/fusion/include/adapt_struct.hpp b/external/boost/include/boost/fusion/include/adapt_struct.hpp index 45cad2fdc913..88ec1e174b89 100644 --- a/external/boost/include/boost/fusion/include/adapt_struct.hpp +++ b/external/boost/include/boost/fusion/include/adapt_struct.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/fusion/include/std_pair.hpp b/external/boost/include/boost/fusion/include/std_pair.hpp new file mode 100644 index 000000000000..9357b6b52cd1 --- /dev/null +++ b/external/boost/include/boost/fusion/include/std_pair.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/fusion/include/std_pair.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/math/special_functions/expm1.hpp b/external/boost/include/boost/interprocess/file_mapping.hpp index ac92a5ade18a..7ccba5ae6613 100644 --- a/external/boost/include/boost/math/special_functions/expm1.hpp +++ b/external/boost/include/boost/interprocess/file_mapping.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" @@ -27,5 +27,5 @@ #pragma GCC diagnostic ignored "-Wunused-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" -#include_next <boost/math/special_functions/expm1.hpp> +#include_next <boost/interprocess/file_mapping.hpp> #pragma GCC diagnostic pop diff --git a/external/boost/include/boost/interprocess/mapped_region.hpp b/external/boost/include/boost/interprocess/mapped_region.hpp new file mode 100644 index 000000000000..d3b31e5b9dca --- /dev/null +++ b/external/boost/include/boost/interprocess/mapped_region.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/interprocess/mapped_region.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/intrusive/circular_list_algorithms.hpp b/external/boost/include/boost/intrusive/circular_list_algorithms.hpp index 5276879e6e3d..33d02eff9627 100644 --- a/external/boost/include/boost/intrusive/circular_list_algorithms.hpp +++ b/external/boost/include/boost/intrusive/circular_list_algorithms.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/intrusive_ptr.hpp b/external/boost/include/boost/intrusive_ptr.hpp index a5672b8eda3f..bc64b6365b83 100644 --- a/external/boost/include/boost/intrusive_ptr.hpp +++ b/external/boost/include/boost/intrusive_ptr.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/iostreams/device/file_descriptor.hpp b/external/boost/include/boost/iostreams/device/file_descriptor.hpp new file mode 100644 index 000000000000..54709f3a0011 --- /dev/null +++ b/external/boost/include/boost/iostreams/device/file_descriptor.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/iostreams/device/file_descriptor.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/iostreams/filter/gzip.hpp b/external/boost/include/boost/iostreams/filter/gzip.hpp index ba684a4c3f88..1c9c50eb7c04 100644 --- a/external/boost/include/boost/iostreams/filter/gzip.hpp +++ b/external/boost/include/boost/iostreams/filter/gzip.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/iostreams/filtering_stream.hpp b/external/boost/include/boost/iostreams/filtering_stream.hpp index 17707286c7e1..34ae39ea8abb 100644 --- a/external/boost/include/boost/iostreams/filtering_stream.hpp +++ b/external/boost/include/boost/iostreams/filtering_stream.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/iterator/iterator_facade.hpp b/external/boost/include/boost/iterator/iterator_facade.hpp index dc8aa41e6e98..e0cac196dd76 100644 --- a/external/boost/include/boost/iterator/iterator_facade.hpp +++ b/external/boost/include/boost/iterator/iterator_facade.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/lexical_cast.hpp b/external/boost/include/boost/lexical_cast.hpp index 56eaf59ef59e..05316296cc6d 100644 --- a/external/boost/include/boost/lexical_cast.hpp +++ b/external/boost/include/boost/lexical_cast.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/locale.hpp b/external/boost/include/boost/locale.hpp index 961105150bbe..e02e9a437384 100644 --- a/external/boost/include/boost/locale.hpp +++ b/external/boost/include/boost/locale.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/locale/gnu_gettext.hpp b/external/boost/include/boost/locale/gnu_gettext.hpp index 979ece26732d..e3f44ec482b6 100644 --- a/external/boost/include/boost/locale/gnu_gettext.hpp +++ b/external/boost/include/boost/locale/gnu_gettext.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/make_shared.hpp b/external/boost/include/boost/make_shared.hpp new file mode 100644 index 000000000000..54ddad0386cc --- /dev/null +++ b/external/boost/include/boost/make_shared.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/make_shared.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/math/constants/constants.hpp b/external/boost/include/boost/math/constants/constants.hpp new file mode 100644 index 000000000000..7ed40c12ead3 --- /dev/null +++ b/external/boost/include/boost/math/constants/constants.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/math/constants/constants.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/math/special_functions/sinc.hpp b/external/boost/include/boost/math/special_functions/sinc.hpp index 262bdf7000fb..a2a9384e4fa6 100644 --- a/external/boost/include/boost/math/special_functions/sinc.hpp +++ b/external/boost/include/boost/math/special_functions/sinc.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_array.hpp b/external/boost/include/boost/multi_array.hpp index bbf1ee094bde..52ad818447a8 100644 --- a/external/boost/include/boost/multi_array.hpp +++ b/external/boost/include/boost/multi_array.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_index/composite_key.hpp b/external/boost/include/boost/multi_index/composite_key.hpp index fc71af8a9eea..ff987096ccd2 100644 --- a/external/boost/include/boost/multi_index/composite_key.hpp +++ b/external/boost/include/boost/multi_index/composite_key.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_index/identity.hpp b/external/boost/include/boost/multi_index/identity.hpp index 95d61fb87ca0..5c994a42cfae 100644 --- a/external/boost/include/boost/multi_index/identity.hpp +++ b/external/boost/include/boost/multi_index/identity.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_index/mem_fun.hpp b/external/boost/include/boost/multi_index/mem_fun.hpp index cc1c4e16e325..69ac0c4ca309 100644 --- a/external/boost/include/boost/multi_index/mem_fun.hpp +++ b/external/boost/include/boost/multi_index/mem_fun.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_index/ordered_index.hpp b/external/boost/include/boost/multi_index/ordered_index.hpp index a617eeb923a4..74885794dc3b 100644 --- a/external/boost/include/boost/multi_index/ordered_index.hpp +++ b/external/boost/include/boost/multi_index/ordered_index.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_index/random_access_index.hpp b/external/boost/include/boost/multi_index/random_access_index.hpp index 0af3b51e8eca..71dd53c5c188 100644 --- a/external/boost/include/boost/multi_index/random_access_index.hpp +++ b/external/boost/include/boost/multi_index/random_access_index.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/multi_index/tag.hpp b/external/boost/include/boost/multi_index/tag.hpp new file mode 100644 index 000000000000..5d0bfbb62f3d --- /dev/null +++ b/external/boost/include/boost/multi_index/tag.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/multi_index/tag.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/multi_index_container.hpp b/external/boost/include/boost/multi_index_container.hpp index 5e0f39701cab..bb0c3e2f39af 100644 --- a/external/boost/include/boost/multi_index_container.hpp +++ b/external/boost/include/boost/multi_index_container.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/none.hpp b/external/boost/include/boost/none.hpp index 4b49b9806b19..f8018cf053e4 100644 --- a/external/boost/include/boost/none.hpp +++ b/external/boost/include/boost/none.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/numeric/conversion/cast.hpp b/external/boost/include/boost/numeric/conversion/cast.hpp index d85f2924e812..5b1ad9fe4459 100644 --- a/external/boost/include/boost/numeric/conversion/cast.hpp +++ b/external/boost/include/boost/numeric/conversion/cast.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/operators.hpp b/external/boost/include/boost/operators.hpp index 716d97934723..bff38b721c75 100644 --- a/external/boost/include/boost/operators.hpp +++ b/external/boost/include/boost/operators.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/optional.hpp b/external/boost/include/boost/optional.hpp index 892970ccd7cf..4f3f9c38f3c2 100644 --- a/external/boost/include/boost/optional.hpp +++ b/external/boost/include/boost/optional.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/phoenix.hpp b/external/boost/include/boost/phoenix.hpp new file mode 100644 index 000000000000..a07c3dc60b01 --- /dev/null +++ b/external/boost/include/boost/phoenix.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/phoenix.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/pool/object_pool.hpp b/external/boost/include/boost/pool/object_pool.hpp new file mode 100644 index 000000000000..a981a26487ed --- /dev/null +++ b/external/boost/include/boost/pool/object_pool.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/pool/object_pool.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/program_options.hpp b/external/boost/include/boost/program_options.hpp index 9e39f3dfd8a2..570da5a94c34 100644 --- a/external/boost/include/boost/program_options.hpp +++ b/external/boost/include/boost/program_options.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/property_tree/ini_parser.hpp b/external/boost/include/boost/property_tree/ini_parser.hpp new file mode 100644 index 000000000000..59d0b8f1c44c --- /dev/null +++ b/external/boost/include/boost/property_tree/ini_parser.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/property_tree/ini_parser.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/property_tree/json_parser.hpp b/external/boost/include/boost/property_tree/json_parser.hpp index 80808d0ebc04..104243cd8ca8 100644 --- a/external/boost/include/boost/property_tree/json_parser.hpp +++ b/external/boost/include/boost/property_tree/json_parser.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/property_tree/json_parser/error.hpp b/external/boost/include/boost/property_tree/json_parser/error.hpp new file mode 100644 index 000000000000..937c2b0b6dda --- /dev/null +++ b/external/boost/include/boost/property_tree/json_parser/error.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/property_tree/json_parser/error.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/property_tree/ptree.hpp b/external/boost/include/boost/property_tree/ptree.hpp index d000b5b94c08..7ad884aa8a11 100644 --- a/external/boost/include/boost/property_tree/ptree.hpp +++ b/external/boost/include/boost/property_tree/ptree.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/property_tree/ptree_fwd.hpp b/external/boost/include/boost/property_tree/ptree_fwd.hpp index 4088ab20a460..93ff95d8af69 100644 --- a/external/boost/include/boost/property_tree/ptree_fwd.hpp +++ b/external/boost/include/boost/property_tree/ptree_fwd.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/range/adaptor/reversed.hpp b/external/boost/include/boost/range/adaptor/reversed.hpp index 5cd97dc3c1a4..e8da5c1e8fb4 100644 --- a/external/boost/include/boost/range/adaptor/reversed.hpp +++ b/external/boost/include/boost/range/adaptor/reversed.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/range/iterator_range.hpp b/external/boost/include/boost/range/iterator_range.hpp index eaf0570b2874..011304764ed8 100644 --- a/external/boost/include/boost/range/iterator_range.hpp +++ b/external/boost/include/boost/range/iterator_range.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/rational.hpp b/external/boost/include/boost/rational.hpp index 93cf05cc0fea..cc5a6550d425 100644 --- a/external/boost/include/boost/rational.hpp +++ b/external/boost/include/boost/rational.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/regex.hpp b/external/boost/include/boost/regex.hpp new file mode 100644 index 000000000000..e4218bfddc09 --- /dev/null +++ b/external/boost/include/boost/regex.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/regex.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/scoped_ptr.hpp b/external/boost/include/boost/scoped_ptr.hpp index 32aa3486a5d3..f96846917463 100644 --- a/external/boost/include/boost/scoped_ptr.hpp +++ b/external/boost/include/boost/scoped_ptr.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/shared_ptr.hpp b/external/boost/include/boost/shared_ptr.hpp index 946c1ffdf297..a57ac3c248a9 100644 --- a/external/boost/include/boost/shared_ptr.hpp +++ b/external/boost/include/boost/shared_ptr.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/smart_ptr/make_shared.hpp b/external/boost/include/boost/smart_ptr/make_shared.hpp new file mode 100644 index 000000000000..b47a86f0acbd --- /dev/null +++ b/external/boost/include/boost/smart_ptr/make_shared.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/smart_ptr/make_shared.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/spirit/include/classic.hpp b/external/boost/include/boost/spirit/include/classic.hpp index cbce68b6cc9e..5fb9db446efe 100644 --- a/external/boost/include/boost/spirit/include/classic.hpp +++ b/external/boost/include/boost/spirit/include/classic.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/classic_core.hpp b/external/boost/include/boost/spirit/include/classic_core.hpp index c2c28fec5bf4..8ad07162bb9a 100644 --- a/external/boost/include/boost/spirit/include/classic_core.hpp +++ b/external/boost/include/boost/spirit/include/classic_core.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/classic_error_handling.hpp b/external/boost/include/boost/spirit/include/classic_error_handling.hpp index bc7498777a66..ad7da30b4196 100644 --- a/external/boost/include/boost/spirit/include/classic_error_handling.hpp +++ b/external/boost/include/boost/spirit/include/classic_error_handling.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/classic_file_iterator.hpp b/external/boost/include/boost/spirit/include/classic_file_iterator.hpp index b1745d453960..3fa37af9625c 100644 --- a/external/boost/include/boost/spirit/include/classic_file_iterator.hpp +++ b/external/boost/include/boost/spirit/include/classic_file_iterator.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/classic_utility.hpp b/external/boost/include/boost/spirit/include/classic_utility.hpp index e68c37e9144a..528be00f5213 100644 --- a/external/boost/include/boost/spirit/include/classic_utility.hpp +++ b/external/boost/include/boost/spirit/include/classic_utility.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/phoenix.hpp b/external/boost/include/boost/spirit/include/phoenix.hpp index 9b08a6c2c14a..2aa62dfd5bc6 100644 --- a/external/boost/include/boost/spirit/include/phoenix.hpp +++ b/external/boost/include/boost/spirit/include/phoenix.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi.hpp b/external/boost/include/boost/spirit/include/qi.hpp index 04c8d83d19a5..26f96c74af0f 100644 --- a/external/boost/include/boost/spirit/include/qi.hpp +++ b/external/boost/include/boost/spirit/include/qi.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi_attr.hpp b/external/boost/include/boost/spirit/include/qi_attr.hpp index 260082005876..caa36eb0f472 100644 --- a/external/boost/include/boost/spirit/include/qi_attr.hpp +++ b/external/boost/include/boost/spirit/include/qi_attr.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi_lit.hpp b/external/boost/include/boost/spirit/include/qi_lit.hpp index d2a768a0d7dd..9754acc12436 100644 --- a/external/boost/include/boost/spirit/include/qi_lit.hpp +++ b/external/boost/include/boost/spirit/include/qi_lit.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi_optional.hpp b/external/boost/include/boost/spirit/include/qi_optional.hpp index 2ec4204e790d..b9f785e3d374 100644 --- a/external/boost/include/boost/spirit/include/qi_optional.hpp +++ b/external/boost/include/boost/spirit/include/qi_optional.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi_parse_attr.hpp b/external/boost/include/boost/spirit/include/qi_parse_attr.hpp index 12a3fec4ab63..cf6e076ecf4c 100644 --- a/external/boost/include/boost/spirit/include/qi_parse_attr.hpp +++ b/external/boost/include/boost/spirit/include/qi_parse_attr.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi_sequence.hpp b/external/boost/include/boost/spirit/include/qi_sequence.hpp index 578e73c5b0e0..710a0e9a5af8 100644 --- a/external/boost/include/boost/spirit/include/qi_sequence.hpp +++ b/external/boost/include/boost/spirit/include/qi_sequence.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/spirit/include/qi_symbols.hpp b/external/boost/include/boost/spirit/include/qi_symbols.hpp index fb60a7f712f8..f109d7dfccb6 100644 --- a/external/boost/include/boost/spirit/include/qi_symbols.hpp +++ b/external/boost/include/boost/spirit/include/qi_symbols.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/static_assert.hpp b/external/boost/include/boost/static_assert.hpp new file mode 100644 index 000000000000..6ad006193fe6 --- /dev/null +++ b/external/boost/include/boost/static_assert.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/static_assert.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/system/error_code.hpp b/external/boost/include/boost/system/error_code.hpp new file mode 100644 index 000000000000..5363711209b7 --- /dev/null +++ b/external/boost/include/boost/system/error_code.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/system/error_code.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/type_index.hpp b/external/boost/include/boost/type_index.hpp new file mode 100644 index 000000000000..5c3b652835e0 --- /dev/null +++ b/external/boost/include/boost/type_index.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/type_index.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/type_traits/function_traits.hpp b/external/boost/include/boost/type_traits/function_traits.hpp new file mode 100644 index 000000000000..f6a38942d533 --- /dev/null +++ b/external/boost/include/boost/type_traits/function_traits.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/type_traits/function_traits.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/unordered_map.hpp b/external/boost/include/boost/unordered_map.hpp index f626a6a0c28c..d8a88013461e 100644 --- a/external/boost/include/boost/unordered_map.hpp +++ b/external/boost/include/boost/unordered_map.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/uuid/detail/sha1.hpp b/external/boost/include/boost/uuid/detail/sha1.hpp new file mode 100644 index 000000000000..722824375ff5 --- /dev/null +++ b/external/boost/include/boost/uuid/detail/sha1.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/uuid/detail/sha1.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/uuid/sha1.hpp b/external/boost/include/boost/uuid/sha1.hpp new file mode 100644 index 000000000000..255798b08177 --- /dev/null +++ b/external/boost/include/boost/uuid/sha1.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/uuid/sha1.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/uuid/uuid.hpp b/external/boost/include/boost/uuid/uuid.hpp new file mode 100644 index 000000000000..559af546d6a8 --- /dev/null +++ b/external/boost/include/boost/uuid/uuid.hpp @@ -0,0 +1,31 @@ +/* generated by bin/gen-boost-headers, do not edit! */ +#pragma once +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ +#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" +#pragma GCC diagnostic ignored "-Wextra" +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#pragma GCC diagnostic ignored "-Winvalid-constexpr" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" +#pragma GCC diagnostic ignored "-Wnonnull" +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wplacement-new" +#pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare" +#pragma GCC diagnostic ignored "-Wtype-limits" +#pragma GCC diagnostic ignored "-Wundef" +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#include_next <boost/uuid/uuid.hpp> +#pragma GCC diagnostic pop diff --git a/external/boost/include/boost/uuid/uuid_generators.hpp b/external/boost/include/boost/uuid/uuid_generators.hpp index 86e07a639e0c..6489b6a16070 100644 --- a/external/boost/include/boost/uuid/uuid_generators.hpp +++ b/external/boost/include/boost/uuid/uuid_generators.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/uuid/uuid_io.hpp b/external/boost/include/boost/uuid/uuid_io.hpp index 4da4374bbfc7..61f947614c30 100644 --- a/external/boost/include/boost/uuid/uuid_io.hpp +++ b/external/boost/include/boost/uuid/uuid_io.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/variant.hpp b/external/boost/include/boost/variant.hpp index 7019b15c0d5e..36113d3bcc87 100644 --- a/external/boost/include/boost/variant.hpp +++ b/external/boost/include/boost/variant.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/variant/recursive_variant.hpp b/external/boost/include/boost/variant/recursive_variant.hpp index 38f71a0f3dcd..f0a81ac10bf4 100644 --- a/external/boost/include/boost/variant/recursive_variant.hpp +++ b/external/boost/include/boost/variant/recursive_variant.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/include/boost/version.hpp b/external/boost/include/boost/version.hpp index 4843c225a934..47797f163a92 100644 --- a/external/boost/include/boost/version.hpp +++ b/external/boost/include/boost/version.hpp @@ -4,6 +4,7 @@ #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */ #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" +#pragma GCC diagnostic ignored "-Wdeprecated-builtins" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor" @@ -13,7 +14,6 @@ #pragma GCC diagnostic ignored "-Winvalid-constexpr" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend" -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #pragma GCC diagnostic ignored "-Wnonnull" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wplacement-new" diff --git a/external/boost/windows-no-utf8-locales.patch.0 b/external/boost/windows-no-utf8-locales.patch.0 index 66038cad70fb..ec0313294375 100644 --- a/external/boost/windows-no-utf8-locales.patch.0 +++ b/external/boost/windows-no-utf8-locales.patch.0 @@ -1,20 +1,19 @@ Don't ever attempt to initialise a std::locale with a UTF-8 locale on Windows -*- Mode: Diff -*- ---- libs/locale/src/std/std_backend.cpp -+++ libs/locale/src/std/std_backend.cpp -@@ -109,12 +109,13 @@ - #endif - } - else { -+ #if !defined(BOOST_WINDOWS) +--- libs/locale/src/boost/locale/std/std_backend.cpp ++++ libs/locale/src/boost/locale/std/std_backend.cpp +@@ -138,10 +138,14 @@ + } else + name_ = "C"; + } else { ++#if !defined(BOOST_WINDOWS) if(loadable(lid)) { name_ = lid; - utf_mode_ = utf8_native_with_wide; - } -- #if defined(BOOST_WINDOWS) -- else if(loadable(win_name)) { -+ #else -+ if(loadable(win_name)) { - name_ = win_name; - utf_mode_ = utf8_from_wide; - } + utf_mode_ = utf8_support::native; + } else { ++#else ++ { ++#endif + std::vector<std::string> alt_names; + if(l_win) + alt_names.push_back(l_win.name); diff --git a/external/box2d/StaticLibrary_box2d.mk b/external/box2d/StaticLibrary_box2d.mk index b50ee47aa498..1dfb6f25288f 100644 --- a/external/box2d/StaticLibrary_box2d.mk +++ b/external/box2d/StaticLibrary_box2d.mk @@ -16,57 +16,57 @@ $(eval $(call gb_StaticLibrary_set_warnings_disabled,box2d)) $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,box2d,cpp)) $(eval $(call gb_StaticLibrary_set_include,box2d,\ - -I$(call gb_UnpackedTarball_get_dir,box2d/Box2D/)\ + -I$(call gb_UnpackedTarball_get_dir,box2d/include/)\ + -I$(call gb_UnpackedTarball_get_dir,box2d/src/)\ $$(INCLUDE)\ )) $(eval $(call gb_StaticLibrary_add_generated_exception_objects,box2d,\ - UnpackedTarball/box2d/Box2D/Box2D/Common/b2Timer \ - UnpackedTarball/box2d/Box2D/Box2D/Common/b2StackAllocator \ - UnpackedTarball/box2d/Box2D/Box2D/Common/b2Draw \ - UnpackedTarball/box2d/Box2D/Box2D/Common/b2Math \ - UnpackedTarball/box2d/Box2D/Box2D/Common/b2BlockAllocator \ - UnpackedTarball/box2d/Box2D/Box2D/Common/b2Settings \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/b2Body \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2CircleContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2ContactSolver \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2PolygonContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2ChainAndCircleContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2Contact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2RopeJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2WheelJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2FrictionJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2PrismaticJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2WeldJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2PulleyJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2MouseJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2MotorJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2DistanceJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2GearJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2Joint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/Joints/b2RevoluteJoint \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/b2WorldCallbacks \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/b2Fixture \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/b2ContactManager \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/b2Island \ - UnpackedTarball/box2d/Box2D/Box2D/Dynamics/b2World \ - UnpackedTarball/box2d/Box2D/Box2D/Rope/b2Rope \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2TimeOfImpact \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2CollidePolygon \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2Distance \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2Collision \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2CollideEdge \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2CollideCircle \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2BroadPhase \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/Shapes/b2EdgeShape \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/Shapes/b2CircleShape \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/Shapes/b2ChainShape \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/Shapes/b2PolygonShape \ - UnpackedTarball/box2d/Box2D/Box2D/Collision/b2DynamicTree \ + UnpackedTarball/box2d/src/common/b2_timer \ + UnpackedTarball/box2d/src/common/b2_stack_allocator \ + UnpackedTarball/box2d/src/common/b2_draw \ + UnpackedTarball/box2d/src/common/b2_math \ + UnpackedTarball/box2d/src/common/b2_block_allocator \ + UnpackedTarball/box2d/src/common/b2_settings \ + UnpackedTarball/box2d/src/dynamics/b2_body \ + UnpackedTarball/box2d/src/dynamics/b2_polygon_circle_contact \ + UnpackedTarball/box2d/src/dynamics/b2_circle_contact \ + UnpackedTarball/box2d/src/dynamics/b2_contact_solver \ + UnpackedTarball/box2d/src/dynamics/b2_polygon_contact \ + UnpackedTarball/box2d/src/dynamics/b2_chain_polygon_contact \ + UnpackedTarball/box2d/src/dynamics/b2_chain_circle_contact \ + UnpackedTarball/box2d/src/dynamics/b2_contact \ + UnpackedTarball/box2d/src/dynamics/b2_edge_polygon_contact \ + UnpackedTarball/box2d/src/dynamics/b2_edge_circle_contact \ + UnpackedTarball/box2d/src/dynamics/b2_wheel_joint \ + UnpackedTarball/box2d/src/dynamics/b2_friction_joint \ + UnpackedTarball/box2d/src/dynamics/b2_prismatic_joint \ + UnpackedTarball/box2d/src/dynamics/b2_weld_joint \ + UnpackedTarball/box2d/src/dynamics/b2_pulley_joint \ + UnpackedTarball/box2d/src/dynamics/b2_mouse_joint \ + UnpackedTarball/box2d/src/dynamics/b2_motor_joint \ + UnpackedTarball/box2d/src/dynamics/b2_distance_joint \ + UnpackedTarball/box2d/src/dynamics/b2_gear_joint \ + UnpackedTarball/box2d/src/dynamics/b2_joint \ + UnpackedTarball/box2d/src/dynamics/b2_revolute_joint \ + UnpackedTarball/box2d/src/dynamics/b2_world_callbacks \ + UnpackedTarball/box2d/src/dynamics/b2_fixture \ + UnpackedTarball/box2d/src/dynamics/b2_contact_manager \ + UnpackedTarball/box2d/src/dynamics/b2_island \ + UnpackedTarball/box2d/src/dynamics/b2_world \ + UnpackedTarball/box2d/src/rope/b2_rope \ + UnpackedTarball/box2d/src/collision/b2_time_of_impact \ + UnpackedTarball/box2d/src/collision/b2_collide_polygon \ + UnpackedTarball/box2d/src/collision/b2_distance \ + UnpackedTarball/box2d/src/collision/b2_collision \ + UnpackedTarball/box2d/src/collision/b2_collide_edge \ + UnpackedTarball/box2d/src/collision/b2_collide_circle \ + UnpackedTarball/box2d/src/collision/b2_broad_phase \ + UnpackedTarball/box2d/src/collision/b2_edge_shape \ + UnpackedTarball/box2d/src/collision/b2_circle_shape \ + UnpackedTarball/box2d/src/collision/b2_chain_shape \ + UnpackedTarball/box2d/src/collision/b2_polygon_shape \ + UnpackedTarball/box2d/src/collision/b2_dynamic_tree \ )) # vim: set noet sw=4 ts=4: diff --git a/external/box2d/UnpackedTarball_box2d.mk b/external/box2d/UnpackedTarball_box2d.mk index 4dd03e69f2d0..7d7d60e932ad 100644 --- a/external/box2d/UnpackedTarball_box2d.mk +++ b/external/box2d/UnpackedTarball_box2d.mk @@ -13,9 +13,4 @@ $(eval $(call gb_UnpackedTarball_set_tarball,box2d,$(BOX2D_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,box2d,1)) -$(eval $(call gb_UnpackedTarball_add_patches,box2d, \ - external/box2d/fix-strict-aliasing-error.patch \ - external/box2d/disable-shadow-warning-for-drawh.patch \ -)) - # vim: set noet sw=4 ts=4: diff --git a/external/box2d/disable-shadow-warning-for-drawh.patch b/external/box2d/disable-shadow-warning-for-drawh.patch deleted file mode 100644 index 316a6ff9e284..000000000000 --- a/external/box2d/disable-shadow-warning-for-drawh.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -ur box2d/Box2D/Box2D/Box2D.h box2d_patched/Box2D/Box2D/Box2D.h ---- box2d/Box2D/Box2D/Box2D.h 2014-04-06 03:43:12.000000000 +0300 -+++ box2d_patched/Box2D/Box2D/Box2D.h 2020-06-17 18:44:25.920658966 +0300 -@@ -32,7 +32,14 @@ - // These include files constitute the main Box2D API
-
- #include <Box2D/Common/b2Settings.h>
-+#if defined __GNUC__
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wshadow"
-+#endif
- #include <Box2D/Common/b2Draw.h>
-+#if defined __GNUC__
-+#pragma GCC diagnostic pop
-+#endif
- #include <Box2D/Common/b2Timer.h>
-
- #include <Box2D/Collision/Shapes/b2CircleShape.h>
diff --git a/external/box2d/fix-strict-aliasing-error.patch b/external/box2d/fix-strict-aliasing-error.patch deleted file mode 100644 index 20b5e49eb936..000000000000 --- a/external/box2d/fix-strict-aliasing-error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ru box2d/Box2D/Box2D/Common/b2Math.h box2d_patched/Box2D/Box2D/Common/b2Math.h ---- box2d/Box2D/Box2D/Common/b2Math.h 2014-04-06 03:43:12.000000000 +0300 -+++ box2d_patched/Box2D/Box2D/Common/b2Math.h 2020-06-16 07:37:31.713248714 +0300 -@@ -25,8 +25,7 @@ - /// This function is used to ensure that a floating point number is not a NaN or infinity.
- inline bool b2IsValid(float32 x)
- {
-- int32 ix = *reinterpret_cast<int32*>(&x);
-- return (ix & 0x7f800000) != 0x7f800000;
-+ return isfinite(x);
- }
-
- /// This is a approximate yet fast inverse square-root.
diff --git a/external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 b/external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 deleted file mode 100644 index 7c8a68c2451a..000000000000 --- a/external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 +++ /dev/null @@ -1,49 +0,0 @@ -From 7e3c165000d44fa153a3270870ed500bc8bbb461 Mon Sep 17 00:00:00 2001 -From: Nicholas Baldwin <baldwinn@google.com> -Date: Fri, 27 Oct 2017 11:44:36 -0700 -Subject: [PATCH] Fix double declaration of tgkill when using Android NDK - Headers. - -As of Android API level 16 tgkill is declared in the NDK version of -signal.h, which conflicts with the static definition found in -src/client/linux/handler/exception_handler.cc. This change removes -the static tgkill definition and replaces its use with sys_tgkill -from the linux syscall support library. - -Bug: -Change-Id: Ic70addd8a064cfa36345d86b7e36409e2089e909 -Reviewed-on: https://chromium-review.googlesource.com/738912 -Reviewed-by: Mike Frysinger <vapier@chromium.org> ---- - src/client/linux/handler/exception_handler.cc | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc -index 95005209..cd94e3b5 100644 ---- a/src/client/linux/handler/exception_handler.cc -+++ b/src/client/linux/handler/exception_handler.cc -@@ -105,12 +105,6 @@ - #define PR_SET_PTRACER 0x59616d61 - #endif - --// A wrapper for the tgkill syscall: send a signal to a specific thread. --static int tgkill(pid_t tgid, pid_t tid, int sig) { -- return syscall(__NR_tgkill, tgid, tid, sig); -- return 0; --} -- - namespace google_breakpad { - - namespace { -@@ -400,7 +394,7 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { - // In order to retrigger it, we have to queue a new signal by calling - // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is - // due to the kernel sending a SIGABRT from a user request via SysRQ. -- if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { -+ if (sys_tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { - // If we failed to kill ourselves (e.g. because a sandbox disallows us - // to do so), we instead resort to terminating our process. This will - // result in an incorrect exit code. --- -2.23.0 - diff --git a/external/breakpad/ExternalProject_breakpad.mk b/external/breakpad/ExternalProject_breakpad.mk index 9e7e72485849..a4f124a49f12 100644 --- a/external/breakpad/ExternalProject_breakpad.mk +++ b/external/breakpad/ExternalProject_breakpad.mk @@ -16,12 +16,20 @@ $(eval $(call gb_ExternalProject_register_targets,breakpad,\ ifeq ($(COM),MSC) +$(call gb_ExternalProject_get_state_target,breakpad,build) : + $(call gb_Trace_StartRange,breakpad,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + MSBuild.exe src/tools/windows/dump_syms/dump_syms.sln -p:Configuration=Release \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ + ) + $(call gb_Trace_EndRange,breakpad,EXTERNAL) + else # !ifeq($(COM),MSC) $(call gb_ExternalProject_get_state_target,breakpad,build) : $(call gb_Trace_StartRange,breakpad,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure CXXFLAGS="-O2 $(gb_VISIBILITY_FLAGS)" \ + $(gb_RUN_CONFIGURE) ./configure CXXFLAGS="-O2 $(gb_VISIBILITY_FLAGS)" \ && $(MAKE) \ ) $(call gb_Trace_EndRange,breakpad,EXTERNAL) diff --git a/external/breakpad/Module_breakpad.mk b/external/breakpad/Module_breakpad.mk index aeb3c42a9d6d..f68385ffb4c7 100644 --- a/external/breakpad/Module_breakpad.mk +++ b/external/breakpad/Module_breakpad.mk @@ -13,11 +13,10 @@ $(eval $(call gb_Module_add_targets,breakpad,\ UnpackedTarball_breakpad \ )) -ifneq ($(OS),WNT) $(eval $(call gb_Module_add_targets,breakpad,\ ExternalProject_breakpad \ )) -else +ifeq ($(OS),WNT) $(eval $(call gb_Module_add_targets,breakpad,\ StaticLibrary_breakpad \ )) diff --git a/external/breakpad/SIGSTKSZ.patch b/external/breakpad/SIGSTKSZ.patch new file mode 100644 index 000000000000..d37c58a2f84b --- /dev/null +++ b/external/breakpad/SIGSTKSZ.patch @@ -0,0 +1,11 @@ +--- src/client/linux/handler/exception_handler.cc ++++ src/client/linux/handler/exception_handler.cc +@@ -138,7 +138,7 @@ + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); ++ static const unsigned kSigStackSize = std::max<decltype(SIGSTKSZ)>(16384, SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. diff --git a/external/breakpad/UnpackedTarball_breakpad.mk b/external/breakpad/UnpackedTarball_breakpad.mk index b9e14874d72d..ce553e334251 100644 --- a/external/breakpad/UnpackedTarball_breakpad.mk +++ b/external/breakpad/UnpackedTarball_breakpad.mk @@ -15,16 +15,32 @@ $(eval $(call gb_UnpackedTarball_set_tarball,breakpad,$(BREAKPAD_TARBALL))) # external/breakpad/0001-Handle-race-between-ExceptionHandler-SignalHandler-a.patch upstreamed at # <https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1176811> "Handle race between -# ExceptionHandler::SignalHandler and ~ExceptionHandler": +# ExceptionHandler::SignalHandler and ~ExceptionHandler"; +# external/breakpad/SIGSTKSZ.patch upstreamed at +# <https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3226470> "Adpat to SIGSTKSZ type +# in glibc 2.34": + +ifneq ($(MSYSTEM),) +# use binary flag so patch from git-bash won't choke on mixed line-endings in patches +$(eval $(call gb_UnpackedTarball_set_patchflags,breakpad,--binary)) +endif + $(eval $(call gb_UnpackedTarball_add_patches,breakpad,\ external/breakpad/breakpad-use-correct-http-header.patch.1 \ external/breakpad/breakpad-wshadow.patch.1 \ - external/breakpad/breakpad-wshadow2.patch.1 \ external/breakpad/breakpad-stackwalk.patch.1 \ - external/breakpad/ucontext.patch \ external/breakpad/0001-Handle-race-between-ExceptionHandler-SignalHandler-a.patch.1 \ - external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 \ external/breakpad/c++20-allocator.patch \ + external/breakpad/breakpad-dump_syms.patch.1 \ + external/breakpad/breakpad-no-env.patch.1 \ + external/breakpad/SIGSTKSZ.patch \ + external/breakpad/sanitizer.patch \ + external/breakpad/include.patch \ +)) + +$(eval $(call gb_UnpackedTarball_add_files,breakpad,src/tools/windows/dump_syms,\ + external/breakpad/dump_syms.vcxproj \ + external/breakpad/dump_syms.sln \ )) ifeq ($(COM_IS_CLANG),TRUE) diff --git a/external/breakpad/breakpad-dump_syms.patch.1 b/external/breakpad/breakpad-dump_syms.patch.1 new file mode 100644 index 000000000000..d895be7ef57a --- /dev/null +++ b/external/breakpad/breakpad-dump_syms.patch.1 @@ -0,0 +1,34 @@ +diff -ur breakpad.org/src/common/windows/pdb_source_line_writer.cc breakpad/src/common/windows/pdb_source_line_writer.cc +--- breakpad.org/src/common/windows/pdb_source_line_writer.cc 2021-06-11 12:37:22.682324700 +0200 ++++ breakpad/src/common/windows/pdb_source_line_writer.cc 2021-06-11 12:44:24.480184800 +0200 +@@ -34,7 +34,7 @@ + #include <atlbase.h> + #include <dia2.h> + #include <diacreate.h> +-#include <ImageHlp.h> ++#include <dbghelp.h> + #include <stdio.h> + + #include <algorithm> +diff -ur breakpad.org/src/common/windows/pe_util.cc breakpad/src/common/windows/pe_util.cc +--- breakpad.org/src/common/windows/pe_util.cc 2021-06-11 12:37:22.682324700 +0200 ++++ breakpad/src/common/windows/pe_util.cc 2021-06-11 12:52:34.542708600 +0200 +@@ -35,6 +35,7 @@ + #include <ImageHlp.h>
+
+ #include <functional>
++#include <memory>
+
+ #include "common/windows/string_utils-inl.h"
+ #include "common/windows/guid_string.h"
+diff -ur breakpad.org/src/tools/windows/dump_syms/dump_syms.cc breakpad/src/tools/windows/dump_syms/dump_syms.cc +--- breakpad.org/src/tools/windows/dump_syms/dump_syms.cc 2021-06-11 12:37:20.697959400 +0200 ++++ breakpad/src/tools/windows/dump_syms/dump_syms.cc 2021-06-11 12:41:16.922559700 +0200 +@@ -33,6 +33,7 @@ + #include <stdio.h> + #include <wchar.h> + ++#include <memory> + #include <string> + + #include "common/windows/pdb_source_line_writer.h" diff --git a/external/breakpad/breakpad-no-env.patch.1 b/external/breakpad/breakpad-no-env.patch.1 new file mode 100644 index 000000000000..d1b37bd21868 --- /dev/null +++ b/external/breakpad/breakpad-no-env.patch.1 @@ -0,0 +1,13 @@ +diff -ur breakpad.org/src/client/linux/minidump_writer/minidump_writer.cc breakpad/src/client/linux/minidump_writer/minidump_writer.cc +--- breakpad.org/src/client/linux/minidump_writer/minidump_writer.cc 2021-06-19 15:32:57.258078847 +0200 ++++ breakpad/src/client/linux/minidump_writer/minidump_writer.cc 2021-06-19 15:35:07.014082452 +0200 +@@ -289,7 +289,8 @@ + dir.CopyIndex(dir_index++, &dirent); + + dirent.stream_type = MD_LINUX_ENVIRON; +- if (!WriteProcFile(&dirent.location, GetCrashThread(), "environ")) ++ // don't include the user's env ++ if (true || !WriteProcFile(&dirent.location, GetCrashThread(), "environ")) + NullifyDirectoryEntry(&dirent); + dir.CopyIndex(dir_index++, &dirent); + diff --git a/external/breakpad/breakpad-stackwalk.patch.1 b/external/breakpad/breakpad-stackwalk.patch.1 index 8df1fa3e2f43..85362b8fb434 100644 --- a/external/breakpad/breakpad-stackwalk.patch.1 +++ b/external/breakpad/breakpad-stackwalk.patch.1 @@ -1,25 +1,25 @@ -diff -ur breakpad.org/src/processor/stackwalk_common.cc breakpad/src/processor/stackwalk_common.cc ---- breakpad.org/src/processor/stackwalk_common.cc 2016-06-27 02:06:43.304932691 +0200 -+++ breakpad/src/processor/stackwalk_common.cc 2016-06-27 02:10:22.815642476 +0200 -@@ -750,7 +750,7 @@ +diff -u -p -d -N -r breakpad.sav/src/processor/stackwalk_common.cc breakpad/src/processor/stackwalk_common.cc +--- breakpad.sav/src/processor/stackwalk_common.cc 2021-04-07 19:16:35.771272332 +0200 ++++ breakpad/src/processor/stackwalk_common.cc 2021-04-07 19:40:46.039940981 +0200 +@@ -750,7 +750,7 @@ static void PrintModules( // one per line, in the following machine-readable pipe-delimited // text format: // Module|{Module Filename}|{Version}|{Debug Filename}|{Debug Identifier}| -// {Base Address}|{Max Address}|{Main} +// {Base Address}|{Max Address}|{Main}|{Code Identifier} - static void PrintModulesMachineReadable(const CodeModules *modules) { + static void PrintModulesMachineReadable(const CodeModules* modules) { if (!modules) return; -@@ -767,7 +767,7 @@ +@@ -767,7 +767,7 @@ static void PrintModulesMachineReadable( ++module_sequence) { - const CodeModule *module = modules->GetModuleAtSequence(module_sequence); + const CodeModule* module = modules->GetModuleAtSequence(module_sequence); uint64_t base_address = module->base_address(); - printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n", + printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d%c%s\n", kOutputSeparator, StripSeparator(PathnameStripper::File(module->code_file())).c_str(), kOutputSeparator, StripSeparator(module->version()).c_str(), -@@ -778,7 +778,9 @@ +@@ -778,7 +778,9 @@ static void PrintModulesMachineReadable( kOutputSeparator, base_address, kOutputSeparator, base_address + module->size() - 1, kOutputSeparator, diff --git a/external/breakpad/breakpad-wshadow.patch.1 b/external/breakpad/breakpad-wshadow.patch.1 index d696e5bdebf5..87010f851f0b 100644 --- a/external/breakpad/breakpad-wshadow.patch.1 +++ b/external/breakpad/breakpad-wshadow.patch.1 @@ -1,29 +1,9 @@ -Only in breakpad: breakpad-client.pc -Only in breakpad: breakpad.pc -Only in breakpad: build.log -Only in breakpad: config.log -Only in breakpad: config.status -Only in breakpad: Makefile -Only in breakpad/src/client: .deps -Only in breakpad/src/client: .dirstamp -Only in breakpad/src/client/linux/crash_generation: crash_generation_client.o -Only in breakpad/src/client/linux/crash_generation: crash_generation_server.o -Only in breakpad/src/client/linux/crash_generation: .deps -Only in breakpad/src/client/linux/crash_generation: .dirstamp -Only in breakpad/src/client/linux: .dirstamp -Only in breakpad/src/client/linux/dump_writer_common: .deps -Only in breakpad/src/client/linux/dump_writer_common: .dirstamp -Only in breakpad/src/client/linux/dump_writer_common: thread_info.o -Only in breakpad/src/client/linux/dump_writer_common: ucontext_reader.o -Only in breakpad/src/client/linux/handler: .deps -Only in breakpad/src/client/linux/handler: .dirstamp -Only in breakpad/src/client/linux/handler: exception_handler.o -diff -ur breakpad.org/src/client/linux/handler/minidump_descriptor.h breakpad/src/client/linux/handler/minidump_descriptor.h ---- breakpad.org/src/client/linux/handler/minidump_descriptor.h 2016-02-07 19:22:24.329411023 +0100 -+++ breakpad/src/client/linux/handler/minidump_descriptor.h 2016-02-07 19:24:28.600438386 +0100 -@@ -55,18 +55,18 @@ - fd_(-1), - size_limit_(-1) {} +diff -u -p -d -N -r breakpad.sav/src/client/linux/handler/minidump_descriptor.h breakpad/src/client/linux/handler/minidump_descriptor.h +--- breakpad.sav/src/client/linux/handler/minidump_descriptor.h 2021-04-07 19:12:50.329462509 +0200 ++++ breakpad/src/client/linux/handler/minidump_descriptor.h 2021-04-07 19:29:58.526084027 +0200 +@@ -57,27 +57,27 @@ class MinidumpDescriptor { + address_within_principal_mapping_(0), + skip_dump_if_principal_mapping_not_referenced_(false) {} - explicit MinidumpDescriptor(const string& directory) + explicit MinidumpDescriptor(const string& dir) @@ -32,8 +12,12 @@ diff -ur breakpad.org/src/client/linux/handler/minidump_descriptor.h breakpad/sr - directory_(directory), + directory_(dir), c_path_(NULL), - size_limit_(-1) { - assert(!directory.empty()); + size_limit_(-1), + address_within_principal_mapping_(0), + skip_dump_if_principal_mapping_not_referenced_(false), + sanitize_stacks_(false) { +- assert(!directory.empty()); ++ assert(!dir.empty()); } - explicit MinidumpDescriptor(int fd) @@ -42,26 +26,20 @@ diff -ur breakpad.org/src/client/linux/handler/minidump_descriptor.h breakpad/sr - fd_(fd), + fd_(file_descriptor), c_path_(NULL), - size_limit_(-1) { - assert(fd != -1); -Only in breakpad/src/client/linux/handler: .minidump_descriptor.h.un~ -Only in breakpad/src/client/linux/handler: minidump_descriptor.o -Only in breakpad/src/client/linux: libbreakpad_client.a -Only in breakpad/src/client/linux: linux_dumper_unittest_helper -Only in breakpad/src/client/linux/log: .deps -Only in breakpad/src/client/linux/log: .dirstamp -Only in breakpad/src/client/linux/log: log.o -Only in breakpad/src/client/linux/microdump_writer: .deps -Only in breakpad/src/client/linux/microdump_writer: .dirstamp -Only in breakpad/src/client/linux/microdump_writer: microdump_writer.o -Only in breakpad/src/client/linux/minidump_writer: .deps -Only in breakpad/src/client/linux/minidump_writer: .dirstamp -Only in breakpad/src/client/linux/minidump_writer: linux_core_dumper.o -diff -ur breakpad.org/src/client/linux/minidump_writer/linux_dumper.h breakpad/src/client/linux/minidump_writer/linux_dumper.h ---- breakpad.org/src/client/linux/minidump_writer/linux_dumper.h 2016-02-07 19:22:24.330410999 +0100 -+++ breakpad/src/client/linux/minidump_writer/linux_dumper.h 2016-02-07 19:26:10.870017835 +0100 -@@ -130,15 +130,15 @@ - uint8_t identifier[sizeof(MDGUID)]); + size_limit_(-1), + address_within_principal_mapping_(0), + skip_dump_if_principal_mapping_not_referenced_(false), + sanitize_stacks_(false) { +- assert(fd != -1); ++ assert(file_descriptor != -1); + } + + explicit MinidumpDescriptor(const MicrodumpOnConsole&) +diff -u -p -d -N -r breakpad.sav/src/client/linux/minidump_writer/linux_dumper.h breakpad/src/client/linux/minidump_writer/linux_dumper.h +--- breakpad.sav/src/client/linux/minidump_writer/linux_dumper.h 2021-04-07 19:12:50.329462509 +0200 ++++ breakpad/src/client/linux/minidump_writer/linux_dumper.h 2021-04-07 19:27:50.808928572 +0200 +@@ -176,12 +176,12 @@ class LinuxDumper { + void SetCrashInfoFromSigInfo(const siginfo_t& siginfo); uintptr_t crash_address() const { return crash_address_; } - void set_crash_address(uintptr_t crash_address) { @@ -73,160 +51,15 @@ diff -ur breakpad.org/src/client/linux/minidump_writer/linux_dumper.h breakpad/s int crash_signal() const { return crash_signal_; } - void set_crash_signal(int crash_signal) { crash_signal_ = crash_signal; } + void set_crash_signal(int crash_sig) { crash_signal_ = crash_sig; } + const char* GetCrashSignalString() const; + + void set_crash_signal_code(int code) { crash_signal_code_ = code; } +@@ -196,7 +196,7 @@ class LinuxDumper { + } pid_t crash_thread() const { return crash_thread_; } - void set_crash_thread(pid_t crash_thread) { crash_thread_ = crash_thread; } + void set_crash_thread(pid_t thread) { crash_thread_ = thread; } - // Extracts the effective path and file name of from |mapping|. In most cases - // the effective name/path are just the mapping's path and basename. In some -Only in breakpad/src/client/linux/minidump_writer: .linux_dumper.h.un~ -Only in breakpad/src/client/linux/minidump_writer: linux_dumper.o -Only in breakpad/src/client/linux/minidump_writer: linux_ptrace_dumper.o -Only in breakpad/src/client/linux/minidump_writer: minidump_writer.o -Only in breakpad/src/client/linux/minidump_writer: src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o -Only in breakpad/src/client: minidump_file_writer.o -Only in breakpad/src/common/android: .deps -Only in breakpad/src/common: convert_UTF.o -Only in breakpad/src/common: .deps -Only in breakpad/src/common: .dirstamp -Only in breakpad/src/common/dwarf: bytereader.o -Only in breakpad/src/common/dwarf: .deps -Only in breakpad/src/common/dwarf: .dirstamp -Only in breakpad/src/common/dwarf: dwarf2diehandler.o -Only in breakpad/src/common/dwarf: dwarf2reader.o -Only in breakpad/src/common/dwarf: src_tools_mac_dump_syms_dump_syms-bytereader.o -Only in breakpad/src/common/dwarf: src_tools_mac_dump_syms_dump_syms-dwarf2diehandler.o -Only in breakpad/src/common/dwarf: src_tools_mac_dump_syms_dump_syms-dwarf2reader.o -Only in breakpad/src/common: dwarf_cfi_to_module.o -Only in breakpad/src/common: dwarf_cu_to_module.o -Only in breakpad/src/common: dwarf_line_to_module.o -Only in breakpad/src/common: language.o -Only in breakpad/src/common/linux: crc32.o -Only in breakpad/src/common/linux: .deps -Only in breakpad/src/common/linux: .dirstamp -Only in breakpad/src/common/linux: dump_symbols.o -Only in breakpad/src/common/linux: elf_core_dump.o -Only in breakpad/src/common/linux: elf_symbols_to_module.o -Only in breakpad/src/common/linux: elfutils.o -Only in breakpad/src/common/linux: file_id.o -Only in breakpad/src/common/linux: guid_creator.o -Only in breakpad/src/common/linux: http_upload.o -Only in breakpad/src/common/linux: linux_libc_support.o -Only in breakpad/src/common/linux: memory_mapped_file.o -Only in breakpad/src/common/linux: safe_readlink.o -Only in breakpad/src/common/linux/tests: .deps -Only in breakpad/src/common/mac: .deps -Only in breakpad/src/common/mac: .dirstamp -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-arch_utilities.o -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-dump_syms.o -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-file_id.o -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-macho_id.o -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-macho_reader.o -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-macho_utilities.o -Only in breakpad/src/common/mac: src_tools_mac_dump_syms_dump_syms-macho_walker.o -Only in breakpad/src/common: md5.o -Only in breakpad/src/common: module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-dwarf_cfi_to_module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-dwarf_cu_to_module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-dwarf_line_to_module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-language.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-md5.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-stabs_reader.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-stabs_to_module.o -Only in breakpad/src/common: stabs_reader.o -Only in breakpad/src/common: stabs_to_module.o -Only in breakpad/src/common: string_conversion.o -Only in breakpad/src/common/tests: .deps -Only in breakpad/src: config.h -Only in breakpad/src: .dirstamp -Only in breakpad/src: libbreakpad.a -Only in breakpad/src/processor: basic_code_modules.o -Only in breakpad/src/processor: basic_source_line_resolver.o -Only in breakpad/src/processor: call_stack.o -Only in breakpad/src/processor: cfi_frame_info.o -Only in breakpad/src/processor: .deps -Only in breakpad/src/processor: .dirstamp -Only in breakpad/src/processor: disassembler_x86.o -Only in breakpad/src/processor: dump_context.o -Only in breakpad/src/processor: dump_object.o -Only in breakpad/src/processor: exploitability_linux.o -Only in breakpad/src/processor: exploitability.o -Only in breakpad/src/processor: exploitability_win.o -Only in breakpad/src/processor: fast_source_line_resolver.o -Only in breakpad/src/processor: logging.o -Only in breakpad/src/processor: microdump.o -Only in breakpad/src/processor: microdump_processor.o -Only in breakpad/src/processor: microdump_stackwalk -Only in breakpad/src/processor: microdump_stackwalk.o -Only in breakpad/src/processor: minidump_dump -Only in breakpad/src/processor: minidump_dump.o -Only in breakpad/src/processor: minidump.o -Only in breakpad/src/processor: minidump_processor.o -Only in breakpad/src/processor: minidump_stackwalk -Only in breakpad/src/processor: minidump_stackwalk.o -Only in breakpad/src/processor: module_comparer.o -Only in breakpad/src/processor: module_serializer.o -Only in breakpad/src/processor: pathname_stripper.o -Only in breakpad/src/processor: process_state.o -Only in breakpad/src/processor: proc_maps_linux.o -Only in breakpad/src/processor: simple_symbol_supplier.o -Only in breakpad/src/processor: source_line_resolver_base.o -Only in breakpad/src/processor: stack_frame_cpu.o -Only in breakpad/src/processor: stack_frame_symbolizer.o -Only in breakpad/src/processor: stackwalk_common.o -Only in breakpad/src/processor: stackwalker_address_list.o -Only in breakpad/src/processor: stackwalker_amd64.o -Only in breakpad/src/processor: stackwalker_arm64.o -Only in breakpad/src/processor: stackwalker_arm.o -Only in breakpad/src/processor: stackwalker_mips.o -Only in breakpad/src/processor: stackwalker.o -Only in breakpad/src/processor: stackwalker_ppc64.o -Only in breakpad/src/processor: stackwalker_ppc.o -Only in breakpad/src/processor: stackwalker_sparc.o -Only in breakpad/src/processor: stackwalker_x86.o -Only in breakpad/src/processor: symbolic_constants_win.o -Only in breakpad/src/processor: tokenize.o -Only in breakpad/src: stamp-h1 -Only in breakpad/src/testing/gtest/src: .deps -Only in breakpad/src/testing/src: .deps -Only in breakpad/src/third_party/libdisasm: .deps -Only in breakpad/src/third_party/libdisasm: .dirstamp -Only in breakpad/src/third_party/libdisasm: ia32_implicit.o -Only in breakpad/src/third_party/libdisasm: ia32_insn.o -Only in breakpad/src/third_party/libdisasm: ia32_invariant.o -Only in breakpad/src/third_party/libdisasm: ia32_modrm.o -Only in breakpad/src/third_party/libdisasm: ia32_opcode_tables.o -Only in breakpad/src/third_party/libdisasm: ia32_operand.o -Only in breakpad/src/third_party/libdisasm: ia32_reg.o -Only in breakpad/src/third_party/libdisasm: ia32_settings.o -Only in breakpad/src/third_party/libdisasm: libdisasm.a -Only in breakpad/src/third_party/libdisasm: x86_disasm.o -Only in breakpad/src/third_party/libdisasm: x86_format.o -Only in breakpad/src/third_party/libdisasm: x86_imm.o -Only in breakpad/src/third_party/libdisasm: x86_insn.o -Only in breakpad/src/third_party/libdisasm: x86_misc.o -Only in breakpad/src/third_party/libdisasm: x86_operand_list.o -Only in breakpad/src/tools/linux/core2md: core2md -Only in breakpad/src/tools/linux/core2md: core2md.o -Only in breakpad/src/tools/linux/core2md: .deps -Only in breakpad/src/tools/linux/core2md: .dirstamp -Only in breakpad/src/tools/linux/dump_syms: .deps -Only in breakpad/src/tools/linux/dump_syms: .dirstamp -Only in breakpad/src/tools/linux/dump_syms: dump_syms -Only in breakpad/src/tools/linux/dump_syms: dump_syms.o -Only in breakpad/src/tools/linux/md2core: .deps -Only in breakpad/src/tools/linux/md2core: .dirstamp -Only in breakpad/src/tools/linux/md2core: minidump-2-core -Only in breakpad/src/tools/linux/md2core: minidump-2-core.o -Only in breakpad/src/tools/linux/symupload: .deps -Only in breakpad/src/tools/linux/symupload: .dirstamp -Only in breakpad/src/tools/linux/symupload: minidump_upload -Only in breakpad/src/tools/linux/symupload: minidump_upload.o -Only in breakpad/src/tools/linux/symupload: sym_upload -Only in breakpad/src/tools/linux/symupload: sym_upload.o -Only in breakpad/src/tools/mac/dump_syms: .deps -Only in breakpad/src/tools/mac/dump_syms: .dirstamp -Only in breakpad/src/tools/mac/dump_syms: dump_syms -Only in breakpad/src/tools/mac/dump_syms: src_tools_mac_dump_syms_dump_syms-dump_syms_tool.o + // Concatenates the |root_prefix_| and |mapping| path. Writes into |path| and + // returns true unless the string is too long. diff --git a/external/breakpad/breakpad-wshadow2.patch.1 b/external/breakpad/breakpad-wshadow2.patch.1 deleted file mode 100644 index 40267b3f7287..000000000000 --- a/external/breakpad/breakpad-wshadow2.patch.1 +++ /dev/null @@ -1,144 +0,0 @@ -Only in breakpad: breakpad-client.pc -Only in breakpad: breakpad.pc -Only in breakpad: build.log -Only in breakpad: config.log -Only in breakpad: config.status -Only in breakpad: Makefile -Only in breakpad/src/client: .deps -Only in breakpad/src/client: .dirstamp -Only in breakpad/src/client/linux/crash_generation: crash_generation_client.o -Only in breakpad/src/client/linux/crash_generation: .deps -Only in breakpad/src/client/linux/crash_generation: .dirstamp -Only in breakpad/src/client/linux: .dirstamp -Only in breakpad/src/client/linux/dump_writer_common: .deps -Only in breakpad/src/client/linux/dump_writer_common: .dirstamp -Only in breakpad/src/client/linux/dump_writer_common: thread_info.o -Only in breakpad/src/client/linux/dump_writer_common: ucontext_reader.o -Only in breakpad/src/client/linux/handler: .deps -Only in breakpad/src/client/linux/handler: .dirstamp -diff -ur breakpad.org/src/client/linux/handler/minidump_descriptor.h breakpad/src/client/linux/handler/minidump_descriptor.h ---- breakpad.org/src/client/linux/handler/minidump_descriptor.h 2016-02-07 19:28:40.335518286 +0100 -+++ breakpad/src/client/linux/handler/minidump_descriptor.h 2016-02-07 19:29:14.706713302 +0100 -@@ -61,7 +61,7 @@ - directory_(dir), - c_path_(NULL), - size_limit_(-1) { -- assert(!directory.empty()); -+ assert(!dir.empty()); - } - - explicit MinidumpDescriptor(int file_descriptor) -@@ -69,7 +69,7 @@ - fd_(file_descriptor), - c_path_(NULL), - size_limit_(-1) { -- assert(fd != -1); -+ assert(file_descriptor != -1); - } - - explicit MinidumpDescriptor(const MicrodumpOnConsole&) -Only in breakpad/src/client/linux/handler: .minidump_descriptor.h.un~ -Only in breakpad/src/client/linux/log: .deps -Only in breakpad/src/client/linux/log: .dirstamp -Only in breakpad/src/client/linux/log: log.o -Only in breakpad/src/client/linux/microdump_writer: .deps -Only in breakpad/src/client/linux/microdump_writer: .dirstamp -Only in breakpad/src/client/linux/minidump_writer: .deps -Only in breakpad/src/client/linux/minidump_writer: .dirstamp -Only in breakpad/src/client/linux/minidump_writer: linux_dumper.o -Only in breakpad/src/client/linux/minidump_writer: linux_ptrace_dumper.o -Only in breakpad/src/client: minidump_file_writer.o -Only in breakpad/src/common/android: .deps -Only in breakpad/src/common: convert_UTF.o -Only in breakpad/src/common: .deps -Only in breakpad/src/common: .dirstamp -Only in breakpad/src/common/dwarf: .deps -Only in breakpad/src/common/dwarf: .dirstamp -Only in breakpad/src/common/dwarf: src_tools_mac_dump_syms_dump_syms-bytereader.o -Only in breakpad/src/common/dwarf: src_tools_mac_dump_syms_dump_syms-dwarf2diehandler.o -Only in breakpad/src/common/dwarf: src_tools_mac_dump_syms_dump_syms-dwarf2reader.o -Only in breakpad/src/common: dwarf_cfi_to_module.o -Only in breakpad/src/common: dwarf_cu_to_module.o -Only in breakpad/src/common: dwarf_line_to_module.o -Only in breakpad/src/common: language.o -Only in breakpad/src/common/linux: crc32.o -Only in breakpad/src/common/linux: .deps -Only in breakpad/src/common/linux: .dirstamp -Only in breakpad/src/common/linux: dump_symbols.o -Only in breakpad/src/common/linux: elf_symbols_to_module.o -Only in breakpad/src/common/linux: http_upload.o -Only in breakpad/src/common/linux/tests: .deps -Only in breakpad/src/common/mac: .deps -Only in breakpad/src/common/mac: .dirstamp -Only in breakpad/src/common: module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-dwarf_cfi_to_module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-dwarf_cu_to_module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-dwarf_line_to_module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-language.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-md5.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-module.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-stabs_reader.o -Only in breakpad/src/common: src_tools_mac_dump_syms_dump_syms-stabs_to_module.o -Only in breakpad/src/common: stabs_reader.o -Only in breakpad/src/common: stabs_to_module.o -Only in breakpad/src/common/tests: .deps -Only in breakpad/src: config.h -Only in breakpad/src: .dirstamp -Only in breakpad/src/processor: basic_code_modules.o -Only in breakpad/src/processor: basic_source_line_resolver.o -Only in breakpad/src/processor: call_stack.o -Only in breakpad/src/processor: cfi_frame_info.o -Only in breakpad/src/processor: .deps -Only in breakpad/src/processor: .dirstamp -Only in breakpad/src/processor: disassembler_x86.o -Only in breakpad/src/processor: dump_context.o -Only in breakpad/src/processor: dump_object.o -Only in breakpad/src/processor: exploitability_linux.o -Only in breakpad/src/processor: exploitability.o -Only in breakpad/src/processor: exploitability_win.o -Only in breakpad/src/processor: fast_source_line_resolver.o -Only in breakpad/src/processor: logging.o -Only in breakpad/src/processor: microdump.o -Only in breakpad/src/processor: microdump_processor.o -Only in breakpad/src/processor: microdump_stackwalk.o -Only in breakpad/src/processor: minidump_dump.o -Only in breakpad/src/processor: minidump.o -Only in breakpad/src/processor: minidump_processor.o -Only in breakpad/src/processor: minidump_stackwalk.o -Only in breakpad/src/processor: module_comparer.o -Only in breakpad/src/processor: module_serializer.o -Only in breakpad/src/processor: pathname_stripper.o -Only in breakpad/src/processor: process_state.o -Only in breakpad/src/processor: proc_maps_linux.o -Only in breakpad/src/processor: simple_symbol_supplier.o -Only in breakpad/src/processor: source_line_resolver_base.o -Only in breakpad/src/processor: stack_frame_cpu.o -Only in breakpad/src/processor: stack_frame_symbolizer.o -Only in breakpad/src/processor: stackwalk_common.o -Only in breakpad/src/processor: stackwalker_address_list.o -Only in breakpad/src/processor: stackwalker_amd64.o -Only in breakpad/src/processor: stackwalker_arm64.o -Only in breakpad/src/processor: stackwalker_arm.o -Only in breakpad/src/processor: stackwalker_mips.o -Only in breakpad/src/processor: stackwalker.o -Only in breakpad/src/processor: stackwalker_ppc64.o -Only in breakpad/src/processor: stackwalker_ppc.o -Only in breakpad/src/processor: stackwalker_sparc.o -Only in breakpad/src/processor: stackwalker_x86.o -Only in breakpad/src/processor: symbolic_constants_win.o -Only in breakpad/src/processor: tokenize.o -Only in breakpad/src: stamp-h1 -Only in breakpad/src/testing/gtest/src: .deps -Only in breakpad/src/testing/src: .deps -Only in breakpad/src/third_party/libdisasm: .deps -Only in breakpad/src/third_party/libdisasm: .dirstamp -Only in breakpad/src/tools/linux/core2md: .deps -Only in breakpad/src/tools/linux/core2md: .dirstamp -Only in breakpad/src/tools/linux/dump_syms: .deps -Only in breakpad/src/tools/linux/dump_syms: .dirstamp -Only in breakpad/src/tools/linux/md2core: .deps -Only in breakpad/src/tools/linux/md2core: .dirstamp -Only in breakpad/src/tools/linux/symupload: .deps -Only in breakpad/src/tools/linux/symupload: .dirstamp -Only in breakpad/src/tools/mac/dump_syms: .deps -Only in breakpad/src/tools/mac/dump_syms: .dirstamp diff --git a/external/breakpad/c++20-allocator.patch b/external/breakpad/c++20-allocator.patch index 588d7db4dc7c..245fac9e22c3 100644 --- a/external/breakpad/c++20-allocator.patch +++ b/external/breakpad/c++20-allocator.patch @@ -1,6 +1,7 @@ ---- src/common/memory.h -+++ src/common/memory.h -@@ -162,7 +162,7 @@ +diff -u -p -d -N -r breakpad.sav/src/common/memory_allocator.h breakpad/src/common/memory_allocator.h +--- src/common/memory_allocator.h 2021-04-07 19:12:50.357462734 +0200 ++++ src/common/memory_allocator.h 2021-04-07 19:45:05.490291766 +0200 +@@ -161,7 +161,7 @@ class PageAllocator { // Wrapper to use with STL containers template <typename T> struct PageStdAllocator : public std::allocator<T> { @@ -8,4 +9,4 @@ + typedef T* pointer; typedef typename std::allocator<T>::size_type size_type; - explicit PageStdAllocator(PageAllocator& allocator): allocator_(allocator) {} + explicit PageStdAllocator(PageAllocator& allocator) : allocator_(allocator), diff --git a/external/breakpad/dump_syms.sln b/external/breakpad/dump_syms.sln new file mode 100644 index 000000000000..354b1783c9d5 --- /dev/null +++ b/external/breakpad/dump_syms.sln @@ -0,0 +1,25 @@ +
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31229.75
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_syms", "dump_syms.vcxproj", "{792E1530-E2C5-4289-992E-317BA30E9D9F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {792E1530-E2C5-4289-992E-317BA30E9D9F}.Debug|x86.ActiveCfg = Debug|Win32
+ {792E1530-E2C5-4289-992E-317BA30E9D9F}.Debug|x86.Build.0 = Debug|Win32
+ {792E1530-E2C5-4289-992E-317BA30E9D9F}.Release|x86.ActiveCfg = Release|Win32
+ {792E1530-E2C5-4289-992E-317BA30E9D9F}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {86FBC9CF-7AF1-4996-BB80-EB24CCFC561A}
+ EndGlobalSection
+EndGlobal
diff --git a/external/breakpad/dump_syms.vcxproj b/external/breakpad/dump_syms.vcxproj new file mode 100644 index 000000000000..9f0fcda9efcf --- /dev/null +++ b/external/breakpad/dump_syms.vcxproj @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{792E1530-E2C5-4289-992E-317BA30E9D9F}</ProjectGuid>
+ <RootNamespace>dumpsyms</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>16.0.31227.257</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>Debug\</OutDir>
+ <IntDir>Debug\</IntDir>
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>Release\</OutDir>
+ <IntDir>Release\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(VSInstallDir)\DIA SDK\include;..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader />
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>$(VSInstallDir)\DIA SDK\lib\diaguids.lib;Dbghelp.lib;imagehlp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(VSInstallDir)\DIA SDK\include;..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader />
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>$(VSInstallDir)\DIA SDK\lib\diaguids.lib;Dbghelp.lib;imagehlp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\common\windows\dia_util.h" />
+ <ClInclude Include="..\..\..\common\windows\guid_string.h" />
+ <ClInclude Include="..\..\..\common\windows\omap.h" />
+ <ClInclude Include="..\..\..\common\windows\omap_internal.h" />
+ <ClInclude Include="..\..\..\common\windows\pdb_source_line_writer.h" />
+ <ClInclude Include="..\..\..\common\windows\string_utils-inl.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\common\windows\dia_util.cc" />
+ <ClCompile Include="..\..\..\common\windows\guid_string.cc" />
+ <ClCompile Include="..\..\..\common\windows\omap.cc" />
+ <ClCompile Include="..\..\..\common\windows\pdb_source_line_writer.cc" />
+ <ClCompile Include="..\..\..\common\windows\pe_source_line_writer.cc" />
+ <ClCompile Include="..\..\..\common\windows\pe_util.cc" />
+ <ClCompile Include="..\..\..\common\windows\string_utils.cc" />
+ <ClCompile Include="dump_syms.cc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/external/breakpad/include.patch b/external/breakpad/include.patch new file mode 100644 index 000000000000..e90ae9c11744 --- /dev/null +++ b/external/breakpad/include.patch @@ -0,0 +1,10 @@ +--- src/client/linux/handler/minidump_descriptor.h ++++ src/client/linux/handler/minidump_descriptor.h +@@ -31,6 +31,7 @@ + #define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_ + + #include <assert.h> ++#include <stdint.h> + #include <sys/types.h> + + #include <string> diff --git a/external/breakpad/sanitizer.patch b/external/breakpad/sanitizer.patch new file mode 100644 index 000000000000..5d673103d95b --- /dev/null +++ b/external/breakpad/sanitizer.patch @@ -0,0 +1,29 @@ +--- src/client/linux/minidump_writer/minidump_writer.cc ++++ src/client/linux/minidump_writer/minidump_writer.cc +@@ -717,7 +717,7 @@ + const std::vector<uint64_t> crash_exception_info = + dumper_->crash_exception_info(); + stream->exception_record.number_parameters = crash_exception_info.size(); +- memcpy(stream->exception_record.exception_information, ++ if (!crash_exception_info.empty()) memcpy(stream->exception_record.exception_information, + crash_exception_info.data(), + sizeof(uint64_t) * crash_exception_info.size()); + stream->thread_context = crashing_thread_context_; +@@ -760,7 +760,7 @@ + // Adjust base address with the virtual address of the PT_LOAD segment + // corresponding to offset 0 + if (ph.p_type == PT_LOAD && ph.p_offset == 0) { +- base -= ph.p_vaddr; ++ base = reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(base) - ph.p_vaddr); + } + if (ph.p_type == PT_DYNAMIC) { + dyn_addr = ph.p_vaddr; +@@ -769,7 +769,7 @@ + if (!dyn_addr) + return false; + +- ElfW(Dyn)* dynamic = reinterpret_cast<ElfW(Dyn)*>(dyn_addr + base); ++ ElfW(Dyn)* dynamic = reinterpret_cast<ElfW(Dyn)*>(dyn_addr + reinterpret_cast<uintptr_t>(base)); + + // The dynamic linker makes information available that helps gdb find all + // DSOs loaded into the program. If this information is indeed available, diff --git a/external/breakpad/ubsan.patch b/external/breakpad/ubsan.patch index f4204516eed4..29790b4c02d1 100644 --- a/external/breakpad/ubsan.patch +++ b/external/breakpad/ubsan.patch @@ -9,13 +9,13 @@ }; } // namespace google_breakpad ---- src/common/memory.h -+++ src/common/memory.h +--- src/common/memory_allocator.h ++++ src/common/memory_allocator.h @@ -75,6 +75,7 @@ if (!bytes) return NULL; + bytes = (bytes + (__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1); if (current_page_ && page_size_ - page_offset_ >= bytes) { - uint8_t *const ret = current_page_ + page_offset_; + uint8_t* const ret = current_page_ + page_offset_; page_offset_ += bytes; diff --git a/external/breakpad/ucontext.patch b/external/breakpad/ucontext.patch deleted file mode 100644 index a108ae11cd59..000000000000 --- a/external/breakpad/ucontext.patch +++ /dev/null @@ -1,194 +0,0 @@ ---- src/client/linux/dump_writer_common/ucontext_reader.cc -+++ src/client/linux/dump_writer_common/ucontext_reader.cc -@@ -40,15 +40,15 @@ - - #if defined(__i386__) - --uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { - return uc->uc_mcontext.gregs[REG_ESP]; - } - --uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { - return uc->uc_mcontext.gregs[REG_EIP]; - } - --void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, -+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, - const struct _libc_fpstate* fp) { - const greg_t* regs = uc->uc_mcontext.gregs; - -@@ -88,15 +88,15 @@ - - #elif defined(__x86_64) - --uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { - return uc->uc_mcontext.gregs[REG_RSP]; - } - --uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { - return uc->uc_mcontext.gregs[REG_RIP]; - } - --void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, -+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, - const struct _libc_fpstate* fpregs) { - const greg_t* regs = uc->uc_mcontext.gregs; - -@@ -145,15 +145,15 @@ - - #elif defined(__ARM_EABI__) - --uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { - return uc->uc_mcontext.arm_sp; - } - --uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { - return uc->uc_mcontext.arm_pc; - } - --void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { -+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { - out->context_flags = MD_CONTEXT_ARM_FULL; - - out->iregs[0] = uc->uc_mcontext.arm_r0; -@@ -184,15 +184,15 @@ - - #elif defined(__aarch64__) - --uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { - return uc->uc_mcontext.sp; - } - --uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { - return uc->uc_mcontext.pc; - } - --void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, -+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, - const struct fpsimd_context* fpregs) { - out->context_flags = MD_CONTEXT_ARM64_FULL; - -@@ -210,15 +210,15 @@ - - #elif defined(__mips__) - --uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { - return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]; - } - --uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { -+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { - return uc->uc_mcontext.pc; - } - --void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { -+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { - out->context_flags = MD_CONTEXT_MIPS_FULL; - - for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i) ---- src/client/linux/dump_writer_common/ucontext_reader.h -+++ src/client/linux/dump_writer_common/ucontext_reader.h -@@ -41,21 +41,21 @@ - - // Wraps platform-dependent implementations of accessors to ucontext structs. - struct UContextReader { -- static uintptr_t GetStackPointer(const struct ucontext* uc); -+ static uintptr_t GetStackPointer(const ucontext_t* uc); - -- static uintptr_t GetInstructionPointer(const struct ucontext* uc); -+ static uintptr_t GetInstructionPointer(const ucontext_t* uc); - - // Juggle a arch-specific ucontext into a minidump format - // out: the minidump structure - // info: the collection of register structures. - #if defined(__i386__) || defined(__x86_64) -- static void FillCPUContext(RawContextCPU *out, const ucontext *uc, -+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, - const struct _libc_fpstate* fp); - #elif defined(__aarch64__) -- static void FillCPUContext(RawContextCPU *out, const ucontext *uc, -+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, - const struct fpsimd_context* fpregs); - #else -- static void FillCPUContext(RawContextCPU *out, const ucontext *uc); -+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc); - #endif - }; - ---- src/client/linux/handler/exception_handler.cc -+++ src/client/linux/handler/exception_handler.cc -@@ -439,9 +439,9 @@ - // Fill in all the holes in the struct to make Valgrind happy. - memset(&g_crash_context_, 0, sizeof(g_crash_context_)); - memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t)); -- memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext)); -+ memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t)); - #if defined(__aarch64__) -- struct ucontext* uc_ptr = (struct ucontext*)uc; -+ ucontext_t* uc_ptr = (ucontext_t*)uc; - struct fpsimd_context* fp_ptr = - (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; - if (fp_ptr->head.magic == FPSIMD_MAGIC) { -@@ -450,9 +450,9 @@ - } - #elif !defined(__ARM_EABI__) && !defined(__mips__) - // FP state is not part of user ABI on ARM Linux. -- // In case of MIPS Linux FP state is already part of struct ucontext -+ // In case of MIPS Linux FP state is already part of ucontext_t - // and 'float_state' is not a member of CrashContext. -- struct ucontext* uc_ptr = (struct ucontext*)uc; -+ ucontext_t* uc_ptr = (ucontext_t*)uc; - if (uc_ptr->uc_mcontext.fpregs) { - memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, - sizeof(g_crash_context_.float_state)); -@@ -476,7 +476,7 @@ - // ExceptionHandler::HandleSignal(). - siginfo.si_code = SI_USER; - siginfo.si_pid = getpid(); -- struct ucontext context; -+ ucontext_t context; - getcontext(&context); - return HandleSignal(sig, &siginfo, &context); - } ---- src/client/linux/handler/exception_handler.h -+++ src/client/linux/handler/exception_handler.h -@@ -191,7 +191,7 @@ - struct CrashContext { - siginfo_t siginfo; - pid_t tid; // the crashing thread. -- struct ucontext context; -+ ucontext_t context; - #if !defined(__ARM_EABI__) && !defined(__mips__) - // #ifdef this out because FP state is not part of user ABI for Linux ARM. - // In case of MIPS Linux FP state is already part of struct ---- src/client/linux/microdump_writer/microdump_writer.cc -+++ src/client/linux/microdump_writer/microdump_writer.cc -@@ -395,7 +395,7 @@ - - void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); } - -- const struct ucontext* const ucontext_; -+ const ucontext_t* const ucontext_; - #if !defined(__ARM_EABI__) && !defined(__mips__) - const google_breakpad::fpstate_t* const float_state_; - #endif ---- src/client/linux/minidump_writer/minidump_writer.cc -+++ src/client/linux/minidump_writer/minidump_writer.cc -@@ -1238,7 +1238,7 @@ - const int fd_; // File descriptor where the minidum should be written. - const char* path_; // Path to the file where the minidum should be written. - -- const struct ucontext* const ucontext_; // also from the signal handler -+ const ucontext_t* const ucontext_; // also from the signal handler - #if !defined(__ARM_EABI__) && !defined(__mips__) - const google_breakpad::fpstate_t* const float_state_; // ditto - #endif diff --git a/external/bzip2/ExternalProject_bzip2.mk b/external/bzip2/ExternalProject_bzip2.mk index 8b37bcd27151..b4c93a356ccc 100644 --- a/external/bzip2/ExternalProject_bzip2.mk +++ b/external/bzip2/ExternalProject_bzip2.mk @@ -27,6 +27,7 @@ $(call gb_ExternalProject_get_state_target,bzip2,build): $(call gb_Trace_StartRange,bzip2,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(MAKE) \ + CC="$(CC) -fPIC" \ ) $(call gb_Trace_EndRange,bzip2,EXTERNAL) endif diff --git a/external/bzip2/UnpackedTarball_bzip2.mk b/external/bzip2/UnpackedTarball_bzip2.mk index f22ca2b5ca8f..350b45c76e0a 100644 --- a/external/bzip2/UnpackedTarball_bzip2.mk +++ b/external/bzip2/UnpackedTarball_bzip2.mk @@ -12,13 +12,13 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,bzip2)) $(eval $(call gb_UnpackedTarball_set_tarball,bzip2,$(BZIP2_TARBALL))) $(eval $(call gb_UnpackedTarball_fix_end_of_line,bzip2,\ - blocksort.c \ - bzlib.c \ - compress.c \ - crctable.c \ - decompress.c \ - huffman.c \ - randtable.c \ + makefile.msc \ )) +ifneq ($(CROSS_COMPILING),) +$(eval $(call gb_UnpackedTarball_add_patches,bzip2,\ + external/bzip2/disable-test.patch.0 \ +)) +endif + # vim: set noet sw=4 ts=4: diff --git a/external/bzip2/disable-test.patch.0 b/external/bzip2/disable-test.patch.0 new file mode 100644 index 000000000000..10d95ed25a7a --- /dev/null +++ b/external/bzip2/disable-test.patch.0 @@ -0,0 +1,49 @@ +Disable bzip2 tests when cross compiling on Windows to avoid this error: + +> Doing 6 tests (3 compress, 3 uncompress) ... +> If there's a problem, things might stop at this point. +> +> .\\bzip2 -1 < sample1.ref > sample1.rb2 +> This version of C:\sources\libo-core\workdir\UnpackedTarball\bzip2\bzip2.exe is not compatible with the version of Windows you're running. +> Check your computer's system information and then contact the software publisher. +> NMAKE : fatal error U1077: '.\\bzip2' : return code '0x1' +> Stop. + +--- makefile.msc.orig 2019-07-14 02:50:05.000000000 +0900 ++++ makefile.msc 2023-09-20 20:00:14.124370100 +0900 +@@ -14,7 +14,7 @@ + decompress.obj \ + bzlib.obj + +-all: lib bzip2 test ++all: lib bzip2 + + bzip2: lib + $(CC) $(CFLAGS) -o bzip2 bzip2.c libbz2.lib setargv.obj +@@ -23,26 +23,6 @@ + lib: $(OBJS) + lib /out:libbz2.lib $(OBJS) + +-test: bzip2 +- type words1 +- .\\bzip2 -1 < sample1.ref > sample1.rb2 +- .\\bzip2 -2 < sample2.ref > sample2.rb2 +- .\\bzip2 -3 < sample3.ref > sample3.rb2 +- .\\bzip2 -d < sample1.bz2 > sample1.tst +- .\\bzip2 -d < sample2.bz2 > sample2.tst +- .\\bzip2 -ds < sample3.bz2 > sample3.tst +- @echo All six of the fc's should find no differences. +- @echo If fc finds an error on sample3.bz2, this could be +- @echo because WinZip's 'TAR file smart CR/LF conversion' +- @echo is too clever for its own good. Disable this option. +- @echo The correct size for sample3.ref is 120,244. If it +- @echo is 150,251, WinZip has messed it up. +- fc sample1.bz2 sample1.rb2 +- fc sample2.bz2 sample2.rb2 +- fc sample3.bz2 sample3.rb2 +- fc sample1.tst sample1.ref +- fc sample2.tst sample2.ref +- fc sample3.tst sample3.ref + + + diff --git a/external/cairo/ExternalPackage_cairo.mk b/external/cairo/ExternalPackage_cairo.mk index 3b78a52fed76..6bd0800d9f21 100644 --- a/external/cairo/ExternalPackage_cairo.mk +++ b/external/cairo/ExternalPackage_cairo.mk @@ -12,11 +12,7 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,cairo,cairo)) $(eval $(call gb_ExternalPackage_use_external_project,cairo,cairo)) ifneq ($(DISABLE_DYNLOADING),TRUE) -ifneq ($(OS),ANDROID) - -$(eval $(call gb_ExternalPackage_add_file,cairo,$(LIBO_LIB_FOLDER)/libcairo.so.2,src/.libs/libcairo.so.2.1160$(CAIRO_VERSION_MICRO).0)) - -endif +$(eval $(call gb_ExternalPackage_add_file,cairo,$(LIBO_LIB_FOLDER)/libcairo-lo.so.2,src/.libs/libcairo-lo.so.2.1170$(CAIRO_VERSION_MICRO).0)) endif # vim: set noet sw=4 ts=4: diff --git a/external/cairo/ExternalPackage_pixman.mk b/external/cairo/ExternalPackage_pixman.mk index 288a9701afda..85ff062f22e2 100644 --- a/external/cairo/ExternalPackage_pixman.mk +++ b/external/cairo/ExternalPackage_pixman.mk @@ -12,12 +12,7 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,pixman,pixman)) $(eval $(call gb_ExternalPackage_use_external_project,pixman,pixman)) ifneq ($(DISABLE_DYNLOADING),TRUE) -ifneq ($(OS),ANDROID) - -$(eval $(call gb_ExternalPackage_add_file,pixman,$(LIBO_LIB_FOLDER)/libpixman-1.so.0,pixman/.libs/libpixman-1.so.0.34.0)) - +$(eval $(call gb_ExternalPackage_add_file,pixman,$(LIBO_LIB_FOLDER)/libpixman-1.so.0,pixman/.libs/libpixman-1.so.0.42.2)) endif -endif - # vim: set noet sw=4 ts=4: diff --git a/external/cairo/ExternalProject_cairo.mk b/external/cairo/ExternalProject_cairo.mk index 41e7621c789f..df6bd5a37b78 100644 --- a/external/cairo/ExternalProject_cairo.mk +++ b/external/cairo/ExternalProject_cairo.mk @@ -12,32 +12,16 @@ $(eval $(call gb_ExternalProject_ExternalProject,cairo)) $(eval $(call gb_ExternalProject_use_external_project,cairo,pixman)) $(eval $(call gb_ExternalProject_use_externals,cairo,\ + fontconfig \ freetype \ libpng \ zlib \ )) -ifeq ($(OS),ANDROID) -$(eval $(call gb_ExternalProject_use_unpacked,cairo,fontconfig)) -$(eval $(call gb_ExternalProject_use_unpacked,cairo,libpng)) -endif - $(eval $(call gb_ExternalProject_register_targets,cairo,\ build \ )) -ifeq ($(OS),WNT) - -$(call gb_ExternalProject_get_state_target,cairo,build) : - $(call gb_Trace_StartRange,cairo,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - $(MAKE) -f Makefile.win32 CFG=release ZLIB3RDLIB=zlib.lib \ - ) - $(call gb_Trace_EndRange,cairo,EXTERNAL) - - -else - # Including -rtlib=compiler-rt in pixman_LIBS is a BAD HACK: At least when compiling with Clang # -fsanitize=undefined on Linux x86-64, the generated code references __muloti4, which is an # extension provided by libclang_rt.builtins-x86_64.a runtime, but not by GCC's libgcc_s.so.1 (which @@ -58,20 +42,22 @@ else # cairo's configure. And pixman_LIBS happens to offer that. (The -Wc is necessary so that libtool # does not throw away the -rtlib=compiler-rt which it does not understand.) -# overwrite src/cairo-version.h because that is just a dummy file and included -# from cairo.h in non-overridable way - $(call gb_ExternalProject_get_state_target,cairo,build) : $(call gb_Trace_StartRange,cairo,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ $(if $(debug),STRIP=" ") \ $(if $(filter ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS) $(gb_VISIBILITY_FLAGS)") \ - $(if $(filter-out ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS)" ) \ + $(if $(filter EMSCRIPTEN,$(OS)),CFLAGS="-O3 -DCAIRO_NO_MUTEX $(ZLIB_CFLAGS) -Wno-enum-conversion $(gb_EMSCRIPTEN_CPPFLAGS)" ) \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + $(if $(filter-out EMSCRIPTEN ANDROID iOS,$(OS)), \ + CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,cairo) $(ZLIB_CFLAGS)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,cairo)" \ + ) \ $(if $(filter ANDROID iOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \ LIBS="$(ZLIB_LIBS)" \ $(if $(filter -fsanitize=%,$(LDFLAGS)),LDFLAGS="$(LDFLAGS) -fuse-ld=bfd") \ - pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman" \ + pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman -pthread" \ pixman_LIBS="-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \ $(if $(filter LINUX,$(OS)),-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\\\$$\$$ORIGIN) \ @@ -83,20 +69,17 @@ $(call gb_ExternalProject_get_state_target,cairo,build) : $(if $(SYSTEM_FREETYPE),,FREETYPE_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,freetype)/include") \ $(if $(SYSTEM_FONTCONFIG),,FONTCONFIG_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,fontconfig)") \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static)) \ - $(if $(filter ANDROID iOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(DISABLE_GUI)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \ + $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ + $(if $(filter EMSCRIPTEN ANDROID iOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(DISABLE_GUI)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \ $(if $(filter iOS,$(OS)),--enable-quartz --enable-quartz-font) \ --disable-valgrind \ $(if $(filter iOS,$(OS)),--disable-ft,--enable-ft --enable-fc) \ --disable-svg --enable-gtk-doc=no --enable-test-surfaces=no \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no ax_cv_c_float_words_bigendian=no)) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no ax_cv_c_float_words_bigendian=no)) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ - && cp cairo-version.h src/cairo-version.h \ && cd src && $(MAKE) \ ) $(call gb_Trace_EndRange,cairo,EXTERNAL) -endif - # vim: set noet sw=4 ts=4: diff --git a/external/cairo/ExternalProject_pixman.mk b/external/cairo/ExternalProject_pixman.mk index fec943762df8..f95fcb626ccc 100644 --- a/external/cairo/ExternalProject_pixman.mk +++ b/external/cairo/ExternalProject_pixman.mk @@ -13,17 +13,6 @@ $(eval $(call gb_ExternalProject_register_targets,pixman,\ build \ )) -ifeq ($(OS),WNT) - -$(call gb_ExternalProject_get_state_target,pixman,build) : - $(call gb_Trace_StartRange,pixman,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - $(MAKE) -f Makefile.win32 MMX=on SSE2=on CFG=release \ - ,pixman) - $(call gb_Trace_EndRange,pixman,EXTERNAL) - -else - # ANDROID: # The pixman-cpu.c code wants to read /proc/<pid>/auxv, but # the Android headers don't define Elf32_auxv_t. @@ -34,15 +23,15 @@ else $(call gb_ExternalProject_get_state_target,pixman,build) : $(call gb_Trace_StartRange,pixman,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure \ - $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static)) \ - $(if $(filter ANDROID,$(OS)),--disable-arm-simd --disable-arm-neon --disable-arm-iwmmxt) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(gb_RUN_CONFIGURE) ./configure \ + $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ + $(if $(filter ANDROID,$(OS)),--disable-arm-simd --disable-arm-neon --disable-arm-a64-neon --disable-arm-iwmmxt) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(if $(filter EMSCRIPTEN,$(OS)),CFLAGS="-O3 -pthread -msimd128") \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ && $(MAKE) \ ) $(call gb_Trace_EndRange,pixman,EXTERNAL) -endif - # vim: set noet sw=4 ts=4: diff --git a/external/cairo/UnpackedTarball_cairo.mk b/external/cairo/UnpackedTarball_cairo.mk index 920722c2e77a..f1697c6d0cc9 100644 --- a/external/cairo/UnpackedTarball_cairo.mk +++ b/external/cairo/UnpackedTarball_cairo.mk @@ -11,12 +11,26 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,cairo)) $(eval $(call gb_UnpackedTarball_set_tarball,cairo,$(CAIRO_TARBALL),,cairo)) +# cairo >= 1.17.6 was probably created in Fedora where +# https://salsa.debian.org/mckinstry/libtool/-/commit/26c23f951d049241128e5e04a7bbc263e5b145f1 +# isn't applied, so add that in to avoid: /usr/bin/ld: unrecognized option '--gdb-index' + +# ofz50805.patch https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/350 +# ofz46165.patch upstreamed as https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/351 +# san.patch upstreamed as https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/352 + $(eval $(call gb_UnpackedTarball_add_patches,cairo,\ - external/cairo/cairo/cairo-1.10.2.patch \ + external/cairo/cairo/cairo.buildfix.patch \ + external/cairo/cairo/cairo.RGB24_888.patch \ external/cairo/cairo/cairo-libtool-rpath.patch.1 \ external/cairo/cairo/cairo.oldfreetype.patch \ external/cairo/cairo/san.patch.0 \ - external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1 \ + external/cairo/cairo/cairo.ofz46165.patch.1 \ + external/cairo/cairo/cairo.ofz50805.patch.1 \ + external/cairo/cairo/0025-libtool-pass-use-ld.patch \ + external/cairo/cairo/libcairo-bundled-soname.patch.0 \ + external/cairo/cairo/cairo-fd-hack.patch.0 \ + external/cairo/cairo/cairo.ofz57493-Timeout.patch.1 \ )) ifeq ($(OS),iOS) @@ -26,8 +40,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,cairo,\ )) endif -# To be applied only when ENABLE_ANDROID_LOK is not defined -ifeq ($(OS)$(ENABLE_ANDROID_LOK),ANDROID) +ifeq ($(ENABLE_CAIRO_RGBA),TRUE) $(eval $(call gb_UnpackedTarball_add_patches,cairo,\ external/cairo/cairo/cairo.GL_RGBA.patch \ )) diff --git a/external/cairo/UnpackedTarball_pixman.mk b/external/cairo/UnpackedTarball_pixman.mk index cc3dbd11dcc0..922ed9f24f22 100644 --- a/external/cairo/UnpackedTarball_pixman.mk +++ b/external/cairo/UnpackedTarball_pixman.mk @@ -13,12 +13,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,pixman,$(PIXMAN_TARBALL),,cairo)) $(eval $(call gb_UnpackedTarball_add_patches,pixman,\ external/cairo/pixman/pixman-0.24.4.patch \ - external/cairo/pixman/pixman-ofz4372.patch \ external/cairo/pixman/pixman-ubsan.patch \ + external/cairo/pixman/pixman-wasm.patch \ )) -ifeq ($(OS),WNT) -$(eval $(call gb_UnpackedTarball_add_file,pixman,pixman,external/cairo/pixman/Makefile.win32.common)) -endif - # vim: set noet sw=4 ts=4: diff --git a/external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1 b/external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1 deleted file mode 100644 index c0431555b09a..000000000000 --- a/external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1 +++ /dev/null @@ -1,54 +0,0 @@ -From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001 -From: Heiko Lewin <heiko.lewin@worldiety.de> -Date: Tue, 15 Dec 2020 16:48:19 +0100 -Subject: [PATCH] Fix mask usage in image-compositor - ---- - src/cairo-image-compositor.c | 8 ++-- - test/Makefile.sources | 1 + - test/bug-image-compositor.c | 39 ++++++++++++++++++++ - test/reference/bug-image-compositor.ref.png | Bin 0 -> 185 bytes - 4 files changed, 44 insertions(+), 4 deletions(-) - create mode 100644 test/bug-image-compositor.c - create mode 100644 test/reference/bug-image-compositor.ref.png - -diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c -index 79ad69f68..4f8aaed99 100644 ---- a/src/cairo-image-compositor.c -+++ b/src/cairo-image-compositor.c -@@ -2610,14 +2610,14 @@ _inplace_src_spans (void *abstract_renderer, int y, int h, - unsigned num_spans) - { - cairo_image_span_renderer_t *r = abstract_renderer; -- uint8_t *m; -+ uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask); - int x0; - - if (num_spans == 0) - return CAIRO_STATUS_SUCCESS; - - x0 = spans[0].x; -- m = r->_buf; -+ m = base; - do { - int len = spans[1].x - spans[0].x; - if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) { -@@ -2655,7 +2655,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h, - spans[0].x, y, - spans[1].x - spans[0].x, h); - -- m = r->_buf; -+ m = base; - x0 = spans[1].x; - } else if (spans[0].coverage == 0x0) { - if (spans[0].x != x0) { -@@ -2684,7 +2684,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h, - #endif - } - -- m = r->_buf; -+ m = base; - x0 = spans[1].x; - } else { - *m++ = spans[0].coverage; -[test code changes removed] diff --git a/external/cairo/cairo/0025-libtool-pass-use-ld.patch b/external/cairo/cairo/0025-libtool-pass-use-ld.patch new file mode 100644 index 000000000000..c5558ff736a1 --- /dev/null +++ b/external/cairo/cairo/0025-libtool-pass-use-ld.patch @@ -0,0 +1,16 @@ +--- a/cairo/build/ltmain.sh 2022-05-04 16:12:17.409012360 +0100 ++++ b/cairo/build/ltmain.sh 2022-05-04 16:12:42.510870063 +0100 +@@ -7273,11 +7273,12 @@ + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files ++ # -fuse-ld=* Linker select flags for GCC + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ +- -specs=*) ++ -specs=*|-fuse-ld=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" diff --git a/external/cairo/cairo/cairo-1.10.2.patch b/external/cairo/cairo/cairo-1.10.2.patch deleted file mode 100644 index f50501926faa..000000000000 --- a/external/cairo/cairo/cairo-1.10.2.patch +++ /dev/null @@ -1,226 +0,0 @@ -diff -ruNw misc/cairo-1.10.2/build/Makefile.win32.features misc/build/cairo-1.10.2/build/Makefile.win32.features ---- misc/cairo-1.10.2/build/Makefile.win32.features 2015-10-27 17:04:21.000000000 -0400 -+++ misc/build/cairo-1.10.2/build/Makefile.win32.features 2017-11-24 21:43:14.103524768 -0500 -@@ -30,7 +30,7 @@ - CAIRO_HAS_FC_FONT=0 - CAIRO_HAS_PS_SURFACE=1 - CAIRO_HAS_PDF_SURFACE=1 --CAIRO_HAS_SVG_SURFACE=1 -+CAIRO_HAS_SVG_SURFACE=0 - CAIRO_HAS_TEST_SURFACES=0 - CAIRO_HAS_TEE_SURFACE=0 - CAIRO_HAS_XML_SURFACE=0 -diff -ruNw misc/cairo-1.10.2/configure misc/build/cairo-1.10.2/configure ---- misc/cairo-1.10.2/configure 2015-12-09 15:41:45.000000000 -0500 -+++ misc/build/cairo-1.10.2/configure 2017-11-24 21:43:14.103524768 -0500 -@@ -20580,61 +20580,12 @@ - rm -f confcache - - --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 --$as_echo_n "checking for compress in -lz... " >&6; } --if ${ac_cv_lib_z_compress+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lz $LIBS" --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char compress (); --int --main () --{ --return compress (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_lib_z_compress=yes --else -- ac_cv_lib_z_compress=no --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 --$as_echo "$ac_cv_lib_z_compress" >&6; } --if test "x$ac_cv_lib_z_compress" = xyes; then : -- ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" --if test "x$ac_cv_header_zlib_h" = xyes; then : - - have_libz=yes - - $as_echo "#define HAVE_ZLIB 1" >>confdefs.h - - --else -- have_libz="no (requires zlib http://www.gzip.org/zlib/)" --fi -- -- --else -- have_libz="no (requires zlib http://www.gzip.org/zlib/)" --fi -- -- - save_LIBS="$LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo2a_decompress in -llzo2" >&5 - $as_echo_n "checking for lzo2a_decompress in -llzo2... " >&6; } -@@ -30069,7 +30020,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - OK" >&5 - $as_echo "$FREETYPE_VERSION - OK" >&6; } - ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags` -- ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs` -+ ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs | $SED -e 's/-lz//g'` - else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - Too old" >&5 - $as_echo "$FREETYPE_VERSION - Too old" >&6; } - use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)" -@@ -30079,7 +30030,7 @@ - fi - - ft_CFLAGS="$FREETYPE_CFLAGS" -- ft_LIBS="$FREETYPE_LIBS" -+ ft_LIBS=`echo "$FREETYPE_LIBS" | $SED -e 's/-lz//g'` - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's FreeType font backend feature could be enabled" >&5 -@@ -30686,7 +30637,7 @@ - - # The ps backend requires zlib. - use_ps=$have_libz -- ps_NONPKGCONFIG_LIBS=-lz -+ ps_NONPKGCONFIG_LIBS=$ZLIB3RDLIB - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PostScript surface backend feature could be enabled" >&5 -@@ -31082,7 +31033,7 @@ - - # The pdf backend requires zlib. - use_pdf=$have_libz -- pdf_NONPKGCONFIG_LIBS=-lz -+ pdf_NONPKGCONFIG_LIBS=$ZLIB3RDLIB - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PDF surface backend feature could be enabled" >&5 -@@ -32973,7 +32924,7 @@ - - - use_xml=$have_libz -- xml_NONPKGCONFIG_LIBS=-lz -+ xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's xml surface backend feature could be enabled" >&5 -diff -ruNw misc/cairo-1.10.2/src/cairo.h misc/build/cairo-1.10.2/src/cairo.h ---- misc/cairo-1.10.2/src/cairo.h 2015-10-27 17:04:21.000000000 -0400 -+++ misc/build/cairo-1.10.2/src/cairo.h 2017-12-17 12:09:59.880406411 -0500 -@@ -397,6 +397,8 @@ - * with red in the upper 5 bits, then green in the middle - * 6 bits, and blue in the lower 5 bits. (Since 1.2) - * @CAIRO_FORMAT_RGB30: like RGB24 but with 10bpc. (Since 1.12) -+ * @CAIRO_FORMAT_RGB24_888: each pixel is a 24-bit quantity, -+ * with Red, Green, Blue taking 8-bits each, in that order. (Since 1.1x) - * - * #cairo_format_t is used to identify the memory format of - * image data. -@@ -412,9 +414,16 @@ - CAIRO_FORMAT_A8 = 2, - CAIRO_FORMAT_A1 = 3, - CAIRO_FORMAT_RGB16_565 = 4, -- CAIRO_FORMAT_RGB30 = 5 -+ CAIRO_FORMAT_RGB30 = 5, -+ CAIRO_FORMAT_RGB24_888 = 6 - } cairo_format_t; - -+/** -+ * Need this until CAIRO_FORMAT_RGB24_888 is in some official release. -+ * Otherwise we can't reliably check if this is available or we should -+ * convert from 24-bit RGB to 32-bit RGB before passing to Cairo. -+ **/ -+#define HAVE_CAIRO_FORMAT_RGB24_888 - - /** - * cairo_write_func_t: -diff -ruNw misc/cairo-1.10.2/src/cairo-image-source.c misc/build/cairo-1.10.2/src/cairo-image-source.c ---- misc/cairo-1.10.2/src/cairo-image-source.c 2015-10-27 17:04:30.000000000 -0400 -+++ misc/build/cairo-1.10.2/src/cairo-image-source.c 2017-12-17 12:09:56.076344387 -0500 -@@ -508,6 +508,19 @@ - color.blue = expand_channel(pixel & 0x3fff, 10); - return pixman_image_create_solid_fill (&color); - -+ case CAIRO_FORMAT_RGB24_888: -+ pixel = *(uint32_t *) (image->data + y * image->stride + 3 * x); -+ pixel &= 0x00ffffff; /* ignore next pixel bits */ -+ if (pixel == 0) -+ return _pixman_black_image (); -+ if (pixel == 0x00ffffff) -+ return _pixman_white_image (); -+ -+ color.red = (pixel >> 16 & 0xff) | (pixel >> 8 & 0xff00); -+ color.green = (pixel >> 8 & 0xff) | (pixel & 0xff00); -+ color.blue = (pixel & 0xff) | (pixel << 8 & 0xff00); -+ return pixman_image_create_solid_fill (&color); -+ - case CAIRO_FORMAT_ARGB32: - case CAIRO_FORMAT_RGB24: - pixel = *(uint32_t *) (image->data + y * image->stride + 4 * x); -diff -ruNw misc/cairo-1.10.2/src/cairo-image-surface.c misc/build/cairo-1.10.2/src/cairo-image-surface.c ---- misc/cairo-1.10.2/src/cairo-image-surface.c 2015-10-27 17:04:30.000000000 -0400 -+++ misc/build/cairo-1.10.2/src/cairo-image-surface.c 2017-12-17 12:09:59.876406346 -0500 -@@ -104,13 +104,15 @@ - return CAIRO_FORMAT_A1; - case PIXMAN_r5g6b5: - return CAIRO_FORMAT_RGB16_565; -+ case PIXMAN_r8g8b8: -+ return CAIRO_FORMAT_RGB24_888; - #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0) - case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8: - #endif - #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2) - case PIXMAN_a8r8g8b8_sRGB: - #endif -- case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8: -+ case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: - case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: - case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5: - case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4: -@@ -320,6 +322,9 @@ - case CAIRO_FORMAT_RGB16_565: - ret = PIXMAN_r5g6b5; - break; -+ case CAIRO_FORMAT_RGB24_888: -+ ret = PIXMAN_r8g8b8; -+ break; - case CAIRO_FORMAT_ARGB32: - case CAIRO_FORMAT_INVALID: - default: -@@ -718,6 +723,8 @@ - case CAIRO_FORMAT_RGB30: - case CAIRO_FORMAT_RGB24: - return 32; -+ case CAIRO_FORMAT_RGB24_888: -+ return 24; - case CAIRO_FORMAT_RGB16_565: - return 16; - case CAIRO_FORMAT_A8: -diff -ruNw misc/cairo-1.10.2/src/cairoint.h misc/build/cairo-1.10.2/src/cairoint.h ---- misc/cairo-1.10.2/src/cairoint.h 2015-10-27 17:04:30.000000000 -0400 -+++ misc/build/cairo-1.10.2/src/cairoint.h 2017-12-17 12:09:59.880406411 -0500 -@@ -1486,7 +1486,7 @@ - * in cairo-xlib-surface.c--again see -Wswitch-enum). - */ - #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \ -- (format) <= CAIRO_FORMAT_RGB30) -+ (format) <= CAIRO_FORMAT_RGB24_888) - - /* pixman-required stride alignment in bytes. */ - #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t)) diff --git a/external/cairo/cairo/cairo-fd-hack.patch.0 b/external/cairo/cairo/cairo-fd-hack.patch.0 new file mode 100644 index 000000000000..e5d980e94dfb --- /dev/null +++ b/external/cairo/cairo/cairo-fd-hack.patch.0 @@ -0,0 +1,15 @@ +# -*- Mode: Diff -*- +--- src/cairo-ft-font.c ++++ src/cairo-ft-font.c +@@ -737,7 +737,10 @@ + if (ret == FcResultOutOfMemory) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + if (ret == FcResultMatch) { +- if (access (filename, R_OK) == 0) { ++ int nFD = -1; ++ int n; ++ if ((sscanf (filename, "/:FD:/%d%n", &nFD, &n) == 1 && filename[n] == '\0') || ++ access (filename, R_OK) == 0) { + /* If FC_INDEX is not set, we just use 0 */ + ret = FcPatternGetInteger (pattern, FC_INDEX, 0, &id); + if (ret == FcResultOutOfMemory) diff --git a/external/cairo/cairo/cairo-libtool-rpath.patch.1 b/external/cairo/cairo/cairo-libtool-rpath.patch.1 index dffa25414f61..18a3507a9506 100644 --- a/external/cairo/cairo/cairo-libtool-rpath.patch.1 +++ b/external/cairo/cairo/cairo-libtool-rpath.patch.1 @@ -2,11 +2,11 @@ Prevent libtool from adding annoying stuff to RPATH --- cairo/configure.orig 2018-10-19 22:20:08.000000000 +0200 +++ cairo/configure 2019-09-04 17:53:00.927539686 +0200 -@@ -16592,6 +16592,7 @@ - esac - ;; - esac +@@ -10432,6 +10432,7 @@ + else + ld_shlibs=no + fi +hardcode_libdir_flag_spec= - ;; + ;; - lynxos*) + netbsd*) diff --git a/external/cairo/cairo/cairo.GL_RGBA.patch b/external/cairo/cairo/cairo.GL_RGBA.patch index 5f50dd13ffa9..648448e9de92 100644 --- a/external/cairo/cairo/cairo.GL_RGBA.patch +++ b/external/cairo/cairo/cairo.GL_RGBA.patch @@ -1,9 +1,9 @@ --- misc/cairo-1.10.2/src/cairo-image-surface.c +++ misc/cairo-1.10.2/src/cairo-image-surface.c -@@ -92,11 +92,11 @@ - _cairo_format_from_pixman_format (pixman_format_code_t pixman_format) - { - switch (pixman_format) { +@@ -97,11 +97,11 @@ + return CAIRO_FORMAT_RGBA128F; + case PIXMAN_rgb_float: + return CAIRO_FORMAT_RGB96F; - case PIXMAN_a8r8g8b8: + case PIXMAN_a8b8g8r8: //tweaked return CAIRO_FORMAT_ARGB32; @@ -14,16 +14,27 @@ return CAIRO_FORMAT_RGB24; case PIXMAN_a8: return CAIRO_FORMAT_A8; -@@ -112,7 +112,7 @@ +@@ -109,7 +109,7 @@ + return CAIRO_FORMAT_A1; + case PIXMAN_r5g6b5: + return CAIRO_FORMAT_RGB16_565; +- case PIXMAN_r8g8b8: ++ case PIXMAN_b8g8r8: //tweaked + return CAIRO_FORMAT_RGB24_888; + #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0) + case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8: +@@ -117,8 +117,8 @@ #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2) case PIXMAN_a8r8g8b8_sRGB: #endif - case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: +- case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: + case PIXMAN_a8r8g8b8: case PIXMAN_x8r8g8b8: //tweaked - case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: ++ case PIXMAN_r8g8b8: case PIXMAN_b5g6r5: case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5: case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4: -@@ -314,7 +314,7 @@ + case PIXMAN_a4b4g4r4: case PIXMAN_x4b4g4r4: case PIXMAN_r3g3b2: +@@ -320,7 +320,7 @@ ret = PIXMAN_a8; break; case CAIRO_FORMAT_RGB24: @@ -32,8 +43,8 @@ break; case CAIRO_FORMAT_RGB30: ret = PIXMAN_x2r10g10b10; -@@ -323,12 +323,12 @@ - ret = PIXMAN_r5g6b5; +@@ -335,12 +335,12 @@ + ret = PIXMAN_rgba_float; break; case CAIRO_FORMAT_RGB24_888: - ret = PIXMAN_r8g8b8; diff --git a/external/cairo/cairo/cairo.RGB24_888.patch b/external/cairo/cairo/cairo.RGB24_888.patch new file mode 100644 index 000000000000..b33bee411b9b --- /dev/null +++ b/external/cairo/cairo/cairo.RGB24_888.patch @@ -0,0 +1,104 @@ +diff -ru cairo-1.17.4.orig/src/cairo.h cairo-1.17.4/src/cairo.h +--- misc/cairo-1.17.4.orig/src/cairo.h 2021-08-29 19:43:26.976435721 +0100 ++++ misc/build/cairo-1.17.4/src/cairo.h 2021-08-29 19:47:41.373919330 +0100 +@@ -407,6 +407,8 @@ + * @CAIRO_FORMAT_RGB30: like RGB24 but with 10bpc. (Since 1.12) + * @CAIRO_FORMAT_RGB96F: 3 floats, R, G, B. (Since 1.17.2) + * @CAIRO_FORMAT_RGBA128F: 4 floats, R, G, B, A. (Since 1.17.2) ++ * @CAIRO_FORMAT_RGB24_888: each pixel is a 24-bit quantity, ++ * with Red, Green, Blue taking 8-bits each, in that order. (Since 1.1x) + * + * #cairo_format_t is used to identify the memory format of + * image data. +@@ -424,9 +426,16 @@ + CAIRO_FORMAT_RGB16_565 = 4, + CAIRO_FORMAT_RGB30 = 5, + CAIRO_FORMAT_RGB96F = 6, +- CAIRO_FORMAT_RGBA128F = 7 ++ CAIRO_FORMAT_RGBA128F = 7, ++ CAIRO_FORMAT_RGB24_888 = 8 + } cairo_format_t; + ++/** ++ * Need this until CAIRO_FORMAT_RGB24_888 is in some official release. ++ * Otherwise we can't reliably check if this is available or we should ++ * convert from 24-bit RGB to 32-bit RGB before passing to Cairo. ++ **/ ++#define HAVE_CAIRO_FORMAT_RGB24_888 + + /** + * cairo_write_func_t: +diff -ru cairo-1.17.4.orig/src/cairo-image-source.c cairo-1.17.4/src/cairo-image-source.c +--- misc/cairo-1.17.4.orig/src/cairo-image-source.c 2021-08-29 19:43:26.979435585 +0100 ++++ misc/build/cairo-1.17.4/src/cairo-image-source.c 2021-08-29 19:43:47.501506559 +0100 +@@ -509,6 +509,19 @@ + color.blue = expand_channel(pixel & 0x3fff, 10); + return pixman_image_create_solid_fill (&color); + ++ case CAIRO_FORMAT_RGB24_888: ++ pixel = (uint32_t)(image->data + y * image->stride + 3 * x)[0] | ((uint32_t)(image->data + y * image->stride + 3 * x)[1] << 8) | ((uint32_t)(image->data + y * image->stride + 3 * x)[2] << 16); ++ if (pixel == 0) ++ return _pixman_black_image (); ++ if (pixel == 0x00ffffff) ++ return _pixman_white_image (); ++ ++ color.alpha = 0xffff; ++ color.red = (pixel >> 16 & 0xff) | (pixel >> 8 & 0xff00); ++ color.green = (pixel >> 8 & 0xff) | (pixel & 0xff00); ++ color.blue = (pixel & 0xff) | (pixel << 8 & 0xff00); ++ return pixman_image_create_solid_fill (&color); ++ + case CAIRO_FORMAT_ARGB32: + case CAIRO_FORMAT_RGB24: + pixel = *(uint32_t *) (image->data + y * image->stride + 4 * x); +diff -ru cairo-1.17.4.orig/src/cairo-image-surface.c cairo-1.17.4/src/cairo-image-surface.c +--- misc/cairo-1.17.4.orig/src/cairo-image-surface.c 2021-08-29 19:43:26.982435449 +0100 ++++ misc/build/cairo-1.17.4/src/cairo-image-surface.c 2021-08-29 19:43:47.501506559 +0100 +@@ -109,13 +109,15 @@ + return CAIRO_FORMAT_A1; + case PIXMAN_r5g6b5: + return CAIRO_FORMAT_RGB16_565; ++ case PIXMAN_r8g8b8: ++ return CAIRO_FORMAT_RGB24_888; + #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0) + case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8: + #endif + #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2) + case PIXMAN_a8r8g8b8_sRGB: + #endif +- case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8: ++ case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: + case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: + case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5: + case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4: +@@ -332,6 +334,9 @@ + case CAIRO_FORMAT_RGBA128F: + ret = PIXMAN_rgba_float; + break; ++ case CAIRO_FORMAT_RGB24_888: ++ ret = PIXMAN_r8g8b8; ++ break; + case CAIRO_FORMAT_ARGB32: + case CAIRO_FORMAT_INVALID: + default: +@@ -736,6 +741,8 @@ + case CAIRO_FORMAT_RGB30: + case CAIRO_FORMAT_RGB24: + return 32; ++ case CAIRO_FORMAT_RGB24_888: ++ return 24; + case CAIRO_FORMAT_RGB16_565: + return 16; + case CAIRO_FORMAT_A8: +diff -ru cairo-1.17.4.orig/src/cairoint.h cairo-1.17.4/src/cairoint.h +--- misc/cairo-1.17.4.orig/src/cairoint.h 2021-08-29 19:43:26.973435857 +0100 ++++ misc/build/cairo-1.17.4/src/cairoint.h 2021-08-29 19:48:08.396696027 +0100 +@@ -1539,7 +1539,7 @@ + * in cairo-xlib-surface.c--again see -Wswitch-enum). + */ + #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \ +- (format) <= CAIRO_FORMAT_RGBA128F) ++ (format) <= CAIRO_FORMAT_RGB24_888) + + /* pixman-required stride alignment in bytes. */ + #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t)) diff --git a/external/cairo/cairo/cairo.buildfix.patch b/external/cairo/cairo/cairo.buildfix.patch new file mode 100644 index 000000000000..5b64dfb593f2 --- /dev/null +++ b/external/cairo/cairo/cairo.buildfix.patch @@ -0,0 +1,122 @@ +diff -ru cairo-1.17.4.orig/build/Makefile.win32.features cairo-1.17.4/build/Makefile.win32.features +--- misc/cairo-1.17.4.orig/build/Makefile.win32.features 2021-08-29 19:43:27.093430425 +0100 ++++ misc/build/cairo-1.17.4/build/Makefile.win32.features 2021-08-29 19:43:47.496506785 +0100 +@@ -30,7 +30,7 @@ + CAIRO_HAS_FC_FONT=0 + CAIRO_HAS_PS_SURFACE=1 + CAIRO_HAS_PDF_SURFACE=1 +-CAIRO_HAS_SVG_SURFACE=1 ++CAIRO_HAS_SVG_SURFACE=0 + CAIRO_HAS_TEST_SURFACES=0 + CAIRO_HAS_TEE_SURFACE=0 + CAIRO_HAS_XML_SURFACE=0 +diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure +--- misc/cairo-1.17.4.orig/configure 2021-08-29 19:43:26.966436173 +0100 ++++ misc/build/cairo-1.17.4/configure 2021-08-29 19:43:47.500506604 +0100 +@@ -17149,61 +17149,12 @@ + rm -f confcache + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 +-$as_echo_n "checking for compress in -lz... " >&6; } +-if ${ac_cv_lib_z_compress+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lz $LIBS" +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char compress (); +-int +-main () +-{ +-return compress (); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- ac_cv_lib_z_compress=yes +-else +- ac_cv_lib_z_compress=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 +-$as_echo "$ac_cv_lib_z_compress" >&6; } +-if test "x$ac_cv_lib_z_compress" = xyes; then : +- ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +-if test "x$ac_cv_header_zlib_h" = xyes; then : + + have_libz=yes + + $as_echo "#define HAVE_ZLIB 1" >>confdefs.h + + +-else +- have_libz="no (requires zlib http://www.gzip.org/zlib/)" +-fi +- +- +-else +- have_libz="no (requires zlib http://www.gzip.org/zlib/)" +-fi +- +- + save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo2a_decompress in -llzo2" >&5 + $as_echo_n "checking for lzo2a_decompress in -llzo2... " >&6; } +@@ -24319,7 +24270,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - OK" >&5 + $as_echo "$FREETYPE_VERSION - OK" >&6; } + ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags` +- ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs` ++ ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs | $SED -e 's/-lz//g'` + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - Too old" >&5 + $as_echo "$FREETYPE_VERSION - Too old" >&6; } + use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)" +@@ -24329,7 +24280,7 @@ + fi + + ft_CFLAGS="$FREETYPE_CFLAGS" +- ft_LIBS="$FREETYPE_LIBS" ++ ft_LIBS=`echo "$FREETYPE_LIBS" | $SED -e 's/-lz//g'` + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's FreeType font backend feature could be enabled" >&5 +@@ -24962,7 +24913,7 @@ + + # The ps backend requires zlib. + use_ps=$have_libz +- ps_NONPKGCONFIG_LIBS=-lz ++ ps_NONPKGCONFIG_LIBS=$ZLIB3RDLIB + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PostScript surface backend feature could be enabled" >&5 +@@ -25355,7 +25306,7 @@ + + # The pdf backend requires zlib. + use_pdf=$have_libz +- pdf_NONPKGCONFIG_LIBS=-lz ++ pdf_NONPKGCONFIG_LIBS=$ZLIB3RDLIB + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PDF surface backend feature could be enabled" >&5 +@@ -27218,7 +27169,7 @@ + use_xml="no (requires --enable-png)" + else + use_xml=$have_libz +- xml_NONPKGCONFIG_LIBS=-lz ++ xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB + fi + + diff --git a/external/cairo/cairo/cairo.ofz46165.patch.1 b/external/cairo/cairo/cairo.ofz46165.patch.1 new file mode 100644 index 000000000000..948313c2a186 --- /dev/null +++ b/external/cairo/cairo/cairo.ofz46165.patch.1 @@ -0,0 +1,16 @@ +--- a/src/cairo-pen.c 2022-03-30 09:48:14.702456922 +0100 ++++ b/src/cairo-pen.c 2022-03-30 09:50:40.011793460 +0100 +@@ -289,7 +289,12 @@ + } else if (tolerance >= major_axis) { + num_vertices = 4; + } else { +- num_vertices = ceil (2*M_PI / acos (1 - tolerance / major_axis)); ++ double divisor = acos (1 - tolerance / major_axis); ++ ++ if (divisor == 0.0) ++ return 4; ++ ++ num_vertices = ceil (2*M_PI / divisor); + + /* number of vertices must be even */ + if (num_vertices % 2) diff --git a/external/cairo/cairo/cairo.ofz50805.patch.1 b/external/cairo/cairo/cairo.ofz50805.patch.1 new file mode 100644 index 000000000000..25bd6bb930df --- /dev/null +++ b/external/cairo/cairo/cairo.ofz50805.patch.1 @@ -0,0 +1,16 @@ +--- a/src/cairo-ft-font.c 2022-08-31 09:46:52.595160200 +0100 ++++ b/src/cairo-ft-font.c 2022-08-31 09:47:41.623945654 +0100 +@@ -2568,9 +2568,11 @@ + if (unlikely (status)) + cairo_surface_destroy (&surface->base); + } +- if (unlikely (status)) +- return status; + } ++ ++ if (unlikely (status)) ++ return status; ++ + if (pixman_image_get_format (surface->pixman_image) == PIXMAN_a8r8g8b8 && + !pixman_image_get_component_alpha (surface->pixman_image)) { + _cairo_scaled_glyph_set_color_surface (scaled_glyph, diff --git a/external/cairo/cairo/cairo.ofz57493-Timeout.patch.1 b/external/cairo/cairo/cairo.ofz57493-Timeout.patch.1 new file mode 100644 index 000000000000..6e8fd5127f14 --- /dev/null +++ b/external/cairo/cairo/cairo.ofz57493-Timeout.patch.1 @@ -0,0 +1,14 @@ +--- a/src/cairo-bentley-ottmann-rectilinear.c 2023-05-11 10:34:16.206027850 +0100 ++++ b/src/cairo-bentley-ottmann-rectilinear.c 2023-05-11 10:34:21.480787694 +0100 +@@ -455,6 +455,11 @@ + if (unlikely (polygon->num_edges == 0)) + return CAIRO_STATUS_SUCCESS; + ++#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) ++ if (unlikely (polygon->num_edges > 100000)) ++ return CAIRO_STATUS_SUCCESS; ++#endif ++ + num_events = 2 * polygon->num_edges; + + events = stack_events; diff --git a/external/cairo/cairo/libcairo-bundled-soname.patch.0 b/external/cairo/cairo/libcairo-bundled-soname.patch.0 new file mode 100644 index 000000000000..92aac5f753df --- /dev/null +++ b/external/cairo/cairo/libcairo-bundled-soname.patch.0 @@ -0,0 +1,12 @@ +# -*- Mode: Diff -*- +--- src/Makefile.in ++++ src/Makefile.in +@@ -2075,7 +2075,7 @@ + $(enabled_cairo_sources) \ + $(NULL) + +-libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) ++libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -release lo -Wl,-soname -Wl,libcairo-lo.so.2 + libcairo_la_LIBADD = $(CAIRO_LIBS) + libcairo_la_DEPENDENCIES = $(cairo_def_dependency) + diff --git a/external/cairo/cairo/san.patch.0 b/external/cairo/cairo/san.patch.0 index 9e187240f240..aba2c2495e64 100644 --- a/external/cairo/cairo/san.patch.0 +++ b/external/cairo/cairo/san.patch.0 @@ -1,3 +1,15 @@ +--- configure 2022-08-27 10:09:35.721992976 +0100 ++++ configure 2022-08-27 10:10:00.363873391 +0100 +@@ -14940,7 +14940,8 @@ + + MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common" + +-MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2" ++# breaks msan ++# MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2" + + # invalidate cached value if MAYBE_WARN has changed + if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then --- src/cairo-fixed-private.h +++ src/cairo-fixed-private.h @@ -61,7 +61,7 @@ @@ -38,75 +50,17 @@ num_clusters * sizeof (cairo_text_cluster_t)); } else { const cairo_glyph_t *cur_glyph; ---- src/cairo-image-compositor.c -+++ src/cairo-image-compositor.c -@@ -130,10 +130,10 @@ - color_to_uint32 (const cairo_color_t *color) - { - return -- (color->alpha_short >> 8 << 24) | -- (color->red_short >> 8 << 16) | -- (color->green_short & 0xff00) | -- (color->blue_short >> 8); -+ ((uint32_t)color->alpha_short >> 8 << 24) | -+ ((uint32_t)color->red_short >> 8 << 16) | -+ ((uint32_t)color->green_short & 0xff00) | -+ ((uint32_t)color->blue_short >> 8); - } - - static inline cairo_bool_t ---- src/cairo-image-source.c -+++ src/cairo-image-source.c -@@ -509,7 +509,11 @@ - return pixman_image_create_solid_fill (&color); +--- src/cairo-surface.c ++++ src/cairo-surface.c +@@ -2849,7 +2849,7 @@ - case CAIRO_FORMAT_RGB24_888: -- pixel = *(uint32_t *) (image->data + y * image->stride + 3 * x); -+#ifdef WORDS_BIGENDIAN -+ pixel = (uint32_t)(image->data + y * image->stride + 3 * x)[3] | ((uint32_t)(image->data + y * image->stride + 3 * x)[2] << 8) | ((uint32_t)(image->data + y * image->stride + 3 * x)[1] << 16) | ((uint32_t)(image->data + y * image->stride + 3 * x)[0] << 24); -+#else -+ pixel = (uint32_t)(image->data + y * image->stride + 3 * x)[0] | ((uint32_t)(image->data + y * image->stride + 3 * x)[1] << 8) | ((uint32_t)(image->data + y * image->stride + 3 * x)[2] << 16) | ((uint32_t)(image->data + y * image->stride + 3 * x)[3] << 24); -+#endif - pixel &= 0x00ffffff; /* ignore next pixel bits */ - if (pixel == 0) - return _pixman_black_image (); ---- src/cairo-spans-compositor.c -+++ src/cairo-spans-compositor.c -@@ -1041,14 +1041,14 @@ - if (status == CAIRO_INT_STATUS_UNSUPPORTED) { - cairo_polygon_t polygon; - cairo_fill_rule_t fill_rule = CAIRO_FILL_RULE_WINDING; -+ cairo_box_t limits; + if (_cairo_scaled_font_has_color_glyphs (scaled_font)) { + utf8_copy = malloc (sizeof (char) * utf8_len); +- memcpy (utf8_copy, utf8, sizeof (char) * utf8_len); ++ if (utf8_len != 0) memcpy (utf8_copy, utf8, sizeof (char) * utf8_len); + utf8 = utf8_copy; - if (! _cairo_rectangle_contains_rectangle (&extents->unbounded, - &extents->mask)) - { - if (extents->clip->num_boxes == 1) { - _cairo_polygon_init (&polygon, extents->clip->boxes, 1); - } else { -- cairo_box_t limits; - _cairo_box_from_rectangle (&limits, &extents->unbounded); - _cairo_polygon_init (&polygon, &limits, 1); - } -@@ -1128,17 +1128,17 @@ - } - if (status == CAIRO_INT_STATUS_UNSUPPORTED) { - cairo_polygon_t polygon; -+ cairo_box_t limits; - - TRACE((stderr, "%s - polygon\n", __FUNCTION__)); - - if (! _cairo_rectangle_contains_rectangle (&extents->unbounded, - &extents->mask)) - { - TRACE((stderr, "%s - clipping to bounds\n", __FUNCTION__)); - if (extents->clip->num_boxes == 1) { - _cairo_polygon_init (&polygon, extents->clip->boxes, 1); - } else { -- cairo_box_t limits; - _cairo_box_from_rectangle (&limits, &extents->unbounded); - _cairo_polygon_init (&polygon, &limits, 1); - } + status = composite_color_glyphs (surface, op, --- src/cairo-tor-scan-converter.c +++ src/cairo-tor-scan-converter.c @@ -253,7 +253,7 @@ @@ -131,17 +85,6 @@ for (i = 0; i < traps->num_traps; i++) { cairo_trapezoid_t *t = &traps->traps[i]; ---- src/cairo-xlib-source.c -+++ src/cairo-xlib-source.c -@@ -567,7 +567,7 @@ - { - cairo_xlib_display_t *display = dst->display; - uint32_t pixel = -- color->alpha_short >> 8 << 24 | -+ (uint32_t)(color->alpha_short >> 8) << 24 | - color->red_short >> 8 << 16 | - color->green_short >> 8 << 8 | - color->blue_short >> 8 << 0; --- src/cairo-xlib-surface-shm.c +++ src/cairo-xlib-surface-shm.c @@ -1152,9 +1152,11 @@ diff --git a/external/cairo/pixman/Makefile.win32.common b/external/cairo/pixman/Makefile.win32.common deleted file mode 100644 index 30b94e7b1ea3..000000000000 --- a/external/cairo/pixman/Makefile.win32.common +++ /dev/null @@ -1,54 +0,0 @@ -LIBRARY = pixman-1 - -CC = cl -LD = link -AR = lib -PERL = perl - -ifeq ($(top_builddir),) -top_builddir = $(top_srcdir) -endif - -CFG_VAR = $(CFG) -ifeq ($(CFG_VAR),) -CFG_VAR = release -endif - -ifeq ($(CFG_VAR),debug) -CFG_CFLAGS = -MD -Od -Zi -CFG_LDFLAGS = -DEBUG -else -CFG_CFLAGS = -MD -O2 -CFG_LDFLAGS = -endif - -# Package definitions, to be used instead of those provided in config.h -PKG_CFLAGS = -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT="" - -BASE_CFLAGS = -nologo -I. -I$(top_srcdir) -I$(top_srcdir)/pixman - -PIXMAN_CFLAGS = $(BASE_CFLAGS) $(PKG_CFLAGS) $(CFG_CFLAGS) $(CFLAGS) -PIXMAN_LDFLAGS = -nologo $(CFG_LDFLAGS) $(LDFLAGS) -PIXMAN_ARFLAGS = -nologo $(LDFLAGS) - - -inform: -ifneq ($(CFG),release) -ifneq ($(CFG),debug) -ifneq ($(CFG),) - @echo "Invalid specified configuration option: "$(CFG)"." - @echo - @echo "Possible choices for configuration are 'release' and 'debug'" - @exit 1 -endif - @echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)" -endif -endif - - -$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES) - @mkdir -p $(CFG_VAR) - @$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $< - -clean: inform - @$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} $(BUILT_SOURCES) || exit 0 diff --git a/external/cairo/pixman/pixman-0.24.4.patch b/external/cairo/pixman/pixman-0.24.4.patch index 6d871e37bfd1..a5d32f88f82f 100644 --- a/external/cairo/pixman/pixman-0.24.4.patch +++ b/external/cairo/pixman/pixman-0.24.4.patch @@ -1,6 +1,6 @@ --- misc/pixman-0.24.4/Makefile.in 2011-11-06 22:11:25.000000000 +0100 +++ misc/build/pixman-0.24.4/Makefile.in 2011-12-16 09:06:45.317211035 +0100 -@@ -272,7 +272,7 @@ +@@ -385,7 +385,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff --git a/external/cairo/pixman/pixman-ofz4372.patch b/external/cairo/pixman/pixman-ofz4372.patch deleted file mode 100644 index aaf83f11d414..000000000000 --- a/external/cairo/pixman/pixman-ofz4372.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- misc/pixman/pixman/pixman-solid-fill.c -+++ misc/build/pixman/pixman/pixman-solid-fill.c -@@ -30,10 +30,10 @@ static uint32_t - color_to_uint32 (const pixman_color_t *color) - { - return -- (color->alpha >> 8 << 24) | -- (color->red >> 8 << 16) | -+ ((uint32_t)color->alpha >> 8 << 24) | -+ ((uint32_t)color->red >> 8 << 16) | - (color->green & 0xff00) | -- (color->blue >> 8); -+ ((uint32_t)color->blue >> 8); - } - - static argb_t diff --git a/external/cairo/pixman/pixman-ubsan.patch b/external/cairo/pixman/pixman-ubsan.patch index 8f68d569e117..b4b1d43adb18 100644 --- a/external/cairo/pixman/pixman-ubsan.patch +++ b/external/cairo/pixman/pixman-ubsan.patch @@ -1,59 +1,7 @@ ---- misc/pixman/pixman/pixman.h -+++ misc/build/pixman/pixman/pixman.h -@@ -127,7 +127,7 @@ - #define pixman_fixed_1_minus_e (pixman_fixed_1 - pixman_fixed_e) - #define pixman_fixed_minus_1 (pixman_int_to_fixed(-1)) - #define pixman_fixed_to_int(f) ((int) ((f) >> 16)) --#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((i) << 16)) -+#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((i) * (1 << 16))) - #define pixman_fixed_to_double(f) (double) ((f) / (double) pixman_fixed_1) - #define pixman_double_to_fixed(d) ((pixman_fixed_t) ((d) * 65536.0)) - #define pixman_fixed_frac(f) ((f) & pixman_fixed_1_minus_e) ---- misc/pixman/pixman/pixman-fast-path.c -+++ misc/build/pixman/pixman/pixman-fast-path.c -@@ -2758,8 +2758,8 @@ - * positioned relative to a particular phase (and not relative to whatever - * exact fraction we happen to get here). - */ -- x = ((vx >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1); -- y = ((vy >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1); -+ x = ((uint32_t)(vx >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1); -+ y = ((uint32_t)(vy >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1); - - px = (x & 0xffff) >> x_phase_shift; - py = (y & 0xffff) >> y_phase_shift; -@@ -2836,7 +2836,7 @@ - sgtot = CLIP (sgtot, 0, 0xff); - sbtot = CLIP (sbtot, 0, 0xff); - -- buffer[k] = (satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0); -+ buffer[k] = ((uint32_t)satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0); - - next: - vx += ux; -@@ -3086,7 +3086,7 @@ - static force_inline uint32_t - convert_a8 (const uint8_t *row, int x) - { -- return *(row + x) << 24; -+ return (uint32_t)*(row + x) << 24; - } - - static force_inline uint32_t ---- misc/pixman/pixman/pixman-access.c -+++ misc/build/pixman/pixman/pixman-access.c -@@ -100,7 +100,7 @@ - uint32_t *__d = ((uint32_t *)(l)) + ((o) >> 5); \ - uint32_t __m, __v; \ - \ -- __m = 1 << ((o) & 0x1f); \ -+ __m = (uint32_t)1 << ((o) & 0x1f); \ - __v = (v)? __m : 0; \ - \ - WRITE((img), __d, (READ((img), __d) & ~__m) | __v); \ ---- misc/pixman/pixman/pixman-bits-image.c -+++ misc/build/pixman/pixman/pixman-bits-image.c -@@ -243,8 +243,8 @@ +diff -ru pixman-0.42.2.orig/pixman/pixman-bits-image.c pixman-0.42.2/pixman/pixman-bits-image.c +--- misc/pixman-0.42.2.orig/pixman/pixman-bits-image.c 2022-11-03 02:25:48.000000000 +0900 ++++ misc/build/pixman-0.42.2/pixman/pixman-bits-image.c 2022-11-28 21:35:25.896969126 +0900 +@@ -351,8 +351,8 @@ * positioned relative to a particular phase (and not relative to whatever * exact fraction we happen to get here). */ @@ -64,17 +12,9 @@ px = (x & 0xffff) >> x_phase_shift; py = (y & 0xffff) >> y_phase_shift; -@@ -306,7 +306,7 @@ - sgtot = CLIP (sgtot, 0, 0xff); - sbtot = CLIP (sbtot, 0, 0xff); - -- return ((satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot)); -+ return (((uint32_t)satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot)); - } - - static force_inline uint32_t ---- misc/pixman/pixman/pixman-combine32.c -+++ misc/build/pixman/pixman/pixman-combine32.c +diff -ru pixman-0.42.2.orig/pixman/pixman-combine32.c pixman-0.42.2/pixman/pixman-combine32.c +--- misc/pixman-0.42.2.orig/pixman/pixman-combine32.c 2022-02-02 05:51:25.000000000 +0900 ++++ misc/build/pixman-0.42.2/pixman/pixman-combine32.c 2022-11-28 21:38:48.226968594 +0900 @@ -589,7 +589,7 @@ rg = DIV_ONE_UN8 (rg); \ rb = DIV_ONE_UN8 (rb); \ @@ -84,49 +24,45 @@ } \ } \ \ ---- misc/pixman/pixman/pixman-gradient-walker.c -+++ misc/build/pixman/pixman/pixman-gradient-walker.c -@@ -193,7 +193,7 @@ - g8 = g + 0.5f; - b8 = b + 0.5f; +diff -ru pixman-0.42.2.orig/pixman/pixman-fast-path.c pixman-0.42.2/pixman/pixman-fast-path.c +--- misc/pixman-0.42.2.orig/pixman/pixman-fast-path.c 2022-10-18 02:47:42.000000000 +0900 ++++ misc/build/pixman-0.42.2/pixman/pixman-fast-path.c 2022-11-28 21:53:12.596963317 +0900 +@@ -2758,8 +2758,8 @@ + * positioned relative to a particular phase (and not relative to whatever + * exact fraction we happen to get here). + */ +- x = ((vx >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1); +- y = ((vy >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1); ++ x = ((uint32_t)(vx >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1); ++ y = ((uint32_t)(vy >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1); -- v = ((a8 << 24) & 0xff000000) | -+ v = (((uint32_t)a8 << 24) & 0xff000000) | - ((r8 << 16) & 0x00ff0000) | - ((g8 << 8) & 0x0000ff00) | - ((b8 >> 0) & 0x000000ff); ---- misc/pixman/pixman/pixman-sse2.c -+++ misc/build/pixman/pixman/pixman-sse2.c -@@ -516,9 +516,13 @@ + px = (x & 0xffff) >> x_phase_shift; + py = (y & 0xffff) >> y_phase_shift; +@@ -2837,9 +2837,9 @@ + sbtot = CLIP (sbtot, 0, 0xff); + + #ifdef WORDS_BIGENDIAN +- buffer[k] = (satot << 0) | (srtot << 8) | (sgtot << 16) | (sbtot << 24); ++ buffer[k] = (satot << 0) | (srtot << 8) | (sgtot << 16) | ((uint32_t)sbtot << 24); + #else +- buffer[k] = (satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0); ++ buffer[k] = ((uint32_t)satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0); + #endif + + next: +diff -ru pixman-0.42.2.orig/pixman/pixman-sse2.c pixman-0.42.2/pixman/pixman-sse2.c +--- misc/pixman-0.42.2/pixman/pixman-sse2.c 2022-02-02 05:51:25.000000000 +0900 ++++ misc/build/pixman-0.42.2/pixman/pixman-sse2.c 2022-11-28 22:11:19.276969466 +0900 +@@ -516,7 +516,7 @@ } static force_inline uint32_t -combine1 (const uint32_t *ps, const uint32_t *pm) +combine1 (const void *ps, const uint32_t *pm) { -- uint32_t s = *ps; -+#ifdef WORDS_BIGENDIAN -+ uint32_t s = (uint32_t)((const uint8_t *)ps)[3] | ((uint32_t)((const uint8_t *)ps)[2] << 8) | ((uint32_t)((const uint8_t *)ps)[1] << 16) | ((uint32_t)((const uint8_t *)ps)[0] << 24); -+#else -+ uint32_t s = (uint32_t)((const uint8_t *)ps)[0] | ((uint32_t)((const uint8_t *)ps)[1] << 8) | ((uint32_t)((const uint8_t *)ps)[2] << 16) | ((uint32_t)((const uint8_t *)ps)[3] << 24); -+#endif - - if (pm) - { -@@ -3256,7 +3260,11 @@ - - while (w >= 4) - { -- m = *((uint32_t*)mask); -+#ifdef WORDS_BIGENDIAN -+ m = (uint32_t)mask[3] | ((uint32_t)mask[2] << 8) | ((uint32_t)mask[1] << 16) | ((uint32_t)mask[0] << 24); -+#else -+ m = (uint32_t)mask[0] | ((uint32_t)mask[1] << 8) | ((uint32_t)mask[2] << 16) | ((uint32_t)mask[3] << 24); -+#endif - - if (srca == 0xff && m == 0xffffffff) - { -@@ -3343,7 +3351,7 @@ + uint32_t s; + memcpy(&s, ps, sizeof(uint32_t)); +@@ -3345,7 +3345,7 @@ b = filler & 0xff; w = (b << 8) | b; @@ -135,57 +71,10 @@ } else if (bpp == 16) { -@@ -3528,7 +3536,11 @@ - - while (w >= 4) - { -- m = *((uint32_t*)mask); -+#ifdef WORDS_BIGENDIAN -+ m = (uint32_t)mask[3] | ((uint32_t)mask[2] << 8) | ((uint32_t)mask[1] << 16) | ((uint32_t)mask[0] << 24); -+#else -+ m = (uint32_t)mask[0] | ((uint32_t)mask[1] << 8) | ((uint32_t)mask[2] << 16) | ((uint32_t)mask[3] << 24); -+#endif - - if (srca == 0xff && m == 0xffffffff) - { -@@ -5016,7 +5028,11 @@ - - while (w >= 4) - { -- m = *(uint32_t *) mask; -+#ifdef WORDS_BIGENDIAN -+ m = (uint32_t)mask[3] | ((uint32_t)mask[2] << 8) | ((uint32_t)mask[1] << 16) | ((uint32_t)mask[0] << 24); -+#else -+ m = (uint32_t)mask[0] | ((uint32_t)mask[1] << 8) | ((uint32_t)mask[2] << 16) | ((uint32_t)mask[3] << 24); -+#endif - - if (m) - { -@@ -5970,7 +5986,11 @@ - __m128i xmm_dst, xmm_dst_lo, xmm_dst_hi; - __m128i xmm_mask, xmm_mask_lo, xmm_mask_hi; - -- m = *(uint32_t*)mask; -+#ifdef WORDS_BIGENDIAN -+ m = (uint32_t)mask[3] | ((uint32_t)mask[2] << 8) | ((uint32_t)mask[1] << 16) | ((uint32_t)mask[0] << 24); -+#else // TODO:big endian -+ m = (uint32_t)mask[0] | ((uint32_t)mask[1] << 8) | ((uint32_t)mask[2] << 16) | ((uint32_t)mask[3] << 24); -+#endif - - if (m) - { -@@ -6437,7 +6457,7 @@ - - while (w) - { -- *dst++ = *(src++) << 24; -+ *dst++ = (uint32_t)*(src++) << 24; - w--; - } - ---- misc/pixman/pixman/pixman-utils.c -+++ misc/build/pixman/pixman/pixman-utils.c -@@ -214,7 +214,7 @@ +diff -ru pixman-0.42.2.orig/pixman/pixman-utils.c pixman-0.42.2/pixman/pixman-utils.c +--- misc/pixman-0.42.2.orig/pixman/pixman-utils.c 2022-02-02 05:51:25.000000000 +0900 ++++ misc/build/pixman-0.42.2/pixman/pixman-utils.c 2022-11-28 21:55:44.196964912 +0900 +@@ -213,7 +213,7 @@ g = float_to_unorm (src[i].g, 8); b = float_to_unorm (src[i].b, 8); diff --git a/external/cairo/pixman/pixman-wasm.patch b/external/cairo/pixman/pixman-wasm.patch new file mode 100644 index 000000000000..a04aa7ccca1b --- /dev/null +++ b/external/cairo/pixman/pixman-wasm.patch @@ -0,0 +1,108 @@ +--- a/pixman/pixman/pixman-x86.c ++++ b/pixman/pixman/pixman-x86.c +@@ -77,13 +77,20 @@ + + #else + +-#define _PIXMAN_X86_64 \ +- (defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)) ++#if (defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)) ++#define _PIXMAN_X86_64 1 ++#else ++#define _PIXMAN_X86_64 0 ++#endif + + static pixman_bool_t + have_cpuid (void) + { +-#if _PIXMAN_X86_64 || defined (_MSC_VER) ++#if defined(__EMSCRIPTEN__) ++ ++ return FALSE; ++ ++#elif _PIXMAN_X86_64 || defined (_MSC_VER) + + return TRUE; + +@@ -109,6 +109,8 @@ + #endif + } + ++#if !defined(__EMSCRIPTEN__) ++ + static void + pixman_cpuid (uint32_t feature, + uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) +@@ -156,10 +156,17 @@ + #error Unknown compiler + #endif + } ++ ++#endif // !__EMSCRIPTEN__ + + static cpu_features_t + detect_cpu_features (void) + { ++#if defined(__EMSCRIPTEN__) ++ ++ return X86_MMX | X86_MMX_EXTENSIONS | X86_SSE | X86_SSE2 | X86_SSSE3; ++ ++#else + uint32_t a, b, c, d; + cpu_features_t features = 0; + +@@ -202,6 +202,8 @@ + } + + return features; ++ ++#endif // !__EMSCRIPTEN__ + } + + #endif +--- a/pixman/pixman/pixman-ssse3.c ++++ b/pixman/pixman/pixman-ssse3.c +@@ -28,7 +28,9 @@ + #endif + + #include <stdlib.h> ++#if !defined(__EMSCRIPTEN__) + #include <mmintrin.h> ++#endif + #include <xmmintrin.h> + #include <emmintrin.h> + #include <tmmintrin.h> +--- a/pixman/configure ++++ b/pixman/configure +@@ -14207,7 +14207,11 @@ + #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)) + #error "Need GCC >= 3.4 for MMX intrinsics" + #endif ++#if !defined(__EMSCRIPTEN__) + #include <mmintrin.h> ++#else ++#include <xmmintrin.h> ++#endif + #include <stdint.h> + + /* Check support for block expressions */ +@@ -14308,7 +14308,9 @@ + # error "Need GCC >= 4.2 for SSE2 intrinsics on x86" + # endif + #endif ++#if !defined(__EMSCRIPTEN__) + #include <mmintrin.h> ++#endif + #include <xmmintrin.h> + #include <emmintrin.h> + int param; +@@ -14380,7 +14380,9 @@ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++#if !defined(__EMSCRIPTEN__) + #include <mmintrin.h> ++#endif + #include <xmmintrin.h> + #include <emmintrin.h> + #include <tmmintrin.h> diff --git a/external/clew/source/include/clew/clew.h b/external/clew/source/include/clew/clew.h index 7b325d1ddf4e..a722b68bbb8f 100644 --- a/external/clew/source/include/clew/clew.h +++ b/external/clew/source/include/clew/clew.h @@ -84,6 +84,8 @@ extern "C" { #define CL_EXTENSION_WEAK_LINK #endif +#include <stdint.h> + #if defined(_WIN32) && defined(_MSC_VER) /* scalar types */ @@ -165,8 +167,6 @@ typedef double cl_double16[16]; #else -#include <stdint.h> - /* scalar types */ typedef int8_t cl_char; typedef uint8_t cl_uchar; diff --git a/external/clucene/Library_clucene.mk b/external/clucene/Library_clucene.mk index 6f585f6f2bfa..e837f9f64fb6 100644 --- a/external/clucene/Library_clucene.mk +++ b/external/clucene/Library_clucene.mk @@ -31,16 +31,23 @@ $(eval $(call gb_Library_add_defs,clucene,\ -Dclucene_contribs_lib_EXPORTS \ )) -# Needed when building against MSVC in C++17 mode, as -# workdir/UnpackedTarball/clucene/src/core/CLucene/util/Equators.h uses std::binary_function: +# Needed when building against either libc++ or MSVC's standard library (including clang-cl builds), +# as e.g. workdir/UnpackedTarball/clucene/src/core/CLucene/util/_Arrays.h uses std::binary_function: +ifeq ($(HAVE_LIBCPP),TRUE) +$(eval $(call gb_Library_add_defs,clucene, \ + -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION \ +)) +else ifeq ($(COM),MSC) $(eval $(call gb_Library_add_defs,clucene, \ -D_HAS_AUTO_PTR_ETC=1 \ )) +endif ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,clucene,\ -lm \ -ldl \ + -pthread \ )) endif diff --git a/external/clucene/Module_clucene.mk b/external/clucene/Module_clucene.mk index aee86111ef28..d74fc441fcb0 100644 --- a/external/clucene/Module_clucene.mk +++ b/external/clucene/Module_clucene.mk @@ -9,13 +9,9 @@ $(eval $(call gb_Module_Module,clucene)) -# do we need the Android check below? Shouldn't it be already covered by -# gb_Helper_optional in Module_external.mk? -ifneq ($(OS),ANDROID) $(eval $(call gb_Module_add_targets,clucene,\ Library_clucene \ UnpackedTarball_clucene \ )) -endif # vim: set noet sw=4 ts=4: diff --git a/external/clucene/UnpackedTarball_clucene.mk b/external/clucene/UnpackedTarball_clucene.mk index 37c1c16dab0f..3acdb35b5757 100644 --- a/external/clucene/UnpackedTarball_clucene.mk +++ b/external/clucene/UnpackedTarball_clucene.mk @@ -34,13 +34,14 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,clucene,0)) # <https://sourceforge.net/p/clucene/mailman/message/36991067/> # c++20.patch was proposed upstream, see # <https://sourceforge.net/p/clucene/mailman/message/37040362/> +# nullstring.patch was proposed upstream, see +# <https://sourceforge.net/p/clucene/mailman/message/37338234/> $(eval $(call gb_UnpackedTarball_add_patches,clucene,\ external/clucene/patches/clucene-debug.patch \ external/clucene/patches/clucene-multimap-put.patch \ external/clucene/patches/clucene-narrowing-conversions.patch \ external/clucene/patches/clucene-nullptr.patch \ external/clucene/patches/clucene-warnings.patch \ - external/clucene/patches/clucene-aix.patch \ external/clucene/patches/clucene-git1-win64.patch \ external/clucene/patches/clucene-ub.patch \ external/clucene/patches/clucene-mutex.patch \ @@ -50,6 +51,11 @@ $(eval $(call gb_UnpackedTarball_add_patches,clucene,\ external/clucene/patches/heap-buffer-overflow.patch \ external/clucene/patches/c++20.patch \ external/clucene/patches/write-strings.patch \ + external/clucene/patches/nullstring.patch \ + external/clucene/patches/binary_function.patch \ + external/clucene/patches/clucene-pure-virtual.patch \ + external/clucene/patches/enumarith.patch \ + external/clucene/patches/clucene-reprobuild.patch.1 \ )) ifneq ($(OS),WNT) diff --git a/external/clucene/patches/binary_function.patch b/external/clucene/patches/binary_function.patch new file mode 100644 index 000000000000..a7e4b867d0c7 --- /dev/null +++ b/external/clucene/patches/binary_function.patch @@ -0,0 +1,57 @@ +--- src/core/CLucene/search/BooleanQuery.cpp ++++ src/core/CLucene/search/BooleanQuery.cpp +@@ -25,7 +25,7 @@ + CL_NS_USE(util) + CL_NS_DEF(search) + +- class BooleanClause_Compare:public CL_NS_STD(binary_function)<const BooleanClause*,const BooleanClause*,bool> ++ class BooleanClause_Compare + { + public: + bool operator()( const BooleanClause* val1, const BooleanClause* val2 ) const { +--- src/core/CLucene/util/_Arrays.h ++++ src/core/CLucene/util/_Arrays.h +@@ -124,8 +124,7 @@ + + template <typename _kt, typename _comparator, + typename class1, typename class2> +- class CLListEquals: +- public CL_NS_STD(binary_function)<class1*,class2*,bool> ++ class CLListEquals + { + typedef typename class1::const_iterator _itr1; + typedef typename class2::const_iterator _itr2; +--- src/core/CLucene/util/Equators.h ++++ src/core/CLucene/util/Equators.h +@@ -22,19 +22,19 @@ + /** @internal */ + class CLUCENE_INLINE_EXPORT Equals{ + public: +- class CLUCENE_INLINE_EXPORT Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> ++ class CLUCENE_INLINE_EXPORT Int32 + { + public: + bool operator()( const int32_t val1, const int32_t val2 ) const; + }; + +- class CLUCENE_INLINE_EXPORT Char:public CL_NS_STD(binary_function)<const char*,const char*,bool> ++ class CLUCENE_INLINE_EXPORT Char + { + public: + bool operator()( const char* val1, const char* val2 ) const; + }; + #ifdef _UCS2 +- class CLUCENE_INLINE_EXPORT WChar: public CL_NS_STD(binary_function)<const wchar_t*,const wchar_t*,bool> ++ class CLUCENE_INLINE_EXPORT WChar + { + public: + bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; +@@ -48,7 +48,7 @@ + + + template<typename _cl> +- class CLUCENE_INLINE_EXPORT Void:public CL_NS_STD(binary_function)<const void*,const void*,bool> ++ class CLUCENE_INLINE_EXPORT Void + { + public: + bool operator()( _cl* val1, _cl* val2 ) const{ diff --git a/external/clucene/patches/clucene-aix.patch b/external/clucene/patches/clucene-aix.patch deleted file mode 100644 index 2b796fa45bdc..000000000000 --- a/external/clucene/patches/clucene-aix.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -rc clucene.orig/src/core/CLucene/store/MMapInput.cpp clucene/src/core/CLucene/store/MMapInput.cpp -*** src/core/CLucene/store/MMapInput.cpp Wed Apr 10 10:57:37 2013 ---- src/core/CLucene/store/MMapInput.cpp Wed Apr 10 10:58:30 2013 -*************** -*** 115,121 **** - { - } - -! bool MMapIndexInput::open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize ) { - - //Func - Constructor. - // Opens the file named path ---- 115,121 ---- - { - } - -! bool MMapIndexInput::Open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize ) { - - //Func - Constructor. - // Opens the file named path -diff -rc clucene.orig/src/core/CLucene/store/_MMapIndexInput.h clucene/src/core/CLucene/store/_MMapIndexInput.h -*** src/core/CLucene/store/_MMapIndexInput.h Wed Apr 10 10:57:37 2013 ---- src/core/CLucene/store/_MMapIndexInput.h Wed Apr 10 10:58:53 2013 -*************** -*** 18,24 **** - MMapIndexInput(const MMapIndexInput& clone); - MMapIndexInput(Internal* _internal); - public: -! static bool open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize); - - ~MMapIndexInput(); - IndexInput* clone() const; ---- 18,24 ---- - MMapIndexInput(const MMapIndexInput& clone); - MMapIndexInput(Internal* _internal); - public: -! static bool Open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize); - - ~MMapIndexInput(); - IndexInput* clone() const; diff --git a/external/clucene/patches/clucene-pure-virtual.patch b/external/clucene/patches/clucene-pure-virtual.patch new file mode 100644 index 000000000000..0d4f95fe538f --- /dev/null +++ b/external/clucene/patches/clucene-pure-virtual.patch @@ -0,0 +1,11 @@ +--- src/core/CLucene/store/IndexOutput.h ++++ src/core/CLucene/store/IndexOutput.h +@@ -159,7 +159,7 @@ + * @param b the bytes to write + * @param len the number of bytes to write + */ +- virtual void flushBuffer(const uint8_t* b, const int32_t len) = 0; ++ virtual void flushBuffer(const uint8_t* /*b*/, const int32_t /*len*/) {} + }; + + CL_NS_END diff --git a/external/clucene/patches/clucene-reprobuild.patch.1 b/external/clucene/patches/clucene-reprobuild.patch.1 new file mode 100644 index 000000000000..2c5a0b95135f --- /dev/null +++ b/external/clucene/patches/clucene-reprobuild.patch.1 @@ -0,0 +1,61 @@ +diff -ur clucene.org/src/core/CLucene/index/IndexWriter.cpp clucene/src/core/CLucene/index/IndexWriter.cpp +--- clucene.org/src/core/CLucene/index/IndexWriter.cpp 2023-11-02 17:31:00.110168174 +0100 ++++ clucene/src/core/CLucene/index/IndexWriter.cpp 2023-11-02 17:33:22.507665912 +0100 +@@ -366,6 +366,10 @@ + } + } + ++void IndexWriter::setSegmentInfoStartVersion(int64_t startVersion) { ++ this->segmentInfos->setStartVersion(startVersion); ++} ++ + int32_t IndexWriter::getMaxBufferedDocs() { + ensureOpen(); + return docWriter->getMaxBufferedDocs(); +diff -ur clucene.org/src/core/CLucene/index/IndexWriter.h clucene/src/core/CLucene/index/IndexWriter.h +--- clucene.org/src/core/CLucene/index/IndexWriter.h 2023-11-02 17:31:00.113501525 +0100 ++++ clucene/src/core/CLucene/index/IndexWriter.h 2023-11-02 17:33:43.547787510 +0100 +@@ -336,6 +336,12 @@ + int64_t getWriteLockTimeout(); + + /** ++ * Sets the 0th segmentinfo version. Default is current system time ++ * in milliseconds ++ */ ++ void setSegmentInfoStartVersion(int64_t startVersion); ++ ++ /** + * Sets the maximum time to wait for a commit lock (in milliseconds). + */ + void setCommitLockTimeout(int64_t commitLockTimeout); +diff -ur clucene.org/src/core/CLucene/index/SegmentInfos.cpp clucene/src/core/CLucene/index/SegmentInfos.cpp +--- clucene.org/src/core/CLucene/index/SegmentInfos.cpp 2023-11-02 17:31:00.110168174 +0100 ++++ clucene/src/core/CLucene/index/SegmentInfos.cpp 2023-11-02 18:04:43.855243418 +0100 +@@ -662,6 +662,10 @@ + return IndexFileNames::fileNameFromGeneration( IndexFileNames::SEGMENTS, "", nextGeneration ); + } + ++ void SegmentInfos::setStartVersion(int64_t version) { ++ this->version = version; ++ } ++ + void SegmentInfos::clearto(size_t from, size_t end){ + size_t range = end - from; + if ( (infos.size() - from) >= range) { // Make sure we actually need to remove +diff -ur clucene.org/src/core/CLucene/index/_SegmentInfos.h clucene/src/core/CLucene/index/_SegmentInfos.h +--- clucene.org/src/core/CLucene/index/_SegmentInfos.h 2023-11-02 17:31:00.106834824 +0100 ++++ clucene/src/core/CLucene/index/_SegmentInfos.h 2023-11-02 18:04:51.178598463 +0100 +@@ -347,6 +347,13 @@ + */ + std::string getNextSegmentFileName(); + ++ /** ++ * Set version value to start from ++ ++ Defaults to current time in milliseconds ++ */ ++ void setStartVersion(int64_t version); ++ + /* public vector-like operations */ + //delete and clears objects 'from' from to 'to' + void clearto(size_t to, size_t end); diff --git a/external/clucene/patches/enumarith.patch b/external/clucene/patches/enumarith.patch new file mode 100644 index 000000000000..d271c7b3df26 --- /dev/null +++ b/external/clucene/patches/enumarith.patch @@ -0,0 +1,11 @@ +--- src/core/CLucene/index/FieldsReader.cpp ++++ src/core/CLucene/index/FieldsReader.cpp +@@ -230,7 +230,7 @@ + int64_t pointer = fieldsStream->getFilePointer(); + //Skip ahead of where we are by the length of what is stored + fieldsStream->skipChars(length); +- f = _CLNEW LazyField(this, fi->name, Field::STORE_YES | getIndexType(fi, tokenize) | getTermVectorType(fi), length, pointer); ++ f = _CLNEW LazyField(this, fi->name, +Field::STORE_YES | getIndexType(fi, tokenize) | getTermVectorType(fi), length, pointer); + f->setOmitNorms(fi->omitNorms); + } + doc.add(*f); diff --git a/external/clucene/patches/nullstring.patch b/external/clucene/patches/nullstring.patch new file mode 100644 index 000000000000..6043e9f00890 --- /dev/null +++ b/external/clucene/patches/nullstring.patch @@ -0,0 +1,11 @@ +--- src/core/CLucene/index/SegmentInfos.cpp ++++ src/core/CLucene/index/SegmentInfos.cpp +@@ -358,7 +358,7 @@ + if (delGen == NO) { + // In this case we know there is no deletion filename + // against this segment +- return NULL; ++ return {}; + } else { + // If delGen is CHECK_DIR, it's the pre-lockless-commit file format + return IndexFileNames::fileNameFromGeneration(name.c_str(), (string(".") + IndexFileNames::DELETES_EXTENSION).c_str(), delGen); diff --git a/external/coinmp/ExternalPackage_coinmp.mk b/external/coinmp/ExternalPackage_coinmp.mk index 23fbb10b820f..91c3d4531748 100644 --- a/external/coinmp/ExternalPackage_coinmp.mk +++ b/external/coinmp/ExternalPackage_coinmp.mk @@ -19,23 +19,25 @@ $(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/CoinMP.dll,C else ifneq ($(DISABLE_DYNLOADING),) # Just use the static archives from workdir. See bin/lo-all-static-libs else ifeq ($(OS),MACOSX) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbc.3.dylib,Cbc/src/.libs/libCbc.3.8.8.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbcSolver.3.dylib,Cbc/src/.libs/libCbcSolver.3.8.8.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCgl.1.dylib,Cgl/src/.libs/libCgl.1.8.5.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClp.1.dylib,Clp/src/.libs/libClp.1.12.6.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsiClp.1.dylib,Clp/src/OsiClp/.libs/libOsiClp.1.12.6.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinMP.1.dylib,CoinMP/src/.libs/libCoinMP.1.7.6.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinUtils.3.dylib,CoinUtils/src/.libs/libCoinUtils.3.9.11.dylib)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsi.1.dylib,Osi/src/Osi/.libs/libOsi.1.11.5.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbc.3.dylib,Cbc/src/.libs/libCbc.3.9.10.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbcSolver.3.dylib,Cbc/src/.libs/libCbcSolver.3.9.10.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCgl.1.dylib,Cgl/src/.libs/libCgl.1.9.11.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClp.1.dylib,Clp/src/.libs/libClp.1.13.12.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClpSolver.1.dylib,Clp/src/.libs/libClpSolver.1.13.12.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsiClp.1.dylib,Clp/src/OsiClp/.libs/libOsiClp.1.13.12.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinMP.1.dylib,CoinMP/src/.libs/libCoinMP.1.8.4.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinUtils.3.dylib,CoinUtils/src/.libs/libCoinUtils.3.10.15.dylib)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsi.1.dylib,Osi/src/Osi/.libs/libOsi.1.12.10.dylib)) else -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbc.so.3,Cbc/src/.libs/libCbc.so.3.8.8)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbcSolver.so.3,Cbc/src/.libs/libCbcSolver.so.3.8.8)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCgl.so.1,Cgl/src/.libs/libCgl.so.1.8.5)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClp.so.1,Clp/src/.libs/libClp.so.1.12.6)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsiClp.so.1,Clp/src/OsiClp/.libs/libOsiClp.so.1.12.6)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinMP.so.1,CoinMP/src/.libs/libCoinMP.so.1.7.6)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinUtils.so.3,CoinUtils/src/.libs/libCoinUtils.so.3.9.11)) -$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsi.so.1,Osi/src/Osi/.libs/libOsi.so.1.11.5)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbc.so.3,Cbc/src/.libs/libCbc.so.3.9.10)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbcSolver.so.3,Cbc/src/.libs/libCbcSolver.so.3.9.10)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCgl.so.1,Cgl/src/.libs/libCgl.so.1.9.11)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClp.so.1,Clp/src/.libs/libClp.so.1.13.12)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClpSolver.so.1,Clp/src/.libs/libClpSolver.so.1.13.12)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsiClp.so.1,Clp/src/OsiClp/.libs/libOsiClp.so.1.13.12)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinMP.so.1,CoinMP/src/.libs/libCoinMP.so.1.8.4)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinUtils.so.3,CoinUtils/src/.libs/libCoinUtils.so.3.10.15)) +$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsi.so.1,Osi/src/Osi/.libs/libOsi.so.1.12.10)) endif # vim: set noet sw=4 ts=4: diff --git a/external/coinmp/ExternalProject_coinmp.mk b/external/coinmp/ExternalProject_coinmp.mk index e1484e656619..559d9eb1b11b 100644 --- a/external/coinmp/ExternalProject_coinmp.mk +++ b/external/coinmp/ExternalProject_coinmp.mk @@ -20,7 +20,7 @@ $(call gb_ExternalProject_get_state_target,coinmp,build) : MSBuild.exe CoinMP.sln /t:Build \ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \ - $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ ,CoinMP/MSVisualStudio/v9) $(call gb_Trace_EndRange,coinmp,EXTERNAL) @@ -29,9 +29,9 @@ else $(call gb_ExternalProject_get_state_target,coinmp,build) : $(call gb_Trace_StartRange,coinmp,EXTERNAL) +$(call gb_ExternalProject_run,build,\ - ./configure COIN_SKIP_PROJECTS="Data/Sample" \ + $(gb_RUN_CONFIGURE) ./configure COIN_SKIP_PROJECTS="Data/Sample" \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(DISABLE_DYNLOADING),--disable-shared) \ --disable-bzlib \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ @@ -43,14 +43,15 @@ $(call gb_ExternalProject_get_state_target,coinmp,build) : && $(MAKE) \ $(if $(filter MACOSX,$(OS)),&& $(PERL) \ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \ - $(EXTERNAL_WORKDIR)/Cbc/src/.libs/libCbc.3.8.8.dylib \ - $(EXTERNAL_WORKDIR)/Cbc/src/.libs/libCbcSolver.3.8.8.dylib \ - $(EXTERNAL_WORKDIR)/Cgl/src/.libs/libCgl.1.8.5.dylib \ - $(EXTERNAL_WORKDIR)/Clp/src/.libs/libClp.1.12.6.dylib \ - $(EXTERNAL_WORKDIR)/Clp/src/OsiClp/.libs/libOsiClp.1.12.6.dylib \ - $(EXTERNAL_WORKDIR)/CoinMP/src/.libs/libCoinMP.1.7.6.dylib \ - $(EXTERNAL_WORKDIR)/CoinUtils/src/.libs/libCoinUtils.3.9.11.dylib \ - $(EXTERNAL_WORKDIR)/Osi/src/Osi/.libs/libOsi.1.11.5.dylib) \ + $(EXTERNAL_WORKDIR)/Cbc/src/.libs/libCbc.3.9.10.dylib \ + $(EXTERNAL_WORKDIR)/Cbc/src/.libs/libCbcSolver.3.9.10.dylib \ + $(EXTERNAL_WORKDIR)/Cgl/src/.libs/libCgl.1.9.11.dylib \ + $(EXTERNAL_WORKDIR)/Clp/src/.libs/libClp.1.13.12.dylib \ + $(EXTERNAL_WORKDIR)/Clp/src/.libs/libClpSolver.1.13.12.dylib \ + $(EXTERNAL_WORKDIR)/Clp/src/OsiClp/.libs/libOsiClp.1.13.12.dylib \ + $(EXTERNAL_WORKDIR)/CoinMP/src/.libs/libCoinMP.1.8.4.dylib \ + $(EXTERNAL_WORKDIR)/CoinUtils/src/.libs/libCoinUtils.3.10.15.dylib \ + $(EXTERNAL_WORKDIR)/Osi/src/Osi/.libs/libOsi.1.12.10.dylib) \ ) $(call gb_Trace_EndRange,coinmp,EXTERNAL) diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk index 0784bbde1ac1..20cf9184516e 100644 --- a/external/coinmp/UnpackedTarball_coinmp.mk +++ b/external/coinmp/UnpackedTarball_coinmp.mk @@ -29,23 +29,29 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,coinmp,\ Osi \ )) +ifneq ($(MSYSTEM),) +# use binary flag so patch from git-bash won't choke on mixed line-endings in patches +$(eval $(call gb_UnpackedTarball_set_patchflags,coinmp,--binary)) +endif + # * external/coinmp/Wnon-c-typedef-for-linkage.patch upstream at # <https://list.coin-or.org/pipermail/coin-discuss/2020-February/003972.html> "[Coin-discuss] # Small patch to fix Clang -Wnon-c-typedef-for-linkage in Clp": $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\ - external/coinmp/osi_cuts_iterator.patch.0 \ external/coinmp/no-binaries.patch.1 \ - external/coinmp/werror-format-security.patch.0 \ external/coinmp/werror-undef.patch.0 \ external/coinmp/coinmp-msvc-disable-sse2.patch.1 \ $(if $(filter MSC,$(COM)),external/coinmp/windows.build.patch.1) \ - external/coinmp/werror-format-pedantic.patch.0 \ external/coinmp/ubsan.patch.0 \ external/coinmp/rpath.patch \ external/coinmp/libtool.patch \ external/coinmp/Wnon-c-typedef-for-linkage.patch \ external/coinmp/register.patch \ external/coinmp/configure-exit.patch \ + external/coinmp/pedantic-errors.patch \ + external/coinmp/bind2nd.patch.1 \ + external/coinmp/clang-with-path.patch \ + external/coinmp/odr.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/coinmp/bind2nd.patch.1 b/external/coinmp/bind2nd.patch.1 new file mode 100644 index 000000000000..6ef10a03e102 --- /dev/null +++ b/external/coinmp/bind2nd.patch.1 @@ -0,0 +1,13 @@ +--- a/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp ++++ b/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp +@@ -1313,8 +1313,8 @@ + int rows_to_delete_arr[] = { 0 } ; + si->deleteRows(1,rows_to_delete_arr) ; + +- std::transform(objective,objective+4,objective, +- std::bind2nd(std::plus<double>(),0.15)) ; ++ for (int i = 0; i != 4; ++i) ++ objective[i] += 0.15; + si->setObjective(objective) ; + si->resolve() ; + OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return false, *si, "test16SebastianNowozin second resolve"); diff --git a/external/coinmp/clang-with-path.patch b/external/coinmp/clang-with-path.patch new file mode 100644 index 000000000000..c66bcb30b01e --- /dev/null +++ b/external/coinmp/clang-with-path.patch @@ -0,0 +1,120 @@ +--- Cbc/configure ++++ Cbc/configure +@@ -3208,7 +3208,7 @@ + + # Correct the LD variable if we are using the MS or Intel-windows compiler + case "$CC" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +@@ -4081,7 +4081,7 @@ + + # correct the LD variable in a build with MS or Intel-windows compiler + case "$CXX" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +--- Cgl/configure ++++ Cgl/configure +@@ -3174,7 +3174,7 @@ + + # Correct the LD variable if we are using the MS or Intel-windows compiler + case "$CC" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +@@ -4045,7 +4045,7 @@ + + # correct the LD variable in a build with MS or Intel-windows compiler + case "$CXX" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +--- Clp/configure ++++ Clp/configure +@@ -3204,7 +3204,7 @@ + + # Correct the LD variable if we are using the MS or Intel-windows compiler + case "$CC" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +@@ -4075,7 +4075,7 @@ + + # correct the LD variable in a build with MS or Intel-windows compiler + case "$CXX" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +--- CoinMP/configure ++++ CoinMP/configure +@@ -3143,7 +3143,7 @@ + + # Correct the LD variable if we are using the MS or Intel-windows compiler + case "$CC" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +@@ -4016,7 +4016,7 @@ + + # correct the LD variable in a build with MS or Intel-windows compiler + case "$CXX" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +--- CoinUtils/configure ++++ CoinUtils/configure +@@ -3200,7 +3200,7 @@ + + # Correct the LD variable if we are using the MS or Intel-windows compiler + case "$CC" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +@@ -4071,7 +4071,7 @@ + + # correct the LD variable in a build with MS or Intel-windows compiler + case "$CXX" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +--- Osi/configure ++++ Osi/configure +@@ -3172,7 +3172,7 @@ + + # Correct the LD variable if we are using the MS or Intel-windows compiler + case "$CC" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; +@@ -4845,7 +4845,7 @@ + + # correct the LD variable in a build with MS or Intel-windows compiler + case "$CXX" in +- clang* ) ;; ++ clang* | */clang* ) ;; + cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) + LD=link + ;; diff --git a/external/coinmp/no-binaries.patch.1 b/external/coinmp/no-binaries.patch.1 index 0c36950c1a29..789e8a7f7e60 100644 --- a/external/coinmp/no-binaries.patch.1 +++ b/external/coinmp/no-binaries.patch.1 @@ -11,7 +11,7 @@ +bin_PROGRAMS = @COIN_HAS_CHOLMOD_TRUE@am__append_7 = -I`$(CYGPATH_W) $(CHOLMODINCDIR)` @COIN_HAS_AMD_TRUE@am__append_8 = -I`$(CYGPATH_W) $(AMDINCDIR)` - @COIN_HAS_ABC_TRUE@am__append_9 = AbcSimplex.hpp CoinAbcCommon.hpp AbcCommon.hpp + @COIN_HAS_ABC_TRUE@am__append_9 = AbcSimplex.hpp CoinAbcCommon.hpp AbcCommon.hpp AbcNonLinearCost.hpp --- coinmp/Cbc/src/Makefile.in +++ coinmp/Cbc/src/Makefile.in @@ -44,7 +44,7 @@ @@ -20,6 +20,6 @@ host_triplet = @host@ -bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) +bin_PROGRAMS = + @COIN_HAS_NTY_TRUE@am__append_1 = -I$(NTYINCDIR) ######################################################################## - # cbc program # diff --git a/external/coinmp/odr.patch b/external/coinmp/odr.patch new file mode 100644 index 000000000000..6e91c86415d2 --- /dev/null +++ b/external/coinmp/odr.patch @@ -0,0 +1,30 @@ +--- Cbc/src/CbcSolver.cpp ++++ Cbc/src/CbcSolver.cpp +@@ -970,8 +970,13 @@ + this set of calls thread-safe. + */ + ++#if defined _MSC_VER + int CbcOrClpRead_mode = 1; + FILE * CbcOrClpReadCommand = stdin; ++#else ++extern int CbcOrClpRead_mode; ++extern FILE * CbcOrClpReadCommand; ++#endif + extern int CbcOrClpEnvironmentIndex; + + int callCbc1(const char * input2, CbcModel & model, +--- Clp/src/CbcOrClpParam.cpp ++++ Clp/src/CbcOrClpParam.cpp +@@ -1233,7 +1233,11 @@ + static char line[1000]; + static char * where = NULL; + extern int CbcOrClpRead_mode; ++#if defined _MSC_VER || !defined COIN_HAS_CBC + int CbcOrClpEnvironmentIndex = -1; ++#else ++extern int CbcOrClpEnvironmentIndex; ++#endif + static size_t fillEnv() + { + #if defined(_MSC_VER) || defined(__MSVCRT__) diff --git a/external/coinmp/osi_cuts_iterator.patch.0 b/external/coinmp/osi_cuts_iterator.patch.0 deleted file mode 100644 index 42ed5afdcf83..000000000000 --- a/external/coinmp/osi_cuts_iterator.patch.0 +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru coinmp.orig/Osi/src/Osi/OsiCuts.hpp coinmp/Osi/src/Osi/OsiCuts.hpp ---- Osi/src/Osi/OsiCuts.hpp 2011-06-13 17:08:11.000000000 +0200 -+++ Osi/src/Osi/OsiCuts.hpp 2016-03-03 22:21:04.669838200 +0100 -@@ -74,7 +74,7 @@ - class const_iterator { - friend class OsiCuts; - public: -- typedef std::bidirectional_iterator_tag iterator_category; -+ typedef std::forward_iterator_tag iterator_category; - typedef OsiCut* value_type; - typedef size_t difference_type; - typedef OsiCut ** pointer; diff --git a/external/coinmp/pedantic-errors.patch b/external/coinmp/pedantic-errors.patch new file mode 100644 index 000000000000..2cf86b7e0ef4 --- /dev/null +++ b/external/coinmp/pedantic-errors.patch @@ -0,0 +1,11 @@ +--- Clp/src/ClpSimplex.cpp ++++ Clp/src/ClpSimplex.cpp +@@ -6035,7 +6035,7 @@ + assert (!doKKT); + ClpCholeskyTaucs * cholesky = new ClpCholeskyTaucs(); + barrier.setCholesky(cholesky); +-#elifdef COIN_HAS_MUMPS ++#elif defined COIN_HAS_MUMPS + if (!doKKT) { + ClpCholeskyMumps * cholesky = new ClpCholeskyMumps(); + barrier.setCholesky(cholesky); diff --git a/external/coinmp/register.patch b/external/coinmp/register.patch index cf4ca4d06c01..050b47f97fa6 100644 --- a/external/coinmp/register.patch +++ b/external/coinmp/register.patch @@ -1,249 +1,3 @@ ---- CoinUtils/src/CoinHelperFunctions.hpp -+++ CoinUtils/src/CoinHelperFunctions.hpp -@@ -41,7 +41,7 @@ - handled correctly. */ - - template <class T> inline void --CoinCopyN(register const T* from, const int size, register T* to) -+CoinCopyN(const T* from, const int size, T* to) - { - if (size == 0 || from == to) - return; -@@ -52,10 +52,10 @@ - "CoinCopyN", ""); - #endif - -- register int n = (size + 7) / 8; -+ int n = (size + 7) / 8; - if (to > from) { -- register const T* downfrom = from + size; -- register T* downto = to + size; -+ const T* downfrom = from + size; -+ T* downto = to + size; - // Use Duff's device to copy - switch (size % 8) { - case 0: do{ *--downto = *--downfrom; -@@ -99,7 +99,7 @@ - the difference down to int. -- lh, 100823 -- - */ - template <class T> inline void --CoinCopy(register const T* first, register const T* last, register T* to) -+CoinCopy(const T* first, const T* last, T* to) - { - CoinCopyN(first, static_cast<int>(last-first), to); - } -@@ -114,7 +114,7 @@ - Note JJF - the speed claim seems to be false on IA32 so I have added - CoinMemcpyN which can be used for atomic data */ - template <class T> inline void --CoinDisjointCopyN(register const T* from, const int size, register T* to) -+CoinDisjointCopyN(const T* from, const int size, T* to) - { - #ifndef _MSC_VER - if (size == 0 || from == to) -@@ -135,7 +135,7 @@ - throw CoinError("overlapping arrays", "CoinDisjointCopyN", ""); - #endif - -- for (register int n = size / 8; n > 0; --n, from += 8, to += 8) { -+ for (int n = size / 8; n > 0; --n, from += 8, to += 8) { - to[0] = from[0]; - to[1] = from[1]; - to[2] = from[2]; -@@ -167,8 +167,8 @@ - are copied at a time. The source array is given by its first and "after - last" entry; the target array is given by its first entry. */ - template <class T> inline void --CoinDisjointCopy(register const T* first, register const T* last, -- register T* to) -+CoinDisjointCopy(const T* first, const T* last, -+ T* to) - { - CoinDisjointCopyN(first, static_cast<int>(last - first), to); - } -@@ -256,7 +256,7 @@ - alternative coding if USE_MEMCPY defined*/ - #ifndef COIN_USE_RESTRICT - template <class T> inline void --CoinMemcpyN(register const T* from, const int size, register T* to) -+CoinMemcpyN(const T* from, const int size, T* to) - { - #ifndef _MSC_VER - #ifdef USE_MEMCPY -@@ -296,7 +296,7 @@ - throw CoinError("overlapping arrays", "CoinMemcpyN", ""); - #endif - -- for (register int n = size / 8; n > 0; --n, from += 8, to += 8) { -+ for (int n = size / 8; n > 0; --n, from += 8, to += 8) { - to[0] = from[0]; - to[1] = from[1]; - to[2] = from[2]; -@@ -343,8 +343,8 @@ - are copied at a time. The source array is given by its first and "after - last" entry; the target array is given by its first entry. */ - template <class T> inline void --CoinMemcpy(register const T* first, register const T* last, -- register T* to) -+CoinMemcpy(const T* first, const T* last, -+ T* to) - { - CoinMemcpyN(first, static_cast<int>(last - first), to); - } -@@ -358,7 +358,7 @@ - Note JJF - the speed claim seems to be false on IA32 so I have added - CoinZero to allow for memset. */ - template <class T> inline void --CoinFillN(register T* to, const int size, register const T value) -+CoinFillN(T* to, const int size, const T value) - { - if (size == 0) - return; -@@ -369,7 +369,7 @@ - "CoinFillN", ""); - #endif - #if 1 -- for (register int n = size / 8; n > 0; --n, to += 8) { -+ for (int n = size / 8; n > 0; --n, to += 8) { - to[0] = value; - to[1] = value; - to[2] = value; -@@ -413,7 +413,7 @@ - entries are filled at a time. The array is given by its first and "after - last" entry. */ - template <class T> inline void --CoinFill(register T* first, register T* last, const T value) -+CoinFill(T* first, T* last, const T value) - { - CoinFillN(first, last - first, value); - } -@@ -427,7 +427,7 @@ - Note JJF - the speed claim seems to be false on IA32 so I have allowed - for memset as an alternative */ - template <class T> inline void --CoinZeroN(register T* to, const int size) -+CoinZeroN(T* to, const int size) - { - #ifdef USE_MEMCPY - // Use memset - seems faster on Intel with gcc -@@ -448,7 +448,7 @@ - "CoinZeroN", ""); - #endif - #if 1 -- for (register int n = size / 8; n > 0; --n, to += 8) { -+ for (int n = size / 8; n > 0; --n, to += 8) { - to[0] = 0; - to[1] = 0; - to[2] = 0; -@@ -519,7 +519,7 @@ - entries are filled at a time. The array is given by its first and "after - last" entry. */ - template <class T> inline void --CoinZero(register T* first, register T* last) -+CoinZero(T* first, T* last) - { - CoinZeroN(first, last - first); - } -@@ -545,7 +545,7 @@ - This function was introduced because for some reason compiler tend to - handle the <code>max()</code> function differently. */ - template <class T> inline T --CoinMax(register const T x1, register const T x2) -+CoinMax(const T x1, const T x2) - { - return (x1 > x2) ? x1 : x2; - } -@@ -556,7 +556,7 @@ - This function was introduced because for some reason compiler tend to - handle the min() function differently. */ - template <class T> inline T --CoinMin(register const T x1, register const T x2) -+CoinMin(const T x1, const T x2) - { - return (x1 < x2) ? x1 : x2; - } -@@ -578,7 +578,7 @@ - according to operator<. The array is given by a pointer to its first entry - and by its size. */ - template <class T> inline bool --CoinIsSorted(register const T* first, const int size) -+CoinIsSorted(const T* first, const int size) - { - if (size == 0) - return true; -@@ -590,7 +590,7 @@ - #if 1 - // size1 is the number of comparisons to be made - const int size1 = size - 1; -- for (register int n = size1 / 8; n > 0; --n, first += 8) { -+ for (int n = size1 / 8; n > 0; --n, first += 8) { - if (first[8] < first[7]) return false; - if (first[7] < first[6]) return false; - if (first[6] < first[5]) return false; -@@ -627,7 +627,7 @@ - according to operator<. The array is given by its first and "after - last" entry. */ - template <class T> inline bool --CoinIsSorted(register const T* first, register const T* last) -+CoinIsSorted(const T* first, const T* last) - { - return CoinIsSorted(first, static_cast<int>(last - first)); - } -@@ -638,7 +638,7 @@ - etc. For speed 8 entries are filled at a time. The array is given by a - pointer to its first entry and its size. */ - template <class T> inline void --CoinIotaN(register T* first, const int size, register T init) -+CoinIotaN(T* first, const int size, T init) - { - if (size == 0) - return; -@@ -648,7 +648,7 @@ - throw CoinError("negative number of entries", "CoinIotaN", ""); - #endif - #if 1 -- for (register int n = size / 8; n > 0; --n, first += 8, init += 8) { -+ for (int n = size / 8; n > 0; --n, first += 8, init += 8) { - first[0] = init; - first[1] = init + 1; - first[2] = init + 2; -@@ -706,7 +706,7 @@ - integer array specified by the last two arguments (again, first and "after - last" entry). */ - template <class T> inline T * --CoinDeleteEntriesFromArray(register T * arrayFirst, register T * arrayLast, -+CoinDeleteEntriesFromArray(T * arrayFirst, T * arrayLast, - const int * firstDelPos, const int * lastDelPos) - { - int delNum = static_cast<int>(lastDelPos - firstDelPos); ---- CoinUtils/src/CoinModelUseful2.cpp -+++ CoinUtils/src/CoinModelUseful2.cpp -@@ -917,8 +917,8 @@ - - int position=0; - int nEof=0; // Number of time send of string -- register int yystate; -- register int yyn; -+ int yystate; -+ int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; -@@ -936,12 +936,12 @@ - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; -- register short *yyssp; -+ short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; -- register YYSTYPE *yyvsp; -+ YYSTYPE *yyvsp; - - - --- CoinUtils/src/CoinOslC.h +++ CoinUtils/src/CoinOslC.h @@ -34,30 +34,30 @@ @@ -319,51 +73,3 @@ { int * hrow = fact->xeradr; int * hcol = fact->xecadr; ---- CoinUtils/src/CoinPackedVectorBase.cpp -+++ CoinUtils/src/CoinPackedVectorBase.cpp -@@ -194,8 +194,8 @@ - double - CoinPackedVectorBase::oneNorm() const - { -- register double norm = 0.0; -- register const double* elements = getElements(); -+ double norm = 0.0; -+ const double* elements = getElements(); - for (int i = getNumElements() - 1; i >= 0; --i) { - norm += fabs(elements[i]); - } -@@ -224,8 +224,8 @@ - double - CoinPackedVectorBase::infNorm() const - { -- register double norm = 0.0; -- register const double* elements = getElements(); -+ double norm = 0.0; -+ const double* elements = getElements(); - for (int i = getNumElements() - 1; i >= 0; --i) { - norm = CoinMax(norm, fabs(elements[i])); - } ---- CoinUtils/src/CoinSearchTree.hpp -+++ CoinUtils/src/CoinSearchTree.hpp -@@ -153,8 +153,8 @@ - static inline const char* name() { return "CoinSearchTreeComparePreferred"; } - inline bool operator()(const CoinTreeSiblings* x, - const CoinTreeSiblings* y) const { -- register const CoinTreeNode* xNode = x->currentNode(); -- register const CoinTreeNode* yNode = y->currentNode(); -+ const CoinTreeNode* xNode = x->currentNode(); -+ const CoinTreeNode* yNode = y->currentNode(); - const BitVector128 xPref = xNode->getPreferred(); - const BitVector128 yPref = yNode->getPreferred(); - bool retval = true; ---- CoinUtils/src/CoinSimpFactorization.cpp -+++ CoinUtils/src/CoinSimpFactorization.cpp -@@ -2440,7 +2440,7 @@ - const int row=secRowOfU_[i]; - const int column=colOfU_[i]; - if ( denseVector_[column]==0.0 ) continue; -- register const double multiplier=denseVector_[column]*invOfPivots_[row]; -+ const double multiplier=denseVector_[column]*invOfPivots_[row]; - denseVector_[column]=0.0; - const int rowBeg=UrowStarts_[row]; - const int rowEnd=rowBeg+UrowLengths_[row]; diff --git a/external/coinmp/werror-format-pedantic.patch.0 b/external/coinmp/werror-format-pedantic.patch.0 deleted file mode 100644 index a604c4354fc6..000000000000 --- a/external/coinmp/werror-format-pedantic.patch.0 +++ /dev/null @@ -1,10 +0,0 @@ ---- Cbc/configure -+++ Cbc/configure -@@ -3780,7 +3780,6 @@ - *-darwin*) - ;; - *) -- coin_warn_cxxflags="-pedantic-errors $coin_warn_cxxflags" - ;; - esac - esac diff --git a/external/coinmp/werror-format-security.patch.0 b/external/coinmp/werror-format-security.patch.0 deleted file mode 100644 index 90c116b5b06d..000000000000 --- a/external/coinmp/werror-format-security.patch.0 +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur coinmp.org/CoinUtils/src/CoinMessageHandler.cpp coinmp/CoinUtils/src/CoinMessageHandler.cpp ---- CoinUtils/src/CoinMessageHandler.cpp 2014-05-21 23:14:01.384874167 +0200 -+++ CoinUtils/src/CoinMessageHandler.cpp 2014-05-21 23:14:47.708874712 +0200 -@@ -820,7 +820,7 @@ - sprintf(messageOut_,g_format_,doublevalue); - if (next != format_+2) { - messageOut_+=strlen(messageOut_); -- sprintf(messageOut_,format_+2); -+ sprintf(messageOut_,"%s",format_+2); - } - } - messageOut_+=strlen(messageOut_); diff --git a/external/coinmp/windows.build.patch.1 b/external/coinmp/windows.build.patch.1 index 2bd0526ac2c4..a412729e1c80 100644 --- a/external/coinmp/windows.build.patch.1 +++ b/external/coinmp/windows.build.patch.1 @@ -1,8 +1,8 @@ diff -urN coinmp.org/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj coinmp/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj --- coinmp.org/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj 1970-01-01 01:00:00.000000000 +0100 -+++ coinmp/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj 2014-02-28 15:32:36.548600694 +0100 -@@ -0,0 +1,506 @@ -+<?xml version="1.0" encoding="utf-8"?> ++++ coinmp/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj 2023-05-24 20:35:48.642884800 +0900 +@@ -0,0 +1,515 @@ ++<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> @@ -318,6 +318,14 @@ diff -urN coinmp.org/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj coinmp/Cbc/MSVi + <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization> + <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization> + </ClCompile> ++ <ClCompile Include="..\..\..\src\CbcHeuristicDW.cpp"> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization> ++ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization> ++ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization> ++ </ClCompile> + <ClCompile Include="..\..\..\src\CbcHeuristicFPump.cpp"> + <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization> + <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks> @@ -475,6 +483,7 @@ diff -urN coinmp.org/Cbc/MSVisualStudio/v9/libCbc/libCbc.vcxproj coinmp/Cbc/MSVi + <ClInclude Include="..\..\..\src\CbcHeuristicDiveLineSearch.hpp" /> + <ClInclude Include="..\..\..\src\CbcHeuristicDivePseudoCost.hpp" /> + <ClInclude Include="..\..\..\src\CbcHeuristicDiveVectorLength.hpp" /> ++ <ClInclude Include="..\..\..\src\CbcHeuristicDW.hpp" /> + <ClInclude Include="..\..\..\src\CbcHeuristicFPump.hpp" /> + <ClInclude Include="..\..\..\src\CbcHeuristicGreedy.hpp" /> + <ClInclude Include="..\..\..\src\CbcHeuristicLocal.hpp" /> @@ -2361,8 +2370,8 @@ diff -urN coinmp.org/CoinMP/MSVisualStudio/v9/unitTest/unitTest.vcxproj coinmp/C \ No newline at end of file diff -urN coinmp.org/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxproj coinmp/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxproj --- coinmp.org/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxproj 1970-01-01 01:00:00.000000000 +0100 -+++ coinmp/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxproj 2014-02-28 15:32:36.564600694 +0100 -@@ -0,0 +1,650 @@ ++++ coinmp/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxproj 2023-06-09 07:25:34.205534300 +0900 +@@ -0,0 +1,659 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> @@ -2890,6 +2899,14 @@ diff -urN coinmp.org/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxpr + <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization> + <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization> + </ClCompile> ++ <ClCompile Include="..\..\..\src\CoinRational.cpp"> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization> ++ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization> ++ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization> ++ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization> ++ </ClCompile> + <ClCompile Include="..\..\..\src\CoinSearchTree.cpp" /> + <ClCompile Include="..\..\..\src\CoinShallowPackedVector.cpp"> + <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization> @@ -2992,6 +3009,7 @@ diff -urN coinmp.org/CoinUtils/MSVisualStudio/v9/libCoinUtils/libCoinUtils.vcxpr + <ClInclude Include="..\..\..\src\CoinPresolveTripleton.hpp" /> + <ClInclude Include="..\..\..\src\CoinPresolveUseless.hpp" /> + <ClInclude Include="..\..\..\src\CoinPresolveZeros.hpp" /> ++ <ClInclude Include="..\..\..\src\CoinRational.hpp" /> + <ClInclude Include="..\..\..\src\CoinSearchTree.hpp" /> + <ClInclude Include="..\..\..\src\CoinShallowPackedVector.hpp" /> + <ClInclude Include="..\..\..\src\CoinSimpFactorization.hpp" /> diff --git a/external/cppunit/0001-cid-1546460-COPY_INSTEAD_OF_MOVE.patch.1 b/external/cppunit/0001-cid-1546460-COPY_INSTEAD_OF_MOVE.patch.1 new file mode 100644 index 000000000000..742dce907bcc --- /dev/null +++ b/external/cppunit/0001-cid-1546460-COPY_INSTEAD_OF_MOVE.patch.1 @@ -0,0 +1,175 @@ +From ae5acc79d5f6e9b6f64cc550d858f41884362025 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sat, 30 Dec 2023 20:08:01 +0000 +Subject: [PATCH] cid#1546460 COPY_INSTEAD_OF_MOVE + +--- + src/cppunit/TestFactoryRegistry.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp +index 3b68d58..7b38a34 100644 +--- a/src/cppunit/TestFactoryRegistry.cpp ++++ b/src/cppunit/TestFactoryRegistry.cpp +@@ -85,7 +85,7 @@ public: + + TestFactoryRegistry::TestFactoryRegistry( std::string name ) : + m_factories(), +- m_name( name ) ++ m_name(std::move(name)) + { + } + +diff --git a/src/cppunit/XmlElement.cpp b/src/cppunit/XmlElement.cpp +index 585c3da..be02385 100644 +--- a/src/cppunit/XmlElement.cpp ++++ b/src/cppunit/XmlElement.cpp +@@ -8,8 +8,8 @@ CPPUNIT_NS_BEGIN + + XmlElement::XmlElement( std::string elementName, + std::string content ) +- : m_name( elementName ) +- , m_content( content ) ++ : m_name(std::move(elementName)) ++ , m_content(std::move(content)) + , m_attributes() + , m_elements() + { +@@ -18,7 +18,7 @@ XmlElement::XmlElement( std::string elementName, + + XmlElement::XmlElement( std::string elementName, + int numericContent ) +- : m_name( elementName ) ++ : m_name(std::move(elementName)) + , m_content() + , m_attributes() + , m_elements() +@@ -74,15 +74,15 @@ XmlElement::setContent( int numericContent ) + + + void +-XmlElement::addAttribute( std::string attributeName, +- std::string value ) ++XmlElement::addAttribute( const std::string& attributeName, ++ const std::string& value ) + { + m_attributes.push_back( Attribute( attributeName, value ) ); + } + + + void +-XmlElement::addAttribute( std::string attributeName, ++XmlElement::addAttribute( const std::string& attributeName, + int numericValue ) + { + addAttribute( attributeName, StringTools::toString( numericValue ) ); +@@ -194,7 +194,7 @@ XmlElement::attributesAsString() const + + + std::string +-XmlElement::escape( std::string value ) const ++XmlElement::escape( const std::string& value ) const + { + std::string escaped; + for ( unsigned int index =0; index < value.length(); ++index ) +diff --git a/include/cppunit/tools/XmlElement.h b/include/cppunit/tools/XmlElement.h +index 3478a35..d033aa2 100644 +--- a/include/cppunit/tools/XmlElement.h ++++ b/include/cppunit/tools/XmlElement.h +@@ -79,14 +79,14 @@ public: + * \param attributeName Name of the attribute. Must not be an empty. + * \param value Value of the attribute. + */ +- void addAttribute( std::string attributeName, +- std::string value ); ++ void addAttribute( const std::string& attributeName, ++ const std::string& value ); + + /*! \brief Adds an attribute with the specified numeric value. + * \param attributeName Name of the attribute. Must not be empty. + * \param numericValue Numeric value of the attribute. + */ +- void addAttribute( std::string attributeName, ++ void addAttribute( const std::string& attributeName, + int numericValue ); + + /*! \brief Adds a child element to the element. +@@ -125,7 +125,7 @@ private: + typedef std::pair<std::string,std::string> Attribute; + + std::string attributesAsString() const; +- std::string escape( std::string value ) const; ++ std::string escape( const std::string& value ) const; + + private: + std::string m_name; +diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h +index ca65593..2010739 100644 +--- a/include/cppunit/Asserter.h ++++ b/include/cppunit/Asserter.h +@@ -159,11 +159,11 @@ + * what are the differences between the expected and actual value. + * \param shortDescription Short description for the failure message. + */ +- [[noreturn]] static void CPPUNIT_API failNotEqual( std::string expected, +- std::string actual, ++ [[noreturn]] static void CPPUNIT_API failNotEqual( const std::string& expected, ++ const std::string& actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage = AdditionalMessage(), +- std::string shortDescription = "equality assertion failed" ); ++ const std::string& shortDescription = "equality assertion failed" ); + + /*! \brief Throws an Exception with the specified message and location. + * \param expected Text describing the expected value. +@@ -231,11 +231,11 @@ + * \param shortDescription Short description for the failure message. + */ + static void CPPUNIT_API failNotEqualIf( bool shouldFail, +- std::string expected, +- std::string actual, ++ const std::string& expected, ++ const std::string& actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage = AdditionalMessage(), +- std::string shortDescription = "equality assertion failed" ); ++ const std::string& shortDescription = "equality assertion failed" ); + + }; + +diff --git a/src/cppunit/Asserter.cpp b/src/cppunit/Asserter.cpp +index 52f8625..fe2097e 100644 +--- a/src/cppunit/Asserter.cpp ++++ b/src/cppunit/Asserter.cpp +@@ -110,11 +110,11 @@ + + + void +-Asserter::failNotEqual( std::string expected, +- std::string actual, ++Asserter::failNotEqual( const std::string& expected, ++ const std::string& actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, +- std::string shortDescription ) ++ const std::string& shortDescription ) + { + fail( makeMessage( makeExpectedEqual(expected), + makeActual(actual), +@@ -182,11 +182,11 @@ + } + void + Asserter::failNotEqualIf( bool shouldFail, +- std::string expected, +- std::string actual, ++ const std::string& expected, ++ const std::string& actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, +- std::string shortDescription ) ++ const std::string& shortDescription ) + { + if ( shouldFail ) + failNotEqual( expected, actual, sourceLine, additionalMessage, shortDescription ); +-- +2.43.0 diff --git a/external/cppunit/ExternalProject_cppunit.mk b/external/cppunit/ExternalProject_cppunit.mk index 1c5ac725af59..f0b4ff06acce 100644 --- a/external/cppunit/ExternalProject_cppunit.mk +++ b/external/cppunit/ExternalProject_cppunit.mk @@ -19,7 +19,7 @@ $(call gb_ExternalProject_get_state_target,cppunit,build) : $(call gb_ExternalProject_run,build,\ PROFILEFLAGS="$(gb_MSBUILD_CONFIG) \ /p:Platform=$(gb_MSBUILD_PLATFORM) \ - $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \ && msbuild.exe cppunit_dll.vcxproj /p:Configuration=$${PROFILEFLAGS} \ && cd ../DllPlugInTester \ @@ -28,13 +28,9 @@ $(call gb_ExternalProject_get_state_target,cppunit,build) : $(call gb_Trace_EndRange,cppunit,EXTERNAL) else -cppunit_CXXFLAGS=$(CXXFLAGS) +cppunit_CXXFLAGS=$(CXXFLAGS) $(gb_EMSCRIPTEN_CXXFLAGS) -ifneq (,$(filter ANDROID DRAGONFLY FREEBSD iOS LINUX NETBSD OPENBSD,$(OS))) -ifneq (,$(gb_ENABLE_DBGUTIL)) -cppunit_CXXFLAGS+=-D_GLIBCXX_DEBUG -endif -endif +cppunit_CXXFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG) ifneq (,$(call gb_LinkTarget__symbols_enabled,cppunit)) cppunit_CXXFLAGS+=-g @@ -43,18 +39,19 @@ endif $(call gb_ExternalProject_get_state_target,cppunit,build) : $(call gb_Trace_StartRange,cppunit,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ --disable-dependency-tracking \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ --disable-doxygen \ --disable-html-docs \ --disable-latex-docs \ --disable-werror \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________NONE) \ $(if $(filter WNT,$(OS)),LDFLAGS="-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2") \ $(if $(filter SOLARIS,$(OS)),LIBS="-lm") \ $(if $(filter ANDROID,$(OS)),LIBS="$(gb_STDLIBS)") \ + $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ CXXFLAGS="$(cppunit_CXXFLAGS)" \ && cd src \ && $(MAKE) \ diff --git a/external/cppunit/UnpackedTarball_cppunit.mk b/external/cppunit/UnpackedTarball_cppunit.mk index 10063d2aa104..7efe5c4f92bf 100644 --- a/external/cppunit/UnpackedTarball_cppunit.mk +++ b/external/cppunit/UnpackedTarball_cppunit.mk @@ -13,6 +13,18 @@ $(eval $(call gb_UnpackedTarball_set_tarball,cppunit,$(CPPUNIT_TARBALL),,cppunit $(eval $(call gb_UnpackedTarball_update_autoconf_configs,cppunit)) +# * external/cppunit/order.patch.0 upstreamed at <https://gerrit.libreoffice.org/c/cppunit/+/123963> +# "Run tests in deterministic order"; +# * external/cppunit/propagate-exceptions.patch.0 upstreamed at +# <https://gerrit.libreoffice.org/c/cppunit/+/144074> "Introduce CPPUNIT_PROPAGATE_EXCEPTIONS +# environment variable"; +# * external/cppunit/sprintf.patch.0 upstreamed at +# <https://gerrit.libreoffice.org/c/cppunit/+/147383> "Use snprintf instead of sprintf"; +# * external/cppunit/clang.patch.0 upstreamed at +# <https://gerrit.libreoffice.org/c/cppunit/+/147384> "Don't mis-apply GCC < 4.6 workaround for +# Clang": +# * external/cppunit/0001-cid-1546460-COPY_INSTEAD_OF_MOVE.patch.1 upstreamed at +# <https://gerrit.libreoffice.org/c/cppunit/+/161455> "cid#1546460 COPY_INSTEAD_OF_MOVE"; $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\ external/cppunit/windows.patch \ external/cppunit/unix.patch \ @@ -21,6 +33,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\ external/cppunit/rtti.patch.0 \ external/cppunit/order.patch.0 \ external/cppunit/windows-arm64.patch.1 \ + external/cppunit/propagate-exceptions.patch.0 \ + external/cppunit/sprintf.patch.0 \ + external/cppunit/clang.patch.0 \ + external/cppunit/0001-cid-1546460-COPY_INSTEAD_OF_MOVE.patch.1 \ )) ifeq ($(DISABLE_DYNLOADING),TRUE) $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\ diff --git a/external/cppunit/clang.patch.0 b/external/cppunit/clang.patch.0 new file mode 100644 index 000000000000..7a520f27616d --- /dev/null +++ b/external/cppunit/clang.patch.0 @@ -0,0 +1,11 @@ +--- include/cppunit/TestAssert.h ++++ include/cppunit/TestAssert.h +@@ -11,7 +11,7 @@ + + // Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T + // is an enum type: +-#if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) ++#if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) && !defined __clang__ + #pragma GCC system_header + #endif + diff --git a/external/cppunit/disable-dynloading.patch b/external/cppunit/disable-dynloading.patch index a9aa37f6f45d..62ed1deeb635 100644 --- a/external/cppunit/disable-dynloading.patch +++ b/external/cppunit/disable-dynloading.patch @@ -17,7 +17,7 @@ +// Actually this is for iOS and Android where we build the cppunit tests libraries +// as plain archives and just link them statically into test fixture programs, +// and don't want any stinking duplicate main(), but shouldn't hurt for MacOSX either. -+#elif defined(__APPLE__) || defined(__ANDROID__) ++#elif defined(__APPLE__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) +#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \ + typedef char __CppUnitPlugInImplementMainDummyTypeDef // Unix diff --git a/external/cppunit/enable-win32-debug.patch b/external/cppunit/enable-win32-debug.patch index dc159ecc51ad..2c7f4f956d2f 100644 --- a/external/cppunit/enable-win32-debug.patch +++ b/external/cppunit/enable-win32-debug.patch @@ -1,6 +1,6 @@ --- misc/cppunit-1.14.0/src/cppunit/cppunit_dll.vcxproj +++ misc/build/cppunit-1.14.0/src/cppunit/cppunit_dll.vcxproj -@@ -107,7 +107,6 @@ +@@ -190,7 +190,6 @@ <SuppressStartupBanner>true</SuppressStartupBanner> <WarningLevel>Level3</WarningLevel> <RuntimeTypeInfo>true</RuntimeTypeInfo> @@ -8,7 +8,7 @@ <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CPPUNIT_BUILD_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AssemblerListingLocation>.\ReleaseDll\</AssemblerListingLocation> -@@ -138,6 +137,7 @@ +@@ -222,6 +221,7 @@ <Link> <SuppressStartupBanner>true</SuppressStartupBanner> <LinkDLL>true</LinkDLL> diff --git a/external/cppunit/propagate-exceptions.patch.0 b/external/cppunit/propagate-exceptions.patch.0 new file mode 100644 index 000000000000..dd9a6b32c542 --- /dev/null +++ b/external/cppunit/propagate-exceptions.patch.0 @@ -0,0 +1,20 @@ +--- src/cppunit/TestResult.cpp ++++ src/cppunit/TestResult.cpp +@@ -5,6 +5,7 @@ + #include <cppunit/tools/Algorithm.h> + #include <cppunit/portability/Stream.h> + #include <algorithm> ++#include <cstdlib> + #include "DefaultProtector.h" + #include "ProtectorChain.h" + #include "ProtectorContext.h" +@@ -18,7 +19,8 @@ + , m_protectorChain( new ProtectorChain ) + , m_stop( false ) + { +- m_protectorChain->push( new DefaultProtector() ); ++ if (!std::getenv("CPPUNIT_PROPAGATE_EXCEPTIONS")) ++ m_protectorChain->push( new DefaultProtector() ); + } + + diff --git a/external/cppunit/sprintf.patch.0 b/external/cppunit/sprintf.patch.0 new file mode 100644 index 000000000000..daa4881f3384 --- /dev/null +++ b/external/cppunit/sprintf.patch.0 @@ -0,0 +1,11 @@ +--- include/cppunit/TestAssert.h ++++ include/cppunit/TestAssert.h +@@ -112,7 +122,7 @@ + #if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning. + sprintf_s(buffer, sizeof(buffer), "%.*g", precision, x); + #else +- sprintf(buffer, "%.*g", precision, x); ++ snprintf(buffer, sizeof(buffer), "%.*g", precision, x); + #endif + return buffer; + } diff --git a/external/ct2n/ConvertTextToNumber-1.3.2-no-license.patch b/external/ct2n/ConvertTextToNumber-1.3.2-no-license.patch deleted file mode 100644 index c4fe3dcd67e4..000000000000 --- a/external/ct2n/ConvertTextToNumber-1.3.2-no-license.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -purN misc/description.xml misc/build/description.xml ---- misc/description.xml 2009-02-03 00:07:30.000000000 +0100 -+++ misc/build/description.xml 2010-03-05 21:38:48.000000000 +0100 -@@ -5,12 +5,4 @@ - xmlns:xlink="http://www.w3.org/1999/xlink"> - <identifier value="nl.nouenoff.ct2n"/> - <version value="1.5.0"/> -- <!-- <dependencies> -- -- </dependencies> --> -- <registration> -- <simple-license accept-by="admin" default-license-id="ID0" suppress-on-update="true" > -- <license-text xlink:href="registration/COPYING" lang="en" license-id="ID0" /> -- </simple-license> -- </registration> - </description> diff --git a/external/ct2n/ConvertTextToNumber-1.3.2-no-visible-by-default.patch b/external/ct2n/ConvertTextToNumber-1.3.2-no-visible-by-default.patch deleted file mode 100644 index 50dd4b5f4775..000000000000 --- a/external/ct2n/ConvertTextToNumber-1.3.2-no-visible-by-default.patch +++ /dev/null @@ -1,104 +0,0 @@ -diff -purN misc/Office/UI/BaseWindowState.xcu misc/build/Office/UI/BaseWindowState.xcu ---- misc/Office/UI/BaseWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/BaseWindowState.xcu 2010-03-05 21:36:37.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/BasicIDEWindowState.xcu misc/build/Office/UI/BasicIDEWindowState.xcu ---- misc/Office/UI/BasicIDEWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/BasicIDEWindowState.xcu 2010-03-05 21:36:46.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/CalcWindowState.xcu misc/build/Office/UI/CalcWindowState.xcu ---- misc/Office/UI/CalcWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/CalcWindowState.xcu 2010-03-05 21:36:32.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/DrawWindowState.xcu misc/build/Office/UI/DrawWindowState.xcu ---- misc/Office/UI/DrawWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/DrawWindowState.xcu 2010-03-05 21:36:54.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/ImpressWindowState.xcu misc/build/Office/UI/ImpressWindowState.xcu ---- misc/Office/UI/ImpressWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/ImpressWindowState.xcu 2010-03-05 21:36:59.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/MathWindowState.xcu misc/build/Office/UI/MathWindowState.xcu ---- misc/Office/UI/MathWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/MathWindowState.xcu 2010-03-05 21:37:03.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/StartModuleWindowState.xcu misc/build/Office/UI/StartModuleWindowState.xcu ---- misc/Office/UI/StartModuleWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/StartModuleWindowState.xcu 2010-03-05 21:37:09.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> -diff -purN misc/Office/UI/WriterWindowState.xcu misc/build/Office/UI/WriterWindowState.xcu ---- misc/Office/UI/WriterWindowState.xcu 2008-02-09 23:26:50.000000000 +0100 -+++ misc/build/Office/UI/WriterWindowState.xcu 2010-03-05 21:37:17.000000000 +0100 -@@ -9,6 +9,9 @@ - <prop oor:name="UIName" oor:type="xs:string"> - <value>CT2N</value> - </prop> -+ <prop oor:name="Visible" oor:type="xs:boolean"> -+ <value>false</value> -+ </prop> - </node> - </node> - </node> diff --git a/external/ct2n/ConvertTextToNumber-1.5.0-add-namespace-prefix.patch b/external/ct2n/ConvertTextToNumber-1.5.0-add-namespace-prefix.patch deleted file mode 100644 index 8602989f7d7b..000000000000 --- a/external/ct2n/ConvertTextToNumber-1.5.0-add-namespace-prefix.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -purN misc/META-INF/manifest.xml misc/build/META-INF/manifest.xml ---- misc/META-INF/manifest.xml 2019-08-14 20:57:00.000000000 +0900 -+++ misc/build/META-INF/manifest.xml 2019-08-14 20:58:00.000000000 +0900 -@@ -1,5 +1,5 @@ - <?xml version="1.0" encoding="UTF-8"?> --<manifest:manifest> -+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> - <manifest:file-entry manifest:full-path="CT2N/" manifest:media-type="application/vnd.sun.star.basic-library"/> - <manifest:file-entry manifest:full-path="pkg-desc/pkg-description.txt" manifest:media-type="application/vnd.sun.star.package-bundle-description"/> - <manifest:file-entry manifest:full-path="Office/UI/BaseWindowState.xcu" manifest:media-type="application/vnd.sun.star.configuration-data"/> diff --git a/external/ct2n/ExternalPackage_ct2n.mk b/external/ct2n/ExternalPackage_ct2n.mk deleted file mode 100644 index 9a4bf2d58119..000000000000 --- a/external/ct2n/ExternalPackage_ct2n.mk +++ /dev/null @@ -1,38 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,ct2n,ct2n)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files_with_dir,ct2n,$(LIBO_SHARE_FOLDER)/extensions/ConvertTextToNumber,\ - Addons.xcu \ - CT2N/MainCode.xba \ - CT2N/ToClipbord.xba \ - CT2N/Language.xba \ - CT2N/dialog.xlb \ - CT2N/dlgCode.xba \ - CT2N/script.xlb \ - CT2N/dlgCT2N.xdl \ - CT2N/UserSettings.xba \ - META-INF/manifest.xml \ - Office/UI/BaseWindowState.xcu \ - Office/UI/ImpressWindowState.xcu \ - Office/UI/StartModuleWindowState.xcu \ - Office/UI/BasicIDEWindowState.xcu \ - Office/UI/CalcWindowState.xcu \ - Office/UI/WriterWindowState.xcu \ - Office/UI/DrawWindowState.xcu \ - Office/UI/MathWindowState.xcu \ - description.xml \ - icons/image1_26.bmp \ - icons/image1_16.bmp \ - pkg-desc/pkg-description.txt \ - registration/COPYING \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/ct2n/README b/external/ct2n/README deleted file mode 100644 index 7d5d278883ff..000000000000 --- a/external/ct2n/README +++ /dev/null @@ -1,4 +0,0 @@ -From [http://extensions.libreoffice.org/extension-center/ct2n-convert-text-to-number-and-dates]. - -ConvertTextToNumber replaces numbers and dates, formatted - as text, with real numbers.
\ No newline at end of file diff --git a/external/ct2n/UnpackedTarball_ct2n.mk b/external/ct2n/UnpackedTarball_ct2n.mk deleted file mode 100644 index 38cfb6743896..000000000000 --- a/external/ct2n/UnpackedTarball_ct2n.mk +++ /dev/null @@ -1,32 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,ct2n)) - -$(eval $(call gb_UnpackedTarball_set_tarball,ct2n,$(CT2N_TARBALL),0)) - -$(eval $(call gb_UnpackedTarball_add_patches,ct2n,\ - external/ct2n/ConvertTextToNumber-1.3.2-no-license.patch \ - external/ct2n/ConvertTextToNumber-1.3.2-no-visible-by-default.patch \ - external/ct2n/ConvertTextToNumber-1.5.0-add-namespace-prefix.patch \ -)) - -$(eval $(call gb_UnpackedTarball_fix_end_of_line,ct2n,\ - description.xml \ - Office/UI/BaseWindowState.xcu \ - Office/UI/BasicIDEWindowState.xcu \ - Office/UI/CalcWindowState.xcu \ - Office/UI/DrawWindowState.xcu \ - Office/UI/ImpressWindowState.xcu \ - Office/UI/MathWindowState.xcu \ - Office/UI/StartModuleWindowState.xcu \ - Office/UI/WriterWindowState.xcu \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/ct2n/description-en-US.txt b/external/ct2n/description-en-US.txt deleted file mode 100644 index a91393b5acf5..000000000000 --- a/external/ct2n/description-en-US.txt +++ /dev/null @@ -1,4 +0,0 @@ -From [http://extensions.libreoffice.org/extension-center/ct2n-convert-text-to-number-and-dates]. - -ConvertTextToNumber replaces numbers and dates, formatted - as text, with real numbers. diff --git a/external/curl/ExternalPackage_curl.mk b/external/curl/ExternalPackage_curl.mk index 79a89a24a52c..e9be1e9aa705 100644 --- a/external/curl/ExternalPackage_curl.mk +++ b/external/curl/ExternalPackage_curl.mk @@ -14,13 +14,11 @@ $(eval $(call gb_ExternalPackage_use_external_project,curl,curl)) ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(COM),MSC) -$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll,builds/libcurl-vc12-$(gb_MSBUILD_PLATFORM)-$(gb_MSBUILD_CONFIG)-dll-ipv6-sspi-winssl/bin/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll)) +$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll,builds/libcurl-vc12-$(gb_MSBUILD_PLATFORM)-$(gb_MSBUILD_CONFIG)-dll-zlib-static-ipv6-sspi-schannel/bin/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll)) else ifeq ($(OS),MACOSX) $(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.4.dylib,lib/.libs/libcurl.4.dylib)) -else ifeq ($(OS),AIX) -$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so,lib/.libs/libcurl.so.4)) else -$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.6.0)) +$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.8.0)) endif endif # $(DISABLE_DYNLOADING) diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk index 138b50afd0e0..c63a8e0465ce 100644 --- a/external/curl/ExternalProject_curl.mk +++ b/external/curl/ExternalProject_curl.mk @@ -10,7 +10,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,curl)) $(eval $(call gb_ExternalProject_use_externals,curl,\ - $(if $(ENABLE_NSS),nss3) \ + $(if $(ENABLE_OPENSSL),openssl) \ zlib \ )) @@ -30,41 +30,40 @@ curl_LDFLAGS += -L$(SYSBASE)/usr/lib endif endif -# there are 2 include paths, the other one is passed to --with-nss below -ifeq ($(SYSTEM_NSS),) -curl_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -endif - -# use --with-darwinssl on macOS >10.5 and iOS to get a native UI for SSL certs for CMIS usage -# use --with-nss only on platforms other than macOS and iOS +# use --with-secure-transport on macOS >10.5 and iOS to get a native UI for SSL certs for CMIS usage +# use --with-openssl only on platforms other than macOS and iOS $(call gb_ExternalProject_get_state_target,curl,build): $(call gb_Trace_StartRange,curl,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure \ - $(if $(filter iOS MACOSX,$(OS)),\ - --with-darwinssl,\ - $(if $(ENABLE_NSS),--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out"),--without-nss)) \ - --without-ssl --without-gnutls --without-polarssl --without-cyassl --without-axtls --without-mbedtls \ - --enable-ftp --enable-http --enable-ipv6 \ + $(gb_RUN_CONFIGURE) ./configure \ + --without-amissl --without-bearssl --without-gnutls \ + --without-mbedtls --without-rustls --without-wolfssl \ + --disable-ftp --enable-http --enable-ipv6 \ --without-libidn2 --without-libpsl --without-librtmp \ - --without-libssh2 --without-metalink --without-nghttp2 \ + --without-libssh2 --without-nghttp2 \ --without-libssh --without-brotli \ --without-ngtcp2 --without-quiche \ - --disable-ares \ + --without-zstd --without-hyper --without-libgsasl --without-gssapi \ + --disable-mqtt --disable-ares \ --disable-dict --disable-file --disable-gopher --disable-imap \ --disable-ldap --disable-ldaps --disable-manual --disable-pop3 \ --disable-rtsp --disable-smb --disable-smtp --disable-telnet \ --disable-tftp \ + $(if $(filter iOS MACOSX,$(OS)),\ + --with-secure-transport,\ + $(if $(ENABLE_OPENSSL),--with-openssl$(if $(SYSTEM_OPENSSL),,="$(call gb_UnpackedTarball_get_dir,openssl)"))) \ $(if $(filter LINUX,$(OS)),--without-ca-bundle --without-ca-path) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ $(if $(ENABLE_DEBUG),--enable-debug) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(filter MACOSX,$(OS)),CFLAGS='$(CFLAGS) \ -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)') \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ CPPFLAGS='$(curl_CPPFLAGS)' \ - LDFLAGS='$(curl_LDFLAGS)' \ + CFLAGS="$(gb_CFLAGS) $(call gb_ExternalProject_get_build_flags,curl)" \ + LDFLAGS='$(call gb_ExternalProject_get_link_flags,curl) $(curl_LDFLAGS)' \ ZLIB_CFLAGS='$(ZLIB_CFLAGS)' ZLIB_LIBS='$(ZLIB_LIBS)' \ && cd lib \ && $(MAKE) \ @@ -83,10 +82,12 @@ $(call gb_ExternalProject_get_state_target,curl,build): VC=12 \ MACHINE=$(gb_MSBUILD_PLATFORM) \ GEN_PDB=$(if $(call gb_Module__symbols_enabled,curl),yes,no) \ + $(if $(call gb_Module__symbols_enabled,curl),CFLAGS_PDB_VALUE="$(gb_DEBUGINFO_FLAGS)") \ DEBUG=$(if $(MSVC_USE_DEBUG_RUNTIME),yes,no) \ ENABLE_IPV6=yes \ ENABLE_SSPI=yes \ ENABLE_WINSSL=yes \ + WITH_ZLIB=static \ ,winbuild) $(call gb_Trace_EndRange,curl,EXTERNAL) diff --git a/external/curl/README b/external/curl/README index 292e4edf57b6..4a7044623608 100644 --- a/external/curl/README +++ b/external/curl/README @@ -1 +1 @@ -A URL manipulation engine from [http://curl.haxx.se/]. +A URL manipulation engine from [https://curl.se/]. diff --git a/external/curl/UnpackedTarball_curl.mk b/external/curl/UnpackedTarball_curl.mk index 6171f17cba48..4412857d36a0 100644 --- a/external/curl/UnpackedTarball_curl.mk +++ b/external/curl/UnpackedTarball_curl.mk @@ -21,18 +21,12 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,curl,\ $(eval $(call gb_UnpackedTarball_add_patches,curl,\ external/curl/curl-msvc.patch.1 \ + external/curl/curl-msvc-zlib.patch.1 \ external/curl/curl-msvc-disable-protocols.patch.1 \ - external/curl/curl-7.26.0_win-proxy.patch \ external/curl/zlib.patch.0 \ - external/curl/curl-ios.patch.1 \ + external/curl/configurable-z-option.patch.0 \ )) -ifeq ($(SYSTEM_NSS),) -$(eval $(call gb_UnpackedTarball_add_patches,curl,\ - external/curl/curl-nss.patch.1 \ -)) -endif - ifeq ($(OS)-$(COM_IS_CLANG),WNT-TRUE) $(eval $(call gb_UnpackedTarball_add_patches,curl, \ external/curl/clang-cl.patch.0 \ diff --git a/external/curl/clang-cl.patch.0 b/external/curl/clang-cl.patch.0 index 2fbb10c2a9aa..5dfb19d5ba59 100644 --- a/external/curl/clang-cl.patch.0 +++ b/external/curl/clang-cl.patch.0 @@ -1,6 +1,6 @@ --- winbuild/MakefileBuild.vc +++ winbuild/MakefileBuild.vc -@@ -60,7 +60,7 @@ +@@ -52,7 +52,7 @@ !ELSE CC_NODEBUG = $(CC) /O2 /DNDEBUG CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd diff --git a/external/curl/configurable-z-option.patch.0 b/external/curl/configurable-z-option.patch.0 new file mode 100644 index 000000000000..84516ad21917 --- /dev/null +++ b/external/curl/configurable-z-option.patch.0 @@ -0,0 +1,20 @@ +--- winbuild/MakefileBuild.vc.sav 2021-11-13 11:43:40.756226600 +0000 ++++ winbuild/MakefileBuild.vc 2021-11-13 11:52:08.921692300 +0000 +@@ -47,7 +47,7 @@ + + !IF "$(VC)"=="6" + CC_NODEBUG = $(CC) /O2 /DNDEBUG +-CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ ++CC_DEBUG = $(CC) /Od /Gm $(DEBUG_FLAGS_VALUE) /D_DEBUG /GZ + CFLAGS = /I. /I../lib /I../include /nologo /W4 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL + !ELSE + CC_NODEBUG = $(CC) /O2 /DNDEBUG +@@ -64,7 +64,7 @@ + # Instead of id: just create an archive, that contains all objects + LNKLIB = lib.exe + +-CFLAGS_PDB = /Zi ++CFLAGS_PDB = $(DEBUG_FLAGS_VALUE) + LFLAGS_PDB = /incremental:no /opt:ref,icf /DEBUG + + CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB diff --git a/external/curl/curl-7.26.0_win-proxy.patch b/external/curl/curl-7.26.0_win-proxy.patch deleted file mode 100644 index 852881570e36..000000000000 --- a/external/curl/curl-7.26.0_win-proxy.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 17:15:22.969492548 +0200 -+++ curl/winbuild/MakefileBuild.vc 2017-10-23 17:16:38.491490679 +0200 -@@ -72,7 +72,7 @@ - - CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB - --WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib -+WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib winhttp.lib - - BASE_NAME = libcurl - BASE_NAME_DEBUG = $(BASE_NAME)_debug ---- curl-7.26.0/lib/url.c -+++ misc/build/curl-7.26.0/lib/url.c -@@ -78,6 +78,10 @@ - bool curl_win32_idn_to_ascii(const char *in, char **out); - #endif /* USE_LIBIDN2 */ - -+#ifdef _WIN32 -+#include <WinHttp.h> -+#endif -+ - #include "urldata.h" - #include "netrc.h" - -@@ -4586,6 +4590,21 @@ - } - - #ifndef CURL_DISABLE_HTTP -+#ifdef _WIN32 -+static char *wstrToCstr(LPWSTR wStr) -+{ -+ int bufSize; -+ char *out = NULL; -+ if(wStr != NULL) { -+ bufSize = WideCharToMultiByte( -+ CP_ACP, 0, wStr, -1, NULL, 0, NULL, NULL); -+ out = (char *)malloc(bufSize * sizeof(char)); -+ WideCharToMultiByte(CP_ACP, 0, wStr, -1, out, bufSize, NULL, NULL); -+ } -+ return out; -+} -+#endif -+ - /**************************************************************** - * Detect what (if any) proxy to use. Remember that this selects a host - * name and is not limited to HTTP proxies only. -@@ -4613,6 +4633,66 @@ - * For compatibility, the all-uppercase versions of these variables are - * checked if the lowercase versions don't exist. - */ -+#ifdef _WIN32 -+ char *no_proxy = NULL; -+ WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *ieProxyConfig; -+ ieProxyConfig = (WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *) -+ malloc(sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG)); -+ if(WinHttpGetIEProxyConfigForCurrentUser(ieProxyConfig)) { -+ if(!ieProxyConfig->fAutoDetect) { -+ char *ieProxy; -+ char *ieNoProxy; -+ char *pos; -+ -+ ieProxy = wstrToCstr(ieProxyConfig->lpszProxy); -+ ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass); -+ -+ /* Convert the ieNoProxy into a proper no_proxy value */ -+ if(NULL != ieNoProxy) { -+ no_proxy = strdup(ieNoProxy); -+ pos = strpbrk(no_proxy, "; "); -+ while(NULL != pos) { -+ no_proxy[pos-no_proxy] = ','; -+ pos = strpbrk(no_proxy, "; "); -+ } -+ } -+ -+ if(!check_noproxy(conn->host.name, no_proxy)) { -+ /* Look for the http proxy setting */ -+ char *tok; -+ char *saveptr; -+ -+ if(NULL != ieProxy) { -+ tok = strtok_s(ieProxy, ";", &saveptr); -+ if(strchr(tok, '=') == NULL) { -+ proxy = strdup(ieProxy); -+ } -+ else { -+ do { -+ if(strncmp(tok, "http=", 5) == 0) { -+ /* We found HTTP proxy value, then use it */ -+ proxy = strdup(tok + 5); -+ } -+ tok = strtok_s(NULL, ";", &saveptr); -+ } -+ while(NULL != tok); -+ } -+ } -+ } -+ -+ free(ieProxy); -+ free(ieNoProxy); -+ } -+ else { -+ /* TODO Handle the Proxy config Auto Detection case */ -+ } -+ -+ GlobalFree(ieProxyConfig->lpszAutoConfigUrl); -+ GlobalFree(ieProxyConfig->lpszProxy); -+ GlobalFree(ieProxyConfig->lpszProxyBypass); -+ } -+ free(no_proxy); -+#else /* !_WIN32 */ - char proxy_env[128]; - const char *protop = conn->handler->scheme; - char *envp = proxy_env; -@@ -4663,6 +4739,7 @@ - } - if(proxy) - infof(conn->data, "Uses proxy env variable %s == '%s'\n", envp, proxy); -+#endif /* _WIN32 */ - - return proxy; - } diff --git a/external/curl/curl-ios.patch.1 b/external/curl/curl-ios.patch.1 deleted file mode 100644 index 1c8fd8f70566..000000000000 --- a/external/curl/curl-ios.patch.1 +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Mode: Diff -*- -# -# We don't want curl's configure script to add a -mmacosx-version-min -# option when it is for iOS we are building. In that case already $CC -# contains a -miphoneos-version-min option. - ---- curl/configure -+++ curl/configure -@@ -18976,7 +18976,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for *version-min in CFLAGS" >&5 - $as_echo_n "checking for *version-min in CFLAGS... " >&6; } - min="" -- if test -z "$(echo $CFLAGS | grep m.*os.*-version-min)"; then -+ if test -z "$(echo $CC $CFLAGS | grep m.*os.*-version-min)"; then - min="-mmacosx-version-min=10.8" - CFLAGS="$CFLAGS $min" - fi diff --git a/external/curl/curl-msvc-disable-protocols.patch.1 b/external/curl/curl-msvc-disable-protocols.patch.1 index c8747a5fcc1d..905a2d6a7ac3 100644 --- a/external/curl/curl-msvc-disable-protocols.patch.1 +++ b/external/curl/curl-msvc-disable-protocols.patch.1 @@ -2,18 +2,19 @@ disable protocols nobody needs in MSVC build --- curl/lib/config-win32.h.orig 2017-08-09 16:43:29.464000000 +0200 +++ curl/lib/config-win32.h 2017-08-09 16:47:38.549200000 +0200 -@@ -733,4 +733,19 @@ +@@ -654,4 +654,20 @@ # define ENABLE_IPV6 1 #endif +#define CURL_DISABLE_DICT 1 +#define CURL_DISABLE_FILE 1 -+//#undef CURL_DISABLE_FTP ++#define CURL_DISABLE_FTP 1 +#define CURL_DISABLE_GOPHER 1 -+//#undef CURL_DISABLE_HTTP ++#undef CURL_DISABLE_HTTP +#define CURL_DISABLE_IMAP 1 +#define CURL_DISABLE_LDAP 1 +#define CURL_DISABLE_LDAPS 1 ++#define CURL_DISABLE_MQTT 1 +#define CURL_DISABLE_POP3 1 +#define CURL_DISABLE_RTSP 1 +#define CURL_DISABLE_SMB 1 @@ -24,7 +25,7 @@ disable protocols nobody needs in MSVC build #endif /* HEADER_CURL_CONFIG_WIN32_H */ --- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 23:41:21.393200000 +0200 +++ curl/winbuild/MakefileBuild.vc 2017-10-23 23:34:16.028000000 +0200 -@@ -431,7 +431,7 @@ +@@ -562,7 +562,7 @@ EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res diff --git a/external/curl/curl-msvc-zlib.patch.1 b/external/curl/curl-msvc-zlib.patch.1 new file mode 100644 index 000000000000..a9ee0013d50b --- /dev/null +++ b/external/curl/curl-msvc-zlib.patch.1 @@ -0,0 +1,16 @@ +find internal zlib in nmake buildsystem + +--- curl/winbuild/MakefileBuild.vc.orig2 2021-10-27 20:44:48.685237000 +0200 ++++ curl/winbuild/MakefileBuild.vc 2021-10-27 20:47:23.792407400 +0200 +@@ -244,8 +244,9 @@ + ZLIB_LIB_DIR = $(ZLIB_PATH)\lib + ZLIB_LFLAGS = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)" + !ELSE +-ZLIB_INC_DIR = $(DEVEL_INCLUDE) +-ZLIB_LIB_DIR = $(DEVEL_LIB) ++ZLIB_INC_DIR = $(WORKDIR)/UnpackedTarball/zlib ++ZLIB_LIB_DIR = $(WORKDIR)/LinkTarget/StaticLibrary ++ZLIB_LFLAGS = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)" + !ENDIF + + # Depending on how zlib is built the libraries have different names, we diff --git a/external/curl/curl-msvc.patch.1 b/external/curl/curl-msvc.patch.1 index a5b79a8e9c49..54ad026ec8c7 100644 --- a/external/curl/curl-msvc.patch.1 +++ b/external/curl/curl-msvc.patch.1 @@ -2,7 +2,7 @@ MSVC: using SOLARINC --- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 16:36:07.713550851 +0200 +++ curl/winbuild/MakefileBuild.vc 2017-10-23 16:38:19.301547594 +0200 -@@ -60,7 +60,7 @@ +@@ -52,7 +52,7 @@ !ELSE CC_NODEBUG = $(CC) /O2 /DNDEBUG CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd @@ -11,7 +11,7 @@ MSVC: using SOLARINC !ENDIF LFLAGS = /nologo /machine:$(MACHINE) -@@ -300,11 +300,11 @@ +@@ -426,11 +426,11 @@ # CURL_XX macros are for the curl.exe command !IF "$(DEBUG)"=="yes" diff --git a/external/curl/curl-nss.patch.1 b/external/curl/curl-nss.patch.1 deleted file mode 100644 index 69fde5f7f236..000000000000 --- a/external/curl/curl-nss.patch.1 +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur curl.org/configure curl/configure ---- curl.org/configure 2016-03-13 15:14:07.177000076 +0100 -+++ curl/configure 2016-03-13 15:16:44.132000076 +0100 -@@ -24009,7 +24009,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired libraries and compilation flags for NSS." >&5 - $as_echo "$as_me: WARNING: Using hard-wired libraries and compilation flags for NSS." >&2;} - addld="-L$OPT_NSS/lib" -- addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" -+ addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lnssutil3" - addcflags="-I$OPT_NSS/include" - version="unknown" - nssprefix=$OPT_NSS diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0 index 189e820d1afa..b4442ba262d1 100644 --- a/external/curl/zlib.patch.0 +++ b/external/curl/zlib.patch.0 @@ -1,22 +1,22 @@ --- configure +++ configure -@@ -20709,7 +20709,6 @@ +@@ -23035,7 +23035,6 @@ clean_CPPFLAGS=$CPPFLAGS clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS -ZLIB_LIBS="" # Check whether --with-zlib was given. - if test "${with_zlib+set}" = set; then : -@@ -20718,6 +20719,7 @@ + if test ${with_zlib+y} +@@ -23045,6 +23044,7 @@ if test "$OPT_ZLIB" = "no" ; then + ZLIB_LIBS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 - $as_echo "$as_me: WARNING: zlib disabled" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 + printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;} else -@@ -20725,6 +20725,21 @@ +@@ -23052,6 +23052,21 @@ OPT_ZLIB="" fi @@ -38,8 +38,8 @@ if test -z "$OPT_ZLIB" ; then if test -n "$PKG_CONFIG"; then -@@ -21005,6 +21020,7 @@ - $as_echo "$as_me: found both libz and libz.h header" >&6;} +@@ -23344,6 +23359,7 @@ + printf "%s\n" "$as_me: found both libz and libz.h header" >&6;} curl_zlib_msg="enabled" fi + fi @@ -48,14 +48,14 @@ if test x"$AMFIXLIB" = x1; then --- configure.ac +++ configure.ac -@@ -880,19 +880,30 @@ +@@ -1243,19 +1243,30 @@ clean_CPPFLAGS=$CPPFLAGS clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS -ZLIB_LIBS="" AC_ARG_WITH(zlib, - AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) - AC_HELP_STRING([--without-zlib],[disable use of zlib]), + AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) + AS_HELP_STRING([--without-zlib],[disable use of zlib]), [OPT_ZLIB="$withval"]) if test "$OPT_ZLIB" = "no" ; then @@ -80,7 +80,7 @@ if test -z "$OPT_ZLIB" ; then CURL_CHECK_PKGCONFIG(zlib) -@@ -975,6 +986,7 @@ +@@ -1336,6 +1347,7 @@ AC_MSG_NOTICE([found both libz and libz.h header]) curl_zlib_msg="enabled" fi diff --git a/external/dragonbox/Module_dragonbox.mk b/external/dragonbox/Module_dragonbox.mk new file mode 100644 index 000000000000..2ed608f1e5e8 --- /dev/null +++ b/external/dragonbox/Module_dragonbox.mk @@ -0,0 +1,16 @@ +# -*- 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_Module_Module,dragonbox)) + +$(eval $(call gb_Module_add_targets,dragonbox,\ + UnpackedTarball_dragonbox \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/dragonbox/README b/external/dragonbox/README new file mode 100644 index 000000000000..28db2711b9e4 --- /dev/null +++ b/external/dragonbox/README @@ -0,0 +1,4 @@ +Dragonbox is available from [ https://github.com/jk-jeon/dragonbox ]. + +Used to convert a double to a decimal string, providing breakout of significand and exponent +as integers, allowing to create custom number representation (e.g., locale-specific). diff --git a/external/dragonbox/UnpackedTarball_dragonbox.mk b/external/dragonbox/UnpackedTarball_dragonbox.mk new file mode 100644 index 000000000000..c483f19a3c56 --- /dev/null +++ b/external/dragonbox/UnpackedTarball_dragonbox.mk @@ -0,0 +1,14 @@ +# -*- 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,dragonbox)) + +$(eval $(call gb_UnpackedTarball_set_tarball,dragonbox,$(DRAGONBOX_TARBALL))) + +# vim: set noet sw=4 ts=4: diff --git a/external/epm/ExternalProject_epm.mk b/external/epm/ExternalProject_epm.mk index 68a61a78a744..7b0dde219e4b 100644 --- a/external/epm/ExternalProject_epm.mk +++ b/external/epm/ExternalProject_epm.mk @@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,epm,\ $(call gb_ExternalProject_get_state_target,epm,build) : $(call gb_Trace_StartRange,epm,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --disable-fltk \ + $(gb_RUN_CONFIGURE) ./configure --disable-fltk \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________NONE) \ && $(MAKE) \ && touch $@ \ diff --git a/external/epm/UnpackedTarball_epm.mk b/external/epm/UnpackedTarball_epm.mk index c064a5bacc1e..91d9fbd2b29a 100644 --- a/external/epm/UnpackedTarball_epm.mk +++ b/external/epm/UnpackedTarball_epm.mk @@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,epm,$(EPM_TARBALL),,epm)) $(eval $(call gb_UnpackedTarball_add_patches,epm,\ external/epm/epm-3.7.patch \ external/epm/asan.patch.0 \ + external/epm/ppc64el.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/epm/ppc64el.patch.0 b/external/epm/ppc64el.patch.0 new file mode 100644 index 000000000000..2b9416e8d215 --- /dev/null +++ b/external/epm/ppc64el.patch.0 @@ -0,0 +1,11 @@ +--- deb.c.orig 2022-08-01 14:50:38.593375838 +0200 ++++ deb.c 2022-08-01 14:58:08.000000000 +0200 +@@ -163,6 +163,8 @@ + #endif + else if (!strcmp(platform->machine, "ppc")) + fputs("Architecture: powerpc\n", fp); ++ else if (!strcmp(platform->machine, "ppc64le")) ++ fputs("Architecture: ppc64el\n", fp); + else + fprintf(fp, "Architecture: %s\n", platform->machine); + diff --git a/external/epoxy/UnpackedTarball_epoxy.mk b/external/epoxy/UnpackedTarball_epoxy.mk index 8dce1ba9d745..7dd319988121 100644 --- a/external/epoxy/UnpackedTarball_epoxy.mk +++ b/external/epoxy/UnpackedTarball_epoxy.mk @@ -16,7 +16,7 @@ $(call gb_UnpackedTarball_get_target,epoxy) :| $(call gb_ExternalExecutable_get_ epoxy_PYTHON := $(call gb_ExternalExecutable_get_command,python) # previous versions of epoxy bundled the output, but now it has to be generated -$(eval $(call gb_UnpackedTarball_set_pre_action,epoxy,\ +$(eval $(call gb_UnpackedTarball_set_post_action,epoxy,\ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/gl.xml && \ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/glx.xml && \ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/egl.xml && \ @@ -25,11 +25,14 @@ $(eval $(call gb_UnpackedTarball_set_pre_action,epoxy,\ $(eval $(call gb_UnpackedTarball_set_patchlevel,epoxy,0)) +# * external/external/epoxy/epoxy.android.patch upstream at +# <https://github.com/anholt/libepoxy/pull/263> "fix error: use of undeclared identifier 'OPENGL_LIB'": $(eval $(call gb_UnpackedTarball_add_patches,epoxy, \ external/epoxy/epoxy.visibility.patch \ external/epoxy/epoxy.windows.api.patch \ external/epoxy/epoxy.noegl.by.default.patch \ external/epoxy/clang-cl.patch \ + external/epoxy/Wint-conversion.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/epoxy/Wint-conversion.patch b/external/epoxy/Wint-conversion.patch new file mode 100644 index 000000000000..b638dfad806f --- /dev/null +++ b/external/epoxy/Wint-conversion.patch @@ -0,0 +1,26 @@ +--- src/gen_dispatch.py ++++ src/gen_dispatch.py +@@ -123,20 +123,16 @@ + # + # We retain those aliases. In the x86_64 ABI, the first 6 + # args are stored in 64-bit registers, so the calls end up +- # being the same despite the different types. We just need to +- # add a cast to uintptr_t to shut up the compiler. ++ # being the same despite the different types. + if arg_type == 'GLhandleARB': + assert len(self.args) < 6 +- arg_list_name = '(uintptr_t)' + arg_name +- else: +- arg_list_name = arg_name + + self.args.append((arg_type, arg_name)) + if self.args_decl == 'void': +- self.args_list = arg_list_name ++ self.args_list = arg_name + self.args_decl = arg_type + ' ' + arg_name + else: +- self.args_list += ', ' + arg_list_name ++ self.args_list += ', ' + arg_name + self.args_decl += ', ' + arg_type + ' ' + arg_name + + def add_provider(self, condition, loader, condition_name): diff --git a/external/epoxy/clang-cl.patch b/external/epoxy/clang-cl.patch index 80b49127104b..0e0232cea68c 100644 --- a/external/epoxy/clang-cl.patch +++ b/external/epoxy/clang-cl.patch @@ -1,6 +1,6 @@ --- src/dispatch_common.c +++ src/dispatch_common.c -@@ -190,7 +190,11 @@ +@@ -272,7 +272,11 @@ #endif }; diff --git a/external/expat/ExternalProject_expat.mk b/external/expat/ExternalProject_expat.mk index 4f4f0301c1bc..1e9609a4aff8 100644 --- a/external/expat/ExternalProject_expat.mk +++ b/external/expat/ExternalProject_expat.mk @@ -16,9 +16,9 @@ $(eval $(call gb_ExternalProject_register_targets,expat,\ $(call gb_ExternalProject_get_state_target,expat,configure) : $(call gb_Trace_StartRange,expat,EXTERNAL) $(call gb_ExternalProject_run,configure,\ - ./configure --without-docbook \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(gb_RUN_CONFIGURE) ./configure --without-docbook \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ ,,expat_configure.log) $(call gb_Trace_EndRange,expat,EXTERNAL) diff --git a/external/expat/UnpackedTarball_expat.mk b/external/expat/UnpackedTarball_expat.mk index 96f4e3ec8732..5d4f41f6d147 100644 --- a/external/expat/UnpackedTarball_expat.mk +++ b/external/expat/UnpackedTarball_expat.mk @@ -15,7 +15,6 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,expat,conftools)) $(eval $(call gb_UnpackedTarball_add_patches,expat,\ external/expat/expat-winapi.patch \ - external/expat/ubsan.patch.0 \ )) # This is a bit hackish. diff --git a/external/expat/expat-winapi.patch b/external/expat/expat-winapi.patch index b33c12b83b4c..fed65644a732 100644 --- a/external/expat/expat-winapi.patch +++ b/external/expat/expat-winapi.patch @@ -1,6 +1,6 @@ ---- misc/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:17.375000000 +0000 -+++ misc/build/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:34.703125000 +0000 -@@ -81,10 +81,6 @@ +--- misc/expat-2.5.0/lib/expat_external.h 2022-10-25 01:32:54.000000000 +0900 ++++ misc/build/expat-2.5.0/lib/expat_external.h 2022-10-30 23:09:47.339459134 +0900 +@@ -88,10 +88,6 @@ # ifndef XML_BUILDING_EXPAT /* using Expat from an application */ @@ -11,3 +11,15 @@ # endif #endif /* not defined XML_STATIC */ +--- misc/expat-2.5.0/lib/xmlparse.c 2022-10-26 00:09:08.000000000 +0900 ++++ misc/build/expat-2.5.0/lib/xmlparse.c 2022-10-30 23:09:01.843006341 +0900 +@@ -67,6 +67,9 @@ + #endif + + #ifdef _WIN32 ++# undef HAVE_ARC4RANDOM_BUF ++# undef HAVE_GETRANDOM ++# undef HAVE_SYSCALL_GETRANDOM + /* force stdlib to define rand_s() */ + # if ! defined(_CRT_RAND_S) + # define _CRT_RAND_S diff --git a/external/expat/ubsan.patch.0 b/external/expat/ubsan.patch.0 deleted file mode 100644 index 8317f922df88..000000000000 --- a/external/expat/ubsan.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/xmlparse.c -+++ lib/xmlparse.c -@@ -6485,7 +6485,7 @@ - static void FASTCALL - hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) { - iter->p = table->v; -- iter->end = iter->p + table->size; -+ iter->end = table->size == 0 ? iter->p : iter->p + table->size; - } - - static NAMED *FASTCALL diff --git a/external/firebird/0001-extern-cloop-Missing-dependencies-of-compilations-on.patch.1 b/external/firebird/0001-extern-cloop-Missing-dependencies-of-compilations-on.patch.1 new file mode 100644 index 000000000000..a59e70e06abc --- /dev/null +++ b/external/firebird/0001-extern-cloop-Missing-dependencies-of-compilations-on.patch.1 @@ -0,0 +1,41 @@ +From 8305b41bb262b6e249f2551639fa88392e152287 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann <sbergman@redhat.com> +Date: Tue, 7 Sep 2021 08:47:32 +0200 +Subject: [PATCH] extern/cloop: Missing dependencies of compilations on output + directories + +When building Firebird 3.0.7 as part of LibreOffice, we noticed occasional build +failures like <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/96392/> + +> error: unable to open output file '/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/firebird/temp/Debug/cloop/release/tests/test1/CTest.o': 'No such file or directory' +> 1 error generated. +> Makefile:72: recipe for target '/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/firebird/temp/Debug/cloop/release/tests/test1/CTest.o' failed + +and while target "all" depends on target "mkdirs" (which would create all those +directories) in extern/cloop/Makefile, there is no order among the dependencies +of "all", so no guarantee that the directories are already created when the +compilation recipes are executed. +--- + extern/cloop/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/extern/cloop/Makefile b/extern/cloop/Makefile +index 3fca0c7356..c5a2b52628 100644 +--- a/extern/cloop/Makefile ++++ b/extern/cloop/Makefile +@@ -54,10 +54,10 @@ vpath %.c $(SRC_DIRS) + vpath %.cpp $(SRC_DIRS) + + define compile +-$1/%.o: %.c ++$1/%.o: %.c | $1 + $(CC) -c $$(C_FLAGS) $$< -o $$@ + +-$1/%.o: %.cpp ++$1/%.o: %.cpp | $1 + $(CXX) -c $$(CXX_FLAGS) $$< -o $$@ + endef + +-- +2.31.1 + diff --git a/external/firebird/ExternalProject_firebird.mk b/external/firebird/ExternalProject_firebird.mk index 0a1706031746..18ee97eb4409 100644 --- a/external/firebird/ExternalProject_firebird.mk +++ b/external/firebird/ExternalProject_firebird.mk @@ -44,6 +44,13 @@ $(call gb_ExternalProject_get_state_target,firebird,build): ) \ $(if $(filter GCC-INTEL,$(COM)-$(CPUNAME)),-Di386=1) \ " \ + && export CFLAGS=" \ + $(if $(filter MSC,$(COM)),$(if $(MSVC_USE_DEBUG_RUNTIME),-DMSVC_USE_DEBUG_RUNTIME)) \ + $(if $(filter MSC-TRUE-X86_64,$(COM)-$(COM_IS_CLANG)-$(CPUNAME)),-march=x86-64-v2) \ + $(if $(HAVE_GCC_FNO_SIZED_DEALLOCATION),-fno-sized-deallocation -fno-delete-null-pointer-checks) \ + $(call gb_ExternalProject_get_build_flags,firebird) \ + $(if $(ENABLE_DEBUG),$(if $(filter MSC,$(COM)),-Od -Z7)) \ + " \ && export CXXFLAGS=" \ $(BOOST_CXXFLAGS) \ $(if $(filter MSC,$(COM)),$(if $(MSVC_USE_DEBUG_RUNTIME),-DMSVC_USE_DEBUG_RUNTIME)) \ @@ -51,9 +58,11 @@ $(call gb_ExternalProject_get_state_target,firebird,build): $(if $(HAVE_GCC_FNO_SIZED_DEALLOCATION),-fno-sized-deallocation -fno-delete-null-pointer-checks) \ $(CXXFLAGS_CXX11) \ $(if $(filter TRUE,$(COM_IS_CLANG)), -Wno-c++11-narrowing) \ - $(if $(call gb_Module__symbols_enabled,firebird),$(gb_DEBUGINFO_FLAGS)) \ + $(call gb_ExternalProject_get_build_flags,firebird) \ + $(if $(ENABLE_DEBUG),$(if $(filter MSC,$(COM)),-Od -Z7)) \ " \ && export LDFLAGS=" \ + $(call gb_ExternalProject_get_link_flags,firebird) \ $(if $(SYSTEM_LIBATOMIC_OPS),$(LIBATOMIC_OPS_LIBS), \ -L$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src \ ) \ @@ -66,22 +75,18 @@ $(call gb_ExternalProject_get_state_target,firebird,build): " \ && export LIBREOFFICE_ICU_LIB="$(call gb_UnpackedTarball_get_dir,icu)/source/lib" \ && export MSVC_USE_INDIVIDUAL_PDBS=TRUE \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --without-editline \ --with-wire-compress=no \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ , \ --enable-shared --disable-static \ ) \ - $(if $(filter MACOSX,$(OS)), \ - $(if $(filter 1, \ - $(shell expr '$(MAC_OS_X_VERSION_MIN_REQUIRED)' \ - '<' 101200)), \ - ac_cv_func_clock_gettime=no)) \ + $(if $(HAVE_LIBCPP),CXX='$(CXX) -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR') \ && LC_ALL=C $(MAKE) \ - $(if $(ENABLE_DEBUG),Debug) SHELL='$(SHELL)' $(if $(filter LINUX,$(OS)),CXXFLAGS="$$CXXFLAGS -std=gnu++11") \ + $(if $(ENABLE_DEBUG),Debug) SHELL='$(SHELL)' $(if $(filter LINUX,$(OS)),CXXFLAGS="$$CXXFLAGS") \ MATHLIB="$(if $(SYSTEM_LIBTOMMATH),$(LIBTOMMATH_LIBS),-L$(call gb_UnpackedTarball_get_dir,libtommath) -ltommath)" \ LIBO_TUNNEL_LIBRARY_PATH='$(subst ','\'',$(subst $$,$$$$,$(call gb_Helper_extend_ld_path,$(call gb_UnpackedTarball_get_dir,icu)/source/lib)))' \ $(if $(filter MACOSX,$(OS)), \ diff --git a/external/firebird/UnpackedTarball_firebird.mk b/external/firebird/UnpackedTarball_firebird.mk index fef0b7fe48b1..821b167650d5 100644 --- a/external/firebird/UnpackedTarball_firebird.mk +++ b/external/firebird/UnpackedTarball_firebird.mk @@ -26,7 +26,10 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,firebird,\ # code", # * external/firebird/0001-extern-cloop-Missing-dependency-of-BIN_DIR-cloop-on-.patch.1 is upstream # at <https://github.com/FirebirdSQL/firebird/pull/302> "extern/cloop: Missing dependency of -# $(BIN_DIR)/cloop on $(BIN_DIR)": +# $(BIN_DIR)/cloop on $(BIN_DIR)", +# * external/firebird/0001-extern-cloop-Missing-dependencies-of-compilations-on.patch.1 is upstream +# at <https://github.com/FirebirdSQL/firebird/pull/6948> "extern/cloop: Missing dependencies of +# compilations on output directories": $(eval $(call gb_UnpackedTarball_add_patches,firebird,\ external/firebird/firebird.disable-ib-util-not-found.patch.1 \ external/firebird/firebird-Engine12.patch \ @@ -44,6 +47,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,firebird,\ external/firebird/0001-Fix-checks-for-null-HANDLE-in-Windows-only-code.patch.1 \ external/firebird/0001-extern-cloop-Missing-dependency-of-BIN_DIR-cloop-on-.patch.1 \ external/firebird/msvc.patch \ + external/firebird/wnt-per-process-trace-storage.patch.1 \ + external/firebird/0001-extern-cloop-Missing-dependencies-of-compilations-on.patch.1 \ + external/firebird/configure-c99.patch \ + external/firebird/Wincompatible-function-pointer-types.patch \ + external/firebird/c++26.patch \ + external/firebird/c++20.patch \ )) ifeq ($(OS),WNT) @@ -61,6 +70,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,firebird,\ )) endif +ifeq ($(ENABLE_MACOSX_SANDBOX),TRUE) +$(eval $(call gb_UnpackedTarball_add_patches,firebird,\ + external/firebird/firebird-macosx-sandbox.patch.1 \ +)) +endif + ifneq ($(filter -fsanitize=%,$(CC)),) $(eval $(call gb_UnpackedTarball_add_patches,firebird, \ external/firebird/sanitizer.patch \ diff --git a/external/firebird/Wincompatible-function-pointer-types.patch b/external/firebird/Wincompatible-function-pointer-types.patch new file mode 100755 index 000000000000..d5482bdcf2c2 --- /dev/null +++ b/external/firebird/Wincompatible-function-pointer-types.patch @@ -0,0 +1,11 @@ +--- extern/cloop/src/tests/test1/CTest.c ++++ extern/cloop/src/tests/test1/CTest.c +@@ -402,7 +402,7 @@ + struct CALC_IFactory* (*createFactory)(); + + #ifdef WIN32 +- createFactory = (struct Factory* (*)()) GetProcAddress(library, "createFactory"); ++ createFactory = (struct CALC_IFactory* (*)()) GetProcAddress(library, "createFactory"); + #else + createFactory = dlsym(library, "createFactory"); + #endif diff --git a/external/firebird/c++20.patch b/external/firebird/c++20.patch new file mode 100644 index 000000000000..97168ce31838 --- /dev/null +++ b/external/firebird/c++20.patch @@ -0,0 +1,61 @@ +--- src/common/classes/Nullable.h ++++ src/common/classes/Nullable.h +@@ -113,19 +113,19 @@ + template <typename T> class Nullable : public BaseNullable<T> + { + public: +- explicit Nullable<T>(const T& v) ++ explicit Nullable(const T& v) + { + this->value = v; + this->specified = true; + } + +- Nullable<T>(const Nullable<T>& o) ++ Nullable(const Nullable<T>& o) + { + this->value = o.value; + this->specified = o.specified; + } + +- Nullable<T>() ++ Nullable() + { + NullableClear<T>::clear(this->value); + this->specified = false; +--- src/common/classes/alloc.h ++++ src/common/classes/alloc.h +@@ -259,7 +259,7 @@ + class SubsystemContextPoolHolder : public ContextPoolHolder + { + public: +- SubsystemContextPoolHolder <SubsystemThreadData, SubsystemPool> ++ SubsystemContextPoolHolder + ( + SubsystemThreadData* subThreadData, + SubsystemPool* newPool +--- src/common/classes/stack.h ++++ src/common/classes/stack.h +@@ -36,7 +36,7 @@ + class Stack : public AutoStorage + { + private: +- Stack<Object, Capacity>(Stack<Object, Capacity>&); // not implemented ++ Stack(Stack<Object, Capacity>&); // not implemented + + class Entry : public Vector<Object, Capacity> + { +@@ -117,11 +117,11 @@ + Entry* stk_cache; + + public: +- explicit Stack<Object, Capacity>(MemoryPool& p) ++ explicit Stack(MemoryPool& p) + : AutoStorage(p), stk(0), stk_cache(0) + { } + +- Stack<Object, Capacity>() : AutoStorage(), stk(0), stk_cache(0) { } ++ Stack() : AutoStorage(), stk(0), stk_cache(0) { } + + ~Stack() + { diff --git a/external/firebird/c++26.patch b/external/firebird/c++26.patch new file mode 100644 index 000000000000..e3ffe61b4f03 --- /dev/null +++ b/external/firebird/c++26.patch @@ -0,0 +1,11 @@ +--- src/jrd/SimilarToMatcher.h ++++ src/jrd/SimilarToMatcher.h +@@ -1455,7 +1455,7 @@ + gds__log("%d, %s", state, debugText.c_str()); + #endif + +-#define ENCODE_OP_STATE(op, state) ((op) | (state)) ++#define ENCODE_OP_STATE(op, state) (+(op) | (state)) + + // Go directly to op and state with a single switch. + diff --git a/external/firebird/configure-c99.patch b/external/firebird/configure-c99.patch new file mode 100644 index 000000000000..a62a63fb024e --- /dev/null +++ b/external/firebird/configure-c99.patch @@ -0,0 +1,45 @@ +--- configure ++++ configure +@@ -20518,8 +20518,9 @@ + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ ++#include <stdlib.h> + #include <semaphore.h> +- main () { ++ int main () { + sem_t s; + exit(sem_init(&s,0,0)); + } +@@ -21263,8 +21264,9 @@ + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ ++#include <stdlib.h> + #include <unistd.h> +- main () { ++ int main () { + exit(!(sizeof(off_t) == 8)); + } + _ACEOF +@@ -21478,8 +21480,9 @@ + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ ++#include <stdlib.h> + #include <semaphore.h> +-main () { ++int main () { + struct s { + char a; + union { long long x; sem_t y; } b; +@@ -21514,7 +21517,8 @@ + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-main () { ++#include <stdlib.h> ++int main () { + struct s { + char a; + double b; diff --git a/external/firebird/firebird-cygwin-msvc-warnings.patch b/external/firebird/firebird-cygwin-msvc-warnings.patch index b40f94750fa9..942522439bac 100644 --- a/external/firebird/firebird-cygwin-msvc-warnings.patch +++ b/external/firebird/firebird-cygwin-msvc-warnings.patch @@ -180,12 +180,12 @@ diff -ur builds/posix/make.rules builds/posix/make.rules vpath %.cpp $(SRC_DIRS) define compile --$1/%.o: %.c -+$1/%.obj: %.c +-$1/%.o: %.c | $1 ++$1/%.obj: %.c | $1 $(CC) -c $$(C_FLAGS) $$< -o $$@ --$1/%.o: %.cpp -+$1/%.obj: %.cpp +-$1/%.o: %.cpp | $1 ++$1/%.obj: %.cpp | $1 $(CXX) -c $$(CXX_FLAGS) $$< -o $$@ endef diff --git a/external/firebird/firebird-cygwin-msvc.patch b/external/firebird/firebird-cygwin-msvc.patch index 9536403886c6..c59c614ba5da 100644 --- a/external/firebird/firebird-cygwin-msvc.patch +++ b/external/firebird/firebird-cygwin-msvc.patch @@ -27,8 +27,34 @@ grep ODS_VERSION $OdsH | grep -v ENCODE_ODS >$Mini +--- configure 2016-07-07 15:57:04.538983200 +0200 ++++ configure 2016-07-13 11:31:18.132820200 +0200 +@@ -21490,13 +21490,12 @@ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include <stdlib.h> +-#include <semaphore.h> + int main () { + struct s { + char a; +- union { long long x; sem_t y; } b; ++ long long b; + }; + exit((int)&((struct s*)1024)->b - 1024); + } + _ACEOF + if ac_fn_c_try_run "$LINENO"; then : --- builds/make.new/config/config.h.in 2016-07-07 15:55:55.693112800 +0200 +++ builds/make.new/config/config.h.in 2016-07-08 13:38:49.994986400 +0200 +@@ -211,7 +211,7 @@ + #undef HAVE_GETMNTENT + + /* Define to 1 if you have the `getpagesize' function. */ +-#undef HAVE_GETPAGESIZE ++#define HAVE_GETPAGESIZE 1 + + /* Define to 1 if you have the `getrlimit' function. */ + #undef HAVE_GETRLIMIT @@ -396,7 +396,7 @@ #undef HAVE_SIGSET @@ -56,7 +82,7 @@ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ -@@ -703,3 +703,36 @@ +@@ -703,3 +703,20 @@ #ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif @@ -66,28 +92,12 @@ +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif +/* target architecture */ -+#if defined(_M_IX86) -+/* sizeof(void *) */ -+#define SIZEOF_VOID_P 4 -+/* sizeof(size_t) */ -+#define SIZEOF_SIZE_T 4 -+/* alignment of long */ -+#define FB_ALIGNMENT 4 -+#elif defined(_M_AMD64) ++#if defined(_M_AMD64) +#define AMD64 -+/* sizeof(void *) */ -+#define SIZEOF_VOID_P 8 -+/* sizeof(size_t) */ -+#define SIZEOF_SIZE_T 8 -+/* alignment of long */ -+#define FB_ALIGNMENT 8 -+#else -+#error unknown target platform +#endif + +#define HAVE_IO_H +#define HAVE_CTIME_S -+#define HAVE_GETPAGESIZE + +#if defined _MSC_VER +#define isnan _isnan diff --git a/external/firebird/firebird-macosx-sandbox.patch.1 b/external/firebird/firebird-macosx-sandbox.patch.1 new file mode 100644 index 000000000000..3bf246c682ba --- /dev/null +++ b/external/firebird/firebird-macosx-sandbox.patch.1 @@ -0,0 +1,13 @@ +-*- Mode: Diff -*- + +--- firebird/src/common/isc_s_proto.h ++++ firebird/src/common/isc_s_proto.h +@@ -37,6 +37,8 @@ + // Firebird platform-specific synchronization data structures + + #if defined(DARWIN) ++#define USE_POSIX_SEMAPHORE ++#define USE_SHARED_FUTEX + #define USE_FILELOCKS + #endif + diff --git a/external/firebird/macos-arm64.patch.0 b/external/firebird/macos-arm64.patch.0 index 12a845c57ce9..ab2596dbd987 100644 --- a/external/firebird/macos-arm64.patch.0 +++ b/external/firebird/macos-arm64.patch.0 @@ -24,14 +24,6 @@ i*86-*-darwin*) MAKEFILE_PREFIX=darwin_i386 MAKEFILE_POSTFIX=darwin -@@ -21344,6 +21344,7 @@ - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ -+#include <stdlib.h> - main () { - struct s { - char a; --- src/common/common.h +++ src/common/common.h @@ -234,6 +234,12 @@ diff --git a/external/firebird/wnt-per-process-trace-storage.patch.1 b/external/firebird/wnt-per-process-trace-storage.patch.1 new file mode 100644 index 000000000000..46af6c5e5c5c --- /dev/null +++ b/external/firebird/wnt-per-process-trace-storage.patch.1 @@ -0,0 +1,18 @@ +diff --git a/src/jrd/trace/TraceConfigStorage.cpp b/src/jrd/trace/TraceConfigStorage.cpp +index 05fce3211ae7..d267713e85de 100644 +--- a/src/jrd/trace/TraceConfigStorage.cpp ++++ b/src/jrd/trace/TraceConfigStorage.cpp +@@ -103,11 +103,11 @@ ConfigStorage::ConfigStorage() + pfnProcessIdToSessionId(GetCurrentProcessId(), &sesID) == 0 || + sesID == 0) + { +- filename.printf(TRACE_FILE); // TODO: it must be per engine instance ++ filename.printf("%s.0.%u", TRACE_FILE, GetCurrentProcessId()); // TODO: it must be per engine instance + } + else + { +- filename.printf("%s.%u", TRACE_FILE, sesID); ++ filename.printf("%s.%u.%u", TRACE_FILE, sesID, GetCurrentProcessId()); + } + #else + filename.printf(TRACE_FILE); // TODO: it must be per engine instance diff --git a/external/ucpp/Module_ucpp.mk b/external/fontconfig/ExternalPackage_fontconfig.mk index dc4c02f5307b..688ae520bfe8 100644 --- a/external/ucpp/Module_ucpp.mk +++ b/external/fontconfig/ExternalPackage_fontconfig.mk @@ -7,14 +7,12 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,ucpp)) +$(eval $(call gb_ExternalPackage_ExternalPackage,fontconfig,fontconfig)) -# if not cross-compiling or we need ucpp for ODK -ifneq (,$(if $(CROSS_COMPILING),,T)$(filter ODK,$(BUILD_TYPE))) -$(eval $(call gb_Module_add_targets,ucpp,\ - Executable_ucpp \ - UnpackedTarball_ucpp \ -)) +$(eval $(call gb_ExternalPackage_use_external_project,fontconfig,fontconfig)) + +ifeq ($(DISABLE_DYNLOADING),) +$(eval $(call gb_ExternalPackage_add_file,fontconfig,$(LIBO_LIB_FOLDER)/libfontconfig-lo.so.1.12.1,src/.libs/libfontconfig-lo.so.1.12.1)) endif # vim: set noet sw=4 ts=4: diff --git a/external/fontconfig/ExternalPackage_fontconfig_data.mk b/external/fontconfig/ExternalPackage_fontconfig_data.mk new file mode 100644 index 000000000000..63bcc8a2a3a2 --- /dev/null +++ b/external/fontconfig/ExternalPackage_fontconfig_data.mk @@ -0,0 +1,62 @@ +# -*- 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_ExternalPackage_ExternalPackage,fontconfig_data,fontconfig)) + +$(eval $(call gb_ExternalPackage_use_external_project,fontconfig_data,fontconfig)) + +$(eval $(call gb_ExternalPackage_add_files,fontconfig_data,$(LIBO_SHARE_FOLDER)/fontconfig,\ + fonts.conf \ +)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fontconfig_data,$(LIBO_SHARE_FOLDER)/fontconfig/conf.d,\ + conf.d/05-reset-dirs-sample.conf \ + conf.d/09-autohint-if-no-hinting.conf \ + conf.d/10-autohint.conf \ + conf.d/10-hinting-full.conf \ + conf.d/10-hinting-medium.conf \ + conf.d/10-hinting-none.conf \ + conf.d/10-hinting-slight.conf \ + conf.d/10-no-antialias.conf \ + conf.d/10-scale-bitmap-fonts.conf \ + conf.d/10-sub-pixel-bgr.conf \ + conf.d/10-sub-pixel-none.conf \ + conf.d/10-sub-pixel-rgb.conf \ + conf.d/10-sub-pixel-vbgr.conf \ + conf.d/10-sub-pixel-vrgb.conf \ + conf.d/10-unhinted.conf \ + conf.d/10-yes-antialias.conf \ + conf.d/11-lcdfilter-default.conf \ + conf.d/11-lcdfilter-legacy.conf \ + conf.d/11-lcdfilter-light.conf \ + conf.d/11-lcdfilter-none.conf \ + conf.d/20-unhint-small-vera.conf \ + conf.d/25-unhint-nonlatin.conf \ + conf.d/30-metric-aliases.conf \ + conf.d/35-lang-normalize.conf \ + conf.d/40-nonlatin.conf \ + conf.d/45-generic.conf \ + conf.d/45-latin.conf \ + conf.d/48-spacing.conf \ + conf.d/49-sansserif.conf \ + conf.d/50-user.conf \ + conf.d/51-local.conf \ + conf.d/60-generic.conf \ + conf.d/60-latin.conf \ + conf.d/65-fonts-persian.conf \ + conf.d/65-khmer.conf \ + conf.d/65-nonlatin.conf \ + conf.d/69-unifont.conf \ + conf.d/70-no-bitmaps.conf \ + conf.d/70-yes-bitmaps.conf \ + conf.d/80-delicious.conf \ + conf.d/90-synthetic.conf \ +)) + +# vim: set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/external/fontconfig/ExternalProject_fontconfig.mk b/external/fontconfig/ExternalProject_fontconfig.mk index b82c7657395b..ee0301b251db 100644 --- a/external/fontconfig/ExternalProject_fontconfig.mk +++ b/external/fontconfig/ExternalProject_fontconfig.mk @@ -10,7 +10,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,fontconfig)) $(eval $(call gb_ExternalProject_use_externals,fontconfig,\ - expat \ + $(if $(filter EMSCRIPTEN,$(OS)),libxml2,expat) \ freetype \ )) @@ -18,18 +18,47 @@ $(eval $(call gb_ExternalProject_register_targets,fontconfig,\ build \ )) +# Can't have this inside the $(call gb_ExternalProject_run as it contains commas +fontconfig_add_fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/TTF,/usr/local/share/fonts + $(call gb_ExternalProject_get_state_target,fontconfig,build) : $(call gb_Trace_StartRange,fontconfig,EXTERNAL) $(call gb_ExternalProject_run,build,\ - CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \ - ./configure \ - --disable-shared \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS="$(CFLAGS) \ + $(call gb_ExternalProject_get_build_flags,fontconfig) \ + $(gb_VISIBILITY_FLAGS) \ + $(if $(filter EMSCRIPTEN,$(OS)),-pthread)" \ + $(if $(filter ANDROID,$(OS)),LIBS="-lm") \ + $(if $(filter EMSCRIPTEN,$(OS)),LIBXML2_CFLAGS="$(LIBXML_CFLAGS)" LIBXML2_LIBS="$(LIBXML_LIBS)") \ + $(gb_RUN_CONFIGURE) ./configure \ --disable-silent-rules \ + --with-pic \ $(if $(filter ANDROID,$(OS)),--with-arch=arm) \ --with-expat-includes=$(call gb_UnpackedTarball_get_dir,expat)/lib \ --with-expat-lib=$(gb_StaticLibrary_WORKDIR) \ - --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - && $(MAKE) -C src \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(filter ANDROID,$(OS)), \ + --disable-shared \ + ) \ + $(if $(filter EMSCRIPTEN,$(OS)), \ + --disable-shared \ + --with-baseconfigdir=/instdir/share/fontconfig \ + --with-cache-dir=/instdir/share/fontconfig/cache \ + --with-add-fonts=/instdir/share/fonts \ + --enable-libxml2 \ + ac_cv_func_fstatfs=no ac_cv_func_fstatvfs=no \ + ) \ + $(if $(filter FUZZERS,$(BUILD_TYPE)), \ + --disable-shared, \ + $(if $(filter LINUX,$(OS)), \ + --disable-static \ + --prefix=/ \ + --with-add-fonts=$(fontconfig_add_fonts) \ + --with-cache-dir=/usr/lib/fontconfig/cache \ + ) \ + ) \ + && $(MAKE) -C src && $(MAKE) fonts.conf \ ) $(call gb_Trace_EndRange,fontconfig,EXTERNAL) diff --git a/external/fontconfig/Module_fontconfig.mk b/external/fontconfig/Module_fontconfig.mk index e755f8610db1..61f201d415b6 100644 --- a/external/fontconfig/Module_fontconfig.mk +++ b/external/fontconfig/Module_fontconfig.mk @@ -11,6 +11,8 @@ $(eval $(call gb_Module_Module,fontconfig)) $(eval $(call gb_Module_add_targets,fontconfig,\ ExternalProject_fontconfig \ + $(if $(filter EMSCRIPTEN,$(OS)),ExternalPackage_fontconfig_data) \ + $(if $(filter LINUX,$(OS)),ExternalPackage_fontconfig) \ UnpackedTarball_fontconfig \ )) diff --git a/external/fontconfig/README b/external/fontconfig/README index 220ee6078a65..5a1d998ada68 100644 --- a/external/fontconfig/README +++ b/external/fontconfig/README @@ -1,6 +1,6 @@ -This "bundled" fontconfig is built only in an Android build +This "bundled" fontconfig is usually built only in an Android build or a fuzzing build Fontconfig is a font configuration and customization library. It is designed to locate fonts -within the system and select them according to requirements specified by applications. +within the system and select them according to requirements specified by applications. -From [ http://packages.debian.org/squeeze/fontconfig ]
\ No newline at end of file +From [ https://www.freedesktop.org/wiki/Software/fontconfig/ ] diff --git a/external/fontconfig/UnpackedTarball_fontconfig.mk b/external/fontconfig/UnpackedTarball_fontconfig.mk index 6026a817c5ed..ceb87ea062ad 100644 --- a/external/fontconfig/UnpackedTarball_fontconfig.mk +++ b/external/fontconfig/UnpackedTarball_fontconfig.mk @@ -11,8 +11,12 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,fontconfig)) $(eval $(call gb_UnpackedTarball_set_tarball,fontconfig,$(FONTCONFIG_TARBALL),,fontconfig)) +$(eval $(call gb_UnpackedTarball_set_patchlevel,fontconfig,0)) + $(eval $(call gb_UnpackedTarball_add_patches,fontconfig,\ external/fontconfig/fontconfig-2.12.1.patch.1 \ + external/fontconfig/ubsan.patch \ + external/fontconfig/libfontconfig-bundled-soname.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/fontconfig/fontconfig-2.12.1.patch.1 b/external/fontconfig/fontconfig-2.12.1.patch.1 index f348d2aa8731..b6f54361bb8c 100644 --- a/external/fontconfig/fontconfig-2.12.1.patch.1 +++ b/external/fontconfig/fontconfig-2.12.1.patch.1 @@ -1,7 +1,7 @@ diff -up fontconfig/configure.dt fontconfig/configure ---- fontconfig/configure.dt 2017-02-01 22:07:29.671668568 +0100 -+++ fontconfig/configure 2017-02-01 22:09:53.335215490 +0100 -@@ -10469,7 +10469,7 @@ _LT_EOF +--- fontconfig/configure.dt 2023-01-27 17:22:13.000000000 +0900 ++++ fontconfig/configure 2023-02-21 20:04:01.347467874 +0900 +@@ -11534,7 +11534,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support @@ -10,7 +10,7 @@ diff -up fontconfig/configure.dt fontconfig/configure archive_expsym_cmds='' ;; m68k) -@@ -10485,7 +10485,7 @@ _LT_EOF +@@ -11550,7 +11550,7 @@ _LT_EOF allow_undefined_flag=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME @@ -19,7 +19,7 @@ diff -up fontconfig/configure.dt fontconfig/configure else ld_shlibs=no fi -@@ -10519,7 +10519,7 @@ _LT_EOF +@@ -11584,7 +11584,7 @@ _LT_EOF ;; haiku*) @@ -28,7 +28,7 @@ diff -up fontconfig/configure.dt fontconfig/configure link_all_deplibs=yes ;; -@@ -10614,13 +10614,13 @@ _LT_EOF +@@ -11680,13 +11680,13 @@ _LT_EOF *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac @@ -37,14 +37,14 @@ diff -up fontconfig/configure.dt fontconfig/configure if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in -@@ -10650,8 +10650,8 @@ _LT_EOF +@@ -11716,8 +11716,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else @@ -55,7 +55,7 @@ diff -up fontconfig/configure.dt fontconfig/configure fi ;; -@@ -10669,8 +10669,8 @@ _LT_EOF +@@ -11735,8 +11735,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then @@ -66,7 +66,7 @@ diff -up fontconfig/configure.dt fontconfig/configure else ld_shlibs=no fi -@@ -10698,8 +10698,8 @@ _LT_EOF +@@ -11764,8 +11764,8 @@ _LT_EOF # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' @@ -77,7 +77,7 @@ diff -up fontconfig/configure.dt fontconfig/configure else ld_shlibs=no fi -@@ -10716,8 +10716,8 @@ _LT_EOF +@@ -11782,8 +11782,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then @@ -88,7 +88,7 @@ diff -up fontconfig/configure.dt fontconfig/configure else ld_shlibs=no fi -@@ -11016,7 +11016,7 @@ fi +@@ -12086,7 +12086,7 @@ fi case $host_cpu in powerpc) # see comment about AmigaOS4 .so support @@ -97,7 +97,7 @@ diff -up fontconfig/configure.dt fontconfig/configure archive_expsym_cmds='' ;; m68k) -@@ -11285,7 +11285,7 @@ fi +@@ -12356,7 +12356,7 @@ fi irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then @@ -106,16 +106,16 @@ diff -up fontconfig/configure.dt fontconfig/configure # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. -@@ -11313,7 +11313,7 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 - $as_echo "$lt_cv_irix_exported_symbol" >&6; } +@@ -12386,7 +12386,7 @@ fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 + printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' -@@ -11408,7 +11408,7 @@ $as_echo "$lt_cv_irix_exported_symbol" > +@@ -12482,7 +12482,7 @@ printf "%s\n" "$lt_cv_irix_exported_symb osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' @@ -124,7 +124,7 @@ diff -up fontconfig/configure.dt fontconfig/configure else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' -@@ -11421,7 +11421,7 @@ $as_echo "$lt_cv_irix_exported_symbol" > +@@ -12495,7 +12495,7 @@ printf "%s\n" "$lt_cv_irix_exported_symb osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' diff --git a/external/fontconfig/libfontconfig-bundled-soname.patch.0 b/external/fontconfig/libfontconfig-bundled-soname.patch.0 new file mode 100644 index 000000000000..46222ca0d6b0 --- /dev/null +++ b/external/fontconfig/libfontconfig-bundled-soname.patch.0 @@ -0,0 +1,11 @@ +# -*- Mode: Diff -*- +--- src/Makefile.in ++++ src/Makefile.in +@@ -529,6 +529,6 @@ + lib_LTLIBRARIES = libfontconfig.la + libfontconfig_la_LDFLAGS = \ +- -version-info @LIBT_VERSION_INFO@ -no-undefined $(export_symbols) ++ -version-info @LIBT_VERSION_INFO@ -no-undefined $(export_symbols) -release lo -Wl,-soname -Wl,libfontconfig-lo.so.1.12.1 + + libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS) $(LTLIBINTL) + libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency) diff --git a/external/fontconfig/ubsan.patch b/external/fontconfig/ubsan.patch new file mode 100644 index 000000000000..91586b093480 --- /dev/null +++ b/external/fontconfig/ubsan.patch @@ -0,0 +1,22 @@ +--- src/fcdir.c ++++ src/fcdir.c +@@ -265,7 +265,7 @@ + /* + * Sort files to make things prettier + */ +- qsort(files->strs, files->num, sizeof(FcChar8 *), cmpstringp); ++ if (files->num != 0) qsort(files->strs, files->num, sizeof(FcChar8 *), cmpstringp); + + /* + * Scan file files to build font patterns +--- src/fcserialize.c ++++ src/fcserialize.c +@@ -163,7 +163,7 @@ + size_t old_used = serialize->buckets_used; + size_t old_count = serialize->buckets_count; + FcSerializeBucket *old_buckets = serialize->buckets; +- FcSerializeBucket *old_buckets_end = old_buckets + old_count; ++ FcSerializeBucket *old_buckets_end = old_count == 0 ? old_buckets : old_buckets + old_count; + + FcSerializeBucket *new_buckets = malloc (new_count * sizeof (*old_buckets)); + if (!new_buckets) diff --git a/external/freetype/ExternalProject_freetype.mk b/external/freetype/ExternalProject_freetype.mk index 3f4a719d5663..d3d65612200c 100644 --- a/external/freetype/ExternalProject_freetype.mk +++ b/external/freetype/ExternalProject_freetype.mk @@ -13,29 +13,27 @@ $(eval $(call gb_ExternalProject_register_targets,freetype,\ build \ )) -ifeq ($(OS),WNT) $(call gb_ExternalProject_get_state_target,freetype,build) : $(call gb_Trace_StartRange,freetype,EXTERNAL) $(call gb_ExternalProject_run,build,\ - cd ../builds/win32/vc2010/ && \ - msbuild.exe freetype.vcxproj /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \ - ,objs) - $(call gb_Trace_EndRange,freetype,EXTERNAL) -else -$(call gb_ExternalProject_get_state_target,freetype,build) : - $(call gb_Trace_StartRange,freetype,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ --disable-shared \ - --without-zlib \ + --with-pic \ + --with-zlib \ + --without-brotli \ --without-bzip2 \ --without-harfbuzz \ + --without-png \ --prefix=$(call gb_UnpackedTarball_get_dir,freetype/instdir) \ - --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS="$(CFLAGS) \ + $(call gb_ExternalProject_get_build_flags,freetype) \ + $(call gb_ExternalProject_get_link_flags,freetype) \ + $(gb_VISIBILITY_FLAGS) \ + $(gb_EMSCRIPTEN_CPPFLAGS)" \ && $(MAKE) install \ && touch $@ ) $(call gb_Trace_EndRange,freetype,EXTERNAL) -endif # vim: set noet sw=4 ts=4: diff --git a/external/freetype/UnpackedTarball_freetype.mk b/external/freetype/UnpackedTarball_freetype.mk index 6f724d1776fc..5ea678f80280 100644 --- a/external/freetype/UnpackedTarball_freetype.mk +++ b/external/freetype/UnpackedTarball_freetype.mk @@ -13,6 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,freetype,$(FREETYPE_TARBALL),,freet $(eval $(call gb_UnpackedTarball_add_patches,freetype,\ external/freetype/freetype-2.6.5.patch.1 \ + external/freetype/ubsan.patch \ + external/freetype/freetype-fd-hack.patch.0 \ )) +$(eval $(call gb_UnpackedTarball_set_patchlevel,freetype,0)) + # vim: set noet sw=4 ts=4: diff --git a/external/freetype/freetype-2.6.5.patch.1 b/external/freetype/freetype-2.6.5.patch.1 index a9c231cbe384..544e4fa496a6 100644 --- a/external/freetype/freetype-2.6.5.patch.1 +++ b/external/freetype/freetype-2.6.5.patch.1 @@ -1,7 +1,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure ---- freetype/builds/unix/configure.dt 2017-02-01 22:14:45.206257952 +0100 -+++ freetype/builds/unix/configure 2017-02-01 22:16:31.076183707 +0100 -@@ -8858,7 +8858,7 @@ +--- freetype/builds/unix/configure.dt 2023-02-09 15:33:17.000000000 +0900 ++++ freetype/builds/unix/configure 2023-02-22 16:53:49.547740397 +0900 +@@ -9523,7 +9523,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support @@ -10,7 +10,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure archive_expsym_cmds='' ;; m68k) -@@ -8874,7 +8874,7 @@ +@@ -9539,7 +9539,7 @@ _LT_EOF allow_undefined_flag=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME @@ -19,7 +19,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure else ld_shlibs=no fi -@@ -8908,7 +8908,7 @@ +@@ -9573,7 +9573,7 @@ _LT_EOF ;; haiku*) @@ -28,7 +28,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure link_all_deplibs=yes ;; -@@ -9003,13 +9003,13 @@ +@@ -9669,13 +9669,13 @@ _LT_EOF *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac @@ -37,14 +37,14 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in -@@ -9039,8 +9039,8 @@ +@@ -9705,8 +9705,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else @@ -55,7 +55,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure fi ;; -@@ -9058,8 +9058,8 @@ +@@ -9724,8 +9724,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then @@ -66,7 +66,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure else ld_shlibs=no fi -@@ -9087,8 +9087,8 @@ +@@ -9753,8 +9753,8 @@ _LT_EOF # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' @@ -77,7 +77,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure else ld_shlibs=no fi -@@ -9105,8 +9105,8 @@ +@@ -9771,8 +9771,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then @@ -88,7 +88,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure else ld_shlibs=no fi -@@ -9405,7 +9405,7 @@ +@@ -10075,7 +10075,7 @@ fi case $host_cpu in powerpc) # see comment about AmigaOS4 .so support @@ -97,7 +97,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure archive_expsym_cmds='' ;; m68k) -@@ -9674,7 +9674,7 @@ +@@ -10345,7 +10345,7 @@ fi irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then @@ -106,16 +106,16 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. -@@ -9702,7 +9702,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 - $as_echo "$lt_cv_irix_exported_symbol" >&6; } +@@ -10375,7 +10375,7 @@ fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 + printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' -@@ -9797,7 +9797,7 @@ +@@ -10471,7 +10471,7 @@ printf "%s\n" "$lt_cv_irix_exported_symb osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' @@ -124,7 +124,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' -@@ -9810,7 +9810,7 @@ +@@ -10484,7 +10484,7 @@ printf "%s\n" "$lt_cv_irix_exported_symb osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' @@ -133,7 +133,7 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' -@@ -13143,10 +13143,10 @@ +@@ -13755,10 +13755,10 @@ if test "x$GCC" = xyes; then XX_CFLAGS="-Wall" case "$host" in *-*-mingw*) @@ -145,14 +145,13 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure + XX_ANSIFLAGS="" ;; *) - GCC_VERSION=`$CC -dumpversion` -@@ -13195,7 +13195,7 @@ - if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, adding to XX_ANSIFLAGS" >&5 - $as_echo "ok, adding to XX_ANSIFLAGS" >&6; } + XX_ANSIFLAGS="" +@@ -13796,7 +13796,7 @@ if ac_fn_c_try_compile "$LINENO" + then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok, adding to XX_ANSIFLAGS" >&5 + printf "%s\n" "ok, adding to XX_ANSIFLAGS" >&6; } - XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}" + XX_ANSIFLAGS="${XX_ANSIFLAGS}" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -diff -up freetype/configure.dt freetype/configure + else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 diff --git a/external/freetype/freetype-fd-hack.patch.0 b/external/freetype/freetype-fd-hack.patch.0 new file mode 100644 index 000000000000..96f666c15daf --- /dev/null +++ b/external/freetype/freetype-fd-hack.patch.0 @@ -0,0 +1,60 @@ +# -*- Mode: Diff -*- +--- src/base/ftsystem.c ++++ src/base/ftsystem.c +@@ -24,6 +24,7 @@ + * + */ + ++#include <unistd.h> + + #include <ft2build.h> + #include FT_CONFIG_CONFIG_H +@@ -238,6 +239,8 @@ + const char* filepathname ) + { + FT_FILE* file; ++ int nFD; ++ int n; + + + if ( !stream ) +@@ -250,7 +253,13 @@ + stream->read = NULL; + stream->close = NULL; + +- file = ft_fopen( filepathname, "rb" ); ++ if ( sscanf( filepathname, "/:FD:/%d%n", &nFD, &n ) == 1 && filepathname[n] == '\0') ++ { ++ lseek( nFD, 0, SEEK_SET ); ++ file = fdopen( dup( nFD ), "rb" ); ++ } ++ else ++ file = ft_fopen( filepathname, "rb" ); + if ( !file ) + { + FT_ERROR(( "FT_Stream_Open:" +--- builds/unix/ftsystem.c ++++ builds/unix/ftsystem.c +@@ -249,13 +249,21 @@ + { + int file; + struct stat stat_buf; ++ int nFD; ++ int n; + + + if ( !stream ) + return FT_THROW( Invalid_Stream_Handle ); + + /* open the file */ +- file = open( filepathname, O_RDONLY ); ++ if ( sscanf( filepathname, "/:FD:/%d%n", &nFD, &n ) == 1 && filepathname[n] == '\0') ++ { ++ lseek( nFD, 0, SEEK_SET ); ++ file = dup( nFD ); ++ } ++ else ++ file = open( filepathname, O_RDONLY ); + if ( file < 0 ) + { + FT_ERROR(( "FT_Stream_Open:" )); diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch new file mode 100644 index 000000000000..43ce217c4b7d --- /dev/null +++ b/external/freetype/ubsan.patch @@ -0,0 +1,23 @@ +--- src/psaux/psobjs.c.orig 2023-02-04 23:00:05.000000000 +0900 ++++ src/psaux/psobjs.c 2023-02-22 16:28:26.632283841 +0900 +@@ -200,7 +200,8 @@ + /* add the object to the base block and adjust offset */ + table->elements[idx] = FT_OFFSET( table->block, table->cursor ); + table->lengths [idx] = length; +- FT_MEM_COPY( table->block + table->cursor, object, length ); ++ if (length != 0) ++ FT_MEM_COPY( table->block + table->cursor, object, length ); + + table->cursor += length; + return FT_Err_Ok; +--- src/truetype/ttgxvar.c ++++ src/truetype/ttgxvar.c +@@ -1045,7 +1045,7 @@ + if ( varData->longWords ) + per_region_size *= 2; + +- bytes = varData->deltaSet + per_region_size * innerIndex; ++ bytes = varData->deltaSet ? varData->deltaSet + per_region_size * innerIndex : NULL; + + if ( varData->longWords ) + { diff --git a/external/frozen/Module_frozen.mk b/external/frozen/Module_frozen.mk new file mode 100644 index 000000000000..10fa0997e0ed --- /dev/null +++ b/external/frozen/Module_frozen.mk @@ -0,0 +1,16 @@ +# -*- 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_Module_Module,frozen)) + +$(eval $(call gb_Module_add_targets,frozen,\ + UnpackedTarball_frozen \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/frozen/README.md b/external/frozen/README.md new file mode 100644 index 000000000000..56b011a771b6 --- /dev/null +++ b/external/frozen/README.md @@ -0,0 +1,7 @@ +External header only library frozen + +Header-only library that provides 0 cost initialization for immutable containers, fixed-size containers, and various algorithms. + +https://github.com/serge-sans-paille/frozen + +Release archives at: https://github.com/serge-sans-paille/frozen/tags diff --git a/external/frozen/UnpackedTarball_frozen.mk b/external/frozen/UnpackedTarball_frozen.mk new file mode 100644 index 000000000000..b0cc5c207d80 --- /dev/null +++ b/external/frozen/UnpackedTarball_frozen.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,frozen)) + +$(eval $(call gb_UnpackedTarball_set_tarball,frozen,$(FROZEN_TARBALL))) + +$(eval $(call gb_UnpackedTarball_add_patches,frozen,\ + external/frozen/defines_h_constexpr_string.patch.0 \ + external/frozen/cid1532449_use_move_ctor.0 \ + external/frozen/cid1586676_use_move_ctor.0 \ + external/frozen/cid1538304_reference_ctor.0 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/frozen/cid1532449_use_move_ctor.0 b/external/frozen/cid1532449_use_move_ctor.0 new file mode 100644 index 000000000000..cbee9e510b93 --- /dev/null +++ b/external/frozen/cid1532449_use_move_ctor.0 @@ -0,0 +1,29 @@ +--- include/frozen/unordered_map.h 2023-06-25 14:47:35.486459668 +0100 ++++ include/frozen/unordered_map.h 2023-06-25 14:55:58.787858570 +0100 +@@ -78,14 +78,24 @@ + public: + /* constructors */ + unordered_map(unordered_map const &) = default; +- constexpr unordered_map(container_type items, ++ constexpr unordered_map(container_type&& items, ++ Hash const &hash, KeyEqual const &equal) ++ : equal_{equal} ++ , items_(std::move(items)) ++ , tables_{ ++ bits::make_pmh_tables<storage_size>( ++ items_, hash, bits::GetKey{}, default_prg_t{})} {} ++ explicit constexpr unordered_map(container_type&& items) ++ : unordered_map{items, Hash{}, KeyEqual{}} {} ++ ++ constexpr unordered_map(const container_type& items, + Hash const &hash, KeyEqual const &equal) + : equal_{equal} + , items_{items} + , tables_{ + bits::make_pmh_tables<storage_size>( + items_, hash, bits::GetKey{}, default_prg_t{})} {} +- explicit constexpr unordered_map(container_type items) ++ explicit constexpr unordered_map(const container_type& items) + : unordered_map{items, Hash{}, KeyEqual{}} {} + + constexpr unordered_map(std::initializer_list<value_type> items, diff --git a/external/frozen/cid1538304_reference_ctor.0 b/external/frozen/cid1538304_reference_ctor.0 new file mode 100644 index 000000000000..c627686cd2bd --- /dev/null +++ b/external/frozen/cid1538304_reference_ctor.0 @@ -0,0 +1,33 @@ +--- include/frozen/map.h 2023-07-22 20:20:19.580400347 +0100 ++++ include/frozen/map.h 2023-07-22 20:25:44.893704485 +0100 +@@ -94,11 +94,11 @@ + + public: + /* constructors */ +- constexpr map(container_type items, Compare const &compare) ++ constexpr map(const container_type& items, Compare const &compare) + : less_than_{compare} + , items_{bits::quicksort(items, less_than_)} {} + +- explicit constexpr map(container_type items) ++ explicit constexpr map(const container_type& items) + : map{items, Compare{}} {} + + constexpr map(std::initializer_list<value_type> items, Compare const &compare) +--- include/frozen/set.h 2023-09-29 09:19:22.208195458 +0100 ++++ include/frozen/set.h 2023-09-29 09:20:21.175291240 +0100 +@@ -59,12 +59,12 @@ + /* constructors */ + constexpr set(const set &other) = default; + +- constexpr set(container_type keys, Compare const & comp) ++ constexpr set(const container_type& keys, Compare const & comp) + : less_than_{comp} + , keys_(bits::quicksort(keys, less_than_)) { + } + +- explicit constexpr set(container_type keys) ++ explicit constexpr set(const container_type& keys) + : set{keys, Compare{}} {} + + constexpr set(std::initializer_list<Key> keys, Compare const & comp) diff --git a/external/frozen/cid1586676_use_move_ctor.0 b/external/frozen/cid1586676_use_move_ctor.0 new file mode 100644 index 000000000000..944d1747098c --- /dev/null +++ b/external/frozen/cid1586676_use_move_ctor.0 @@ -0,0 +1,24 @@ +--- include/frozen/unordered_set.h 2024-01-22 10:42:57.125966099 +0000 ++++ include/frozen/unordered_set.h 2024-01-22 10:46:07.701159961 +0000 +@@ -74,13 +74,19 @@ + public: + /* constructors */ + unordered_set(unordered_set const &) = default; +- constexpr unordered_set(container_type keys, Hash const &hash, ++ constexpr unordered_set(container_type&& keys, Hash const &hash, ++ KeyEqual const &equal) ++ : equal_{equal} ++ , keys_{std::move(keys)} ++ , tables_{bits::make_pmh_tables<storage_size>( ++ keys_, hash, bits::Get{}, default_prg_t{})} {} ++ constexpr unordered_set(const container_type& keys, Hash const &hash, + KeyEqual const &equal) + : equal_{equal} + , keys_{keys} + , tables_{bits::make_pmh_tables<storage_size>( + keys_, hash, bits::Get{}, default_prg_t{})} {} +- explicit constexpr unordered_set(container_type keys) ++ explicit constexpr unordered_set(const container_type& keys) + : unordered_set{keys, Hash{}, KeyEqual{}} {} + + constexpr unordered_set(std::initializer_list<Key> keys) diff --git a/external/frozen/defines_h_constexpr_string.patch.0 b/external/frozen/defines_h_constexpr_string.patch.0 new file mode 100644 index 000000000000..d911ce3f9fa5 --- /dev/null +++ b/external/frozen/defines_h_constexpr_string.patch.0 @@ -0,0 +1,11 @@ +--- include/frozen/bits/defines.h ++++ include/frozen/bits/defines.h +@@ -59,7 +59,7 @@ + #define FROZEN_LETITGO_HAS_DEDUCTION_GUIDES + #endif + +-#if __cpp_lib_constexpr_string >= 201907L ++#if defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L + #define FROZEN_LETITGO_HAS_CONSTEXPR_STRING + #endif + diff --git a/external/glm/c++20.patch.0 b/external/glm/c++20.patch.0 index 34a40b5ef4c6..9fdd813a1e53 100644 --- a/external/glm/c++20.patch.0 +++ b/external/glm/c++20.patch.0 @@ -1,11 +1,11 @@ --- glm/detail/type_half.inl +++ glm/detail/type_half.inl @@ -6,7 +6,7 @@ - volatile float f = 1e10; - - for(int i = 0; i < 10; ++i) -- f *= f; // this will overflow before the for loop terminates -+ f = f * f; // this will overflow before the for loop terminates - return f; - } - + volatile float f = 1e10;
+
+ for(int i = 0; i < 10; ++i)
+- f *= f; // this will overflow before the for loop terminates
++ f = f * f; // this will overflow before the for loop terminates
+ return f;
+ }
+
diff --git a/external/glm/clang-cl.patch.0 b/external/glm/clang-cl.patch.0 index 44713a1968c5..e5536e145094 100644 --- a/external/glm/clang-cl.patch.0 +++ b/external/glm/clang-cl.patch.0 @@ -3,12 +3,12 @@ --- glm/detail/func_integer.inl +++ glm/detail/func_integer.inl @@ -3,7 +3,9 @@ - #include "_vectorize.hpp" - #if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) - # include <intrin.h> -+#if !defined __clang__^M - # pragma intrinsic(_BitScanReverse) -+#endif - #endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) - #include <limits> - + #include "_vectorize.hpp"
+ #if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
+ # include <intrin.h>
++#if !defined __clang__
+ # pragma intrinsic(_BitScanReverse)
++#endif
+ #endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
+ #include <limits>
+
diff --git a/external/gpgmepp/ExternalPackage_gpgmepp.mk b/external/gpgmepp/ExternalPackage_gpgmepp.mk index 6bab3e5e293f..be32afd6b324 100644 --- a/external/gpgmepp/ExternalPackage_gpgmepp.mk +++ b/external/gpgmepp/ExternalPackage_gpgmepp.mk @@ -15,8 +15,8 @@ ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.10.0)) -$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.22.1)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.20.1)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.32.1)) else ifeq ($(OS),MACOSX) diff --git a/external/gpgmepp/ExternalProject_gpgmepp.mk b/external/gpgmepp/ExternalProject_gpgmepp.mk index 1ba51cfb3bce..d2733bf21b49 100644 --- a/external/gpgmepp/ExternalProject_gpgmepp.mk +++ b/external/gpgmepp/ExternalProject_gpgmepp.mk @@ -25,8 +25,9 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_ $(call gb_Trace_StartRange,gpgmepp,EXTERNAL) $(call gb_ExternalProject_run,build, \ $(gb_WIN_GPG_cross_setup_exports) \ - && autoreconf \ - && ./configure \ + && $(WSL) autoreconf \ + && $(gb_RUN_CONFIGURE) ./configure \ + $(gb_CONFIGURE_PLATFORMS) \ --disable-shared \ --disable-languages \ --disable-gpgconf-test \ @@ -35,9 +36,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_ --disable-g13-test \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ CFLAGS='$(CFLAGS) \ - $(if $(ENABLE_OPTIMIZED), \ - $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ - $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \ + $(call gb_ExternalProject_get_build_flags,gpgmepp)' \ $(gb_WIN_GPG_platform_switches) \ MAKE=$(MAKE) \ && $(MAKE) \ @@ -48,7 +47,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Trace_StartRange,gpgmepp,EXTERNAL) $(call gb_ExternalProject_run,build,\ autoreconf \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --disable-gpgconf-test \ --disable-gpg-test \ --disable-gpgsm-test \ @@ -59,18 +58,14 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): LIBASSUAN_CFLAGS="$(LIBASSUAN_CFLAGS)" \ LIBASSUAN_LIBS="$(LIBASSUAN_LIBS)" \ CFLAGS='$(CFLAGS) \ - $(if $(ENABLE_OPTIMIZED), \ - $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ - $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \ + $(call gb_ExternalProject_get_build_flags,gpgmepp)' \ CXXFLAGS='$(CXXFLAGS) \ - $(if $(ENABLE_OPTIMIZED), \ - $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ - $(if $(ENABLE_DBGUTIL),-D_GLIBCXX_DEBUG) \ - $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \ + $(call gb_ExternalProject_get_build_flags,gpgmepp) \ + $(gb_COMPILERDEFS_STDLIB_DEBUG)' \ $(if $(filter LINUX,$(OS)), \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ && $(MAKE) \ diff --git a/external/gpgmepp/Library_gpgmepp.mk b/external/gpgmepp/Library_gpgmepp.mk index f60301a4eb0d..8191e55d4709 100644 --- a/external/gpgmepp/Library_gpgmepp.mk +++ b/external/gpgmepp/Library_gpgmepp.mk @@ -58,9 +58,11 @@ $(eval $(call gb_Library_add_generated_exception_objects,gpgmepp,\ UnpackedTarball/gpgmepp/lang/cpp/src/engineinfo \ UnpackedTarball/gpgmepp/lang/cpp/src/eventloopinteractor \ UnpackedTarball/gpgmepp/lang/cpp/src/exception \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgaddexistingsubkeyeditinteractor \ UnpackedTarball/gpgmepp/lang/cpp/src/gpgadduserideditinteractor \ UnpackedTarball/gpgmepp/lang/cpp/src/gpgagentgetinfoassuantransaction \ UnpackedTarball/gpgmepp/lang/cpp/src/gpggencardkeyinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgrevokekeyeditinteractor \ UnpackedTarball/gpgmepp/lang/cpp/src/gpgsetexpirytimeeditinteractor \ UnpackedTarball/gpgmepp/lang/cpp/src/gpgsetownertrusteditinteractor \ UnpackedTarball/gpgmepp/lang/cpp/src/gpgsignkeyeditinteractor \ @@ -70,9 +72,11 @@ $(eval $(call gb_Library_add_generated_exception_objects,gpgmepp,\ UnpackedTarball/gpgmepp/lang/cpp/src/keylistresult \ UnpackedTarball/gpgmepp/lang/cpp/src/scdgetinfoassuantransaction \ UnpackedTarball/gpgmepp/lang/cpp/src/signingresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/statusconsumerassuantransaction \ UnpackedTarball/gpgmepp/lang/cpp/src/swdbresult \ UnpackedTarball/gpgmepp/lang/cpp/src/tofuinfo \ UnpackedTarball/gpgmepp/lang/cpp/src/trustitem \ + UnpackedTarball/gpgmepp/lang/cpp/src/util \ UnpackedTarball/gpgmepp/lang/cpp/src/verificationresult \ UnpackedTarball/gpgmepp/lang/cpp/src/vfsmountresult \ )) diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk index 2e9eb3d826ff..dcbda38d591d 100644 --- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -19,20 +19,21 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,gpgmepp,0)) $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ external/gpgmepp/find-libgpg-error-libassuan.patch \ external/gpgmepp/fix-autoconf-macros.patch \ - external/gpgmepp/add-minimal-keyexport.patch \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-build-fixes.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-disable-docs.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-win32-macro.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-libtool.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-add-initializer.patch.1) \ - external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 \ external/gpgmepp/w32-build-fixes-2.patch \ $(if $(filter LINUX,$(OS)),external/gpgmepp/asan.patch) \ $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \ - external/gpgmepp/gcc9.patch \ external/gpgmepp/ubsan.patch \ external/gpgmepp/c++20.patch \ external/gpgmepp/clang-cl.patch \ external/gpgmepp/configure.patch \ + external/gpgmepp/w32-include.patch \ + external/gpgmepp/Wincompatible-function-pointer-types.patch \ + external/gpgmepp/macos-macports-path.patch \ + external/gpgmepp/macos-tdf152524.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/gpgmepp/Wincompatible-function-pointer-types.patch b/external/gpgmepp/Wincompatible-function-pointer-types.patch new file mode 100755 index 000000000000..cd4f1117fd06 --- /dev/null +++ b/external/gpgmepp/Wincompatible-function-pointer-types.patch @@ -0,0 +1,31 @@ +--- src/assuan-support.c ++++ src/assuan-support.c +@@ -126,7 +126,7 @@ + } + + +-static gpgme_ssize_t ++static ssize_t + my_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size) + { + (void)ctx; +@@ -134,7 +134,7 @@ + } + + +-static gpgme_ssize_t ++static ssize_t + my_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer, size_t size) + { + (void)ctx; +--- src/gpgme-w32spawn.c ++++ src/gpgme-w32spawn.c +@@ -24,7 +249,7 @@ + handle = LoadLibraryA ("user32.dll"); + if (handle) + { +- func = GetProcAddress (handle, "AllowSetForegroundWindow"); ++ func = (BOOL (WINAPI *)(DWORD)) GetProcAddress (handle, "AllowSetForegroundWindow"); + if (!func) + FreeLibrary (handle); + } diff --git a/external/gpgmepp/add-minimal-keyexport.patch b/external/gpgmepp/add-minimal-keyexport.patch deleted file mode 100644 index d163ef814917..000000000000 --- a/external/gpgmepp/add-minimal-keyexport.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- lang/cpp/src/context.h.bak 2017-10-18 12:28:00.898945587 +0200 -+++ lang/cpp/src/context.h 2017-10-18 12:28:35.794832395 +0200 -@@ -178,10 +178,10 @@ - // Key Export - // - -- GpgME::Error exportPublicKeys(const char *pattern, Data &keyData); -- GpgME::Error exportPublicKeys(const char *pattern[], Data &keyData); -- GpgME::Error startPublicKeyExport(const char *pattern, Data &keyData); -- GpgME::Error startPublicKeyExport(const char *pattern[], Data &keyData); -+ GpgME::Error exportPublicKeys(const char *pattern, Data &keyData, bool minimal=false); -+ GpgME::Error exportPublicKeys(const char *pattern[], Data &keyData, bool minimal=false); -+ GpgME::Error startPublicKeyExport(const char *pattern, Data &keyData, bool minimal=false); -+ GpgME::Error startPublicKeyExport(const char *pattern[], Data &keyData, bool minimal=false); - - // - // Key Import ---- lang/cpp/src/context.cpp.bak 2017-10-18 12:27:50.830978224 +0200 -+++ lang/cpp/src/context.cpp 2017-10-18 12:30:13.278515603 +0200 -@@ -557,14 +557,14 @@ - } - } - --Error Context::exportPublicKeys(const char *pattern, Data &keyData) -+Error Context::exportPublicKeys(const char *pattern, Data &keyData, bool minimal) - { - d->lastop = Private::Export; - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export(d->ctx, pattern, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export(d->ctx, pattern, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - --Error Context::exportPublicKeys(const char *patterns[], Data &keyData) -+Error Context::exportPublicKeys(const char *patterns[], Data &keyData, bool minimal) - { - d->lastop = Private::Export; - #ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN -@@ -574,17 +574,17 @@ - } - #endif - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - --Error Context::startPublicKeyExport(const char *pattern, Data &keyData) -+Error Context::startPublicKeyExport(const char *pattern, Data &keyData, bool minimal) - { - d->lastop = Private::Export; - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export_start(d->ctx, pattern, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export_start(d->ctx, pattern, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - --Error Context::startPublicKeyExport(const char *patterns[], Data &keyData) -+Error Context::startPublicKeyExport(const char *patterns[], Data &keyData, bool minimal) - { - d->lastop = Private::Export; - #ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN -@@ -594,7 +594,7 @@ - } - #endif - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - - ImportResult Context::importKeys(const Data &data) diff --git a/external/gpgmepp/asan.patch b/external/gpgmepp/asan.patch index 16d97f6ff307..e0b1c85fe51b 100644 --- a/external/gpgmepp/asan.patch +++ b/external/gpgmepp/asan.patch @@ -1,6 +1,6 @@ --- src/posix-io.c +++ src/posix-io.c -@@ -468,6 +468,9 @@ +@@ -563,6 +563,9 @@ if (atfork) atfork (atforkvalue, 0); diff --git a/external/gpgmepp/configure.patch b/external/gpgmepp/configure.patch index 4b51db6bebad..ad3f97e632fb 100644 --- a/external/gpgmepp/configure.patch +++ b/external/gpgmepp/configure.patch @@ -1,6 +1,6 @@ --- configure.ac +++ configure.ac -@@ -619,6 +619,15 @@ +@@ -617,6 +617,15 @@ AC_SUBST(API__SSIZE_T) AM_SUBST_NOTMAKE(API__SSIZE_T) @@ -16,7 +16,7 @@ # Checks for compiler features. if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" -@@ -679,15 +679,6 @@ +@@ -677,15 +686,6 @@ AC_FUNC_FSEEKO diff --git a/external/gpgmepp/find-libgpg-error-libassuan.patch b/external/gpgmepp/find-libgpg-error-libassuan.patch index 699136cfb066..a98a7d845a34 100644 --- a/external/gpgmepp/find-libgpg-error-libassuan.patch +++ b/external/gpgmepp/find-libgpg-error-libassuan.patch @@ -2,7 +2,7 @@ diff --git a/configure.ac b/configure.ac index f28480b..92a3e85 100644 --- configure.ac +++ configure.ac -@@ -674,15 +674,34 @@ AC_CHECK_FUNCS(setlocale) +@@ -719,8 +719,18 @@ # Checking for libgpg-error. have_gpg_error=no @@ -23,6 +23,8 @@ index f28480b..92a3e85 100644 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME, [The default error source for GPGME.]) +@@ -729,8 +739,17 @@ + # And for libassuan. have_libassuan=no -AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION", @@ -40,35 +42,6 @@ index f28480b..92a3e85 100644 if test "$have_libassuan" = "yes"; then AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version", [version of the libassuan library]) -diff --git a/src/Makefile.am b/src/Makefile.am -index ce6f1d4..6b1d835 100644 ---- src/Makefile.am -+++ src/Makefile.am -@@ -26,7 +26,7 @@ - m4data_DATA = gpgme.m4 - nodist_include_HEADERS = gpgme.h - --bin_PROGRAMS = gpgme-tool gpgme-json -+bin_PROGRAMS = gpgme-tool - - if BUILD_W32_GLIB - ltlib_gpgme_glib = libgpgme-glib.la -@@ -97,13 +97,10 @@ - - # We use a global CFLAGS setting for all libraries - # versions, because then every object file is only compiled once. --AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ -+AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@ @GLIB_CFLAGS@ - - gpgme_tool_SOURCES = gpgme-tool.c argparse.c argparse.h --gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@ -- --gpgme_json_SOURCES = gpgme-json.c cJSON.c cJSON.h --gpgme_json_LDADD = -lm libgpgme.la $(GPG_ERROR_LIBS) -+gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ - - - if HAVE_W32_SYSTEM --- lang/cpp/tests/Makefile.am 2020-06-20 00:43:49.213657887 +0200 +++ lang/cpp/tests/Makefile.am~ 2019-01-25 13:27:34.000000000 +0100 @@ -21,7 +21,7 @@ @@ -82,7 +55,7 @@ index ce6f1d4..6b1d835 100644 AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ --- lang/cpp/tests/Makefile.in 2020-06-20 00:44:49.542344510 +0200 +++ lang/cpp/tests/Makefile.in~ 2020-06-13 00:55:19.021212970 +0200 -@@ -415,7 +415,7 @@ +@@ -427,7 +427,7 @@ top_srcdir = @top_srcdir@ AM_LDFLAGS = -no-install LDADD = ../../cpp/src/libgpgmepp.la \ diff --git a/external/gpgmepp/fix-autoconf-macros.patch b/external/gpgmepp/fix-autoconf-macros.patch index e333168b2b33..265703b00671 100644 --- a/external/gpgmepp/fix-autoconf-macros.patch +++ b/external/gpgmepp/fix-autoconf-macros.patch @@ -1,7 +1,7 @@ diff -ur gpgme.org/configure.ac gpgme/configure.ac --- configure.ac 2017-02-16 15:18:45.051417378 +0100 +++ configure.ac~ 2017-02-16 15:20:03.635059285 +0100 -@@ -35,6 +35,11 @@ +@@ -38,6 +38,11 @@ # the decimalized short revision number, a beta version string and a # flag indicating a development version (mym4_isbeta). Note that the # m4 processing is done by autoconf and not during the configure run. @@ -13,10 +13,10 @@ diff -ur gpgme.org/configure.ac gpgme/configure.ac m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \ mym4_package mym4_major mym4_minor mym4_micro),[:])) m4_define([mym4_isbeta], m4_argn(2, mym4_verslist)) -@@ -90,7 +90,22 @@ +@@ -98,7 +103,22 @@ AC_CONFIG_MACRO_DIR([m4]) - AC_CONFIG_SRCDIR(src/gpgme.h.in) - AC_CONFIG_HEADER(conf/config.h) + AC_CONFIG_SRCDIR([src/gpgme.h.in]) + AC_CONFIG_HEADERS([conf/config.h]) -AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip]) + +dnl Initialize automake. automake < 1.12 didn't have serial-tests and diff --git a/external/gpgmepp/gcc9.patch b/external/gpgmepp/gcc9.patch deleted file mode 100644 index c2a9fd444df7..000000000000 --- a/external/gpgmepp/gcc9.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- lang/cpp/src/key.h -+++ lang/cpp/src/key.h -@@ -62,6 +62,7 @@ - /* implicit */ Key(const Null &); - Key(const shared_gpgme_key_t &key); - Key(gpgme_key_t key, bool acquireRef); -+ Key(Key const &) = default; - - static const Null null; - diff --git a/external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 b/external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 deleted file mode 100644 index 1b5e22a7eccd..000000000000 --- a/external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 +++ /dev/null @@ -1,30 +0,0 @@ -From fe2892618c20cd40c342cce26ffb6ac4644fd3c3 Mon Sep 17 00:00:00 2001 -From: Andre Heinecke <aheinecke@gnupg.org> -Date: Mon, 28 Oct 2019 16:00:29 +0100 -Subject: [PATCH 1/1] core,w32: Initialize dbg_help for socket debugging - -* src/w32-io.c (_gpgme_io_select): Initialize dbg_help. - --- -This fixes a crash on Windows because dbg_help might -be used unitialized. ---- - src/w32-io.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/w32-io.c b/src/w32-io.c -index c5c21f59..80978f9a 100644 ---- a/src/w32-io.c -+++ b/src/w32-io.c -@@ -1643,7 +1643,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock) - int i; - int any; - int count; -- void *dbg_help; -+ void *dbg_help = NULL; - TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_select", fds, - "nfds=%u, nonblock=%u", nfds, nonblock); - --- -2.11.0 - diff --git a/external/gpgmepp/macos-macports-path.patch b/external/gpgmepp/macos-macports-path.patch new file mode 100644 index 000000000000..de7e8f68e69f --- /dev/null +++ b/external/gpgmepp/macos-macports-path.patch @@ -0,0 +1,11 @@ +--- src/posix-util.c 2023-04-20 07:35:50.000000000 -0400 ++++ src/posix-util.c 2023-07-14 17:28:21.000000000 -0400 +@@ -145,7 +145,7 @@ + the browser interface we should look into some additional + fallback paths. */ + const char *additional_path +- = "/usr/local/bin:/usr/local/MacGPG2/bin:/opt/homebrew/bin"; ++ = "/usr/local/bin:/usr/local/MacGPG2/bin:/opt/homebrew/bin:/opt/local/bin"; + if (!ret) + { + ret = walk_path_str (additional_path, pgm); diff --git a/external/gpgmepp/macos-tdf152524.patch b/external/gpgmepp/macos-tdf152524.patch new file mode 100644 index 000000000000..c1cdd047dba8 --- /dev/null +++ b/external/gpgmepp/macos-tdf152524.patch @@ -0,0 +1,102 @@ +--- src/posix-io.c 2023-02-01 11:50:48 ++++ src/posix-io.c 2024-03-21 09:50:24 +@@ -67,6 +67,13 @@ + #include "priv-io.h" + #include "sema.h" + #include "debug.h" ++ ++#if HAVE_MACOS_SYSTEM ++#include <dispatch/dispatch.h> ++#include <spawn.h> ++ ++extern char **environ; ++#endif + + + #ifdef USE_LINUX_GETDENTS +@@ -515,6 +522,15 @@ + } + return 0; + } ++ ++ ++#if HAVE_MACOS_SYSTEM ++static int ++_gpgme_io_spawn_macos (const char *path, char *const argv[], unsigned int flags, ++ struct spawn_fd_item_s *fd_list, ++ void (*atfork) (void *opaque, int reserved), ++ void *atforkvalue, pid_t *r_pid); ++#endif /*HAVE_MACOS_SYSTEM*/ + + + /* Returns 0 on success, -1 on error. */ +@@ -523,6 +539,35 @@ + struct spawn_fd_item_s *fd_list, + void (*atfork) (void *opaque, int reserved), + void *atforkvalue, pid_t *r_pid) ++#if HAVE_MACOS_SYSTEM ++{ ++ /* tdf#152524 fork() and exec() in a separate libdispatch queue ++ * This is another attempt to stop the crashing in libdispatch by ++ * running fork() and exec() within a libdispatch task that will ++ * run in a sequential queue in a non-main thread. */ ++ static dispatch_queue_t queue = NULL; ++ if (!queue) ++ queue = dispatch_queue_create ("gpgmepp", ++ DISPATCH_QUEUE_CONCURRENT); ++ if (!queue) ++ return -1; ++ ++ __block int ret = -1; ++ dispatch_sync(queue, ^{ ++ ret = _gpgme_io_spawn_macos (path, argv, flags, ++ fd_list, atfork, ++ atforkvalue, r_pid); ++ }); ++ ++ return ret; ++} ++ ++static int ++_gpgme_io_spawn_macos (const char *path, char *const argv[], unsigned int flags, ++ struct spawn_fd_item_s *fd_list, ++ void (*atfork) (void *opaque, int reserved), ++ void *atforkvalue, pid_t *r_pid) ++#endif /*HAVE_MACOS_SYSTEM*/ + { + pid_t pid; + int i; +@@ -552,8 +597,15 @@ + if (!pid) + { + /* Intermediate child to prevent zombie processes. */ ++#if HAVE_MACOS_SYSTEM ++ /* tdf#152524 fix crash by skipping second fork() ++ * Instead of calling a second fork() in the child process, replace ++ * execv() with posix_spawn(). posix_spawn() does not call any atfork ++ * handlers so the atfork handler that crashes will be skipped. */ ++#else /*HAVE_MACOS_SYSTEM*/ + if ((pid = fork ()) == 0) + { ++#endif /*HAVE_MACOS_SYSTEM*/ + /* Child. */ + int max_fds = -1; + int fd; +@@ -664,6 +716,9 @@ + close (fd); + } + ++#if HAVE_MACOS_SYSTEM ++ _exit(posix_spawn(NULL, path, NULL, NULL, argv, environ)); ++#else /*HAVE_MACOS_SYSTEM*/ + execv (path, (char *const *) argv); + /* Hmm: in that case we could write a special status code to the + status-pipe. */ +@@ -674,6 +729,7 @@ + _exit (1); + else + _exit (0); ++#endif /*HAVE_MACOS_SYSTEM*/ + } + + TRACE_LOG ("waiting for child process pid=%i", pid); diff --git a/external/gpgmepp/rpath.patch b/external/gpgmepp/rpath.patch index e83dcf2762ef..6e6c46105b94 100644 --- a/external/gpgmepp/rpath.patch +++ b/external/gpgmepp/rpath.patch @@ -1,6 +1,6 @@ --- configure.ac +++ configure.ac -@@ -176,6 +176,9 @@ +@@ -187,6 +187,9 @@ LT_INIT([win32-dll disable-static]) LT_LANG([Windows Resource]) diff --git a/external/gpgmepp/ubsan.patch b/external/gpgmepp/ubsan.patch index 5a6e6dcdc9b2..c23ab80ad007 100644 --- a/external/gpgmepp/ubsan.patch +++ b/external/gpgmepp/ubsan.patch @@ -1,8 +1,8 @@ --- src/engine-gpg.c +++ src/engine-gpg.c -@@ -60,6 +60,15 @@ +@@ -62,6 +62,15 @@ building command line to this location. */ - char arg[1]; /* Used if data above is not used. */ + char arg[FLEXIBLE_ARRAY_MEMBER]; /* Used if data above is not used. */ }; +struct arg_without_data_s +{ @@ -16,16 +16,14 @@ struct fd_data_map_s -@@ -299,23 +308,24 @@ - a = malloc (sizeof *a - 1); +@@ -335,19 +344,20 @@ + a = malloc (offsetof (struct arg_and_data_s, arg)); if (!a) return gpg_error_from_syserror (); -- a->next = NULL; - a->data = data; - a->inbound = inbound; - a->arg_locp = NULL; + struct arg_without_data_s *a2 = (struct arg_without_data_s *)a; -+ a2->next = NULL; + a2->data = data; + a2->inbound = inbound; + a2->arg_locp = NULL; @@ -44,9 +42,5 @@ + a2->print_fd = 0; + a2->dup_to = dup_to; } - *gpg->argtail = a; -- gpg->argtail = &a->next; -+ gpg->argtail = &a2->next; - return 0; - } + if (front) diff --git a/external/gpgmepp/w32-build-fixes.patch.1 b/external/gpgmepp/w32-build-fixes.patch.1 index 9bc8f52b4c64..250b2022c540 100644 --- a/external/gpgmepp/w32-build-fixes.patch.1 +++ b/external/gpgmepp/w32-build-fixes.patch.1 @@ -1,19 +1,19 @@ -diff -ru gpgme.orig/m4/ax_cxx_compile_stdcxx.m4 gpgme/m4/ax_cxx_compile_stdcxx.m4 ---- gpgme.orig/m4/ax_cxx_compile_stdcxx.m4 2016-05-27 22:04:36.000000000 +0200 -+++ gpgme/m4/ax_cxx_compile_stdcxx.m4 2017-09-29 17:34:49.795243600 +0200 -@@ -156,7 +156,7 @@ - - #error "This is not a C++ compiler" - --#elif __cplusplus < 201103L -+#elif __cplusplus < 201103L && !(defined _MSC_VER) - - #error "This is not a C++11 compiler" - +diff -ru gpgme.orig/src/debug.h gpgme/src/debug.h +--- gpgme.orig/src/debug.h ++++ gpgme/src/debug.h +@@ -180,7 +180,7 @@ static inline gpgme_ssize_t + _trace_sysres_ssize_t (gpgme_ssize_t res, int lvl, const char *func, int line) + { + if (res >= 0) +- _gpgme_debug (NULL, lvl, 3, func, NULL, NULL, "result=%zd", (ssize_t)res); ++ _gpgme_debug (NULL, lvl, 3, func, NULL, NULL, "result=%zd", res); + else + _gpgme_debug (NULL, lvl, -1, NULL, NULL, NULL, + "%s:%d: error: %s (%d)\n", diff -ru gpgme.orig/src/dirinfo.c gpgme/src/dirinfo.c --- gpgme.orig/src/dirinfo.c 2017-03-21 11:09:41.000000000 +0100 +++ gpgme/src/dirinfo.c 2017-09-30 08:36:13.239279300 +0200 -@@ -33,6 +33,10 @@ +@@ -34,6 +34,10 @@ DEFINE_STATIC_LOCK (dirinfo_lock); @@ -24,10 +24,23 @@ diff -ru gpgme.orig/src/dirinfo.c gpgme/src/dirinfo.c /* Constants used internally to select the data. */ enum { +diff -ru gpgme.orig/src/gpgme-w32spawn.c gpgme/src/gpgme-w32spawn.c +--- gpgme.orig/src/gpgme-w32spawn.c 2023-10-27 21:27:30.000000000 +0900 ++++ gpgme/src/gpgme-w32spawn.c 2024-02-26 17:32:59.949338645 +0900 +@@ -52,6 +52,9 @@ + #define mystderr stderr + #endif + ++#ifdef _MSC_VER ++#define snwprintf _snwprintf ++#endif + + + static wchar_t * diff -ru gpgme.orig/src/mbox-util.c gpgme/src/mbox-util.c --- gpgme.orig/src/mbox-util.c 2016-11-16 13:22:41.000000000 +0100 +++ gpgme/src/mbox-util.c 2017-09-30 08:18:29.270567500 +0200 -@@ -28,7 +28,9 @@ +@@ -29,7 +29,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -40,7 +53,7 @@ diff -ru gpgme.orig/src/mbox-util.c gpgme/src/mbox-util.c diff -ru gpgme.orig/src/priv-io.h gpgme/src/priv-io.h --- gpgme.orig/src/priv-io.h 2016-11-16 13:23:14.000000000 +0100 +++ gpgme/src/priv-io.h 2017-09-30 08:20:38.770562400 +0200 -@@ -36,6 +36,9 @@ +@@ -33,6 +33,9 @@ #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif @@ -53,20 +66,20 @@ diff -ru gpgme.orig/src/priv-io.h gpgme/src/priv-io.h diff -ru gpgme.orig/src/util.h gpgme/src/util.h --- gpgme.orig/src/util.h 2017-03-28 11:41:30.000000000 +0200 +++ gpgme/src/util.h 2017-09-30 08:10:54.194049100 +0200 -@@ -39,6 +39,9 @@ - #ifdef HAVE_UNISTD_H +@@ -36,6 +36,9 @@ # include <unistd.h> #endif + #include <stdint.h> +#ifdef _MSC_VER +typedef int pid_t; +#endif - #include "gpgme.h" + #include "gpgme.h" diff -ru gpgme.orig/src/w32-util.c gpgme/src/w32-util.c --- gpgme.orig/src/w32-util.c 2017-03-09 09:01:10.000000000 +0100 +++ gpgme/src/w32-util.c 2017-09-30 08:32:02.114330500 +0200 -@@ -721,7 +721,8 @@ +@@ -772,7 +772,8 @@ v /= 62; XXXXXX[5] = letters[v % 62]; @@ -79,16 +92,16 @@ diff -ru gpgme.orig/src/w32-util.c gpgme/src/w32-util.c diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am --- gpgme.orig/src/Makefile.am 2017-09-30 11:50:07.456960000 +0200 +++ gpgme/src/Makefile.am 2017-09-30 11:51:29.609649400 +0200 -@@ -26,7 +26,7 @@ +@@ -35,7 +35,7 @@ m4data_DATA = gpgme.m4 nodist_include_HEADERS = gpgme.h --bin_PROGRAMS = gpgme-tool +-bin_PROGRAMS = gpgme-tool gpgme-json +bin_PROGRAMS = if BUILD_W32_GLIB ltlib_gpgme_glib = libgpgme-glib.la -@@ -99,8 +99,8 @@ +@@ -107,11 +107,11 @@ # versions, because then every object file is only compiled once. AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@ @GLIB_CFLAGS@ @@ -97,9 +110,14 @@ diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am +gpgme_tool_SOURCES = +gpgme_tool_LDADD = +-gpgme_json_SOURCES = gpgme-json.c cJSON.c cJSON.h +-gpgme_json_LDADD = -lm libgpgme.la $(GPG_ERROR_LIBS) ++gpgme_json_SOURCES = ++gpgme_json_LDADD = + if HAVE_W32_SYSTEM -@@ -120,7 +120,7 @@ +@@ -126,7 +126,7 @@ SUFFIXES = .rc .lo .rc.lo: diff --git a/external/gpgmepp/w32-disable-docs.patch.1 b/external/gpgmepp/w32-disable-docs.patch.1 index 2c307f502b63..1803ffa03cb5 100644 --- a/external/gpgmepp/w32-disable-docs.patch.1 +++ b/external/gpgmepp/w32-disable-docs.patch.1 @@ -4,7 +4,7 @@ like libgpg-error's --disable-doc diff -ur gpgmepp.org/Makefile.am gpgmepp/Makefile.am --- gpgmepp.org/Makefile.am 2016-11-16 13:20:18.000000000 +0100 +++ gpgmepp/Makefile.am 2017-11-20 15:34:49.086731000 +0100 -@@ -33,7 +33,7 @@ +@@ -45,7 +45,7 @@ tests = endif diff --git a/external/gpgmepp/w32-fix-libtool.patch.1 b/external/gpgmepp/w32-fix-libtool.patch.1 index 9a7adf713694..40893908b7f6 100644 --- a/external/gpgmepp/w32-fix-libtool.patch.1 +++ b/external/gpgmepp/w32-fix-libtool.patch.1 @@ -9,7 +9,7 @@ linking, by accepting cygwin path names, and correctly expanding diff -ur gpgmepp.org/m4/libtool.m4 gpgmepp/m4/libtool.m4 --- gpgmepp.org/m4/libtool.m4 2016-11-16 13:20:16.000000000 +0100 +++ gpgmepp/m4/libtool.m4 2017-11-21 22:00:05.006587800 +0100 -@@ -3209,24 +3209,11 @@ +@@ -3230,24 +3230,11 @@ ;; cygwin*) diff --git a/external/gpgmepp/w32-fix-win32-macro.patch.1 b/external/gpgmepp/w32-fix-win32-macro.patch.1 index 70a8b5ffe6e8..8ab7b0fab089 100644 --- a/external/gpgmepp/w32-fix-win32-macro.patch.1 +++ b/external/gpgmepp/w32-fix-win32-macro.patch.1 @@ -1,7 +1,7 @@ diff -ur gpgmepp.org/lang/cpp/src/callbacks.cpp gpgmepp/lang/cpp/src/callbacks.cpp --- gpgmepp.org/lang/cpp/src/callbacks.cpp 2016-10-18 19:22:02.000000000 +0200 +++ gpgmepp/lang/cpp/src/callbacks.cpp 2017-11-20 18:03:04.290060900 +0100 -@@ -38,7 +38,9 @@ +@@ -40,7 +40,9 @@ #include <cassert> #include <cerrno> #include <cstring> @@ -29,7 +29,7 @@ diff -ur gpgmepp.org/lang/cpp/src/data.h gpgmepp/lang/cpp/src/data.h diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editinteractor.cpp --- gpgmepp.org/lang/cpp/src/editinteractor.cpp 2017-03-09 09:01:10.000000000 +0100 +++ gpgmepp/lang/cpp/src/editinteractor.cpp 2017-11-20 18:09:33.022674700 +0100 -@@ -30,9 +30,11 @@ +@@ -33,9 +33,11 @@ #include <gpgme.h> @@ -46,7 +46,7 @@ diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editin diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_export.h --- gpgmepp.org/lang/cpp/src/gpgmepp_export.h 2016-08-04 15:03:09.000000000 +0200 +++ gpgmepp/lang/cpp/src/gpgmepp_export.h 2017-11-20 16:57:47.805691100 +0100 -@@ -29,14 +29,14 @@ +@@ -30,14 +30,14 @@ # ifndef GPGMEPP_EXPORT # ifdef BUILDING_GPGMEPP /* We are building this library */ @@ -63,7 +63,7 @@ diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_ # define GPGMEPP_EXPORT __declspec(dllimport) # else # define GPGMEPP_EXPORT __attribute__((visibility("default"))) -@@ -45,7 +45,7 @@ +@@ -46,7 +46,7 @@ # endif # ifndef GPGMEPP_NO_EXPORT @@ -72,7 +72,7 @@ diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_ # define GPGMEPP_NO_EXPORT # else # define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden"))) -@@ -54,7 +54,11 @@ +@@ -55,7 +55,11 @@ #endif #ifndef GPGMEPP_DEPRECATED @@ -88,7 +88,7 @@ diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_ diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src/interfaces/dataprovider.h --- gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h 2016-05-17 14:32:37.000000000 +0200 +++ gpgmepp/lang/cpp/src/interfaces/dataprovider.h 2017-11-20 18:03:11.332715700 +0100 -@@ -29,6 +29,11 @@ +@@ -31,6 +31,11 @@ #include <gpg-error.h> @@ -103,13 +103,14 @@ diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src diff -ur gpgmepp.org/lang/cpp/src/key.cpp gpgmepp/lang/cpp/src/key.cpp --- gpgmepp.org/lang/cpp/src/key.cpp 2017-03-20 20:10:15.000000000 +0100 +++ gpgmepp/lang/cpp/src/key.cpp 2017-11-20 17:44:50.321858800 +0100 -@@ -33,10 +33,16 @@ +@@ -34,11 +34,17 @@ #include <gpgme.h> #include <string.h> +#if HAVE_STRINGS_H #include <strings.h> +#endif + #include <cassert> #include <istream> #include <iterator> @@ -134,7 +135,7 @@ diff -ur gpgmepp.org/lang/cpp/src/key.h gpgmepp/lang/cpp/src/key.h diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_export.h --- gpgmepp.org/lang/qt/src/qgpgme_export.h 2016-11-03 17:32:30.000000000 +0100 +++ gpgmepp/lang/qt/src/qgpgme_export.h 2017-11-20 16:58:27.395388000 +0100 -@@ -39,14 +39,14 @@ +@@ -40,14 +40,14 @@ # ifndef QGPGME_EXPORT # ifdef BUILDING_QGPGME /* We are building this library */ @@ -151,7 +152,7 @@ diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_expo # define QGPGME_EXPORT __declspec(dllimport) # else # define QGPGME_EXPORT __attribute__((visibility("default"))) -@@ -55,7 +55,7 @@ +@@ -56,7 +56,7 @@ # endif # ifndef QGPGME_NO_EXPORT @@ -160,7 +161,7 @@ diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_expo # define QGPGME_NO_EXPORT # else # define QGPGME_NO_EXPORT __attribute__((visibility("hidden"))) -@@ -64,7 +64,11 @@ +@@ -65,7 +65,11 @@ #endif #ifndef QGPGME_DEPRECATED diff --git a/external/gpgmepp/w32-include.patch b/external/gpgmepp/w32-include.patch new file mode 100644 index 000000000000..0fda72c2b072 --- /dev/null +++ b/external/gpgmepp/w32-include.patch @@ -0,0 +1,42 @@ +--- src/data-fd.c ++++ src/data-fd.c +@@ -28,6 +28,9 @@ + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif ++#if defined HAVE_W32_SYSTEM ++#include <io.h> ++#endif + + #include "debug.h" + #include "data.h" +--- src/gpgme-w32spawn.c ++++ src/gpgme-w32spawn.c +@@ -36,6 +36,7 @@ + # include <sys/stat.h> + #endif + #include <stdint.h> ++#include <io.h> + #include <process.h> + + #include "priv-io.h" +--- lang/cpp/src/gpgaddexistingsubkeyeditinteractor.h ++++ lang/cpp/src/gpgaddexistingsubkeyeditinteractor.h +@@ -27,6 +27,7 @@ + #include "editinteractor.h" + + #include <memory> ++#include <string> + + namespace GpgME + { +--- lang/cpp/src/gpgrevokekeyeditinteractor.h ++++ lang/cpp/src/gpgrevokekeyeditinteractor.h +@@ -28,6 +28,7 @@ + #include "global.h" + + #include <memory> ++#include <string> + #include <vector> + + namespace GpgME diff --git a/external/graphite/UnpackedTarball_graphite.mk b/external/graphite/UnpackedTarball_graphite.mk index 464fcc256069..0f678542e80f 100644 --- a/external/graphite/UnpackedTarball_graphite.mk +++ b/external/graphite/UnpackedTarball_graphite.mk @@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,graphite,0)) $(eval $(call gb_UnpackedTarball_add_patches,graphite, \ external/graphite/ubsan.patch \ + external/graphite/enumarith.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/graphite/enumarith.patch b/external/graphite/enumarith.patch new file mode 100644 index 000000000000..f5b83097f2b6 --- /dev/null +++ b/external/graphite/enumarith.patch @@ -0,0 +1,22 @@ +--- src/Pass.cpp ++++ src/Pass.cpp +@@ -194,7 +194,7 @@ + m_cPConstraint = vm::Machine::Code(true, pcCode, pcCode + pass_constraint_len, + precontext[0], be::peek<uint16>(sort_keys), *m_silf, face, PASS_TYPE_UNKNOWN); + if (e.test(!m_cPConstraint, E_OUTOFMEM) +- || e.test(m_cPConstraint.status() != Code::loaded, m_cPConstraint.status() + E_CODEFAILURE)) ++ || e.test(m_cPConstraint.status() != Code::loaded, +m_cPConstraint.status() + E_CODEFAILURE)) + return face.error(e); + face.error_context(face.error_context() - 1); + } +@@ -266,8 +266,8 @@ + r->constraint = new (m_codes+n*2-1) vm::Machine::Code(true, rc_begin, rc_end, r->preContext, r->sort, *m_silf, face, pt, &prog_pool_free); + + if (e.test(!r->action || !r->constraint, E_OUTOFMEM) +- || e.test(r->action->status() != Code::loaded, r->action->status() + E_CODEFAILURE) +- || e.test(r->constraint->status() != Code::loaded, r->constraint->status() + E_CODEFAILURE) ++ || e.test(r->action->status() != Code::loaded, +r->action->status() + E_CODEFAILURE) ++ || e.test(r->constraint->status() != Code::loaded, +r->constraint->status() + E_CODEFAILURE) + || e.test(!r->constraint->immutable(), E_MUTABLECCODE)) + return face.error(e); + } diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk index 7219d402df3c..9c8dd804e8f0 100644 --- a/external/harfbuzz/ExternalProject_harfbuzz.mk +++ b/external/harfbuzz/ExternalProject_harfbuzz.mk @@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) : $(if $(SYSTEM_ICU),,ICU_CONFIG=$(SRCDIR)/external/icu/cross-bin/icu-config) \ GRAPHITE2_CFLAGS="$(GRAPHITE_CFLAGS)" \ GRAPHITE2_LIBS="$(GRAPHITE_LIBS)" \ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ --enable-static \ --disable-shared \ --disable-gtk-doc \ @@ -41,16 +41,14 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) : $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \ --libdir=$(call gb_UnpackedTarball_get_dir,harfbuzz/src/.libs) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ CXXFLAGS=' \ $(if $(filter ANDROID,$(OS)),-DHB_NO_MMAP=1,) \ - $(if $(call gb_Module__symbols_enabled,harfbuzz),$(gb_DEBUGINFO_FLAGS)) \ - $(if $(ENABLE_OPTIMIZED), \ - $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ + $(call gb_ExternalProject_get_build_flags,harfbuzz) \ $(if $(ENABLE_RUNTIME_OPTIMIZATIONS),,-frtti) \ $(CXXFLAGS) $(CXXFLAGS_CXX11) \ - $(ICU_UCHAR_TYPE) \ $(if $(filter LINUX,$(OS)),-fvisibility=hidden)' \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,harfbuzz)" \ MAKE=$(MAKE) \ && (cd $(EXTERNAL_WORKDIR)/src && $(MAKE) lib) \ ) diff --git a/external/harfbuzz/README b/external/harfbuzz/README index d2af8b559ad1..557c0a724ce8 100644 --- a/external/harfbuzz/README +++ b/external/harfbuzz/README @@ -1 +1,5 @@ -HarfBuzz is an OpenType text shaping engine. From [http://harfbuzz.org/]. +HarfBuzz is an OpenType text shaping engine. + +From [https://harfbuzz.github.io/]. + +Release archives at [https://github.com/harfbuzz/harfbuzz/releases]. diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk index adec72ed0d57..71627725fae7 100644 --- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk +++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk @@ -15,11 +15,8 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,harfbuzz)) $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0)) -# icu-65-api-macros-with-semicolon.patch.1 -# See http://site.icu-project.org/download/65 Migration Issues $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \ - external/harfbuzz/ubsan.patch \ - external/harfbuzz/icu-65-api-macros-with-semicolon.patch.1 \ + external/harfbuzz/tdf159529.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/harfbuzz/icu-65-api-macros-with-semicolon.patch.1 b/external/harfbuzz/icu-65-api-macros-with-semicolon.patch.1 deleted file mode 100644 index 55344bc632ba..000000000000 --- a/external/harfbuzz/icu-65-api-macros-with-semicolon.patch.1 +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur harfbuzz.org/src/hb-icu.cc harfbuzz/src/hb-icu.cc ---- harfbuzz.org/src/hb-icu.cc 2019-06-26 22:30:55.000000000 +0200 -+++ harfbuzz/src/hb-icu.cc 2019-10-28 23:21:42.198460246 +0100 -@@ -53,7 +53,7 @@ - - /* ICU doesn't do-while(0) around their statements. Ugh! - * https://unicode-org.atlassian.net/browse/CLDR-13027 */ --#define HB_ICU_STMT(S) do { S } while (0) -+#define HB_ICU_STMT(S) do { S; } while (0) - - hb_script_t - hb_icu_script_to_script (UScriptCode script) diff --git a/external/harfbuzz/tdf159529.patch.0 b/external/harfbuzz/tdf159529.patch.0 new file mode 100644 index 000000000000..d76313ce83be --- /dev/null +++ b/external/harfbuzz/tdf159529.patch.0 @@ -0,0 +1,28 @@ +--- ./src/hb-ot-font.cc 2023-11-11 09:08:45 ++++ ./src/hb-ot-font.cc 2024-02-20 18:53:55 +@@ -428,13 +428,23 @@ + const hb_ot_face_t *ot_face = ot_font->ot_face; + + #if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) +- if (ot_face->sbix->get_extents (font, glyph, extents)) return true; ++ /* tdf#159529 clear the hb_ot_face_t's data after fetching 'sbix' table ++ * The 'sbix' table can be very large for color emoji fonts so clear any ++ * cached data in hb_ot_face_t after fetching that table's extents. */ ++ bool sbixResult = ot_face->sbix->get_extents (font, glyph, extents); ++ const_cast<hb_ot_face_t*>(ot_face)->sbix.fini (); ++ if (sbixResult) return true; + if (ot_face->CBDT->get_extents (font, glyph, extents)) return true; + #endif + #if !defined(HB_NO_COLOR) && !defined(HB_NO_PAINT) + if (ot_face->COLR->get_extents (font, glyph, extents)) return true; + #endif +- if (ot_face->glyf->get_extents (font, glyph, extents)) return true; ++ /* tdf#159529 clear the hb_ot_face_t's data after fetching 'glyf' table ++ * The 'glyf' table can be very large for color emoji fonts so clear any ++ * cached data in hb_ot_face_t after fetching that table's extents. */ ++ bool glyfResult = ot_face->glyf->get_extents (font, glyph, extents); ++ const_cast<hb_ot_face_t*>(ot_face)->glyf.fini (); ++ if (glyfResult) return true; + #ifndef HB_NO_OT_FONT_CFF + if (ot_face->cff2->get_extents (font, glyph, extents)) return true; + if (ot_face->cff1->get_extents (font, glyph, extents)) return true; diff --git a/external/harfbuzz/ubsan.patch b/external/harfbuzz/ubsan.patch deleted file mode 100644 index a9d1b72ef1a2..000000000000 --- a/external/harfbuzz/ubsan.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- src/hb-ot-layout-gsubgpos.hh -+++ src/hb-ot-layout-gsubgpos.hh -@@ -387,7 +387,7 @@ - skip == matcher_t::SKIP_NO)) - { - num_items--; -- match_glyph_data++; -+ if (match_glyph_data != nullptr) match_glyph_data++; - return true; - } - -@@ -414,7 +414,7 @@ - skip == matcher_t::SKIP_NO)) - { - num_items--; -- match_glyph_data++; -+ if (match_glyph_data != nullptr) match_glyph_data++; - return true; - } - diff --git a/external/hsqldb/ExternalProject_hsqldb.mk b/external/hsqldb/ExternalProject_hsqldb.mk index 4d5f5f8786f0..4e5c750c7f3c 100644 --- a/external/hsqldb/ExternalProject_hsqldb.mk +++ b/external/hsqldb/ExternalProject_hsqldb.mk @@ -13,10 +13,17 @@ $(eval $(call gb_ExternalProject_register_targets,hsqldb,\ build \ )) +# ANT_OPTS -Djava.security.manager=allow allows latest Apache Ant 1.10.12 to still run under +# Java 18, where java.lang.System.setSecurityManager (as called from +# org.apache.tools.ant.types.Permissions.setSecurityManager) would otherwise throw an +# UnsupportedOperationException (see <https://openjdk.java.net/jeps/411> "Deprecate the Security +# Manager for Removal"): $(call gb_ExternalProject_get_state_target,hsqldb,build) : $(call gb_Trace_StartRange,hsqldb,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + $(if $(JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD), \ + ANT_OPTS="$$ANT_OPTS -Djava.security.manager=allow") \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build/build.xml \ diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk index cbba770f19a0..0b05b45ba3c3 100644 --- a/external/hsqldb/UnpackedTarball_hsqldb.mk +++ b/external/hsqldb/UnpackedTarball_hsqldb.mk @@ -25,10 +25,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\ external/hsqldb/patches/fdo36824.patch \ external/hsqldb/patches/limit_as_table_alias.patch \ external/hsqldb/patches/hsqldb-runFinalizersOnExit.patch \ - $(if $(HSQLDB_USE_JDBC_4_1),\ - external/hsqldb/patches/jdbc-4.1.patch \ - external/hsqldb/patches/multipleResultSets.patch \ - ) \ + external/hsqldb/patches/jdbc-4.1.patch \ + external/hsqldb/patches/multipleResultSets.patch \ + external/hsqldb/patches/disable-dump-script.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/hsqldb/patches/disable-dump-script.patch b/external/hsqldb/patches/disable-dump-script.patch new file mode 100644 index 000000000000..401dd38abc9a --- /dev/null +++ b/external/hsqldb/patches/disable-dump-script.patch @@ -0,0 +1,14 @@ +--- a/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 11:08:11.297243034 +0000 ++++ b/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 13:49:17.973089433 +0000 +@@ -403,6 +403,11 @@ + throw Trace.error(Trace.INVALID_IDENTIFIER); + } + ++ // added condition to avoid execution of spurious command in .script or .log file ++ if (session.isProcessingScript() || session.isProcessingLog()) { ++ return new Result(ResultConstants.UPDATECOUNT); ++ } ++ + dsw = new ScriptWriterText(database, token, true, true, true); + + dsw.writeAll(); diff --git a/external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch b/external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch new file mode 100644 index 000000000000..2e903a34e42a --- /dev/null +++ b/external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch @@ -0,0 +1,149 @@ +From b88f9ea57bdb9b219f3c1d2c67f4f882f1f23194 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= <nemeth@numbertext.org> +Date: Sun, 14 May 2023 22:15:15 +0200 +Subject: [PATCH] Keep only REP, ph: or 2-word dictionary phrase suggestions + +These are the best suggestions, no need to search other +ones to avoid annoying redundant and long list. + +For example to suggest only "a lot" to the bad form "alot", +add the 2-word phrase "a lot" to the dic file. + +Or for a very typical spelling mistake, enough to specify the +bad form with a ph: in the dictionary file to remove the other +suggestions. + +Note: partial revert of commit de9fe28008eb0761c33bd83847f282602c599fda +"fix up some warnings seen with -Wall -Wextra". +--- + src/hunspell/atypes.hxx | 1 + + src/hunspell/suggestmgr.cxx | 31 ++++++++++++++++++++++++++----- + src/hunspell/suggestmgr.hxx | 2 +- + tests/ph.sug | 4 ++-- + tests/rep.sug | 2 +- + 5 files changed, 31 insertions(+), 9 deletions(-) + +diff --git a/src/hunspell/atypes.hxx b/src/hunspell/atypes.hxx +index 7e5a5c0..6e3ed1b 100644 +--- a/src/hunspell/atypes.hxx ++++ b/src/hunspell/atypes.hxx +@@ -82,6 +82,7 @@ static inline void HUNSPELL_WARNING(FILE*, const char*, ...) {} + #define SPELL_ORIGCAP (1 << 5) + #define SPELL_WARN (1 << 6) + #define SPELL_COMPOUND_2 (1 << 7) // permit only 2 dictionary words in the compound ++#define SPELL_BEST_SUG (1 << 8) // limit suggestions for the best ones, i.e. ph: + + #define MINCPDLEN 3 + #define MAXCOMPOUND 10 +diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx +index 19a24f8..ba688aa 100644 +--- a/src/hunspell/suggestmgr.cxx ++++ b/src/hunspell/suggestmgr.cxx +@@ -242,8 +242,11 @@ bool SuggestMgr::suggest(std::vector<std::string>& slst, + if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) { + size_t i = slst.size(); + replchars(slst, word, cpdsuggest, info); +- if (slst.size() > i) ++ if (slst.size() > i) { + good_suggestion = true; ++ if (info & SPELL_BEST_SUG) ++ return true; ++ } + } + if (clock() > timelimit + TIMELIMIT_SUGGESTION) + return good_suggestion; +@@ -365,7 +368,10 @@ bool SuggestMgr::suggest(std::vector<std::string>& slst, + // we always suggest them, in despite of nosplitsugs, and + // drop compound word and other suggestions) + if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) { +- good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info); ++ good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info); ++ ++ if (info & SPELL_BEST_SUG) ++ return true; + } + if (clock() > timelimit + TIMELIMIT_SUGGESTION) + return good_suggestion; +@@ -506,15 +512,23 @@ int SuggestMgr::replchars(std::vector<std::string>& wlst, + candidate.assign(word, 0, r); + candidate.append(entry.outstrings[type]); + candidate.append(word, r + entry.pattern.size(), std::string::npos); ++ size_t sp = candidate.find(' '); ++ size_t oldns = wlst.size(); + testsug(wlst, candidate, cpdsuggest, NULL, NULL, info); ++ if (oldns < wlst.size()) { ++ int patlen = entry.pattern.size(); ++ int replen = entry.outstrings[type].size(); ++ // REP suggestions are the best, don't search other type of suggestions ++ info |= SPELL_BEST_SUG; ++ } ++ + // check REP suggestions with space +- size_t sp = candidate.find(' '); + if (sp != std::string::npos) { + size_t prev = 0; + while (sp != std::string::npos) { + std::string prev_chunk = candidate.substr(prev, sp - prev); + if (checkword(prev_chunk, 0, NULL, NULL)) { +- size_t oldns = wlst.size(); ++ oldns = wlst.size(); + std::string post_chunk = candidate.substr(sp + 1); + testsug(wlst, post_chunk, cpdsuggest, NULL, NULL, info); + if (oldns < wlst.size()) { +@@ -854,11 +868,15 @@ bool SuggestMgr::twowords(std::vector<std::string>& wlst, + // alot -> a lot, alto, slot... + *p = ' '; + if (!cpdsuggest && checkword(candidate, cpdsuggest, NULL, NULL)) { ++ // best solution ++ info |= SPELL_BEST_SUG; ++ + // remove not word pair suggestions + if (!good) { + good = true; + wlst.clear(); + } ++ + wlst.insert(wlst.begin(), candidate); + } + +@@ -867,6 +885,9 @@ bool SuggestMgr::twowords(std::vector<std::string>& wlst, + *p = '-'; + + if (!cpdsuggest && checkword(candidate, cpdsuggest, NULL, NULL)) { ++ // best solution ++ info |= SPELL_BEST_SUG; ++ + // remove not word pair suggestions + if (!good) { + good = true; +diff --git a/tests/ph.sug b/tests/ph.sug +index 8daee56..ccd936e 100644 +--- a/tests/ph.sug ++++ b/tests/ph.sug +@@ -1,11 +1,11 @@ + a lot +-in spite, inspire ++in spite + what + what + Wednesday + Wednesday + Wednesday + Wednesday +-which, witch, winch, wish ++which, witch + Oh, my gosh! + OH, MY GOSH! +diff --git a/tests/rep.sug b/tests/rep.sug +index b48a5b8..424731c 100644 +--- a/tests/rep.sug ++++ b/tests/rep.sug +@@ -5,4 +5,4 @@ a lot, lot + un alunno + bar + vinte e un +-auto's, auto ++auto's +-- +2.25.1 + diff --git a/external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch b/external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch new file mode 100644 index 000000000000..c0225fbd70a4 --- /dev/null +++ b/external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch @@ -0,0 +1,77 @@ +From e2fe9f86e1769b440972971240e9b8fb1cd53b97 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> +Date: Fri, 6 Jan 2023 16:20:45 +0000 +Subject: [PATCH] Resolves: rhbz#2158548 allow longer words for hunspell-ko +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://github.com/hunspell/hunspell/issues/903 + +A problem since the sanity check added in: + +commit 05e44e069e4cfaa9ce1264bf13f23fc9abd7ed05 +Author: Caolán McNamara <caolanm@redhat.com> +Date: Thu Sep 1 13:46:40 2022 +0100 + + Check word limit (#813) + + * check against hentry blen max +--- + src/hunspell/hashmgr.cxx | 6 +++--- + src/hunspell/htypes.hxx | 4 ++-- + tests/korean.dic | 3 ++- + 3 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx +index 100916d..14201e9 100644 +--- a/src/hunspell/hashmgr.cxx ++++ b/src/hunspell/hashmgr.cxx +@@ -209,7 +209,7 @@ int HashMgr::add_word(const std::string& in_word, + } + + // limit of hp->blen +- if (word->size() > std::numeric_limits<unsigned char>::max()) { ++ if (word->size() > std::numeric_limits<unsigned short>::max()) { + HUNSPELL_WARNING(stderr, "error: word len %ld is over max limit\n", word->size()); + delete desc_copy; + delete word_copy; +@@ -235,8 +235,8 @@ int HashMgr::add_word(const std::string& in_word, + + int i = hash(hpw, word->size()); + +- hp->blen = (unsigned char)word->size(); +- hp->clen = (unsigned char)wcl; ++ hp->blen = (unsigned short)word->size(); ++ hp->clen = (unsigned short)wcl; + hp->alen = (short)al; + hp->astr = aff; + hp->next = NULL; +diff --git a/src/hunspell/htypes.hxx b/src/hunspell/htypes.hxx +index 44366b1..2b896fb 100644 +--- a/src/hunspell/htypes.hxx ++++ b/src/hunspell/htypes.hxx +@@ -62,8 +62,8 @@ + #endif + + struct hentry { +- unsigned char blen; // word length in bytes +- unsigned char clen; // word length in characters (different for UTF-8 enc.) ++ unsigned short blen; // word length in bytes ++ unsigned short clen; // word length in characters (different for UTF-8 enc.) + short alen; // length of affix flag vector + unsigned short* astr; // affix flag vector + struct hentry* next; // next word with same hash code +diff --git a/tests/korean.dic b/tests/korean.dic +index 95cb450..d76ea05 100644 +--- a/tests/korean.dic ++++ b/tests/korean.dic +@@ -1,3 +1,4 @@ +-2 ++3 + 들어오세요 + 안녕하세요 ++김수한무거북이와두루미삼천갑자동방삭치치카포사리사리세ᅡ워리워리세브리캉무드셀ᅡ구름위허ᅵ케ᅵᆫᅦ담벼락서생원에ᄀ양 +-- +2.38.1 + diff --git a/external/hunspell/0001-fix-LibreOffice-build-problem-with-basic_string-appe.patch b/external/hunspell/0001-fix-LibreOffice-build-problem-with-basic_string-appe.patch new file mode 100644 index 000000000000..3c6f9831b2b4 --- /dev/null +++ b/external/hunspell/0001-fix-LibreOffice-build-problem-with-basic_string-appe.patch @@ -0,0 +1,84 @@ +From 1587ea4ab5e8d94c9c0d552f7ab61c217ebdcbeb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= <nemeth@numbertext.org> +Date: Fri, 30 Dec 2022 12:20:02 +0100 +Subject: [PATCH] fix LibreOffice build problem with basic_string::append() + +--- + src/hunspell/affentry.cxx | 6 +++--- + src/hunspell/affixmgr.cxx | 8 ++++---- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/hunspell/affentry.cxx b/src/hunspell/affentry.cxx +index 46e8b58..6ee23be 100644 +--- a/src/hunspell/affentry.cxx ++++ b/src/hunspell/affentry.cxx +@@ -290,7 +290,7 @@ struct hentry* PfxEntry::check_twosfx(const std::string& word, + // back any characters that would have been stripped + + std::string tmpword(strip); +- tmpword.append(word, start + appnd.size()); ++ tmpword.append(word, start + appnd.size(), tmpl); + + // now make sure all of the conditions on characters + // are met. Please see the appendix at the end of +@@ -338,7 +338,7 @@ std::string PfxEntry::check_twosfx_morph(const std::string& word, + // back any characters that would have been stripped + + std::string tmpword(strip); +- tmpword.append(word, start + appnd.size()); ++ tmpword.append(word, start + appnd.size(), tmpl); + + // now make sure all of the conditions on characters + // are met. Please see the appendix at the end of +@@ -386,7 +386,7 @@ std::string PfxEntry::check_morph(const std::string& word, + // back any characters that would have been stripped + + std::string tmpword(strip); +- tmpword.append(word, start + appnd.size()); ++ tmpword.append(word, start + appnd.size(), tmpl); + + // now make sure all of the conditions on characters + // are met. Please see the appendix at the end of +diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx +index 4d1ad2f..a8931c1 100644 +--- a/src/hunspell/affixmgr.cxx ++++ b/src/hunspell/affixmgr.cxx +@@ -2465,7 +2465,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + result.append(presult); + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + if (complexprefixes && HENTRY_DATA(rv)) + result.append(HENTRY_DATA2(rv)); + if (!HENTRY_FIND(rv, MORPH_STEM)) { +@@ -2522,7 +2522,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + result.append(presult); + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + + if (HENTRY_DATA(rv)) { + if (complexprefixes) +@@ -2573,7 +2573,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + if (!m.empty()) { + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + line_uniq_app(m, MSEP_REC); + result.append(m); + } +@@ -2665,7 +2665,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + if (!m.empty()) { + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + line_uniq_app(m, MSEP_REC); + result.push_back(MSEP_FLD); + result.append(m); +-- +2.17.1 + diff --git a/external/hunspell/0001-invalid-read-memory-access-624.patch b/external/hunspell/0001-invalid-read-memory-access-624.patch deleted file mode 100644 index 66b55e7555bd..000000000000 --- a/external/hunspell/0001-invalid-read-memory-access-624.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> -Date: Tue, 12 Nov 2019 20:03:15 +0000 -Subject: [PATCH] invalid read memory access #624 - ---- - src/hunspell/suggestmgr.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx -index dba084e..c23f165 100644 ---- a/src/hunspell/suggestmgr.cxx -+++ b/src/hunspell/suggestmgr.cxx -@@ -2040,7 +2040,7 @@ int SuggestMgr::leftcommonsubstring( - int l2 = su2.size(); - // decapitalize dictionary word - if (complexprefixes) { -- if (su1[l1 - 1] == su2[l2 - 1]) -+ if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1]) - return 1; - } else { - unsigned short idx = su2.empty() ? 0 : (su2[0].h << 8) + su2[0].l; --- -2.23.0 - diff --git a/external/hunspell/ExternalProject_hunspell.mk b/external/hunspell/ExternalProject_hunspell.mk index 43da1c254e34..47c4c736bd44 100644 --- a/external/hunspell/ExternalProject_hunspell.mk +++ b/external/hunspell/ExternalProject_hunspell.mk @@ -15,20 +15,22 @@ $(eval $(call gb_ExternalProject_register_targets,hunspell,\ hunspell_CPPCLAGS=$(CPPFLAGS) -ifneq (,$(filter ANDROID DRAGONFLY FREEBSD iOS LINUX NETBSD OPENBSD,$(OS))) -ifneq (,$(gb_ENABLE_DBGUTIL)) -hunspell_CPPFLAGS+=-D_GLIBCXX_DEBUG -endif -endif +hunspell_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG) + +hunspell_CXXFLAGS:=$(CXXFLAGS) $(gb_LTOFLAGS) \ + $(gb_EMSCRIPTEN_CPPFLAGS) \ + $(call gb_ExternalProject_get_build_flags,hunspell) + +hunspell_LDFLAGS:=$(gb_LTOFLAGS) $(call gb_ExternalProject_get_link_flags,hunspell) $(call gb_ExternalProject_get_state_target,hunspell,build): $(call gb_Trace_StartRange,hunspell,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --disable-shared --disable-nls --with-pic \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\ - $(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \ + $(gb_RUN_CONFIGURE) ./configure --disable-shared --disable-nls --with-pic \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \ - CXXFLAGS="$(CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS))" \ + $(if $(hunspell_CXXFLAGS),CXXFLAGS='$(hunspell_CXXFLAGS)') \ + $(if $(hunspell_LDFLAGS),LDFLAGS='$(hunspell_LDFLAGS)') \ && cd src/hunspell && $(MAKE) \ ) $(call gb_Trace_EndRange,hunspell,EXTERNAL) diff --git a/external/hunspell/StaticLibrary_hunspell.mk b/external/hunspell/StaticLibrary_hunspell.mk index 02d534f69169..3a2eccafb0aa 100644 --- a/external/hunspell/StaticLibrary_hunspell.mk +++ b/external/hunspell/StaticLibrary_hunspell.mk @@ -20,6 +20,12 @@ $(eval $(call gb_StaticLibrary_add_defs,hunspell,\ -DOPENOFFICEORG \ )) +ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE) +$(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\ + UnpackedTarball/hunspell/src/hunspell/hunspell \ +)) +endif + $(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\ UnpackedTarball/hunspell/src/hunspell/affentry \ UnpackedTarball/hunspell/src/hunspell/affixmgr \ @@ -30,7 +36,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\ UnpackedTarball/hunspell/src/hunspell/hunzip \ UnpackedTarball/hunspell/src/hunspell/filemgr \ UnpackedTarball/hunspell/src/hunspell/replist \ - UnpackedTarball/hunspell/src/hunspell/hunspell \ )) # vim: set noet sw=4 ts=4: diff --git a/external/hunspell/UnpackedTarball_hunspell.mk b/external/hunspell/UnpackedTarball_hunspell.mk index 1cd24e225868..0d5986798265 100644 --- a/external/hunspell/UnpackedTarball_hunspell.mk +++ b/external/hunspell/UnpackedTarball_hunspell.mk @@ -22,7 +22,11 @@ endif $(eval $(call gb_UnpackedTarball_set_patchlevel,hunspell,1)) $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \ - external/hunspell/0001-invalid-read-memory-access-624.patch \ + external/hunspell/0001-fix-LibreOffice-build-problem-with-basic_string-appe.patch \ + external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch \ + external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch \ + external/hunspell/bit_cast.patch.0 \ + external/hunspell/clock-monotonic.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/hunspell/bit_cast.patch.0 b/external/hunspell/bit_cast.patch.0 new file mode 100644 index 000000000000..777b9bbfdd8e --- /dev/null +++ b/external/hunspell/bit_cast.patch.0 @@ -0,0 +1,22 @@ +--- src/hunspell/w_char.hxx ++++ src/hunspell/w_char.hxx +@@ -42,9 +42,8 @@ + + #if __cplusplus >= 202002L + #include <bit> +-#else ++#endif + #include <cstring> +-#endif + + #ifndef GCC + struct w_char { +@@ -58,7 +57,7 @@ + { + #if defined(__i386__) || defined(_M_IX86) || defined(_M_X64) + //use little-endian optimized version +-#if __cplusplus >= 202002L ++#if __cplusplus >= 202002L && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L + return std::bit_cast<unsigned short>(*this); + #else + unsigned short u; diff --git a/external/hunspell/clock-monotonic.patch.1 b/external/hunspell/clock-monotonic.patch.1 new file mode 100644 index 000000000000..dd873f6c3908 --- /dev/null +++ b/external/hunspell/clock-monotonic.patch.1 @@ -0,0 +1,105 @@ +From 5737bdb3d7e5819528e33c360a73372e0e93a6be Mon Sep 17 00:00:00 2001 +From: Noel Grandin <noel.grandin@collabora.co.uk> +Date: Fri, 3 Nov 2023 12:04:30 +0000 +Subject: [PATCH] speed up hunspell inner loop + +which calls into the kernel to get elapsed time, instead of using the +VDSO-based CLOCK_MONOTONIC (or at least, the C++ equivalent of that), +which is much faster + +https://gerrit.libreoffice.org/c/core/+/158809 +--- + src/hunspell/affixmgr.cxx | 43 +++++++++++++++++++++++---------------- + 1 file changed, 25 insertions(+), 18 deletions(-) + +diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx +index 2cad09f..a3c93cd 100644 +--- a/src/hunspell/affixmgr.cxx ++++ b/src/hunspell/affixmgr.cxx +@@ -75,6 +75,7 @@ + #include <ctime> + + #include <algorithm> ++#include <chrono> + #include <memory> + #include <limits> + #include <string> +@@ -1590,17 +1591,20 @@ struct hentry* AffixMgr::compound_check(const std::string& word, + // add a time limit to handle possible + // combinatorical explosion of the overlapping words + +- HUNSPELL_THREAD_LOCAL clock_t timelimit; ++ HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start; ++ HUNSPELL_THREAD_LOCAL bool timelimit_exceeded; ++ ++ // get the current time ++ std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now(); + + if (wordnum == 0) { +- // get the start time, seeing as we're reusing this set to 0 +- // to flag timeout, use clock() + 1 to avoid start clock() +- // of 0 as being a timeout +- timelimit = clock() + 1; +- } +- else if (timelimit != 0 && (clock() > timelimit + TIMELIMIT)) { +- timelimit = 0; ++ // set the start time ++ clock_time_start = clock_now; ++ timelimit_exceeded = false; + } ++ else if (std::chrono::duration_cast<std::chrono::milliseconds>(clock_now - clock_time_start).count() ++ > TIMELIMIT * CLOCKS_PER_SEC * 1000) ++ timelimit_exceeded = true; + + setcminmax(&cmin, &cmax, word.c_str(), len); + +@@ -1626,7 +1630,7 @@ struct hentry* AffixMgr::compound_check(const std::string& word, + + do { // simplified checkcompoundpattern loop + +- if (timelimit == 0) ++ if (timelimit_exceeded) + return 0; + + if (scpd > 0) { +@@ -2216,17 +2220,20 @@ int AffixMgr::compound_check_morph(const std::string& word, + // add a time limit to handle possible + // combinatorical explosion of the overlapping words + +- HUNSPELL_THREAD_LOCAL clock_t timelimit; ++ HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start; ++ HUNSPELL_THREAD_LOCAL bool timelimit_exceeded; ++ ++ // get the current time ++ std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now(); + + if (wordnum == 0) { +- // get the start time, seeing as we're reusing this set to 0 +- // to flag timeout, use clock() + 1 to avoid start clock() +- // of 0 as being a timeout +- timelimit = clock() + 1; +- } +- else if (timelimit != 0 && (clock() > timelimit + TIMELIMIT)) { +- timelimit = 0; ++ // set the start time ++ clock_time_start = clock_now; ++ timelimit_exceeded = false; + } ++ else if (std::chrono::duration_cast<std::chrono::milliseconds>(clock_now - clock_time_start).count() ++ > TIMELIMIT * CLOCKS_PER_SEC * 1000) ++ timelimit_exceeded = true; + + setcminmax(&cmin, &cmax, word.c_str(), len); + +@@ -2246,7 +2253,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + + do { // onlycpdrule loop + +- if (timelimit == 0) ++ if (timelimit_exceeded) + return 0; + + oldnumsyllable = numsyllable; +-- +2.41.0 + diff --git a/external/hyphen/ExternalProject_hyphen.mk b/external/hyphen/ExternalProject_hyphen.mk index 21cef66d85d0..0d1a3e05271b 100644 --- a/external/hyphen/ExternalProject_hyphen.mk +++ b/external/hyphen/ExternalProject_hyphen.mk @@ -9,7 +9,9 @@ $(eval $(call gb_ExternalProject_ExternalProject,hyphen)) +ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE) $(eval $(call gb_ExternalProject_use_external,hyphen,hunspell)) +endif $(eval $(call gb_ExternalProject_register_targets,hyphen,\ build \ @@ -18,9 +20,12 @@ $(eval $(call gb_ExternalProject_register_targets,hyphen,\ $(call gb_ExternalProject_get_state_target,hyphen,build): $(call gb_Trace_StartRange,hyphen,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --disable-shared \ + $(gb_RUN_CONFIGURE) ./configure --disable-shared \ $(if $(filter-out iOS,$(OS)),--with-pic) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),gio_can_sniff=no) \ + CFLAGS=" $(CFLAGS) $(call gb_ExternalProject_get_build_flags,libgpg-error)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,hyphen)" \ && $(MAKE) \ ) $(call gb_Trace_EndRange,hyphen,EXTERNAL) diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk index 3ded08562211..cd4bc99ab1a3 100644 --- a/external/icu/ExternalProject_icu.mk +++ b/external/icu/ExternalProject_icu.mk @@ -20,14 +20,15 @@ ifeq ($(OS),WNT) $(call gb_ExternalProject_get_state_target,icu,build) : $(call gb_Trace_StartRange,icu,EXTERNAL) $(call gb_ExternalProject_run,build,\ - autoconf \ + $(WSL) autoconf -f \ && export LIB="$(ILIB)" PYTHONWARNINGS="default" \ gb_ICU_XFLAGS="-FS $(SOLARINC) $(gb_DEBUGINFO_FLAGS) $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD -Gy)" \ && CFLAGS="$${gb_ICU_XFLAGS}" CPPFLAGS="$(SOLARINC)" CXXFLAGS="$${gb_ICU_XFLAGS}" \ INSTALL=`cygpath -m /usr/bin/install` $(if $(MSVC_USE_DEBUG_RUNTIME),LDFLAGS="-DEBUG") \ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ $(if $(MSVC_USE_DEBUG_RUNTIME),--enable-debug --disable-release) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING), \ --with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source \ --disable-tools --disable-extras) \ && $(MAKE) $(if $(CROSS_COMPILING),DATASUBDIR=data) $(if $(verbose),VERBOSE=1) \ @@ -36,25 +37,24 @@ $(call gb_ExternalProject_get_state_target,icu,build) : else # $(OS) -icu_CFLAGS:=" \ +icu_CFLAGS:="$(CFLAGS) \ $(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \ $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \ - $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ + $(call gb_ExternalProject_get_build_flags,icu) \ $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \ $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \ - $(if $(call gb_Module__symbols_enabled,icu),$(gb_DEBUGINFO_FLAGS)) \ $(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \ $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)" icu_CXXFLAGS:="$(CXXFLAGS) $(CXXFLAGS_CXX11) \ $(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \ - $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ + $(call gb_ExternalProject_get_build_flags,icu) \ $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \ $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \ - $(if $(call gb_Module__symbols_enabled,icu),$(gb_DEBUGINFO_FLAGS)) \ $(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \ - $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer $(SOLARINC))" + $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer -I$(SRCDIR)/include)" icu_LDFLAGS:=" \ $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \ + $(call gb_ExternalProject_get_link_flags,icu) \ $(if $(filter TRUE,$(HAVE_LD_HASH_STYLE)),-Wl$(COMMA)--hash-style=$(WITH_LINKER_HASH_STYLE)) \ $(if $(SYSBASE),-L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)/usr/lib) \ $(if $(filter TRUE,$(HAVE_LD_BSYMBOLIC_FUNCTIONS)), -Wl$(COMMA)-Bsymbolic-functions) \ @@ -66,22 +66,23 @@ icu_LDFLAGS:=" \ $(call gb_ExternalProject_get_state_target,icu,build) : $(call gb_Trace_StartRange,icu,EXTERNAL) $(call gb_ExternalProject_run,build,\ - autoconf && \ + autoconf -f && \ CPPFLAGS=$(icu_CPPFLAGS) CFLAGS=$(icu_CFLAGS) \ CXXFLAGS=$(icu_CXXFLAGS) LDFLAGS=$(icu_LDFLAGS) \ PYTHONWARNINGS="default" \ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ --disable-layout --disable-samples \ $(if $(filter FUZZERS,$(BUILD_TYPE)),--disable-release) \ - $(if $(filter iOS ANDROID,$(OS)),--disable-dyload) \ - $(if $(filter ANDROID,$(OS)),--disable-strict ac_cv_c_bigendian=no) \ - $(if $(filter SOLARIS AIX,$(OS)),--disable-64bit-libs) \ + $(if $(filter EMSCRIPTEN ANDROID,$(OS)),--disable-strict ac_cv_c_bigendian=no) \ + $(if $(filter SOLARIS,$(OS)),--disable-64bit-libs) \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),\ --with-data-packaging=static --enable-static --disable-shared --disable-dyload,\ --disable-static --enable-shared $(if $(filter ANDROID,$(OS)),--with-library-suffix=lo)) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)\ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING), \ --with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source \ --disable-tools --disable-extras) \ + AR="$(AR)" RANLIB="$(RANLIB)" \ && $(MAKE) $(if $(CROSS_COMPILING),DATASUBDIR=data) $(if $(verbose),VERBOSE=1) \ $(if $(filter MACOSX,$(OS)), \ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl \ diff --git a/external/icu/README b/external/icu/README index 484de1f41536..23cf5f0524ae 100644 --- a/external/icu/README +++ b/external/icu/README @@ -1 +1 @@ -Library providing Unicode support, from [http://site.icu-project.org/]. +Library providing Unicode support, from [https://icu.unicode.org/]. diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk index 435382fa7988..019bec6546ce 100644 --- a/external/icu/UnpackedTarball_icu.mk +++ b/external/icu/UnpackedTarball_icu.mk @@ -23,7 +23,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,icu,0)) $(eval $(call gb_UnpackedTarball_add_patches,icu,\ external/icu/icu4c-build.patch.1 \ - external/icu/icu4c-aix.patch.1 \ external/icu/icu4c-warnings.patch.1 \ external/icu/icu4c-macosx.patch.1 \ external/icu/icu4c-solarisgcc.patch.1 \ @@ -33,14 +32,15 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\ external/icu/icu4c-rtti.patch.1 \ external/icu/icu4c-clang-cl.patch.1 \ external/icu/gcc9.patch \ - external/icu/c++20-comparison.patch \ - external/icu/ubsan.patch.1 \ + external/icu/c++20-comparison.patch.1 \ external/icu/Wdeprecated-copy-dtor.patch \ - external/icu/icu4c-khmerbreakengine.patch.1 \ - external/icu/strict_ansi.patch \ external/icu/icu4c-windows-cygwin-cross.patch.1 \ + external/icu/icu4c-emscripten-cross.patch.1 \ + external/icu/icu4c-use-pkgdata-single-ccode-file-mode.patch.1 \ + external/icu/icu4c-khmerbreakengine.patch.1 \ external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch.1 \ $(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \ + external/icu/no-python.patch \ )) $(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict)) diff --git a/external/icu/c++20-comparison.patch b/external/icu/c++20-comparison.patch deleted file mode 100644 index 44053e6719ca..000000000000 --- a/external/icu/c++20-comparison.patch +++ /dev/null @@ -1,171 +0,0 @@ ---- source/common/uvector.cpp -+++ source/common/uvector.cpp -@@ -110,7 +110,7 @@ - } - - // This only does something sensible if this object has a non-null comparer --UBool UVector::operator==(const UVector& other) { -+UBool UVector::operator==(const UVector& other) const { - int32_t i; - if (count != other.count) return FALSE; - if (comparer != NULL) { ---- source/common/uvector.h -+++ source/common/uvector.h -@@ -113,12 +113,12 @@ - * equal if they are of the same size and all elements are equal, - * as compared using this object's comparer. - */ -- UBool operator==(const UVector& other); -+ UBool operator==(const UVector& other) const; - - /** - * Equivalent to !operator==() - */ -- inline UBool operator!=(const UVector& other); -+ inline UBool operator!=(const UVector& other) const; - - //------------------------------------------------------------ - // java.util.Vector API -@@ -382,7 +382,7 @@ - return elementAt(index); - } - --inline UBool UVector::operator!=(const UVector& other) { -+inline UBool UVector::operator!=(const UVector& other) const { - return !operator==(other); - } - ---- source/i18n/tzrule.cpp -+++ source/i18n/tzrule.cpp -@@ -53,7 +53,7 @@ - return *this; - } - --UBool -+bool - TimeZoneRule::operator==(const TimeZoneRule& that) const { - return ((this == &that) || - (typeid(*this) == typeid(that) && -@@ -120,7 +120,7 @@ - return *this; - } - --UBool -+bool - InitialTimeZoneRule::operator==(const TimeZoneRule& that) const { - return ((this == &that) || - (typeid(*this) == typeid(that) && -@@ -226,7 +226,7 @@ - return *this; - } - --UBool -+bool - AnnualTimeZoneRule::operator==(const TimeZoneRule& that) const { - if (this == &that) { - return TRUE; -@@ -445,7 +445,7 @@ - return *this; - } - --UBool -+bool - TimeArrayTimeZoneRule::operator==(const TimeZoneRule& that) const { - if (this == &that) { - return TRUE; ---- source/i18n/unicode/rbtz.h -+++ source/i18n/unicode/rbtz.h -@@ -85,6 +85,7 @@ - * @stable ICU 3.8 - */ - virtual UBool operator!=(const TimeZone& that) const; -+ UBool operator!=(const RuleBasedTimeZone& that) const {return !operator==(that);} - - /** - * Adds the <code>TimeZoneRule</code> which represents time transitions. ---- source/i18n/unicode/simpletz.h -+++ source/i18n/unicode/simpletz.h -@@ -110,6 +110,7 @@ - * @stable ICU 2.0 - */ - virtual UBool operator==(const TimeZone& that) const; -+ UBool operator!=(const SimpleTimeZone& that) const {return !operator==(that);} - - /** - * Constructs a SimpleTimeZone with the given raw GMT offset and time zone ID, ---- source/i18n/unicode/smpdtfmt.h -+++ source/i18n/unicode/smpdtfmt.h -@@ -874,6 +874,7 @@ - * @stable ICU 2.0 - */ - virtual UBool operator==(const Format& other) const; -+ UBool operator!=(const SimpleDateFormat& that) const {return !operator==(that);} - - - using DateFormat::format; ---- source/i18n/unicode/stsearch.h -+++ source/i18n/unicode/stsearch.h -@@ -297,6 +297,7 @@ - * @stable ICU 2.0 - */ - virtual UBool operator==(const SearchIterator &that) const; -+ UBool operator!=(const StringSearch &that) const {return !operator==(that);} - - // public get and set methods ---------------------------------------- - ---- source/i18n/unicode/tzrule.h -+++ source/i18n/unicode/tzrule.h -@@ -54,7 +54,7 @@ - * @return true if the given <code>TimeZoneRule</code> objects are semantically equal. - * @stable ICU 3.8 - */ -- virtual UBool operator==(const TimeZoneRule& that) const; -+ virtual bool operator==(const TimeZoneRule& that) const; - - /** - * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects -@@ -245,7 +245,7 @@ - * @return true if the given <code>TimeZoneRule</code> objects are semantically equal. - * @stable ICU 3.8 - */ -- virtual UBool operator==(const TimeZoneRule& that) const; -+ virtual bool operator==(const TimeZoneRule& that) const; - - /** - * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects -@@ -255,6 +255,7 @@ - * @stable ICU 3.8 - */ - virtual UBool operator!=(const TimeZoneRule& that) const; -+ UBool operator!=(const InitialTimeZoneRule& that) const {return !operator==(that);} - - /** - * Gets the time when this rule takes effect in the given year. -@@ -456,7 +457,7 @@ - * @return true if the given <code>TimeZoneRule</code> objects are semantically equal. - * @stable ICU 3.8 - */ -- virtual UBool operator==(const TimeZoneRule& that) const; -+ virtual bool operator==(const TimeZoneRule& that) const; - - /** - * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects -@@ -672,7 +673,7 @@ - * @return true if the given <code>TimeZoneRule</code> objects are semantically equal. - * @stable ICU 3.8 - */ -- virtual UBool operator==(const TimeZoneRule& that) const; -+ virtual bool operator==(const TimeZoneRule& that) const; - - /** - * Return true if the given <code>TimeZoneRule</code> objects are semantically unequal. Objects ---- source/i18n/unicode/vtzone.h -+++ source/i18n/unicode/vtzone.h -@@ -81,6 +81,7 @@ - * @stable ICU 3.8 - */ - virtual UBool operator!=(const TimeZone& that) const; -+ UBool operator!=(const VTimeZone& that) const {return !operator==(that);} - - /** - * Create a <code>VTimeZone</code> instance by the time zone ID. diff --git a/external/icu/c++20-comparison.patch.1 b/external/icu/c++20-comparison.patch.1 new file mode 100644 index 000000000000..fa10b048ce41 --- /dev/null +++ b/external/icu/c++20-comparison.patch.1 @@ -0,0 +1,82 @@ +diff -ur icu.org/source/i18n/unicode/rbtz.h icu/source/i18n/unicode/rbtz.h +--- icu.org/source/i18n/unicode/rbtz.h 2022-10-19 02:53:21.000000000 +0200 ++++ icu/source/i18n/unicode/rbtz.h 2022-10-24 22:20:10.889969185 +0200 +@@ -87,6 +87,7 @@ + * @stable ICU 3.8 + */ + virtual bool operator!=(const TimeZone& that) const; ++ bool operator!=(const RuleBasedTimeZone& that) const {return !operator==(that);} + + /** + * Adds the `TimeZoneRule` which represents time transitions. +diff -ur icu.org/source/i18n/unicode/simpletz.h icu/source/i18n/unicode/simpletz.h +--- icu.org/source/i18n/unicode/simpletz.h 2022-10-19 02:53:21.000000000 +0200 ++++ icu/source/i18n/unicode/simpletz.h 2022-10-24 22:20:10.890969183 +0200 +@@ -112,6 +112,7 @@ + * @stable ICU 2.0 + */ + virtual bool operator==(const TimeZone& that) const override; ++ bool operator!=(const SimpleTimeZone& that) const {return !operator==(that);} + + /** + * Constructs a SimpleTimeZone with the given raw GMT offset and time zone ID, +diff -ur icu.org/source/i18n/unicode/smpdtfmt.h icu/source/i18n/unicode/smpdtfmt.h +--- icu.org/source/i18n/unicode/smpdtfmt.h 2022-10-19 02:53:21.000000000 +0200 ++++ icu/source/i18n/unicode/smpdtfmt.h 2022-10-24 22:20:10.891969181 +0200 +@@ -877,6 +877,7 @@ + * @stable ICU 2.0 + */ + virtual bool operator==(const Format& other) const override; ++ bool operator!=(const SimpleDateFormat& that) const {return !operator==(that);} + + + using DateFormat::format; +diff -ur icu.org/source/i18n/unicode/stsearch.h icu/source/i18n/unicode/stsearch.h +--- icu.org/source/i18n/unicode/stsearch.h 2022-10-19 02:53:21.000000000 +0200 ++++ icu/source/i18n/unicode/stsearch.h 2022-10-24 22:20:10.892969178 +0200 +@@ -298,6 +298,7 @@ + * @stable ICU 2.0 + */ + virtual bool operator==(const SearchIterator &that) const override; ++ bool operator!=(const StringSearch &that) const {return !operator==(that);} + + // public get and set methods ---------------------------------------- + +diff -ur icu.org/source/i18n/unicode/tzrule.h icu/source/i18n/unicode/tzrule.h +--- icu.org/source/i18n/unicode/tzrule.h 2022-10-19 02:53:21.000000000 +0200 ++++ icu/source/i18n/unicode/tzrule.h 2022-10-24 22:30:23.298744116 +0200 +@@ -257,6 +257,7 @@ + * @stable ICU 3.8 + */ + virtual bool operator!=(const TimeZoneRule& that) const override; ++ bool operator!=(const InitialTimeZoneRule& that) const {return !operator==(that);} + + /** + * Returns if this rule represents the same rule and offsets as another. +@@ -454,6 +455,7 @@ + * @stable ICU 3.8 + */ + virtual bool operator!=(const TimeZoneRule& that) const override; ++ bool operator!=(const AnnualTimeZoneRule& that) const {return !operator==(that);} + + /** + * Gets the start date/time rule used by this rule. +@@ -670,6 +672,7 @@ + * @stable ICU 3.8 + */ + virtual bool operator!=(const TimeZoneRule& that) const override; ++ bool operator!=(const TimeArrayTimeZoneRule& that) const {return !operator==(that);} + + /** + * Gets the time type of the start times used by this rule. The return value +diff -ur icu.org/source/i18n/unicode/vtzone.h icu/source/i18n/unicode/vtzone.h +--- icu.org/source/i18n/unicode/vtzone.h 2022-10-19 02:53:21.000000000 +0200 ++++ icu/source/i18n/unicode/vtzone.h 2022-10-24 22:20:10.895969172 +0200 +@@ -83,6 +83,7 @@ + * @stable ICU 3.8 + */ + virtual bool operator!=(const TimeZone& that) const; ++ bool operator!=(const VTimeZone& that) const {return !operator==(that);} + + /** + * Create a <code>VTimeZone</code> instance by the time zone ID. diff --git a/external/icu/icu4c-aix.patch.1 b/external/icu/icu4c-aix.patch.1 deleted file mode 100644 index 77982163b965..000000000000 --- a/external/icu/icu4c-aix.patch.1 +++ /dev/null @@ -1,143 +0,0 @@ -diff -ur icu.org/source/config/mh-aix-gcc icu/source/config/mh-aix-gcc ---- icu.org/source/config/mh-aix-gcc 2016-06-15 20:58:17.000000000 +0200 -+++ icu/source/config/mh-aix-gcc 2017-04-21 21:58:49.731432198 +0200 -@@ -18,84 +18,29 @@ - GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) - GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) - --## Commands to link --## We need to use the C++ linker, even when linking C programs, since --## our libraries contain C++ code (C++ static init not called) --LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) --LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -- --## Shared library options --LD_SOOPTIONS= -Wl,-bsymbolic -- --## Commands to make a shared library --SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS) --SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS) -- --## Compiler switch to embed a runtime search path --LD_RPATH= -I --LD_RPATH_PRE= -+## Flags for position independent code -+SHAREDLIBCFLAGS = -fPIC -+SHAREDLIBCXXFLAGS = -fPIC -+SHAREDLIBCPPFLAGS = -DPIC -+ -+## Additional flags when building libraries and with threads -+THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE -+LIBCPPFLAGS = - --## enable the shared lib loader --LDFLAGS += -Wl,-bbigtoc -+LD_RPATH= -+LD_RPATH_PRE= - - ## These are the library specific LDFLAGS - LDFLAGSICUDT=-nodefaultlibs -nostdlib - --## We need to delete things prior to linking, or else we'll get --## SEVERE ERROR: output file in use .. on AIX. --## But, shell script version should NOT delete target as we don't --## have $@ in that context. (SH = only shell script, icu-config) --AIX_PREDELETE=rm -f $@ ; --#SH# AIX_PREDELETE= -- - ## Environment variable to set a runtime search path - LDLIBRARYPATH_ENVVAR = LIBPATH - --## Override Versioned target for a shared library. --FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) --MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) --SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ))) --SHARED_OBJECT_NO_VERSION = $(basename $(SO_TARGET)).$(SOBJ) -- --# The following is for Makefile.inc's use. --ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) -- --# this one is for icudefs.mk's use --ifeq ($(ENABLE_SHARED),YES) --SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) --endif -- --## Compiler switch to embed a library name. Not present on AIX. --LD_SONAME = -- --## The type of assembly needed when pkgdata is used for generating shared libraries. --GENCCODE_ASSEMBLY=-a xlc -- - ## Shared object suffix --SOBJ= so --# without the -brtl option, the library names use .a. AIX is funny that way. --SO= a --A= a -+SO= so - - ## Non-shared intermediate object suffix --STATIC_O = o -- --## Special AIX rules -- --## Build archive from shared object --%.a : %.so -- ln -f $< $(SHARED_OBJECT_NO_VERSION) -- $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) -- rm -f $(SHARED_OBJECT_NO_VERSION) --$(LIBDIR)/%.a : %.so -- ln -f $< $(SHARED_OBJECT_NO_VERSION) -- $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) -- rm -f $(SHARED_OBJECT_NO_VERSION) -- --## Build import list from export list --%.e : %.exp -- @echo "Building an import list for $<" -- @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" -+STATIC_O = ao - - ## Compilation rules - %.$(STATIC_O): $(srcdir)/%.c -@@ -123,10 +68,10 @@ - [ -s $@ ] || rm -f $@' - - ## Versioned libraries rules --%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) -- $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ --%.$(SO): %$(SO_TARGET_VERSION).$(SO) -- $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ -+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) -+ $(RM) $@ && ln -s ${<F} $@ -+%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) -+ $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ - - - ## BIR - bind with internal references [so app data and icu data doesn't collide] -diff -ur icu.org/source/tools/pkgdata/pkgdata.cpp icu/source/tools/pkgdata/pkgdata.cpp ---- icu.org/source/tools/pkgdata/pkgdata.cpp 2017-03-21 02:03:49.000000000 +0100 -+++ icu/source/tools/pkgdata/pkgdata.cpp 2017-04-21 21:58:49.732432195 +0200 -@@ -934,7 +934,7 @@ - - uprv_strcat(pkgDataFlags[SO_EXT], "."); - uprv_strcat(pkgDataFlags[SO_EXT], pkgDataFlags[A_EXT]); --#elif U_PLATFORM == U_PF_OS400 || defined(_AIX) -+#elif U_PLATFORM == U_PF_OS400 - sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s%s%s", - libFileNames[LIB_FILE], - FILE_EXTENSION_SEP, -@@ -1407,15 +1407,6 @@ - pkgDataFlags[LDICUDTFLAGS], - targetDir, - libFileNames[LIB_FILE_CYGWIN_VERSION], --#elif U_PLATFORM == U_PF_AIX -- sprintf(cmd, "%s %s%s;%s %s -o %s%s %s %s%s %s %s", -- RM_CMD, -- targetDir, -- libFileNames[LIB_FILE_VERSION_TMP], -- pkgDataFlags[GENLIB], -- pkgDataFlags[LDICUDTFLAGS], -- targetDir, -- libFileNames[LIB_FILE_VERSION_TMP], - #else - sprintf(cmd, "%s %s -o %s%s %s %s%s %s %s", - pkgDataFlags[GENLIB], diff --git a/external/icu/icu4c-android.patch.1 b/external/icu/icu4c-android.patch.1 index 602d225d7812..9ba252b402d1 100644 --- a/external/icu/icu4c-android.patch.1 +++ b/external/icu/icu4c-android.patch.1 @@ -1,8 +1,8 @@ diff -ur icu.org/source/common/unicode/platform.h icu/source/common/unicode/platform.h ---- icu.org/source/common/unicode/platform.h 2019-10-03 13:16:41.000000000 +0200 -+++ icu/source/common/unicode/platform.h 2019-10-29 22:58:26.881221287 +0100 +--- icu.org/source/common/unicode/platform.h 2021-10-28 18:04:57.000000000 +0200 ++++ icu/source/common/unicode/platform.h 2021-11-15 21:03:11.474638494 +0100 @@ -818,7 +818,7 @@ - UPRV_HAS_DECLSPEC_ATTRIBUTE(dllimport)) + UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__)) # define U_EXPORT __declspec(dllexport) #elif defined(__GNUC__) -# define U_EXPORT __attribute__((visibility("default"))) @@ -11,8 +11,8 @@ diff -ur icu.org/source/common/unicode/platform.h icu/source/common/unicode/plat || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) # define U_EXPORT __global diff -ur icu.org/source/config/mh-linux icu/source/config/mh-linux ---- icu.org/source/config/mh-linux 2018-09-29 02:34:41.000000000 +0200 -+++ icu/source/config/mh-linux 2018-10-20 00:33:36.558130876 +0200 +--- icu.org/source/config/mh-linux 2021-11-15 20:56:39.460705065 +0100 ++++ icu/source/config/mh-linux 2021-11-15 21:03:11.474638494 +0100 @@ -27,7 +27,7 @@ ## Compiler switch to embed a library name @@ -23,9 +23,9 @@ diff -ur icu.org/source/config/mh-linux icu/source/config/mh-linux #SH# LD_SONAME= diff -ur icu.org/source/configure icu/source/configure ---- icu.org/source/configure 2018-10-02 00:39:56.000000000 +0200 -+++ icu/source/configure 2018-10-20 00:33:36.559130874 +0200 -@@ -5207,7 +5207,7 @@ +--- icu.org/source/configure 2021-11-15 20:56:39.875703936 +0100 ++++ icu/source/configure 2021-11-15 21:03:11.475638491 +0100 +@@ -5272,7 +5273,7 @@ else icu_cv_host_frag=mh-linux-va fi ;; @@ -34,7 +34,7 @@ diff -ur icu.org/source/configure icu/source/configure i[34567]86-*-cygwin) if test "$GCC" = yes; then icu_cv_host_frag=mh-cygwin -@@ -6400,6 +6400,10 @@ +@@ -6472,6 +6466,10 @@ # Check to see if genccode can generate simple assembly. GENCCODE_ASSEMBLY= case "${host}" in @@ -45,7 +45,7 @@ diff -ur icu.org/source/configure icu/source/configure *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu) if test "$GCC" = yes; then # We're using gcc, and the simple -a gcc command line works for genccode -@@ -7499,6 +7503,10 @@ +@@ -7594,6 +7592,10 @@ # wchar_t can be used CHECK_UTF16_STRING_RESULT="available" ;; @@ -57,8 +57,8 @@ diff -ur icu.org/source/configure icu/source/configure ;; esac diff -ur icu.org/source/i18n/decimfmt.cpp icu/source/i18n/decimfmt.cpp ---- icu.org/source/i18n/decimfmt.cpp 2018-10-02 00:39:56.000000000 +0200 -+++ icu/source/i18n/decimfmt.cpp 2018-10-20 00:33:36.560130873 +0200 +--- icu.org/source/i18n/decimfmt.cpp 2021-10-28 18:04:57.000000000 +0200 ++++ icu/source/i18n/decimfmt.cpp 2021-11-15 21:03:11.476638489 +0100 @@ -9,6 +9,13 @@ // Helpful in toString methods and elsewhere. #define UNISTR_FROM_STRING_EXPLICIT diff --git a/external/icu/icu4c-emscripten-cross.patch.1 b/external/icu/icu4c-emscripten-cross.patch.1 new file mode 100644 index 000000000000..84c88a68a87d --- /dev/null +++ b/external/icu/icu4c-emscripten-cross.patch.1 @@ -0,0 +1,99 @@ +--- icu/source/acinclude.m4.orig 2020-04-22 22:04:20.000000000 +0200 ++++ icu/source/acinclude.m4 2020-11-04 06:10:29.993070072 +0100 +@@ -84,6 +84,7 @@ + *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; + *-*-nto*) icu_cv_host_frag=mh-qnx ;; + *-ncr-*) icu_cv_host_frag=mh-mpras ;; ++wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;; + *) icu_cv_host_frag=mh-unknown ;; + esac + ] +--- /dev/null ++++ icu/source/config/mh-emscripten 2015-10-06 12:01:00.497972406 +0200 +@@ -0,0 +1,86 @@ ++## Emscripten-specific setup ++## Copyright (c) 1999-2013, International Business Machines Corporation and ++## others. All Rights Reserved. ++## Commands to generate dependency files ++GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) ++GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) ++ ++## Flags for position independent code ++SHAREDLIBCFLAGS = -fPIC ++SHAREDLIBCXXFLAGS = -fPIC ++SHAREDLIBCPPFLAGS = -DPIC ++ ++## Additional flags when building libraries and with threads ++THREADSCPPFLAGS = -D_REENTRANT ++LIBCPPFLAGS = ++ ++## Compiler switch to embed a runtime search path ++LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN ++LD_RPATH_PRE = -Wl,-rpath, ++ ++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH: ++ENABLE_RPATH=YES ++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN' ++ ++## These are the library specific LDFLAGS ++#LDFLAGSICUDT=-nodefaultlibs -nostdlib ++# Debian change: linking icudata as data only causes too many problems. ++LDFLAGSICUDT= ++ ++## Compiler switch to embed a library name ++# The initial tab in the next line is to prevent icu-config from reading it. ++ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) ++#SH# # We can't depend on MIDDLE_SO_TARGET being set. ++#SH# LD_SONAME= ++ ++## Shared library options ++LD_SOOPTIONS= -Wl,-Bsymbolic-functions ++ ++## Shared object suffix ++SO = so ++## Non-shared intermediate object suffix ++STATIC_O = o ++ ++## Compilation rules ++# WASM needs -pthread for atomics support ++%.$(STATIC_O): $(srcdir)/%.c ++ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<) ++ ++%.$(STATIC_O): $(srcdir)/%.cpp ++ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<) ++ ++ ++## Dependency rules ++%.d: $(srcdir)/%.c ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.c) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${<F} $@ ++%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) ++ $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ ++ ++## Bind internal references ++ ++# LDflags that pkgdata will use ++BIR_LDFLAGS= -Wl,-Bsymbolic ++ ++# Dependencies [i.e. map files] for the final library ++BIR_DEPS= ++ ++## Remove shared library 's' ++STATIC_PREFIX_WHEN_USED = ++STATIC_PREFIX = ++ ++## without assembly ++PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc -w diff --git a/external/icu/icu4c-khmerbreakengine.patch.1 b/external/icu/icu4c-khmerbreakengine.patch.1 index 272d0b8ab204..605914014e96 100644 --- a/external/icu/icu4c-khmerbreakengine.patch.1 +++ b/external/icu/icu4c-khmerbreakengine.patch.1 @@ -1,7 +1,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp ---- icu.org/source/common/dictbe.cpp 2020-04-22 22:04:20.000000000 +0200 -+++ icu/source/common/dictbe.cpp 2020-05-11 18:55:07.702282061 +0200 -@@ -32,7 +32,19 @@ +--- icu.org/source/common/dictbe.cpp 2023-06-14 06:23:55.000000000 +0900 ++++ icu/source/common/dictbe.cpp 2023-06-26 17:43:53.034173100 +0900 +@@ -35,7 +35,19 @@ ****************************************************************** */ @@ -13,16 +13,16 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp +DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes) + : fTypes(breakTypes), clusterLimit(3) { + UErrorCode status = U_ZERO_ERROR; -+ fViramaSet.applyPattern(UNICODE_STRING_SIMPLE("[[:ccc=VR:]]"), status); ++ fViramaSet.applyPattern(UnicodeString(u"[[:ccc=VR:]]"), status); + + // note Skip Sets contain fIgnoreSet characters too. -+ fSkipStartSet.applyPattern(UNICODE_STRING_SIMPLE("[[:lb=OP:][:lb=QU:]\\u200C\\u200D\\u2060]"), status); -+ fSkipEndSet.applyPattern(UNICODE_STRING_SIMPLE("[[:lb=CP:][:lb=QU:][:lb=EX:][:lb=CL:]\\u200C\\u200D\\u2060]"), status); -+ fNBeforeSet.applyPattern(UNICODE_STRING_SIMPLE("[[:lb=CR:][:lb=LF:][:lb=NL:][:lb=SP:][:lb=ZW:][:lb=IS:][:lb=BA:][:lb=NS:]]"), status); ++ fSkipStartSet.applyPattern(UnicodeString(u"[[:lb=OP:][:lb=QU:]\\u200C\\u200D\\u2060]"), status); ++ fSkipEndSet.applyPattern(UnicodeString(u"[[:lb=CP:][:lb=QU:][:lb=EX:][:lb=CL:]\\u200C\\u200D\\u2060]"), status); ++ fNBeforeSet.applyPattern(UnicodeString(u"[[:lb=CR:][:lb=LF:][:lb=NL:][:lb=SP:][:lb=ZW:][:lb=IS:][:lb=BA:][:lb=NS:]]"), status); } DictionaryBreakEngine::~DictionaryBreakEngine() { -@@ -79,6 +91,169 @@ +@@ -85,6 +97,169 @@ fSet.compact(); } @@ -192,7 +192,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp /* ****************************************************************** * PossibleWord -@@ -108,7 +283,7 @@ +@@ -114,7 +289,7 @@ ~PossibleWord() {} // Fill the list of candidates if needed, select the longest, and return the number found @@ -201,7 +201,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp // Select the currently marked candidate, point after it in the text, and invalidate self int32_t acceptMarked( UText *text ); -@@ -129,12 +304,12 @@ +@@ -135,12 +310,12 @@ }; @@ -211,12 +211,12 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp int32_t start = (int32_t)utext_getNativeIndex(text); if (start != offset) { offset = start; -- count = dict->matches(text, rangeEnd-start, UPRV_LENGTHOF(cuLengths), cuLengths, cpLengths, NULL, &prefix); -+ count = dict->matches(text, rangeEnd-start, UPRV_LENGTHOF(cuLengths), cuLengths, cpLengths, NULL, &prefix, ignoreSet, minLength); +- count = dict->matches(text, rangeEnd-start, UPRV_LENGTHOF(cuLengths), cuLengths, cpLengths, nullptr, &prefix); ++ count = dict->matches(text, rangeEnd-start, UPRV_LENGTHOF(cuLengths), cuLengths, cpLengths, nullptr, &prefix, ignoreSet, minLength); // Dictionary leaves text after longest prefix, not longest word. Back up. if (count <= 0) { utext_setNativeIndex(text, start); -@@ -815,53 +990,30 @@ +@@ -814,53 +989,30 @@ * KhmerBreakEngine */ @@ -243,17 +243,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp { UTRACE_ENTRY(UTRACE_UBRK_CREATE_BREAK_ENGINE); UTRACE_DATA1(UTRACE_INFO, "dictbe=%s", "Khmr"); -- fKhmerWordSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:LineBreak=SA:]]"), status); +- UnicodeSet khmerWordSet(UnicodeString(u"[[:Khmr:]&[:LineBreak=SA:]]"), status); + + clusterLimit = 3; + -+ fKhmerWordSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]\\u2060\\u200C\\u200D]"), status); ++ UnicodeSet khmerWordSet(UnicodeString(u"[[:Khmr:]\\u2060\\u200C\\u200D]"), status); if (U_SUCCESS(status)) { - setCharacters(fKhmerWordSet); + setCharacters(khmerWordSet); } - fMarkSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:LineBreak=SA:]&[:M:]]"), status); + fMarkSet.applyPattern(UnicodeString(u"[[:Khmr:]&[:LineBreak=SA:]&[:M:]]"), status); - fMarkSet.add(0x0020); -- fEndWordSet = fKhmerWordSet; +- fEndWordSet = khmerWordSet; - fBeginWordSet.add(0x1780, 0x17B3); - //fBeginWordSet.add(0x17A3, 0x17A4); // deprecated vowels - //fEndWordSet.remove(0x17A5, 0x17A9); // Khmer independent vowels that can't end a word @@ -268,8 +268,8 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp -// fSuffixSet.add(THAI_MAIYAMOK); + fIgnoreSet.add(0x2060); // WJ + fIgnoreSet.add(0x200C, 0x200D); // ZWJ, ZWNJ -+ fBaseSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:lb=SA:]&[:^M:]]"), status); -+ fPuncSet.applyPattern(UNICODE_STRING_SIMPLE("[\\u17D4\\u17D5\\u17D6\\u17D7\\u17D9:]"), status); ++ fBaseSet.applyPattern(UnicodeString(u"[[:Khmr:]&[:lb=SA:]&[:^M:]]"), status); ++ fPuncSet.applyPattern(UnicodeString(u"[\\u17D4\\u17D5\\u17D6\\u17D7\\u17D9:]"), status); // Compact for caching. fMarkSet.compact(); @@ -282,22 +282,13 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp UTRACE_EXIT_STATUS(status); } -@@ -874,180 +1026,204 @@ - int32_t rangeStart, - int32_t rangeEnd, - UVector32 &foundBreaks ) const { +@@ -876,175 +1028,205 @@ + UBool /* isPhraseBreaking */, + UErrorCode& status ) const { + if (U_FAILURE(status)) return 0; - if ((rangeEnd - rangeStart) < KHMER_MIN_WORD_SPAN) { - return 0; // Not enough characters for two words -- } -- -- uint32_t wordsFound = 0; -- int32_t cpWordLength = 0; -- int32_t cuWordLength = 0; -- int32_t current; + uint32_t wordsFound = foundBreaks.size(); - UErrorCode status = U_ZERO_ERROR; -- PossibleWord words[KHMER_LOOKAHEAD]; -- + int32_t before = 0; + int32_t after = 0; + int32_t finalBefore = 0; @@ -312,7 +303,14 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp + if (rangeStart > 0) { + --scanStart; + startZwsp = scanBeforeStart(text, scanStart, breakStart); -+ } + } + +- uint32_t wordsFound = 0; +- int32_t cpWordLength = 0; +- int32_t cuWordLength = 0; +- int32_t current; +- PossibleWord words[KHMER_LOOKAHEAD]; +- utext_setNativeIndex(text, rangeStart); + scanFwdClusters(text, rangeEnd, initAfter); + bool endZwsp = scanAfterEnd(text, utext_nativeLength(text), scanEnd, breakEnd); @@ -357,13 +355,9 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp - goto foundBest; - } - do { -- int32_t wordsMatched = 1; - if (words[(wordsFound + 1) % KHMER_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) { -- if (wordsMatched < 2) { -- // Followed by another dictionary word; mark first word as a good candidate -- words[wordsFound % KHMER_LOOKAHEAD].markCurrent(); -- wordsMatched = 2; -- } +- // Followed by another dictionary word; mark first word as a good candidate +- words[wordsFound % KHMER_LOOKAHEAD].markCurrent(); + utext_setNativeIndex(text, rangeStart); + int32_t numCodePts = rangeEnd - rangeStart; + // bestSnlp[i] is the snlp of the best segmentation of the first i @@ -566,7 +560,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp + t_boundary.addElement(i, status); + numBreaks++; } -+ U_ASSERT(prev.elementAti(t_boundary.elementAti(numBreaks - 1)) == 0); ++ // U_ASSERT(prev.elementAti(t_boundary.elementAti(numBreaks - 1)) == 0); + } - // Look ahead for possible suffixes if a dictionary word does not follow. @@ -632,16 +626,16 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp (void) foundBreaks.popi(); - wordsFound -= 1; } -- + - return wordsFound; + return foundBreaks.size() - wordsFound; } #if !UCONFIG_NO_NORMALIZATION diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h ---- icu.org/source/common/dictbe.h 2020-04-22 22:04:20.000000000 +0200 -+++ icu/source/common/dictbe.h 2020-05-11 19:08:24.754634732 +0200 -@@ -34,7 +34,8 @@ +--- icu.org/source/common/dictbe.h 2022-04-08 00:41:55.000000000 +0200 ++++ icu/source/common/dictbe.h 2022-05-16 13:49:33.820459894 +0200 +@@ -35,7 +35,8 @@ * threads without synchronization.</p> */ class DictionaryBreakEngine : public LanguageBreakEngine { @@ -651,7 +645,7 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h /** * The set of characters handled by this engine * @internal -@@ -42,14 +43,84 @@ +@@ -43,14 +44,84 @@ UnicodeSet fSet; @@ -737,28 +731,25 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h * <p>Virtual destructor.</p> */ virtual ~DictionaryBreakEngine(); -@@ -293,11 +364,13 @@ - */ - - UnicodeSet fKhmerWordSet; -- UnicodeSet fEndWordSet; -- UnicodeSet fBeginWordSet; -- UnicodeSet fMarkSet; -- DictionaryMatcher *fDictionary; -- -+ UnicodeSet fBeginWordSet; +@@ -305,10 +376,12 @@ + * @internal + */ + +- UnicodeSet fEndWordSet; + UnicodeSet fBeginWordSet; +- UnicodeSet fMarkSet; +- DictionaryMatcher *fDictionary; + UnicodeSet fPuncSet; + DictionaryMatcher *fDictionary; + + const uint32_t BADSNLP = 256 * 20; + const uint32_t kuint32max = 0x7FFFFFFF; -+ - public: - - /** + + public: + diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionarydata.cpp ---- icu.org/source/common/dictionarydata.cpp 2020-04-22 22:04:20.000000000 +0200 -+++ icu/source/common/dictionarydata.cpp 2020-05-11 18:50:43.703113749 +0200 +--- icu.org/source/common/dictionarydata.cpp 2023-06-14 06:23:55.000000000 +0900 ++++ icu/source/common/dictionarydata.cpp 2023-06-26 02:18:05.709454400 +0900 @@ -44,7 +44,7 @@ int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t limit, @@ -780,7 +771,7 @@ diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionaryda + continue; + } if (wordCount < limit) { - if (values != NULL) { + if (values != nullptr) { values[wordCount] = uct.getValue(); @@ -112,7 +118,7 @@ @@ -803,11 +794,12 @@ diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionaryda + continue; + } if (wordCount < limit) { - if (values != NULL) { + if (values != nullptr) { values[wordCount] = bt.getValue(); + diff -ur icu.org/source/common/dictionarydata.h icu/source/common/dictionarydata.h ---- icu.org/source/common/dictionarydata.h 2020-04-22 22:04:20.000000000 +0200 -+++ icu/source/common/dictionarydata.h 2020-05-11 18:50:43.704113746 +0200 +--- icu.org/source/common/dictionarydata.h 2023-06-14 06:23:55.000000000 +0900 ++++ icu/source/common/dictionarydata.h 2023-06-26 17:43:53.097724900 +0900 @@ -21,6 +21,7 @@ #include "unicode/utext.h" #include "unicode/udata.h" @@ -829,17 +821,17 @@ diff -ur icu.org/source/common/dictionarydata.h icu/source/common/dictionarydata virtual ~UCharsDictionaryMatcher(); virtual int32_t matches(UText *text, int32_t maxLength, int32_t limit, int32_t *lengths, int32_t *cpLengths, int32_t *values, -- int32_t *prefix) const; -+ int32_t *prefix, UnicodeSet const* ignoreSet = NULL, int32_t minLength = 0) const; - virtual int32_t getType() const; +- int32_t *prefix) const override; ++ int32_t *prefix, UnicodeSet const* ignoreSet = NULL, int32_t minLength = 0) const override; + virtual int32_t getType() const override; private: - const UChar *characters; + const char16_t *characters; @@ -125,7 +126,7 @@ virtual ~BytesDictionaryMatcher(); virtual int32_t matches(UText *text, int32_t maxLength, int32_t limit, int32_t *lengths, int32_t *cpLengths, int32_t *values, -- int32_t *prefix) const; -+ int32_t *prefix, UnicodeSet const* ignoreSet = NULL, int32_t minLength = 0) const; - virtual int32_t getType() const; +- int32_t *prefix) const override; ++ int32_t *prefix, UnicodeSet const* ignoreSet = NULL, int32_t minLength = 0) const override; + virtual int32_t getType() const override; private: UChar32 transform(UChar32 c) const; diff --git a/external/icu/icu4c-use-pkgdata-single-ccode-file-mode.patch.1 b/external/icu/icu4c-use-pkgdata-single-ccode-file-mode.patch.1 new file mode 100644 index 000000000000..237e554b8a4b --- /dev/null +++ b/external/icu/icu4c-use-pkgdata-single-ccode-file-mode.patch.1 @@ -0,0 +1,12 @@ +--- icu/source/tools/toolutil/pkg_genc.h.orig 2022-01-11 06:02:29.694678787 +0100 ++++ icu/source/tools/toolutil/pkg_genc.h 2022-01-11 06:02:41.602640965 +0100 +@@ -48,9 +48,7 @@ + * the data to generate the final data library. This can + * increase the performance of the pkdata tool. + */ +-#if U_PLATFORM == U_PF_OS400 + #define USE_SINGLE_CCODE_FILE +-#endif + + /* Need to fix the file seperator character when using MinGW. */ + #if defined(WINDOWS_WITH_GNUC) || defined(USING_CYGWIN) diff --git a/external/icu/no-python.patch b/external/icu/no-python.patch new file mode 100644 index 000000000000..33960fcae321 --- /dev/null +++ b/external/icu/no-python.patch @@ -0,0 +1,11 @@ +--- source/configure.ac ++++ source/configure.ac +@@ -202,7 +202,7 @@ + m4_ifndef([AX_CHECK_COMPILE_FLAG], [AC_MSG_ERROR(['autoconf-archive' is missing])]) + + # TODO(ICU-20301): Remove fallback to Python 2. +-AC_CHECK_PROGS(PYTHON, python3 "py -3" python "py") ++PYTHON= + AC_SUBST(PYTHON) + + # Check for the platform make diff --git a/external/icu/strict_ansi.patch b/external/icu/strict_ansi.patch deleted file mode 100644 index 972f0e65b1f1..000000000000 --- a/external/icu/strict_ansi.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- source/io/ufile.cpp -+++ source/io/ufile.cpp -@@ -21,12 +21,6 @@ - */ - - #include "unicode/platform.h" --#if defined(__GNUC__) && !defined(__clang__) && defined(__STRICT_ANSI__) --// g++, fileno isn't defined if __STRICT_ANSI__ is defined. --// clang fails to compile the <string> header unless __STRICT_ANSI__ is defined. --// __GNUC__ is set by both gcc and clang. --#undef __STRICT_ANSI__ --#endif - - #include "locmap.h" - #include "unicode/ustdio.h" diff --git a/external/icu/ubsan.patch.1 b/external/icu/ubsan.patch.1 deleted file mode 100644 index 1d7006347bd3..000000000000 --- a/external/icu/ubsan.patch.1 +++ /dev/null @@ -1,69 +0,0 @@ ---- a/source/common/rbbitblb.cpp -+++ a/source/common/rbbitblb.cpp -@@ -1402,12 +1402,13 @@ - U_ASSERT (sd->fAccepting <= 255); - U_ASSERT (sd->fLookAhead <= 255); - U_ASSERT (0 <= sd->fTagsIdx && sd->fTagsIdx <= 255); -- row->r8.fAccepting = sd->fAccepting; -- row->r8.fLookAhead = sd->fLookAhead; -- row->r8.fTagsIdx = sd->fTagsIdx; -+ RBBIStateTableRow8 *row8 = reinterpret_cast<RBBIStateTableRow8 *>(row); -+ row8->fAccepting = sd->fAccepting; -+ row8->fLookAhead = sd->fLookAhead; -+ row8->fTagsIdx = sd->fTagsIdx; - for (col=0; col<catCount; col++) { - U_ASSERT (sd->fDtran->elementAti(col) <= kMaxStateFor8BitsTable); -- row->r8.fNextState[col] = sd->fDtran->elementAti(col); -+ row8->fNextState[col] = sd->fDtran->elementAti(col); - } - } else { - U_ASSERT (sd->fAccepting <= 0xffff); -@@ -1603,12 +1603,13 @@ - UnicodeString *rowString = (UnicodeString *)fSafeTable->elementAt(state); - RBBIStateTableRow *row = (RBBIStateTableRow *)(table->fTableData + state*table->fRowLen); - if (use8BitsForSafeTable()) { -- row->r8.fAccepting = 0; -- row->r8.fLookAhead = 0; -- row->r8.fTagsIdx = 0; -+ RBBIStateTableRow8 *row8 = reinterpret_cast<RBBIStateTableRow8 *>(row); -+ row8->fAccepting = 0; -+ row8->fLookAhead = 0; -+ row8->fTagsIdx = 0; - for (col=0; col<catCount; col++) { - U_ASSERT(rowString->charAt(col) <= kMaxStateFor8BitsTable); -- row->r8.fNextState[col] = static_cast<uint8_t>(rowString->charAt(col)); -+ row8->fNextState[col] = static_cast<uint8_t>(rowString->charAt(col)); - } - } else { - row->r16.fAccepting = 0; -diff -ur icu.org/source/tools/genrb/rbutil.c icu/source/tools/genrb/rbutil.c ---- icu.org/source/tools/genrb/rbutil.c 2020-10-28 22:21:12.000000000 +0100 -+++ icu/source/tools/genrb/rbutil.c 2020-11-16 19:50:44.005119253 +0100 -@@ -30,7 +30,12 @@ - get_dirname(char *dirname, - const char *filename) - { -- const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR) + 1; -+ const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR); -+ if(lastSlash == NULL) { -+ lastSlash = filename; -+ } else { -+ ++lastSlash; -+ } - - if(lastSlash>filename) { - uprv_strncpy(dirname, filename, (lastSlash - filename)); -@@ -46,7 +51,12 @@ - const char *filename) - { - /* strip off any leading directory portions */ -- const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR) + 1; -+ const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR); -+ if(lastSlash == NULL) { -+ lastSlash = filename; -+ } else { -+ ++lastSlash; -+ } - char *lastDot; - - if(lastSlash>filename) { diff --git a/external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk b/external/java_websocket/ExternalPackage_java_websocket.mk index b9038cd1c961..2b3d1d87f3c0 100644 --- a/external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk +++ b/external/java_websocket/ExternalPackage_java_websocket.mk @@ -7,10 +7,10 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,owncloud_android_lib)) +$(eval $(call gb_ExternalPackage_ExternalPackage,java_websocket_project,java_websocket)) -$(eval $(call gb_UnpackedTarball_set_tarball,owncloud_android_lib,$(OWNCLOUD_ANDROID_LIB_TARBALL))) +$(eval $(call gb_ExternalPackage_use_external_project,java_websocket_project,java_websocket)) -$(eval $(call gb_UnpackedTarball_add_file,owncloud_android_lib,build.gradle,external/owncloud-android-lib/build.gradle)) +$(eval $(call gb_ExternalPackage_add_file,java_websocket_project,$(LIBO_SHARE_JAVA_FOLDER)/java_websocket.jar,dist/java_websocket.jar)) # vim: set noet sw=4 ts=4: diff --git a/external/java_websocket/ExternalProject_java_websocket.mk b/external/java_websocket/ExternalProject_java_websocket.mk new file mode 100644 index 000000000000..9d4a62d81183 --- /dev/null +++ b/external/java_websocket/ExternalProject_java_websocket.mk @@ -0,0 +1,31 @@ +# -*- 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_ExternalProject_ExternalProject,java_websocket)) + +$(eval $(call gb_ExternalProject_register_targets,java_websocket,\ + build \ +)) + +$(call gb_ExternalProject_get_state_target,java_websocket,build) : + $(call gb_Trace_StartRange,java_websocket,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + $(ICECREAM_RUN) "$(ANT)" \ + $(if $(verbose),-v,-q) \ + -f build.xml \ + -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ + -Dant.build.javac.source=$(JAVA_SOURCE_VER) \ + -Dant.build.javac.target=$(JAVA_TARGET_VER) \ + $(if $(debug),-Dbuild.debug="on") \ + jar \ + ) + $(call gb_Trace_EndRange,java_websocket,EXTERNAL) + +# vim: set noet sw=4 ts=4: diff --git a/external/apr/Makefile b/external/java_websocket/Makefile index e4968cf85fb6..e4968cf85fb6 100644 --- a/external/apr/Makefile +++ b/external/java_websocket/Makefile diff --git a/external/java_websocket/Module_java_websocket.mk b/external/java_websocket/Module_java_websocket.mk new file mode 100644 index 000000000000..3dcb12dde43e --- /dev/null +++ b/external/java_websocket/Module_java_websocket.mk @@ -0,0 +1,18 @@ +# -*- 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_Module_Module,java_websocket)) + +$(eval $(call gb_Module_add_targets,java_websocket,\ + ExternalPackage_java_websocket \ + ExternalProject_java_websocket \ + UnpackedTarball_java_websocket \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/java_websocket/README b/external/java_websocket/README new file mode 100644 index 000000000000..def0298a09cb --- /dev/null +++ b/external/java_websocket/README @@ -0,0 +1,3 @@ +Java WebSocket Implmentation from [https://github.com/TooTallNate/Java-WebSocket]. + +To send data over websockets, enabling uno over websockets. diff --git a/external/java_websocket/UnpackedTarball_java_websocket.mk b/external/java_websocket/UnpackedTarball_java_websocket.mk new file mode 100644 index 000000000000..c0794de9b4a6 --- /dev/null +++ b/external/java_websocket/UnpackedTarball_java_websocket.mk @@ -0,0 +1,31 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,java_websocket)) + +$(eval $(call gb_UnpackedTarball_set_tarball,java_websocket,$(JAVA_WEBSOCKET_TARBALL),,java_websocket)) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,java_websocket,1)) + +$(eval $(call gb_UnpackedTarball_add_patches,java_websocket,\ + external/java_websocket/patches/ant-build.patch \ + external/java_websocket/patches/no-slf4j.patch \ + external/java_websocket/patches/0001-cid-1546192-SIC-Inner-class-could-be-made-static.patch \ + external/java_websocket/patches/0001-cid-1545614-UR-Uninitialized-read-of-field-in-constr.patch \ + external/java_websocket/patches/0002-cid-1545284-UR-Uninitialized-read-of-field-in-constr.patch \ + external/java_websocket/patches/0001-cid-1546292-DLS-Dead-local-store.patch \ + external/java_websocket/patches/0001-cid-1545227-Dm-Dubious-method-used.patch \ + external/java_websocket/patches/0001-cid-1545515-Dm-Dubious-method-used.patch \ + external/java_websocket/patches/0001-cid-1546264-Dm-Dubious-method-used.patch \ + external/java_websocket/patches/0001-cid-1546341-Resource-leak-on-an-exceptional-path.patch \ + external/java_websocket/patches/0001-cid-1545249-Bad-bit-shift-operation.patch \ + external/java_websocket/patches/0001-cid-1546344-Dm-Dubious-method-used.patch \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/java_websocket/patches/0001-cid-1545227-Dm-Dubious-method-used.patch b/external/java_websocket/patches/0001-cid-1545227-Dm-Dubious-method-used.patch new file mode 100644 index 000000000000..162051aca26f --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1545227-Dm-Dubious-method-used.patch @@ -0,0 +1,55 @@ +From 695aacc67345bf1f9d311972f864751c135d4047 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 1 Oct 2023 19:42:26 +0100 +Subject: [PATCH] cid#1545227 Dm: Dubious method used + +and + +cid#1545310 Dm: Dubious method used +cid#1545513 Dm: Dubious method used +--- + src/main/java/org/java_websocket/drafts/Draft_6455.java | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/main/java/org/java_websocket/drafts/Draft_6455.java b/src/main/java/org/java_websocket/drafts/Draft_6455.java +index f9f960d..1e08448 100644 +--- a/src/main/java/org/java_websocket/drafts/Draft_6455.java ++++ b/src/main/java/org/java_websocket/drafts/Draft_6455.java +@@ -26,6 +26,7 @@ + package org.java_websocket.drafts; + + import java.math.BigInteger; ++import java.nio.charset.StandardCharsets; + import java.nio.ByteBuffer; + import java.security.MessageDigest; + import java.security.NoSuchAlgorithmException; +@@ -470,7 +471,7 @@ + if (log.isLoggable(Level.FINE)) { + log.fine("afterEnconding({}): {}" + " : " + framedata.getPayloadData().remaining() + " : " + + (framedata.getPayloadData().remaining() > 1000 ? "too big to display" +- : new String(framedata.getPayloadData().array()))); ++ : new String(framedata.getPayloadData().array(), StandardCharsets.US_ASCII))); + } + return createByteBufferFromFramedata(framedata); + } +@@ -590,7 +591,7 @@ + if (log.isLoggable(Level.FINE)) { + log.fine("afterDecoding({}): {}" + " : " + frame.getPayloadData().remaining() + " : " + + (frame.getPayloadData().remaining() > 1000 ? "too big to display" +- : new String(frame.getPayloadData().array()))); ++ : new String(frame.getPayloadData().array(), StandardCharsets.US_ASCII))); + } + frame.isValid(); + return frame; +@@ -838,7 +839,7 @@ + } catch (NoSuchAlgorithmException e) { + throw new IllegalStateException(e); + } +- return Base64.encodeBytes(sh1.digest(acc.getBytes())); ++ return Base64.encodeBytes(sh1.digest(acc.getBytes(StandardCharsets.US_ASCII))); + } + + private byte[] toByteArray(long val, int bytecount) { +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1545249-Bad-bit-shift-operation.patch b/external/java_websocket/patches/0001-cid-1545249-Bad-bit-shift-operation.patch new file mode 100644 index 000000000000..759038d8d331 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1545249-Bad-bit-shift-operation.patch @@ -0,0 +1,50 @@ +From 49a74350016b59c4cca054c5802b4437c0b3857f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Wed, 4 Oct 2023 15:19:13 +0100 +Subject: [PATCH] cid#1545249 Bad bit shift operation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.19 + +If the promoted type of the left-hand operand is int, only the five +lowest-order bits of the right-hand operand are used as the shift +distance. It is as if the right-hand operand were subjected to a bitwise +logical AND operator & (§15.22.1) with the mask value 0x1f (0b11111). +The shift distance actually used is therefore always in the range 0 to +31, inclusive. + +so a >>> of 32 is the same as >>> 0 so this is +result = 31 * result + (maxFrameSize ^ maxFrameSize); +i.e. +result = 31 * result + (0); + +which all looks a bit dubious. + +Working theory from https://gerrit.libreoffice.org/c/core/+/157571/1 is +that at some point maxFrameSize was a long value, and then got changed +to an int, but the hashCode() was not updated and should now read as +changed here. + + result = 31 * result + maxFrameSize; +--- + src/main/java/org/java_websocket/drafts/Draft_6455.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/org/java_websocket/drafts/Draft_6455.java b/src/main/java/org/java_websocket/drafts/Draft_6455.java +index 1e08448..635fa1f 100644 +--- a/src/main/java/org/java_websocket/drafts/Draft_6455.java ++++ b/src/main/java/org/java_websocket/drafts/Draft_6455.java +@@ -1150,7 +1150,7 @@ public class Draft_6455 extends Draft { + public int hashCode() { + int result = negotiatedExtension != null ? negotiatedExtension.hashCode() : 0; + result = 31 * result + (protocol != null ? protocol.hashCode() : 0); +- result = 31 * result + (maxFrameSize ^ (maxFrameSize >>> 32)); ++ result = 31 * result + maxFrameSize; + return result; + } + +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1545515-Dm-Dubious-method-used.patch b/external/java_websocket/patches/0001-cid-1545515-Dm-Dubious-method-used.patch new file mode 100644 index 000000000000..e56780600ad0 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1545515-Dm-Dubious-method-used.patch @@ -0,0 +1,42 @@ +From 695941c8da3e6cefa0553996773a8cf8673bb00e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 1 Oct 2023 19:50:02 +0100 +Subject: [PATCH] cid#1545515 Dm: Dubious method used + +--- + src/main/java/org/java_websocket/WebSocketImpl.java | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/main/java/org/java_websocket/WebSocketImpl.java b/src/main/java/org/java_websocket/WebSocketImpl.java +index 85fd413..926f330 100644 +--- a/src/main/java/org/java_websocket/WebSocketImpl.java ++++ b/src/main/java/org/java_websocket/WebSocketImpl.java +@@ -30,6 +30,7 @@ + import java.nio.ByteBuffer; + import java.nio.channels.ByteChannel; + import java.nio.channels.SelectionKey; ++import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.Collection; + import java.util.Collections; +@@ -227,7 +228,7 @@ + if (log.isLoggable(Level.FINE)) { + log.fine("process({}): ({})" + " : " + socketBuffer.remaining() + " : " + + (socketBuffer.remaining() > 1000 ? "too big to display" +- : new String(socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining()))); ++ : new String(socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining(), StandardCharsets.US_ASCII))); + } + if (readyState != ReadyState.NOT_YET_CONNECTED) { + if (readyState == ReadyState.OPEN) { +@@ -740,7 +741,7 @@ + + private void write(ByteBuffer buf) { + log.fine("write({}): {}" + " : " + buf.remaining() + " : " + +- (buf.remaining() > 1000 ? "too big to display" : new String(buf.array()))); ++ (buf.remaining() > 1000 ? "too big to display" : new String(buf.array(), StandardCharsets.US_ASCII))); + + outQueue.add(buf); + wsl.onWriteDemand(this); +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1545614-UR-Uninitialized-read-of-field-in-constr.patch b/external/java_websocket/patches/0001-cid-1545614-UR-Uninitialized-read-of-field-in-constr.patch new file mode 100644 index 000000000000..f23b3c532336 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1545614-UR-Uninitialized-read-of-field-in-constr.patch @@ -0,0 +1,26 @@ +From b6191d3422873648bebb322d85367647ae7d9dc0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 1 Oct 2023 19:28:15 +0100 +Subject: [PATCH 1/2] cid#1545614 UR: Uninitialized read of field in + constructor + +--- + src/main/java/org/java_websocket/WebSocketImpl.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/org/java_websocket/WebSocketImpl.java b/src/main/java/org/java_websocket/WebSocketImpl.java +index c2cd223..85fd413 100644 +--- a/src/main/java/org/java_websocket/WebSocketImpl.java ++++ b/src/main/java/org/java_websocket/WebSocketImpl.java +@@ -205,7 +205,7 @@ public class WebSocketImpl implements WebSocket { + */ + public WebSocketImpl(WebSocketListener listener, Draft draft) { + // socket can be null because we want do be able to create the object without already having a bound channel +- if (listener == null || (draft == null && role == Role.SERVER)) { ++ if (listener == null) { + throw new IllegalArgumentException("parameters must not be null"); + } + this.outQueue = new LinkedBlockingQueue<>(); +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1546192-SIC-Inner-class-could-be-made-static.patch b/external/java_websocket/patches/0001-cid-1546192-SIC-Inner-class-could-be-made-static.patch new file mode 100644 index 000000000000..ea7c56c03689 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1546192-SIC-Inner-class-could-be-made-static.patch @@ -0,0 +1,25 @@ +From 2fc9513baa5b6e1d9fd26edef5816e598805754c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sat, 30 Sep 2023 19:45:58 +0100 +Subject: [PATCH] cid#1546192 SIC: Inner class could be made static + +--- + src/main/java/org/java_websocket/drafts/Draft_6455.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/org/java_websocket/drafts/Draft_6455.java b/src/main/java/org/java_websocket/drafts/Draft_6455.java +index eb48799..f9f960d 100644 +--- a/src/main/java/org/java_websocket/drafts/Draft_6455.java ++++ b/src/main/java/org/java_websocket/drafts/Draft_6455.java +@@ -1192,7 +1192,7 @@ public class Draft_6455 extends Draft { + return totalSize; + } + +- private class TranslatedPayloadMetaData { ++ private static class TranslatedPayloadMetaData { + + private int payloadLength; + private int realPackageSize; +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1546264-Dm-Dubious-method-used.patch b/external/java_websocket/patches/0001-cid-1546264-Dm-Dubious-method-used.patch new file mode 100644 index 000000000000..22730e59f83a --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1546264-Dm-Dubious-method-used.patch @@ -0,0 +1,64 @@ +From 83e8f4ee244e2616032dc0b8b260fda30ca1105b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 1 Oct 2023 19:52:37 +0100 +Subject: [PATCH] cid#1546264 Dm: Dubious method used + +and + +cid#1546494 Dm: Dubious method used +--- + src/main/java/org/java_websocket/SSLSocketChannel2.java | 7 ++++--- + .../java/org/java_websocket/framing/FramedataImpl1.java | 3 ++- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/main/java/org/java_websocket/SSLSocketChannel2.java b/src/main/java/org/java_websocket/SSLSocketChannel2.java +index c0ea28e..2d3a279 100644 +--- a/src/main/java/org/java_websocket/SSLSocketChannel2.java ++++ b/src/main/java/org/java_websocket/SSLSocketChannel2.java +@@ -34,6 +34,7 @@ + import java.nio.channels.SelectableChannel; + import java.nio.channels.SelectionKey; + import java.nio.channels.SocketChannel; ++import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; +@@ -257,12 +258,12 @@ + } + } + if (inData.remaining() != 0 && log.isLoggable(Level.FINE)) { +- log.fine(new String(inData.array(), inData.position(), inData.remaining())); ++ log.fine(new String(inData.array(), inData.position(), inData.remaining(), StandardCharsets.US_ASCII)); + } + inData.rewind(); + inData.flip(); + if (inCrypt.remaining() != 0 && log.isLoggable(Level.FINE)) { +- log.fine(new String(inCrypt.array(), inCrypt.position(), inCrypt.remaining())); ++ log.fine(new String(inCrypt.array(), inCrypt.position(), inCrypt.remaining(), StandardCharsets.US_ASCII)); + } + inCrypt.rewind(); + inCrypt.flip(); +diff --git a/src/main/java/org/java_websocket/framing/FramedataImpl1.java b/src/main/java/org/java_websocket/framing/FramedataImpl1.java +index fc74f7a..6ff1af2 100644 +--- a/src/main/java/org/java_websocket/framing/FramedataImpl1.java ++++ b/src/main/java/org/java_websocket/framing/FramedataImpl1.java +@@ -26,6 +26,7 @@ + package org.java_websocket.framing; + + import java.nio.ByteBuffer; ++import java.nio.charset.StandardCharsets; + import org.java_websocket.enums.Opcode; + import org.java_websocket.exceptions.InvalidDataException; + import org.java_websocket.util.ByteBufferUtils; +@@ -162,7 +163,7 @@ public abstract class FramedataImpl1 implements Framedata { + + ", rsv2:" + isRSV2() + ", rsv3:" + isRSV3() + ", payload length:[pos:" + unmaskedpayload + .position() + ", len:" + unmaskedpayload.remaining() + "], payload:" + ( + unmaskedpayload.remaining() > 1000 ? "(too big to display)" +- : new String(unmaskedpayload.array())) + '}'; ++ : new String(unmaskedpayload.array(), StandardCharsets.US_ASCII)) + '}'; + } + + /** +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1546292-DLS-Dead-local-store.patch b/external/java_websocket/patches/0001-cid-1546292-DLS-Dead-local-store.patch new file mode 100644 index 000000000000..c1981de3f123 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1546292-DLS-Dead-local-store.patch @@ -0,0 +1,25 @@ +From 01a9d917f7f595a191f67a876ee67f3276dbf7cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 1 Oct 2023 19:39:22 +0100 +Subject: [PATCH] cid#1546292 DLS: Dead local store + +--- + .../permessage_deflate/PerMessageDeflateExtension.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/org/java_websocket/extensions/permessage_deflate/PerMessageDeflateExtension.java b/src/main/java/org/java_websocket/extensions/permessage_deflate/PerMessageDeflateExtension.java +index f24f9b6..9947da0 100644 +--- a/src/main/java/org/java_websocket/extensions/permessage_deflate/PerMessageDeflateExtension.java ++++ b/src/main/java/org/java_websocket/extensions/permessage_deflate/PerMessageDeflateExtension.java +@@ -304,7 +304,7 @@ public class PerMessageDeflateExtension extends CompressionExtension { + } + + // Holds parameters that are sent by the server, as a response to our initial extension request. +- Map<String, String> headers = extensionData.getExtensionParameters(); ++ // Map<String, String> headers = extensionData.getExtensionParameters(); + // After this point, parameters that the server sent back can be configured, but we don't use them for now. + return true; + } +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1546341-Resource-leak-on-an-exceptional-path.patch b/external/java_websocket/patches/0001-cid-1546341-Resource-leak-on-an-exceptional-path.patch new file mode 100644 index 000000000000..8c388f2ef287 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1546341-Resource-leak-on-an-exceptional-path.patch @@ -0,0 +1,40 @@ +From 77aac6a0be7a22dc63fd449a8292ff0b83dcb005 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Tue, 3 Oct 2023 11:06:35 +0100 +Subject: [PATCH] cid#1546341 Resource leak on an exceptional path + +--- + .../java_websocket/server/WebSocketServer.java | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/src/main/java/org/java_websocket/server/WebSocketServer.java b/src/main/java/org/java_websocket/server/WebSocketServer.java +index bb8178c..36e19a7 100644 +--- a/src/main/java/org/java_websocket/server/WebSocketServer.java ++++ b/src/main/java/org/java_websocket/server/WebSocketServer.java +@@ -473,10 +473,19 @@ public abstract class WebSocketServer extends AbstractWebSocket implements Runna + if (channel == null) { + return; + } +- channel.configureBlocking(false); +- Socket socket = channel.socket(); +- socket.setTcpNoDelay(isTcpNoDelay()); +- socket.setKeepAlive(true); ++ try { ++ channel.configureBlocking(false); ++ Socket socket = channel.socket(); ++ socket.setTcpNoDelay(isTcpNoDelay()); ++ socket.setKeepAlive(true); ++ } catch (IOException ex) { ++ try { ++ channel.close(); ++ } catch (IOException e) { ++ // there is nothing that must be done here ++ } ++ throw ex; ++ } + WebSocketImpl w = wsf.createWebSocket(this, drafts); + w.setSelectionKey(channel.register(selector, SelectionKey.OP_READ, w)); + try { +-- +2.41.0 + diff --git a/external/java_websocket/patches/0001-cid-1546344-Dm-Dubious-method-used.patch b/external/java_websocket/patches/0001-cid-1546344-Dm-Dubious-method-used.patch new file mode 100644 index 000000000000..0dff805889a5 --- /dev/null +++ b/external/java_websocket/patches/0001-cid-1546344-Dm-Dubious-method-used.patch @@ -0,0 +1,30 @@ +From f08918e466a99bdb7577fe4f91fa651d7c14fcb5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Wed, 4 Oct 2023 15:36:02 +0100 +Subject: [PATCH] cid#1546344 Dm: Dubious method used + +--- + src/main/java/org/java_websocket/util/Base64.java | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/src/main/java/org/java_websocket/util/Base64.java b/src/main/java/org/java_websocket/util/Base64.java +index e9ff7b8..da49ed5 100644 +--- a/src/main/java/org/java_websocket/util/Base64.java ++++ b/src/main/java/org/java_websocket/util/Base64.java +@@ -620,12 +620,7 @@ public class Base64 { + byte[] encoded = encodeBytesToBytes(source, off, len, options); + + // Return value according to relevant encoding. +- try { +- return new String(encoded, PREFERRED_ENCODING); +- } catch (java.io.UnsupportedEncodingException uue) { +- return new String(encoded); +- } // end catch +- ++ return new String(encoded, PREFERRED_ENCODING); + } // end encodeBytes + + /** +-- +2.41.0 + diff --git a/external/java_websocket/patches/0002-cid-1545284-UR-Uninitialized-read-of-field-in-constr.patch b/external/java_websocket/patches/0002-cid-1545284-UR-Uninitialized-read-of-field-in-constr.patch new file mode 100644 index 000000000000..61415c932e11 --- /dev/null +++ b/external/java_websocket/patches/0002-cid-1545284-UR-Uninitialized-read-of-field-in-constr.patch @@ -0,0 +1,26 @@ +From 04fa9cea4d9d14743ff54ad5faaf7e31f081bacb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 1 Oct 2023 19:29:27 +0100 +Subject: [PATCH 2/2] cid#1545284 UR: Uninitialized read of field in + constructor + +--- + src/main/java/org/java_websocket/SSLSocketChannel.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/main/java/org/java_websocket/SSLSocketChannel.java b/src/main/java/org/java_websocket/SSLSocketChannel.java +index b402450..760f643 100644 +--- a/src/main/java/org/java_websocket/SSLSocketChannel.java ++++ b/src/main/java/org/java_websocket/SSLSocketChannel.java +@@ -130,7 +130,7 @@ public class SSLSocketChannel implements WrappedByteChannel, ByteChannel, ISSLCh + + public SSLSocketChannel(SocketChannel inputSocketChannel, SSLEngine inputEngine, + ExecutorService inputExecutor, SelectionKey key) throws IOException { +- if (inputSocketChannel == null || inputEngine == null || executor == inputExecutor) { ++ if (inputSocketChannel == null || inputEngine == null || inputExecutor == null) { + throw new IllegalArgumentException("parameter must not be null"); + } + +-- +2.41.0 + diff --git a/external/java_websocket/patches/ant-build.patch b/external/java_websocket/patches/ant-build.patch new file mode 100644 index 000000000000..c2546bcc1f1e --- /dev/null +++ b/external/java_websocket/patches/ant-build.patch @@ -0,0 +1,27 @@ +--- /dev/null 1970-01-01 01:00:00.000000000 +0100 ++++ b/build.xml 2023-08-30 11:43:05.152647141 +0100 +@@ -0,0 +1,24 @@ ++<project default="all"> ++ <target name="all" depends="jar" /> ++ ++ <target name="compile"> ++ <mkdir dir="build/classes" /> ++ <javac includeantruntime="false" srcdir="src/main/java" ++ destdir="build/classes" encoding="UTF-8"> ++ <exclude name="**/PerMessageDeflateExtension.java"/> ++ </javac> ++ </target> ++ ++ <target name="jar" depends="compile"> ++ <mkdir dir="dist"/> ++ <jar destfile="dist/java_websocket.jar"> ++ <fileset dir="build/classes" includes="**/*.class" /> ++ </jar> ++ </target> ++ ++ <target name="clean"> ++ <delete dir="build" /> ++ <delete dir="dist" /> ++ </target> ++ ++</project> diff --git a/external/java_websocket/patches/no-slf4j.patch b/external/java_websocket/patches/no-slf4j.patch new file mode 100644 index 000000000000..27296071eff7 --- /dev/null +++ b/external/java_websocket/patches/no-slf4j.patch @@ -0,0 +1,748 @@ +diff -ru a/src/main/java/org/java_websocket/AbstractWebSocket.java b/src/main/java/org/java_websocket/AbstractWebSocket.java +--- a/src/main/java/org/java_websocket/AbstractWebSocket.java 2023-07-20 21:24:05.000000000 +0100 ++++ b/src/main/java/org/java_websocket/AbstractWebSocket.java 2023-08-30 12:06:11.004719499 +0100 +@@ -33,9 +33,7 @@ + import java.util.concurrent.TimeUnit; + import org.java_websocket.framing.CloseFrame; + import org.java_websocket.util.NamedThreadFactory; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; +- ++import java.util.logging.Logger; + + /** + * Base class for additional implementations for the server as well as the client +@@ -47,7 +45,7 @@ + * + * @since 1.4.0 + */ +- private final Logger log = LoggerFactory.getLogger(AbstractWebSocket.class); ++ private final Logger log = Logger.getLogger(AbstractWebSocket.class.getName()); + + /** + * Attribute which allows you to deactivate the Nagle's algorithm +@@ -118,12 +116,12 @@ + synchronized (syncConnectionLost) { + this.connectionLostTimeout = TimeUnit.SECONDS.toNanos(connectionLostTimeout); + if (this.connectionLostTimeout <= 0) { +- log.trace("Connection lost timer stopped"); ++ log.fine("Connection lost timer stopped"); + cancelConnectionLostTimer(); + return; + } + if (this.websocketRunning) { +- log.trace("Connection lost timer restarted"); ++ log.fine("Connection lost timer restarted"); + //Reset all the pings + try { + ArrayList<WebSocket> connections = new ArrayList<>(getConnections()); +@@ -135,7 +133,7 @@ + } + } + } catch (Exception e) { +- log.error("Exception during connection lost restart", e); ++ log.severe("Exception during connection lost restart" + " : " + e); + } + restartConnectionLostTimer(); + } +@@ -151,7 +149,7 @@ + synchronized (syncConnectionLost) { + if (connectionLostCheckerService != null || connectionLostCheckerFuture != null) { + this.websocketRunning = false; +- log.trace("Connection lost timer stopped"); ++ log.fine("Connection lost timer stopped"); + cancelConnectionLostTimer(); + } + } +@@ -165,10 +163,10 @@ + protected void startConnectionLostTimer() { + synchronized (syncConnectionLost) { + if (this.connectionLostTimeout <= 0) { +- log.trace("Connection lost timer deactivated"); ++ log.fine("Connection lost timer deactivated"); + return; + } +- log.trace("Connection lost timer started"); ++ log.fine("Connection lost timer started"); + this.websocketRunning = true; + restartConnectionLostTimer(); + } +@@ -228,14 +226,14 @@ + } + WebSocketImpl webSocketImpl = (WebSocketImpl) webSocket; + if (webSocketImpl.getLastPong() < minimumPongTime) { +- log.trace("Closing connection due to no pong received: {}", webSocketImpl); ++ log.fine("Closing connection due to no pong received: {}" + " : " + webSocketImpl); + webSocketImpl.closeConnection(CloseFrame.ABNORMAL_CLOSE, + "The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection"); + } else { + if (webSocketImpl.isOpen()) { + webSocketImpl.sendPing(); + } else { +- log.trace("Trying to ping a non open connection: {}", webSocketImpl); ++ log.fine("Trying to ping a non open connection: {}" + " : " + webSocketImpl); + } + } + } +diff -ru a/src/main/java/org/java_websocket/drafts/Draft_6455.java b/src/main/java/org/java_websocket/drafts/Draft_6455.java +--- a/src/main/java/org/java_websocket/drafts/Draft_6455.java 2023-07-20 21:24:05.000000000 +0100 ++++ b/src/main/java/org/java_websocket/drafts/Draft_6455.java 2023-08-30 12:16:03.534083539 +0100 +@@ -66,8 +66,8 @@ + import org.java_websocket.protocols.Protocol; + import org.java_websocket.util.Base64; + import org.java_websocket.util.Charsetfunctions; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * Implementation for the RFC 6455 websocket protocol This is the recommended class for your +@@ -110,7 +110,7 @@ + * + * @since 1.4.0 + */ +- private final Logger log = LoggerFactory.getLogger(Draft_6455.class); ++ private final Logger log = Logger.getLogger(Draft_6455.class.getName()); + + /** + * Attribute for the used extension in this draft +@@ -263,7 +263,7 @@ + throws InvalidHandshakeException { + int v = readVersion(handshakedata); + if (v != 13) { +- log.trace("acceptHandshakeAsServer - Wrong websocket version."); ++ log.fine("acceptHandshakeAsServer - Wrong websocket version."); + return HandshakeState.NOT_MATCHED; + } + HandshakeState extensionState = HandshakeState.NOT_MATCHED; +@@ -272,7 +272,7 @@ + if (knownExtension.acceptProvidedExtensionAsServer(requestedExtension)) { + negotiatedExtension = knownExtension; + extensionState = HandshakeState.MATCHED; +- log.trace("acceptHandshakeAsServer - Matching extension found: {}", negotiatedExtension); ++ log.fine("acceptHandshakeAsServer - Matching extension found: {}" + " : " + negotiatedExtension); + break; + } + } +@@ -281,7 +281,7 @@ + if (protocolState == HandshakeState.MATCHED && extensionState == HandshakeState.MATCHED) { + return HandshakeState.MATCHED; + } +- log.trace("acceptHandshakeAsServer - No matching extension or protocol found."); ++ log.fine("acceptHandshakeAsServer - No matching extension or protocol found."); + return HandshakeState.NOT_MATCHED; + } + +@@ -295,7 +295,7 @@ + for (IProtocol knownProtocol : knownProtocols) { + if (knownProtocol.acceptProvidedProtocol(requestedProtocol)) { + protocol = knownProtocol; +- log.trace("acceptHandshake - Matching protocol found: {}", protocol); ++ log.fine("acceptHandshake - Matching protocol found: {}" + " : " + protocol); + return HandshakeState.MATCHED; + } + } +@@ -306,12 +306,12 @@ + public HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response) + throws InvalidHandshakeException { + if (!basicAccept(response)) { +- log.trace("acceptHandshakeAsClient - Missing/wrong upgrade or connection in handshake."); ++ log.fine("acceptHandshakeAsClient - Missing/wrong upgrade or connection in handshake."); + return HandshakeState.NOT_MATCHED; + } + if (!request.hasFieldValue(SEC_WEB_SOCKET_KEY) || !response + .hasFieldValue(SEC_WEB_SOCKET_ACCEPT)) { +- log.trace("acceptHandshakeAsClient - Missing Sec-WebSocket-Key or Sec-WebSocket-Accept"); ++ log.fine("acceptHandshakeAsClient - Missing Sec-WebSocket-Key or Sec-WebSocket-Accept"); + return HandshakeState.NOT_MATCHED; + } + +@@ -320,7 +320,7 @@ + seckeyChallenge = generateFinalKey(seckeyChallenge); + + if (!seckeyChallenge.equals(seckeyAnswer)) { +- log.trace("acceptHandshakeAsClient - Wrong key for Sec-WebSocket-Key."); ++ log.fine("acceptHandshakeAsClient - Wrong key for Sec-WebSocket-Key."); + return HandshakeState.NOT_MATCHED; + } + HandshakeState extensionState = HandshakeState.NOT_MATCHED; +@@ -329,7 +329,7 @@ + if (knownExtension.acceptProvidedExtensionAsClient(requestedExtension)) { + negotiatedExtension = knownExtension; + extensionState = HandshakeState.MATCHED; +- log.trace("acceptHandshakeAsClient - Matching extension found: {}", negotiatedExtension); ++ log.fine("acceptHandshakeAsClient - Matching extension found: {}" + " : " + negotiatedExtension); + break; + } + } +@@ -338,7 +338,7 @@ + if (protocolState == HandshakeState.MATCHED && extensionState == HandshakeState.MATCHED) { + return HandshakeState.MATCHED; + } +- log.trace("acceptHandshakeAsClient - No matching extension or protocol found."); ++ log.fine("acceptHandshakeAsClient - No matching extension or protocol found."); + return HandshakeState.NOT_MATCHED; + } + +@@ -467,8 +467,8 @@ + @Override + public ByteBuffer createBinaryFrame(Framedata framedata) { + getExtension().encodeFrame(framedata); +- if (log.isTraceEnabled()) { +- log.trace("afterEnconding({}): {}", framedata.getPayloadData().remaining(), ++ if (log.isLoggable(Level.FINE)) { ++ log.fine("afterEnconding({}): {}" + " : " + framedata.getPayloadData().remaining() + " : " + + (framedata.getPayloadData().remaining() > 1000 ? "too big to display" + : new String(framedata.getPayloadData().array()))); + } +@@ -587,8 +587,8 @@ + } + currentDecodingExtension.isFrameValid(frame); + currentDecodingExtension.decodeFrame(frame); +- if (log.isTraceEnabled()) { +- log.trace("afterDecoding({}): {}", frame.getPayloadData().remaining(), ++ if (log.isLoggable(Level.FINE)) { ++ log.fine("afterDecoding({}): {}" + " : " + frame.getPayloadData().remaining() + " : " + + (frame.getPayloadData().remaining() > 1000 ? "too big to display" + : new String(frame.getPayloadData().array()))); + } +@@ -615,7 +615,7 @@ + int payloadlength = oldPayloadlength; + int realpacketsize = oldRealpacketsize; + if (optcode == Opcode.PING || optcode == Opcode.PONG || optcode == Opcode.CLOSING) { +- log.trace("Invalid frame: more than 125 octets"); ++ log.fine("Invalid frame: more than 125 octets"); + throw new InvalidFrameException("more than 125 octets"); + } + if (payloadlength == 126) { +@@ -647,15 +647,15 @@ + */ + private void translateSingleFrameCheckLengthLimit(long length) throws LimitExceededException { + if (length > Integer.MAX_VALUE) { +- log.trace("Limit exedeed: Payloadsize is to big..."); ++ log.fine("Limit exedeed: Payloadsize is to big..."); + throw new LimitExceededException("Payloadsize is to big..."); + } + if (length > maxFrameSize) { +- log.trace("Payload limit reached. Allowed: {} Current: {}", maxFrameSize, length); ++ log.fine("Payload limit reached. Allowed: {} Current: {}" + " : " + maxFrameSize + " : " + length); + throw new LimitExceededException("Payload limit reached.", maxFrameSize); + } + if (length < 0) { +- log.trace("Limit underflow: Payloadsize is to little..."); ++ log.fine("Limit underflow: Payloadsize is to little..."); + throw new LimitExceededException("Payloadsize is to little..."); + } + } +@@ -670,7 +670,7 @@ + private void translateSingleFrameCheckPacketSize(int maxpacketsize, int realpacketsize) + throws IncompleteException { + if (maxpacketsize < realpacketsize) { +- log.trace("Incomplete frame: maxpacketsize < realpacketsize"); ++ log.fine("Incomplete frame: maxpacketsize < realpacketsize"); + throw new IncompleteException(realpacketsize); + } + } +@@ -903,7 +903,7 @@ + } else if (!frame.isFin() || curop == Opcode.CONTINUOUS) { + processFrameContinuousAndNonFin(webSocketImpl, frame, curop); + } else if (currentContinuousFrame != null) { +- log.error("Protocol error: Continuous frame sequence not completed."); ++ log.severe("Protocol error: Continuous frame sequence not completed."); + throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR, + "Continuous frame sequence not completed."); + } else if (curop == Opcode.TEXT) { +@@ -911,7 +911,7 @@ + } else if (curop == Opcode.BINARY) { + processFrameBinary(webSocketImpl, frame); + } else { +- log.error("non control or continious frame expected"); ++ log.severe("non control or continious frame expected"); + throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR, + "non control or continious frame expected"); + } +@@ -932,13 +932,13 @@ + } else if (frame.isFin()) { + processFrameIsFin(webSocketImpl, frame); + } else if (currentContinuousFrame == null) { +- log.error("Protocol error: Continuous frame sequence was not started."); ++ log.severe("Protocol error: Continuous frame sequence was not started."); + throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR, + "Continuous frame sequence was not started."); + } + //Check if the whole payload is valid utf8, when the opcode indicates a text + if (curop == Opcode.TEXT && !Charsetfunctions.isValidUTF8(frame.getPayloadData())) { +- log.error("Protocol error: Payload is not UTF8"); ++ log.severe("Protocol error: Payload is not UTF8"); + throw new InvalidDataException(CloseFrame.NO_UTF8); + } + //Checking if the current continuous frame contains a correct payload with the other frames combined +@@ -969,7 +969,7 @@ + * @param e the runtime exception + */ + private void logRuntimeException(WebSocketImpl webSocketImpl, RuntimeException e) { +- log.error("Runtime exception during onWebsocketMessage", e); ++ log.severe("Runtime exception during onWebsocketMessage" + " : " + e); + webSocketImpl.getWebSocketListener().onWebsocketError(webSocketImpl, e); + } + +@@ -999,7 +999,7 @@ + private void processFrameIsFin(WebSocketImpl webSocketImpl, Framedata frame) + throws InvalidDataException { + if (currentContinuousFrame == null) { +- log.trace("Protocol error: Previous continuous frame sequence not completed."); ++ log.fine("Protocol error: Previous continuous frame sequence not completed."); + throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR, + "Continuous frame sequence was not started."); + } +@@ -1036,7 +1036,7 @@ + */ + private void processFrameIsNotFin(Framedata frame) throws InvalidDataException { + if (currentContinuousFrame != null) { +- log.trace("Protocol error: Previous continuous frame sequence not completed."); ++ log.fine("Protocol error: Previous continuous frame sequence not completed."); + throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR, + "Previous continuous frame sequence not completed."); + } +@@ -1102,7 +1102,7 @@ + long totalSize = getByteBufferListSize(); + if (totalSize > maxFrameSize) { + clearBufferList(); +- log.trace("Payload limit reached. Allowed: {} Current: {}", maxFrameSize, totalSize); ++ log.fine("Payload limit reached. Allowed: {} Current: {}" + " : " + maxFrameSize + " : " + totalSize); + throw new LimitExceededException(maxFrameSize); + } + } +diff -ru a/src/main/java/org/java_websocket/server/WebSocketServer.java b/src/main/java/org/java_websocket/server/WebSocketServer.java +--- a/src/main/java/org/java_websocket/server/WebSocketServer.java 2023-07-20 21:24:05.000000000 +0100 ++++ b/src/main/java/org/java_websocket/server/WebSocketServer.java 2023-08-30 12:06:46.372798355 +0100 +@@ -67,8 +67,7 @@ + import org.java_websocket.framing.Framedata; + import org.java_websocket.handshake.ClientHandshake; + import org.java_websocket.handshake.Handshakedata; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; ++import java.util.logging.Logger; + + /** + * <tt>WebSocketServer</tt> is an abstract class that only takes care of the +@@ -84,7 +83,7 @@ + * + * @since 1.4.0 + */ +- private final Logger log = LoggerFactory.getLogger(WebSocketServer.class); ++ private final Logger log = Logger.getLogger(WebSocketServer.class.getName()); + + /** + * Holds the list of active WebSocket connections. "Active" means WebSocket handshake is complete +@@ -611,7 +610,7 @@ + try { + selector.close(); + } catch (IOException e) { +- log.error("IOException during selector.close", e); ++ log.severe("IOException during selector.close" + " : " + e); + onError(null, e); + } + } +@@ -619,7 +618,7 @@ + try { + server.close(); + } catch (IOException e) { +- log.error("IOException during server.close", e); ++ log.severe("IOException during server.close" + " : " + e); + onError(null, e); + } + } +@@ -677,13 +676,13 @@ + } catch (IOException e) { + // there is nothing that must be done here + } +- log.trace("Connection closed because of exception", ex); ++ log.fine("Connection closed because of exception" + " : " + ex); + } + } + } + + private void handleFatal(WebSocket conn, Exception e) { +- log.error("Shutdown due to fatal error", e); ++ log.severe("Shutdown due to fatal error" + " : " + e); + onError(conn, e); + + String causeMessage = e.getCause() != null ? " caused by " + e.getCause().getClass().getName() : ""; +@@ -692,7 +691,7 @@ + stop(0, errorMessage); + } catch (InterruptedException e1) { + Thread.currentThread().interrupt(); +- log.error("Interrupt during stop", e); ++ log.severe("Interrupt during stop" + " : " + e); + onError(null, e1); + } + +@@ -760,8 +759,8 @@ + removed = this.connections.remove(ws); + } else { + //Don't throw an assert error if the ws is not in the list. e.g. when the other endpoint did not send any handshake. see #512 +- log.trace( +- "Removing connection which is not in the connections collection! Possible no handshake received! {}", ++ log.fine( ++ "Removing connection which is not in the connections collection! Possible no handshake received! {}" + " : " + + ws); + } + } +@@ -1065,7 +1064,7 @@ + setUncaughtExceptionHandler(new UncaughtExceptionHandler() { + @Override + public void uncaughtException(Thread t, Throwable e) { +- log.error("Uncaught exception in thread {}: {}", t.getName(), e); ++ log.severe("Uncaught exception in thread {}: {}" + " : " + t.getName() + " : " + e); + } + }); + } +@@ -1089,11 +1088,11 @@ + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } catch (VirtualMachineError | ThreadDeath | LinkageError e) { +- log.error("Got fatal error in worker thread {}", getName()); ++ log.severe("Got fatal error in worker thread {}" + " : " + getName()); + Exception exception = new Exception(e); + handleFatal(ws, exception); + } catch (Throwable e) { +- log.error("Uncaught exception in thread {}: {}", getName(), e); ++ log.severe("Uncaught exception in thread {}: {}" + " : " + getName() + " : " + e); + if (ws != null) { + Exception exception = new Exception(e); + onWebsocketError(ws, exception); +@@ -1113,7 +1112,7 @@ + try { + ws.decode(buf); + } catch (Exception e) { +- log.error("Error while reading from remote connection", e); ++ log.severe("Error while reading from remote connection" + " : " + e); + } finally { + pushBuffer(buf); + } +diff -ru a/src/main/java/org/java_websocket/SSLSocketChannel2.java b/src/main/java/org/java_websocket/SSLSocketChannel2.java +--- a/src/main/java/org/java_websocket/SSLSocketChannel2.java 2023-07-20 21:24:05.000000000 +0100 ++++ b/src/main/java/org/java_websocket/SSLSocketChannel2.java 2023-08-30 12:05:33.937636854 +0100 +@@ -47,8 +47,8 @@ + import javax.net.ssl.SSLException; + import javax.net.ssl.SSLSession; + import org.java_websocket.interfaces.ISSLChannel; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * Implements the relevant portions of the SocketChannel interface with the SSLEngine wrapper. +@@ -66,7 +66,7 @@ + * + * @since 1.4.0 + */ +- private final Logger log = LoggerFactory.getLogger(SSLSocketChannel2.class); ++ private final Logger log = Logger.getLogger(SSLSocketChannel2.class.getName()); + + protected ExecutorService exec; + +@@ -256,13 +256,13 @@ + inCrypt = ByteBuffer.allocate(netBufferMax); + } + } +- if (inData.remaining() != 0 && log.isTraceEnabled()) { +- log.trace(new String(inData.array(), inData.position(), inData.remaining())); ++ if (inData.remaining() != 0 && log.isLoggable(Level.FINE)) { ++ log.fine(new String(inData.array(), inData.position(), inData.remaining())); + } + inData.rewind(); + inData.flip(); +- if (inCrypt.remaining() != 0 && log.isTraceEnabled()) { +- log.trace(new String(inCrypt.array(), inCrypt.position(), inCrypt.remaining())); ++ if (inCrypt.remaining() != 0 && log.isLoggable(Level.FINE)) { ++ log.fine(new String(inCrypt.array(), inCrypt.position(), inCrypt.remaining())); + } + inCrypt.rewind(); + inCrypt.flip(); +@@ -498,4 +498,4 @@ + saveCryptData = null; + } + } +-} +\ No newline at end of file ++} +diff -ru a/src/main/java/org/java_websocket/SSLSocketChannel.java b/src/main/java/org/java_websocket/SSLSocketChannel.java +--- a/src/main/java/org/java_websocket/SSLSocketChannel.java 2023-07-20 21:24:05.000000000 +0100 ++++ b/src/main/java/org/java_websocket/SSLSocketChannel.java 2023-08-30 11:55:09.427244528 +0100 +@@ -39,8 +39,7 @@ + import javax.net.ssl.SSLSession; + import org.java_websocket.interfaces.ISSLChannel; + import org.java_websocket.util.ByteBufferUtils; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; ++import java.util.logging.Logger; + + + /** +@@ -70,7 +69,7 @@ + * + * @since 1.4.0 + */ +- private final Logger log = LoggerFactory.getLogger(SSLSocketChannel.class); ++ private final Logger log = Logger.getLogger(SSLSocketChannel.class.getName()); + + /** + * The underlying socket channel +@@ -148,7 +147,7 @@ + try { + socketChannel.close(); + } catch (IOException e) { +- log.error("Exception during the closing of the channel", e); ++ log.severe("Exception during the closing of the channel" + " : " + e); + } + } + } +@@ -176,7 +175,7 @@ + try { + result = engine.unwrap(peerNetData, peerAppData); + } catch (SSLException e) { +- log.error("SSLException during unwrap", e); ++ log.severe("SSLException during unwrap" + " : " + e); + throw e; + } + switch (result.getStatus()) { +@@ -490,7 +489,7 @@ + try { + engine.closeInbound(); + } catch (Exception e) { +- log.error( ++ log.severe( + "This engine was forced to close inbound, without having received the proper SSL/TLS close notification message from the peer, due to end of stream."); + } + closeConnection(); +@@ -536,4 +535,4 @@ + public SSLEngine getSSLEngine() { + return engine; + } +-} +\ No newline at end of file ++} +diff -ru a/src/main/java/org/java_websocket/WebSocketImpl.java b/src/main/java/org/java_websocket/WebSocketImpl.java +--- a/src/main/java/org/java_websocket/WebSocketImpl.java 2023-07-20 21:24:05.000000000 +0100 ++++ b/src/main/java/org/java_websocket/WebSocketImpl.java 2023-08-30 12:12:26.045577651 +0100 +@@ -61,8 +61,8 @@ + import org.java_websocket.protocols.IProtocol; + import org.java_websocket.server.WebSocketServer.WebSocketWorker; + import org.java_websocket.util.Charsetfunctions; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * Represents one end (client or server) of a single WebSocketImpl connection. Takes care of the +@@ -95,7 +95,7 @@ + * + * @since 1.4.0 + */ +- private final Logger log = LoggerFactory.getLogger(WebSocketImpl.class); ++ private final Logger log = Logger.getLogger(WebSocketImpl.class.getName()); + + /** + * Queue of buffers that need to be sent to the client. +@@ -224,8 +224,8 @@ + */ + public void decode(ByteBuffer socketBuffer) { + assert (socketBuffer.hasRemaining()); +- if (log.isTraceEnabled()) { +- log.trace("process({}): ({})", socketBuffer.remaining(), ++ if (log.isLoggable(Level.FINE)) { ++ log.fine("process({}): ({})" + " : " + socketBuffer.remaining() + " : " + + (socketBuffer.remaining() > 1000 ? "too big to display" + : new String(socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining()))); + } +@@ -280,7 +280,7 @@ + socketBuffer.reset(); + Handshakedata tmphandshake = d.translateHandshake(socketBuffer); + if (!(tmphandshake instanceof ClientHandshake)) { +- log.trace("Closing due to wrong handshake"); ++ log.fine("Closing due to wrong handshake"); + closeConnectionDueToWrongHandshake( + new InvalidDataException(CloseFrame.PROTOCOL_ERROR, "wrong http function")); + return false; +@@ -293,11 +293,11 @@ + try { + response = wsl.onWebsocketHandshakeReceivedAsServer(this, d, handshake); + } catch (InvalidDataException e) { +- log.trace("Closing due to wrong handshake. Possible handshake rejection", e); ++ log.fine("Closing due to wrong handshake. Possible handshake rejection" + " : " + e); + closeConnectionDueToWrongHandshake(e); + return false; + } catch (RuntimeException e) { +- log.error("Closing due to internal server error", e); ++ log.severe("Closing due to internal server error" + " : " + e); + wsl.onWebsocketError(this, e); + closeConnectionDueToInternalServerError(e); + return false; +@@ -313,7 +313,7 @@ + } + } + if (draft == null) { +- log.trace("Closing due to protocol error: no draft matches"); ++ log.fine("Closing due to protocol error: no draft matches"); + closeConnectionDueToWrongHandshake( + new InvalidDataException(CloseFrame.PROTOCOL_ERROR, "no draft matches")); + } +@@ -322,7 +322,7 @@ + // special case for multiple step handshakes + Handshakedata tmphandshake = draft.translateHandshake(socketBuffer); + if (!(tmphandshake instanceof ClientHandshake)) { +- log.trace("Closing due to protocol error: wrong http function"); ++ log.fine("Closing due to protocol error: wrong http function"); + flushAndClose(CloseFrame.PROTOCOL_ERROR, "wrong http function", false); + return false; + } +@@ -333,7 +333,7 @@ + open(handshake); + return true; + } else { +- log.trace("Closing due to protocol error: the handshake did finally not match"); ++ log.fine("Closing due to protocol error: the handshake did finally not match"); + close(CloseFrame.PROTOCOL_ERROR, "the handshake did finally not match"); + } + return false; +@@ -342,7 +342,7 @@ + draft.setParseMode(role); + Handshakedata tmphandshake = draft.translateHandshake(socketBuffer); + if (!(tmphandshake instanceof ServerHandshake)) { +- log.trace("Closing due to protocol error: wrong http function"); ++ log.fine("Closing due to protocol error: wrong http function"); + flushAndClose(CloseFrame.PROTOCOL_ERROR, "wrong http function", false); + return false; + } +@@ -352,11 +352,11 @@ + try { + wsl.onWebsocketHandshakeReceivedAsClient(this, handshakerequest, handshake); + } catch (InvalidDataException e) { +- log.trace("Closing due to invalid data exception. Possible handshake rejection", e); ++ log.fine("Closing due to invalid data exception. Possible handshake rejection" + " : " + e); + flushAndClose(e.getCloseCode(), e.getMessage(), false); + return false; + } catch (RuntimeException e) { +- log.error("Closing since client was never connected", e); ++ log.severe("Closing since client was never connected" + " : " + e); + wsl.onWebsocketError(this, e); + flushAndClose(CloseFrame.NEVER_CONNECTED, e.getMessage(), false); + return false; +@@ -364,12 +364,12 @@ + open(handshake); + return true; + } else { +- log.trace("Closing due to protocol error: draft {} refuses handshake", draft); ++ log.fine("Closing due to protocol error: draft {} refuses handshake" + " : " + draft); + close(CloseFrame.PROTOCOL_ERROR, "draft " + draft + " refuses handshake"); + } + } + } catch (InvalidHandshakeException e) { +- log.trace("Closing due to invalid handshake", e); ++ log.fine("Closing due to invalid handshake" + " : " + e); + close(e); + } + } catch (IncompleteHandshakeException e) { +@@ -398,24 +398,24 @@ + try { + frames = draft.translateFrame(socketBuffer); + for (Framedata f : frames) { +- log.trace("matched frame: {}", f); ++ log.fine("matched frame: {}" + " : " + f); + draft.processFrame(this, f); + } + } catch (LimitExceededException e) { + if (e.getLimit() == Integer.MAX_VALUE) { +- log.error("Closing due to invalid size of frame", e); ++ log.severe("Closing due to invalid size of frame" + " : " + e); + wsl.onWebsocketError(this, e); + } + close(e); + } catch (InvalidDataException e) { +- log.error("Closing due to invalid data in frame", e); ++ log.severe("Closing due to invalid data in frame" + " : " + e); + wsl.onWebsocketError(this, e); + close(e); + } catch (VirtualMachineError | ThreadDeath | LinkageError e) { +- log.error("Got fatal error during frame processing"); ++ log.severe("Got fatal error during frame processing"); + throw e; + } catch (Error e) { +- log.error("Closing web socket due to an error during frame processing"); ++ log.severe("Closing web socket due to an error during frame processing"); + Exception exception = new Exception(e); + wsl.onWebsocketError(this, exception); + String errorMessage = "Got error " + e.getClass().getName(); +@@ -491,7 +491,7 @@ + sendFrame(closeFrame); + } + } catch (InvalidDataException e) { +- log.error("generated frame is invalid", e); ++ log.severe("generated frame is invalid" + " : " + e); + wsl.onWebsocketError(this, e); + flushAndClose(CloseFrame.ABNORMAL_CLOSE, "generated frame is invalid", false); + } +@@ -551,9 +551,9 @@ + channel.close(); + } catch (IOException e) { + if (e.getMessage() != null && e.getMessage().equals("Broken pipe")) { +- log.trace("Caught IOException: Broken pipe during closeConnection()", e); ++ log.fine("Caught IOException: Broken pipe during closeConnection()" + " : " + e); + } else { +- log.error("Exception during channel.close()", e); ++ log.severe("Exception during channel.close()" + " : " + e); + wsl.onWebsocketError(this, e); + } + } +@@ -601,7 +601,7 @@ + try { + wsl.onWebsocketClosing(this, code, message, remote); + } catch (RuntimeException e) { +- log.error("Exception in onWebsocketClosing", e); ++ log.severe("Exception in onWebsocketClosing" + " : " + e); + wsl.onWebsocketError(this, e); + } + if (draft != null) { +@@ -678,7 +678,7 @@ + } + ArrayList<ByteBuffer> outgoingFrames = new ArrayList<>(); + for (Framedata f : frames) { +- log.trace("send frame: {}", f); ++ log.fine("send frame: {}" + " : " + f); + outgoingFrames.add(draft.createBinaryFrame(f)); + } + write(outgoingFrames); +@@ -729,7 +729,7 @@ + // Stop if the client code throws an exception + throw new InvalidHandshakeException("Handshake data rejected by client."); + } catch (RuntimeException e) { +- log.error("Exception in startHandshake", e); ++ log.severe("Exception in startHandshake" + " : " + e); + wsl.onWebsocketError(this, e); + throw new InvalidHandshakeException("rejected because of " + e); + } +@@ -739,8 +739,8 @@ + } + + private void write(ByteBuffer buf) { +- log.trace("write({}): {}", buf.remaining(), +- buf.remaining() > 1000 ? "too big to display" : new String(buf.array())); ++ log.fine("write({}): {}" + " : " + buf.remaining() + " : " + ++ (buf.remaining() > 1000 ? "too big to display" : new String(buf.array()))); + + outQueue.add(buf); + wsl.onWriteDemand(this); +@@ -760,7 +760,7 @@ + } + + private void open(Handshakedata d) { +- log.trace("open using draft: {}", draft); ++ log.fine("open using draft: {}" + " : " + draft); + readyState = ReadyState.OPEN; + updateLastPong(); + try { diff --git a/external/jfreereport/ExternalProject_jfreereport_flow_engine.mk b/external/jfreereport/ExternalProject_jfreereport_flow_engine.mk index 6a782b4dc4ff..a41206b506f0 100644 --- a/external/jfreereport/ExternalProject_jfreereport_flow_engine.mk +++ b/external/jfreereport/ExternalProject_jfreereport_flow_engine.mk @@ -20,14 +20,11 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_flow_engine,\ $(call gb_ExternalProject_get_state_target,jfreereport_flow_engine,build) : $(call gb_Trace_StartRange,jfreereport_flow_engine,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - $(if $(SYSTEM_APACHE_COMMONS),\ - -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR), \ - -Dcommons-logging.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-$(COMMONS_LOGGING_VERSION).jar") \ -Dlibbase.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libbase)/dist/libbase-$(LIBBASE_VERSION).jar \ -Dlibformula.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libformula)/dist/libformula-$(LIBFORMULA_VERSION).jar \ -Dliblayout.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_liblayout)/build/lib/liblayout.jar \ diff --git a/external/jfreereport/ExternalProject_jfreereport_flute.mk b/external/jfreereport/ExternalProject_jfreereport_flute.mk index 120c98cbdbb4..1a57167246c0 100644 --- a/external/jfreereport/ExternalProject_jfreereport_flute.mk +++ b/external/jfreereport/ExternalProject_jfreereport_flute.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_flute,\ $(call gb_ExternalProject_get_state_target,jfreereport_flute,build) : $(call gb_Trace_StartRange,jfreereport_flute,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_libbase.mk b/external/jfreereport/ExternalProject_jfreereport_libbase.mk index 6d97ffa5762a..864b13ed1519 100644 --- a/external/jfreereport/ExternalProject_jfreereport_libbase.mk +++ b/external/jfreereport/ExternalProject_jfreereport_libbase.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_libbase,\ $(call gb_ExternalProject_get_state_target,jfreereport_libbase,build) : $(call gb_Trace_StartRange,jfreereport_libbase,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_libfonts.mk b/external/jfreereport/ExternalProject_jfreereport_libfonts.mk index 9a6edf0b891f..6b7da7b5c52b 100644 --- a/external/jfreereport/ExternalProject_jfreereport_libfonts.mk +++ b/external/jfreereport/ExternalProject_jfreereport_libfonts.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_libfonts,\ $(call gb_ExternalProject_get_state_target,jfreereport_libfonts,build) : $(call gb_Trace_StartRange,jfreereport_libfonts,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_libformula.mk b/external/jfreereport/ExternalProject_jfreereport_libformula.mk index 1182873e66aa..5211d54fbca9 100644 --- a/external/jfreereport/ExternalProject_jfreereport_libformula.mk +++ b/external/jfreereport/ExternalProject_jfreereport_libformula.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_libformula,\ $(call gb_ExternalProject_get_state_target,jfreereport_libformula,build) : $(call gb_Trace_StartRange,jfreereport_libformula,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_liblayout.mk b/external/jfreereport/ExternalProject_jfreereport_liblayout.mk index fb3f2b9fc67a..0ea331570b77 100644 --- a/external/jfreereport/ExternalProject_jfreereport_liblayout.mk +++ b/external/jfreereport/ExternalProject_jfreereport_liblayout.mk @@ -9,10 +9,6 @@ $(eval $(call gb_ExternalProject_ExternalProject,jfreereport_liblayout)) -$(eval $(call gb_ExternalProject_use_externals,jfreereport_liblayout,\ - commons-logging \ -)) - $(eval $(call gb_ExternalProject_use_external_projects,jfreereport_liblayout,\ jfreereport_sac \ jfreereport_libbase \ @@ -32,14 +28,11 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_liblayout,\ $(call gb_ExternalProject_get_state_target,jfreereport_liblayout,build) : $(call gb_Trace_StartRange,jfreereport_liblayout,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - $(if $(SYSTEM_APACHE_COMMONS),\ - -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR), \ - -Dcommons-logging.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-$(COMMONS_LOGGING_VERSION).jar") \ -Dflute.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_flute)/dist/flute-$(FLUTE_VERSION).jar \ -Dlibbase.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libbase)/dist/libbase-$(LIBBASE_VERSION).jar \ -Dlibformula.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libformula)/dist/libformula-$(LIBFORMULA_VERSION).jar \ diff --git a/external/jfreereport/ExternalProject_jfreereport_libloader.mk b/external/jfreereport/ExternalProject_jfreereport_libloader.mk index ddb34e3d8614..5c5964b9e17a 100644 --- a/external/jfreereport/ExternalProject_jfreereport_libloader.mk +++ b/external/jfreereport/ExternalProject_jfreereport_libloader.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_libloader,\ $(call gb_ExternalProject_get_state_target,jfreereport_libloader,build) : $(call gb_Trace_StartRange,jfreereport_libloader,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_librepository.mk b/external/jfreereport/ExternalProject_jfreereport_librepository.mk index 59fa203fbe63..49d7e9497fb9 100644 --- a/external/jfreereport/ExternalProject_jfreereport_librepository.mk +++ b/external/jfreereport/ExternalProject_jfreereport_librepository.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_librepository,\ $(call gb_ExternalProject_get_state_target,jfreereport_librepository,build) : $(call gb_Trace_StartRange,jfreereport_librepository,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_libserializer.mk b/external/jfreereport/ExternalProject_jfreereport_libserializer.mk index 1226e14206d4..d0d37a59bded 100644 --- a/external/jfreereport/ExternalProject_jfreereport_libserializer.mk +++ b/external/jfreereport/ExternalProject_jfreereport_libserializer.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_libserializer,\ $(call gb_ExternalProject_get_state_target,jfreereport_libserializer,build) : $(call gb_Trace_StartRange,jfreereport_libserializer,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_libxml.mk b/external/jfreereport/ExternalProject_jfreereport_libxml.mk index 295573ec67ab..f79bf3731eac 100644 --- a/external/jfreereport/ExternalProject_jfreereport_libxml.mk +++ b/external/jfreereport/ExternalProject_jfreereport_libxml.mk @@ -19,7 +19,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_libxml,\ $(call gb_ExternalProject_get_state_target,jfreereport_libxml,build) : $(call gb_Trace_StartRange,jfreereport_libxml,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/ExternalProject_jfreereport_sac.mk b/external/jfreereport/ExternalProject_jfreereport_sac.mk index a33186183ee7..807f30e37ab5 100644 --- a/external/jfreereport/ExternalProject_jfreereport_sac.mk +++ b/external/jfreereport/ExternalProject_jfreereport_sac.mk @@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,jfreereport_sac,\ $(call gb_ExternalProject_get_state_target,jfreereport_sac,build) : $(call gb_Trace_StartRange,jfreereport_sac,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ + unset MSYS_NO_PATHCONV && JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ $(ICECREAM_RUN) "$(ANT)" \ $(if $(verbose),-v,-q) \ -f build.xml \ diff --git a/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk b/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk index e0d309ab2f30..42e90e1e0bb4 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_flow_engine.mk @@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_flow_engine,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_flow_engine,\ external/jfreereport/patches/flow-engine.patch \ external/jfreereport/patches/flow-engine_date_is_datetime.patch.1 \ + external/jfreereport/patches/pentaho-reporting-flow-engine-0.9.4-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libbase.mk b/external/jfreereport/UnpackedTarball_jfreereport_libbase.mk index c3ba35190ede..46bb438aa58a 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_libbase.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_libbase.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libbase,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libbase,\ external/jfreereport/patches/common_build.patch \ external/jfreereport/patches/libbase-$(LIBBASE_VERSION)-deprecated.patch \ + external/jfreereport/patches/libbase-1.1.3-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libfonts.mk b/external/jfreereport/UnpackedTarball_jfreereport_libfonts.mk index b648c58bbef8..c45958505e96 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_libfonts.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_libfonts.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libfonts,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libfonts,\ external/jfreereport/patches/common_build.patch \ external/jfreereport/patches/libfonts-$(LIBFONTS_VERSION)-deprecated.patch \ + external/jfreereport/patches/libfonts-1.1.3-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk b/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk index 59622966895a..13e8fcfaf640 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_libformula.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libformula,\ external/jfreereport/patches/libformula-seconds_rounding.patch.1 \ external/jfreereport/patches/libformula-minutes_truncation.patch.1 \ external/jfreereport/patches/libformula-datevalue_truncation.patch.1 \ + external/jfreereport/patches/libformula-1.1.3-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_liblayout.mk b/external/jfreereport/UnpackedTarball_jfreereport_liblayout.mk index 7281ba59b353..a2538c37820b 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_liblayout.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_liblayout.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_liblayout,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_liblayout,\ external/jfreereport/patches/liblayout.patch \ + external/jfreereport/patches/liblayout-0.2.10-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libloader.mk b/external/jfreereport/UnpackedTarball_jfreereport_libloader.mk index 7357ddd03ad9..6221dfa52b1b 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_libloader.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_libloader.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libloader,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libloader,\ external/jfreereport/patches/common_build.patch \ external/jfreereport/patches/libloader-$(LIBLOADER_VERSION)-deprecated.patch \ + external/jfreereport/patches/libloader-1.1.3-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_librepository.mk b/external/jfreereport/UnpackedTarball_jfreereport_librepository.mk index 86ff991b9f3e..e1db29d02b3e 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_librepository.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_librepository.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_librepository,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_librepository,\ external/jfreereport/patches/common_build.patch \ external/jfreereport/patches/librepository-$(LIBREPOSITORY_VERSION)-deprecated.patch \ + external/jfreereport/patches/librepository-1.1.3-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libserializer.mk b/external/jfreereport/UnpackedTarball_jfreereport_libserializer.mk index 22d6d0cb7a2a..fb6f3d60c8da 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_libserializer.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_libserializer.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libserializer,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libserializer,\ external/jfreereport/patches/common_build.patch \ + external/jfreereport/patches/libserializer-1.1.2-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/UnpackedTarball_jfreereport_libxml.mk b/external/jfreereport/UnpackedTarball_jfreereport_libxml.mk index ceca692adee2..7a920a873d4c 100644 --- a/external/jfreereport/UnpackedTarball_jfreereport_libxml.mk +++ b/external/jfreereport/UnpackedTarball_jfreereport_libxml.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libxml,\ $(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libxml,\ external/jfreereport/patches/common_build.patch \ + external/jfreereport/patches/libxml-1.1.3-remove-commons-logging.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/jfreereport/patches/flow-engine.patch b/external/jfreereport/patches/flow-engine.patch index 63f0dbda0e9f..5cf834994268 100644 --- a/external/jfreereport/patches/flow-engine.patch +++ b/external/jfreereport/patches/flow-engine.patch @@ -1,13 +1,12 @@ --- misc/flow-engine-0.9.4/build.xml (Revision 6728) +++ misc/build/flow-engine-0.9.4/build.xml (Arbeitskopie) -@@ -24,9 +24,13 @@ +@@ -24,9 +24,12 @@ <!-- Setup the compile classpath --> <path id="classpath"> - <fileset dir="lib"> - <include name="*.jar" /> - </fileset> -+ <pathelement path="${commons-logging.jar}"/> + <pathelement path="${libbase.jar}"/> + <pathelement path="${libformula.jar}"/> + <pathelement path="${liblayout.jar}"/> diff --git a/external/jfreereport/patches/libbase-1.1.3-remove-commons-logging.patch.1 b/external/jfreereport/patches/libbase-1.1.3-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..8d0df70a96df --- /dev/null +++ b/external/jfreereport/patches/libbase-1.1.3-remove-commons-logging.patch.1 @@ -0,0 +1,903 @@ +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/AbstractBoot.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/AbstractBoot.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/AbstractBoot.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/AbstractBoot.java 2021-02-23 12:11:46.680967049 +0000 +@@ -24,8 +24,7 @@ + import java.util.ArrayList; + import java.util.Enumeration; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.config.ExtendedConfiguration; + import org.pentaho.reporting.libraries.base.config.ExtendedConfigurationWrapper; +@@ -52,7 +51,7 @@ + /** + * The logger for this class. + */ +- private static final Log LOGGER = LogFactory.getLog(AbstractBoot.class); ++ private static final Logger LOGGER = Logger.getLogger(AbstractBoot.class.getName()); + + /** + * The configuration wrapper around the plain configuration. +@@ -163,7 +162,7 @@ + } + if (isBootFailed()) + { +- LOGGER.error(getClass() + " failed to boot: " + bootFailed.getMessage()); ++ LOGGER.severe(getClass() + " failed to boot: " + bootFailed.getMessage()); + } + while (isBootInProgress()) + { +@@ -206,7 +205,7 @@ + } + catch (Exception e) + { +- LOGGER.error(getClass() + " failed to boot: ", e); ++ LOGGER.severe(getClass() + " failed to boot: " + e); + this.bootFailed = e; + } + finally +@@ -265,8 +264,8 @@ + if (boot.isBootFailed()) + { + this.bootFailed = boot.getBootFailureReason(); +- LOGGER.error("Dependent project failed to boot up: " + +- projectInformation.getBootClass() + " failed to boot: ", this.bootFailed); ++ LOGGER.severe("Dependent project failed to boot up: " + ++ projectInformation.getBootClass() + " failed to boot: " + this.bootFailed); + return; + } + } +@@ -419,7 +418,7 @@ + } + catch (IOException ioe) + { +- LOGGER.warn("Failed to load the user configuration at " + url, ioe); ++ LOGGER.warning("Failed to load the user configuration at " + url + " : " + ioe); + } + } + +@@ -431,7 +430,7 @@ + } + catch (IOException e) + { +- LOGGER.warn("Failed to lookup the user configurations.", e); ++ LOGGER.warning("Failed to lookup the user configurations: " + e); + } + } + if (addSysProps) +@@ -455,4 +454,4 @@ + } + return extWrapper; + } +-} +\ No newline at end of file ++} +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/PackageManager.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/PackageManager.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/PackageManager.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/PackageManager.java 2021-02-23 12:18:45.836952221 +0000 +@@ -23,8 +23,8 @@ + import java.util.HashMap; + import java.util.Iterator; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.config.PropertyFileConfiguration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; +@@ -63,7 +63,7 @@ + } + } + +- private static final Log LOGGER = LogFactory.getLog(PackageManager.class); ++ private static final Logger LOGGER = Logger.getLogger(PackageManager.class.getName()); + + /** + * An internal constant declaring that the specified module was already loaded. +@@ -201,7 +201,7 @@ + } + } + } +- LOGGER.debug("Loaded a total of " + count + " modules under prefix: " + modulePrefix); ++ LOGGER.config("Loaded a total of " + count + " modules under prefix: " + modulePrefix); + } + + /** +@@ -224,9 +224,9 @@ + + if (mod.configure(this.booter)) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { +- LOGGER.debug("Conf: " + ++ LOGGER.config("Conf: " + + new PadMessage(mod.getModule().getModuleClass(), 70) + + " [" + mod.getModule().getSubSystem() + ']'); + } +@@ -244,9 +244,9 @@ + + if (mod.initialize(this.booter)) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { +- LOGGER.debug("Init: " + ++ LOGGER.config("Init: " + + new PadMessage(mod.getModule().getModuleClass(), 70) + + " [" + mod.getModule().getSubSystem() + ']'); + } +@@ -271,12 +271,12 @@ + final PackageState dependentState = (PackageState) modulesByClass.get(key); + if (dependentState == null) + { +- LOGGER.warn("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not found."); ++ LOGGER.warning("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not found."); + return false; + } + if (dependentState.getState() != PackageState.STATE_CONFIGURED) + { +- LOGGER.warn("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not configured."); ++ LOGGER.warning("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not configured."); + return false; + } + } +@@ -300,12 +300,12 @@ + final PackageState dependentState = (PackageState) modulesByClass.get(key); + if (dependentState == null) + { +- LOGGER.warn("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not found."); ++ LOGGER.warning("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not found."); + return false; + } + if (dependentState.getState() != PackageState.STATE_INITIALIZED) + { +- LOGGER.warn("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not initializable."); ++ LOGGER.warning("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not initializable."); + return false; + } + } +@@ -418,15 +418,15 @@ + { + if (fatal) + { +- LOGGER.warn("Unresolved dependency for package: " + moduleInfo.getModuleClass()); ++ LOGGER.warning("Unresolved dependency for package: " + moduleInfo.getModuleClass()); + } +- LOGGER.debug("Module class referenced, but not in classpath: " + moduleInfo.getModuleClass()); ++ LOGGER.config("Module class referenced, but not in classpath: " + moduleInfo.getModuleClass()); + } + + if (acceptVersion(moduleInfo, module) == false) + { + // module conflict! +- LOGGER.warn("Module " + module.getName() + ": required version: " ++ LOGGER.warning("Module " + module.getName() + ": required version: " + + moduleInfo + ", but found Version: \n" + module); + final PackageState state = new PackageState(module, PackageState.STATE_ERROR); + dropFailedModule(state); +@@ -437,7 +437,7 @@ + if (moduleContained == RETURN_MODULE_ERROR) + { + // the module caused harm before ... +- LOGGER.debug("Indicated failure for module: " + module.getModuleClass()); ++ LOGGER.config("Indicated failure for module: " + module.getModuleClass()); + final PackageState state = new PackageState(module, PackageState.STATE_ERROR); + dropFailedModule(state); + return false; +@@ -447,7 +447,7 @@ + if (incompleteModules.contains(module)) + { + // we assume that loading will continue ... +- LOGGER.error ++ LOGGER.severe + ("Circular module reference: This module definition is invalid: " + + module.getClass()); + final PackageState state = new PackageState(module, PackageState.STATE_ERROR); +@@ -460,7 +460,7 @@ + { + if (loadModule(required[i], incompleteModules, modules, true) == false) + { +- LOGGER.debug("Indicated failure for module: " + module.getModuleClass()); ++ LOGGER.config("Indicated failure for module: " + module.getModuleClass()); + final PackageState state = new PackageState(module, PackageState.STATE_ERROR); + dropFailedModule(state); + return false; +@@ -472,7 +472,7 @@ + { + if (loadModule(optional[i], incompleteModules, modules, true) == false) + { +- LOGGER.debug("Optional module: " + optional[i].getModuleClass() + " was not loaded."); ++ LOGGER.config("Optional module: " + optional[i].getModuleClass() + " was not loaded."); + } + } + // maybe a dependent module defined the same base module ... +@@ -486,7 +486,7 @@ + } + catch (Exception e) + { +- LOGGER.warn("Exception while loading module: " + moduleInfo, e); ++ LOGGER.warning("Exception while loading module: " + moduleInfo + " : " + e); + return false; + } + } +@@ -506,7 +506,7 @@ + } + if (module.getMajorVersion() == null) + { +- LOGGER.warn("Module " + module.getName() + " does not define a major version."); ++ LOGGER.warning("Module " + module.getName() + " does not define a major version."); + } + else + { +@@ -528,7 +528,7 @@ + } + if (module.getMinorVersion() == null) + { +- LOGGER.warn("Module " + module.getName() + " does not define a minor version."); ++ LOGGER.warning("Module " + module.getName() + " does not define a minor version."); + } + else + { +@@ -550,14 +550,14 @@ + } + if (module.getPatchLevel() == null) + { +- LOGGER.debug("Module " + module.getName() + " does not define a patch level."); ++ LOGGER.config("Module " + module.getName() + " does not define a patch level."); + } + else + { + if (acceptVersion(moduleRequirement.getPatchLevel(), + module.getPatchLevel()) > 0) + { +- LOGGER.debug("Did not accept patchlevel: " ++ LOGGER.config("Did not accept patchlevel: " + + moduleRequirement.getPatchLevel() + " - " + + module.getPatchLevel()); + return false; +@@ -699,4 +699,4 @@ + p.println(mod.getDescription()); + } + } +-} +\ No newline at end of file ++} +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/PackageSorter.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/PackageSorter.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/PackageSorter.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/PackageSorter.java 2021-02-23 12:19:11.752198616 +0000 +@@ -23,8 +23,7 @@ + import java.util.Iterator; + import java.util.List; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + + /** +@@ -180,7 +179,7 @@ + } + + /** A logger for debug-messages. */ +- private static final Log LOGGER = LogFactory.getLog(PackageSorter.class); ++ private static final Logger LOGGER = Logger.getLogger(PackageSorter.class.getName()); + + /** + * DefaultConstructor. +@@ -313,7 +312,7 @@ + final SortModule reqMod = (SortModule) moduleMap.get(moduleName); + if (reqMod == null) + { +- LOGGER.warn("Invalid state: Required dependency of '" + moduleName + "' had an error."); ++ LOGGER.warning("Invalid state: Required dependency of '" + moduleName + "' had an error."); + continue; + } + if (reqMod.getPosition() >= position) +@@ -415,7 +414,7 @@ + moduleMap.get(requiredModules[i].getModuleClass()); + if (dependentModule == null) + { +- LOGGER.warn ++ LOGGER.warning + ("A dependent module was not found in the list of known modules." + + requiredModules[i].getModuleClass()); + continue; +@@ -431,11 +430,11 @@ + moduleMap.get(optionalModules[i].getModuleClass()); + if (dependentModule == null) + { +- LOGGER.warn("A dependent module was not found in the list of known modules."); ++ LOGGER.warning("A dependent module was not found in the list of known modules."); + continue; + } + collector.add(dependentModule.getSubSystem()); + } + return collector; + } +-} +\ No newline at end of file ++} +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/PackageState.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/PackageState.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/boot/PackageState.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/boot/PackageState.java 2021-02-23 12:22:15.204942814 +0000 +@@ -17,8 +17,8 @@ + + package org.pentaho.reporting.libraries.base.boot; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * The package state class is used by the package manager to keep track of +@@ -31,7 +31,7 @@ + public class PackageState + { + /** A logger. */ +- private static final Log LOGGER = LogFactory.getLog(PackageState.class); ++ private static final Logger LOGGER = Logger.getLogger(PackageState.class.getName()); + + /** + * A constant defining that the package is new. +@@ -119,20 +119,20 @@ + } + catch (NoClassDefFoundError noClassDef) + { +- LOGGER.warn("Unable to load module classes for " + ++ LOGGER.warning("Unable to load module classes for " + + this.module.getName() + ':' + noClassDef.getMessage()); + this.state = STATE_ERROR; + } + catch (Exception e) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { + // its still worth a warning, but now we are more verbose ... +- LOGGER.warn("Unable to configure the module " + this.module.getName(), e); ++ LOGGER.warning("Unable to configure the module " + this.module.getName() + " : " + e); + } +- else if (LOGGER.isWarnEnabled()) ++ else if (LOGGER.isLoggable(Level.WARNING)) + { +- LOGGER.warn("Unable to configure the module " + this.module.getName()); ++ LOGGER.warning("Unable to configure the module " + this.module.getName()); + } + this.state = STATE_ERROR; + } +@@ -187,32 +187,32 @@ + } + catch (NoClassDefFoundError noClassDef) + { +- LOGGER.warn("Unable to load module classes for " + this.module.getName() + ':' + noClassDef.getMessage()); ++ LOGGER.warning("Unable to load module classes for " + this.module.getName() + ':' + noClassDef.getMessage()); + this.state = STATE_ERROR; + } + catch (ModuleInitializeException me) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { + // its still worth a warning, but now we are more verbose ... +- LOGGER.warn("Unable to initialize the module " + this.module.getName(), me); ++ LOGGER.warning("Unable to initialize the module " + this.module.getName() + " : " + me); + } +- else if (LOGGER.isWarnEnabled()) ++ else if (LOGGER.isLoggable(Level.WARNING)) + { +- LOGGER.warn("Unable to initialize the module " + this.module.getName()); ++ LOGGER.warning("Unable to initialize the module " + this.module.getName()); + } + this.state = STATE_ERROR; + } + catch (Exception e) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { + // its still worth a warning, but now we are more verbose ... +- LOGGER.warn("Unable to initialize the module " + this.module.getName(), e); ++ LOGGER.warning("Unable to initialize the module " + this.module.getName() + " : " + e); + } +- else if (LOGGER.isWarnEnabled()) ++ else if (LOGGER.isLoggable(Level.WARNING)) + { +- LOGGER.warn("Unable to initialize the module " + this.module.getName()); ++ LOGGER.warning("Unable to initialize the module " + this.module.getName()); + } + this.state = STATE_ERROR; + } +@@ -267,4 +267,4 @@ + { + this.state = STATE_ERROR; + } +-} +\ No newline at end of file ++} +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/config/PropertyFileConfiguration.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/config/PropertyFileConfiguration.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/config/PropertyFileConfiguration.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/config/PropertyFileConfiguration.java 2021-02-23 12:13:55.788194558 +0000 +@@ -22,8 +22,7 @@ + import java.io.InputStream; + import java.util.Properties; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + + /** +@@ -34,7 +33,7 @@ + public class PropertyFileConfiguration extends HierarchicalConfiguration + { + /** A logger for debug-messages. */ +- private static final Log LOGGER = LogFactory.getLog(PropertyFileConfiguration.class); ++ private static final Logger LOGGER = Logger.getLogger(PropertyFileConfiguration.class.getName()); + /** A serialization related constant. */ + private static final long serialVersionUID = 2423181637547944866L; + +@@ -89,7 +88,7 @@ + } + else + { +- LOGGER.debug("Configuration file not found in the classpath: " + resourceName); ++ LOGGER.config("Configuration file not found in the classpath: " + resourceName); + } + + } +@@ -118,9 +117,9 @@ + } + catch (IOException ioe) + { +- LOGGER.warn("Unable to read configuration", ioe); ++ LOGGER.warning("Unable to read configuration:" + ioe); + } + + } + +-} +\ No newline at end of file ++} +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/ClassQueryTool.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/ClassQueryTool.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/ClassQueryTool.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/ClassQueryTool.java 2021-02-23 12:24:05.460991092 +0000 +@@ -26,8 +26,7 @@ + import java.util.zip.ZipEntry; + import java.util.zip.ZipInputStream; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * The class-query tool loads classes using a classloader and calls "processClass" for each class encountered. This is +@@ -41,7 +40,7 @@ + public abstract class ClassQueryTool + { + /** A logger. */ +- private static final Log logger = LogFactory.getLog(ClassQueryTool.class); ++ private static final Logger logger = Logger.getLogger(ClassQueryTool.class.getName()); + + /** + * The default constructor. +@@ -89,7 +88,7 @@ + catch (Throwable e) + { + // ignore .. +- logger.debug("At class '" + className + "': " + e); ++ logger.config("At class '" + className + "': " + e); + } + } + +@@ -137,7 +136,7 @@ + } + catch (final IOException e1) + { +- logger.debug("Caught IO-Exception while processing file " + jarFile, e1); ++ logger.config("Caught IO-Exception while processing file " + jarFile + " : " + e1); + } + } + +@@ -225,7 +224,7 @@ + for (int i = 0; i < allArray.length; i++) + { + final URL url = allArray[i]; +- logger.debug(url); ++ logger.config(url.toString()); + } + for (int i = 0; i < urlsArray.length; i++) + { +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/DebugLog.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/DebugLog.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/DebugLog.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/DebugLog.java 2021-02-23 12:26:00.488084723 +0000 +@@ -17,8 +17,7 @@ + + package org.pentaho.reporting.libraries.base.util; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * This class provides static log messages for on-going bug-hunting efforts. This removes the need to create +@@ -29,7 +28,7 @@ + public final class DebugLog + { + /** A logger. */ +- private static final Log logger = LogFactory.getLog(DebugLog.class); ++ private static final Logger logger = Logger.getLogger(DebugLog.class.getName()); + + /** + * Logs a message using the debug-logger. By channeling all temporary log messages through this method, +@@ -39,7 +38,7 @@ + */ + public static void log(final Object message) + { +- logger.info(message); ++ logger.info(message.toString()); + } + + /** +@@ -51,7 +50,7 @@ + */ + public static void log(final Object message, final Throwable t) + { +- logger.info(message, t); ++ logger.info(message + " : " + t); + } + + /** +@@ -68,7 +67,7 @@ + public static void logHereWE() + { + //noinspection ThrowableInstanceNeverThrown +- logger.info("HERE: Debug point reached", new Exception("Debug-Point reached")); ++ logger.info("HERE: Debug point reached"); + } + + /** +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/ObjectUtilities.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/ObjectUtilities.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/ObjectUtilities.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/ObjectUtilities.java 2021-02-23 12:30:11.253468898 +0000 +@@ -29,8 +29,8 @@ + import java.util.Arrays; + import java.util.StringTokenizer; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * A collection of useful static utility methods for handling classes and object instantiation. +@@ -39,7 +39,7 @@ + */ + public final class ObjectUtilities + { +- private static final Log LOGGER = LogFactory.getLog(ObjectUtilities.class); ++ private static final Logger LOGGER = Logger.getLogger(ObjectUtilities.class.getName()); + + /** + * A constant for using the TheadContext as source for the classloader. +@@ -180,15 +180,15 @@ + } + catch (NoSuchMethodException e) + { +- LOGGER.warn("Object without clone() method is impossible on class " + aClass, e); ++ LOGGER.warning("Object without clone() method is impossible on class " + aClass + " : " + e); + } + catch (IllegalAccessException e) + { +- LOGGER.warn("Object.clone(): unable to call method 'clone()' on class " + aClass, e); ++ LOGGER.warning("Object.clone(): unable to call method 'clone()' on class " + aClass + " : " + e); + } + catch (InvocationTargetException e) + { +- LOGGER.warn("Object without clone() method is impossible on class " + aClass, e); ++ LOGGER.warning("Object without clone() method is impossible on class " + aClass + " : " + e); + } + throw new CloneNotSupportedException + ("Failed to clone: Clone caused an Exception while cloning type " + aClass); +@@ -424,32 +424,32 @@ + if (type != null && type.isAssignableFrom(c) == false) + { + // this is unacceptable and means someone messed up the configuration +- LOGGER.warn("Specified class " + className + " is not of expected type " + type); ++ LOGGER.warning("Specified class " + className + " is not of expected type " + type); + return null; + } + return c.newInstance(); + } + catch (ClassNotFoundException e) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { +- LOGGER.debug("Specified class " + className + " does not exist."); ++ LOGGER.config("Specified class " + className + " does not exist."); + } + // sometimes, this one is expected. + } + catch (NoClassDefFoundError e) + { +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { +- LOGGER.debug("Specified class " + className + " cannot be loaded [NOCLASSDEFERROR]."); ++ LOGGER.config("Specified class " + className + " cannot be loaded [NOCLASSDEFERROR]."); + } + } + catch (Throwable e) + { + // this is more severe than a class not being found at all +- if (LOGGER.isDebugEnabled()) ++ if (LOGGER.isLoggable(Level.CONFIG)) + { +- LOGGER.info("Specified class " + className + " failed to instantiate correctly.", e); ++ LOGGER.info("Specified class " + className + " failed to instantiate correctly." + " : " + e); + } + else + { +@@ -615,4 +615,4 @@ + } + return hashCode; + } +-} +\ No newline at end of file ++} +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/PngEncoder.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/PngEncoder.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/PngEncoder.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/PngEncoder.java 2021-02-23 12:27:15.484797751 +0000 +@@ -27,8 +27,7 @@ + import java.util.zip.Deflater; + import java.util.zip.DeflaterOutputStream; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.encoder.ImageEncoder; + import org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException; + +@@ -66,7 +65,7 @@ + public class PngEncoder implements ImageEncoder + { + /** A logger for debug-messages. */ +- private static final Log logger = LogFactory.getLog(PngEncoder.class); ++ private static final Logger logger = Logger.getLogger(PngEncoder.class.getName()); + + /** + * Constant specifying that alpha channel should be encoded. +@@ -622,12 +621,12 @@ + } + catch (Exception e) + { +- logger.error("interrupted waiting for pixels!", e); ++ logger.severe("interrupted waiting for pixels: " + e); + return false; + } + if ((pg.getStatus() & ImageObserver.ABORT) != 0) + { +- logger.error("image fetch aborted or errored"); ++ logger.severe("image fetch aborted or errored"); + return false; + } + +@@ -709,7 +708,7 @@ + } + catch (IOException e) + { +- logger.error("Failed to write PNG Data", e); ++ logger.severe("Failed to write PNG Data:" + e); + return false; + } + } +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/ResourceBundleSupport.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/ResourceBundleSupport.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/ResourceBundleSupport.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/ResourceBundleSupport.java 2021-02-23 12:27:45.015078518 +0000 +@@ -36,8 +36,7 @@ + import javax.swing.JMenu; + import javax.swing.KeyStroke; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * An utility class to ease up using property-file resource bundles. +@@ -60,7 +59,7 @@ + /** + * A logger for debug-messages. + */ +- private static final Log logger = LogFactory.getLog(ResourceBundleSupport.class); ++ private static final Logger logger = Logger.getLogger(ResourceBundleSupport.class.getName()); + + /** + * The resource bundle that will be used for local lookups. +@@ -259,7 +258,7 @@ + } + catch (Exception e) + { +- logger.error("Error during global lookup", e); ++ logger.severe("Error during global lookup: " + e); + throw new MissingResourceException("Error during global lookup", getResourceBase(), key); + } + } +@@ -643,7 +642,7 @@ + final URL in = ObjectUtilities.getResource(name, ResourceBundleSupport.class); + if (in == null) + { +- logger.warn("Unable to find file in the class path: " + name + "; key=" + key); ++ logger.warning("Unable to find file in the class path: " + name + "; key=" + key); + } + return in; + } +@@ -668,13 +667,13 @@ + + if (in == null) + { +- logger.warn("Unable to find file in the class path: " + resourceName); ++ logger.warning("Unable to find file in the class path: " + resourceName); + return new ImageIcon(createTransparentImage(1, 1)); + } + final Image img = Toolkit.getDefaultToolkit().createImage(in); + if (img == null) + { +- logger.warn("Unable to instantiate the image: " + resourceName); ++ logger.warning("Unable to instantiate the image: " + resourceName); + return new ImageIcon(createTransparentImage(1, 1)); + } + if (scale) +@@ -808,7 +808,7 @@ + } + catch (MissingResourceException mre) + { +- logger.warn ("ResourceBundleSupport#getString(,,)", mre); ++ logger.warning ("ResourceBundleSupport#getString(,,): " + mre); + return '!' + key + '!'; + } + } +@@ -821,7 +821,7 @@ + } + catch (MissingResourceException mre) + { +- logger.warn ("ResourceBundleSupport#getString(,,)", mre); ++ logger.warning ("ResourceBundleSupport#getString(,,): " + mre); + return '!' + key + '!'; + } + } +@@ -836,7 +836,7 @@ + } + catch (MissingResourceException mre) + { +- logger.warn ("ResourceBundleSupport#getString(,,)", mre); ++ logger.warning ("ResourceBundleSupport#getString(,,): " + mre); + return '!' + key + '!'; + } + } +@@ -852,7 +852,7 @@ + } + catch (MissingResourceException mre) + { +- logger.warn ("ResourceBundleSupport#getString(,,)", mre); ++ logger.warning ("ResourceBundleSupport#getString(,,): " + mre); + return '!' + key + '!'; + } + } +diff -ru libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/WaitingImageObserver.java libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/WaitingImageObserver.java +--- libbase-1.1.3.orig/source/org/pentaho/reporting/libraries/base/util/WaitingImageObserver.java 2009-11-16 10:14:12.000000000 +0000 ++++ libbase-1.1.3/source/org/pentaho/reporting/libraries/base/util/WaitingImageObserver.java 2021-02-23 12:30:28.223630238 +0000 +@@ -22,8 +22,7 @@ + import java.awt.image.BufferedImage; + import java.awt.image.ImageObserver; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * This image observer blocks until the image is completely loaded. AWT defers the loading of images until they are +@@ -37,7 +36,7 @@ + public class WaitingImageObserver implements ImageObserver + { + /** A logger. */ +- private static final Log LOGGER = LogFactory.getLog(WaitingImageObserver.class); ++ private static final Logger LOGGER = Logger.getLogger(WaitingImageObserver.class.getName()); + + /** + * For serialization. +@@ -149,7 +148,7 @@ + } + catch (InterruptedException e) + { +- LOGGER.info("WaitingImageObserver.waitImageLoaded(): InterruptedException thrown", e); ++ LOGGER.info("WaitingImageObserver.waitImageLoaded(): InterruptedException thrown: " + e); + } + + if (maxLoadTime > 0 && lastUpdate < (System.currentTimeMillis() - maxLoadTime)) +@@ -172,4 +171,4 @@ + { + return this.error; + } +-} +\ No newline at end of file ++} +--- a/source/org/pentaho/reporting/libraries/base/util/IOUtils.java ++++ b/source/org/pentaho/reporting/libraries/base/util/IOUtils.java +@@ -34,8 +34,7 @@ + import java.sql.Clob; + import java.sql.SQLException; + +-import org.apache.commons.logging.LogFactory; +-import org.apache.commons.logging.Log; ++import java.util.logging.Logger; + + /** + * The IOUtils provide some IO related helper methods. +@@ -48,7 +47,7 @@ + * the singleton instance of the utility package. + */ + private static IOUtils instance; +- private static final Log logger = LogFactory.getLog(IOUtils.class); ++ private static final Logger logger = Logger.getLogger(IOUtils.class.getName()); + /** + * DefaultConstructor. + */ +@@ -855,7 +854,7 @@ + final long length = clob.length(); + if (length > Integer.MAX_VALUE) + { +- logger.warn ("This CLOB contains more than 2^31 characters. We cannot handle that."); ++ logger.warning ("This CLOB contains more than 2^31 characters. We cannot handle that."); + return null; + } + +@@ -867,7 +866,7 @@ + } + catch (IOException e) + { +- logger.warn ("Copying the stream failed.", e); ++ logger.warning ("Copying the stream failed: " + e); + } + try + { +@@ -875,7 +874,7 @@ + } + catch (IOException e) + { +- logger.warn ("Failed to close input stream. No worries, we will be alright anyway.", e); ++ logger.warning ("Failed to close input stream. No worries, we will be alright anyway: " + e); + } + return outStream.toString(); + } +@@ -898,7 +897,7 @@ + final long length = clob.length(); + if (length > Integer.MAX_VALUE) + { +- logger.warn ("This CLOB contains more than 2^31 characters. We cannot handle that."); ++ logger.warning ("This CLOB contains more than 2^31 characters. We cannot handle that."); + return null; + } + +@@ -910,7 +909,7 @@ + } + catch (IOException e) + { +- logger.warn ("Copying the stream failed.", e); ++ logger.warning ("Copying the stream failed: " + e); + } + try + { +@@ -918,7 +917,7 @@ + } + catch (IOException e) + { +- logger.warn ("Failed to close input stream. No worries, we will be alright anyway.", e); ++ logger.warning ("Failed to close input stream. No worries, we will be alright anyway: " + e); + } + return outStream.toByteArray(); + } diff --git a/external/jfreereport/patches/libfonts-1.1.3-remove-commons-logging.patch.1 b/external/jfreereport/patches/libfonts-1.1.3-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..723a732a593a --- /dev/null +++ b/external/jfreereport/patches/libfonts-1.1.3-remove-commons-logging.patch.1 @@ -0,0 +1,506 @@ +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/afm/AfmFontRegistry.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/afm/AfmFontRegistry.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/afm/AfmFontRegistry.java 2021-03-12 10:15:06.215353433 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/afm/AfmFontRegistry.java 2021-03-12 10:26:44.036236575 +0000 +@@ -37,8 +37,7 @@ + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.base.util.StringUtils; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: 21.07.2007, 20:14:05 +@@ -47,7 +46,8 @@ + */ + public class AfmFontRegistry extends AbstractFontFileRegistry + { +- private static final Log logger = LogFactory.getLog(AfmFontRegistry.class); ++ private static final Logger logger = Logger.getLogger(AfmFontRegistry.class.getName()); ++ + /** + * The font path filter is used to collect font files and directories during + * the font path registration. +@@ -133,7 +133,7 @@ + filePfb.isFile() == false || + filePfb.canRead() == false) + { +- logger.warn("Cannot embedd font: " + filePfb + " is missing for " + font); ++ logger.warning("Cannot embedd font: " + filePfb + " is missing for " + font); + embedded = false; + } + +@@ -264,11 +264,11 @@ + catch (final ClassNotFoundException cnfe) + { + // ignore the exception. +- logger.debug("Failed to restore the cache: Cache was created by a different version of LibFonts"); ++ logger.config("Failed to restore the cache: Cache was created by a different version of LibFonts"); + } + catch (Exception e) + { +- logger.debug("Failed to restore the cache:", e); ++ logger.config("Failed to restore the cache: " + e); + } + } + +@@ -311,14 +311,14 @@ + catch (IOException e) + { + // ignore .. +- logger.debug("Failed to store cached font data", e); ++ logger.config("Failed to store cached font data: " + e); + } + } + } + catch (IOException e) + { + // should not happen +- logger.debug("Failed to store cached font data", e); ++ logger.config("Failed to store cached font data: " + e); + } + } + } +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/encoding/EncodingRegistry.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/encoding/EncodingRegistry.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/encoding/EncodingRegistry.java 2021-03-12 10:15:06.228353587 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/encoding/EncodingRegistry.java 2021-03-12 10:27:11.614524616 +0000 +@@ -31,8 +31,7 @@ + import org.pentaho.reporting.libraries.resourceloader.factory.property.PropertiesResourceFactory; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * A global registry for all supported encodings. This offers the option to fall +@@ -42,7 +41,7 @@ + */ + public final class EncodingRegistry + { +- private static final Log logger = LogFactory.getLog(EncodingRegistry.class); ++ private static final Logger logger = Logger.getLogger(EncodingRegistry.class.getName()); + + /** + * Implementation doc: This class uses several sources to load the encodings. +@@ -266,7 +265,7 @@ + catch (Exception e) + { + // fall back ... +- logger.warn("Failed to create external-encoding instance for key " + key, e); ++ logger.warning("Failed to create external-encoding instance for key " + key + " : " + e); + } + } + if (isEncodingSupportedJVM(name)) +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/encoding/generator/EncodingGenerator.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/encoding/generator/EncodingGenerator.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/encoding/generator/EncodingGenerator.java 2021-03-12 10:15:06.218353469 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/encoding/generator/EncodingGenerator.java 2021-03-12 10:27:47.015894357 +0000 +@@ -35,8 +35,7 @@ + import org.pentaho.reporting.libraries.fonts.encoding.External8BitEncodingData; + import org.pentaho.reporting.libraries.base.config.DefaultConfiguration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * A simple sourcecode generator. +@@ -45,7 +44,7 @@ + */ + public class EncodingGenerator + { +- private static final Log logger = LogFactory.getLog(EncodingGenerator.class); ++ private static final Logger logger = Logger.getLogger(EncodingGenerator.class.getName()); + + private File targetDirectory; + private DefaultConfiguration propertySet; +@@ -200,7 +199,7 @@ + } + catch(Exception e) + { +- logger.warn ("Failed to generate Encoding " + key, e); ++ logger.warning("Failed to generate Encoding " + key + " : " + e); + } + } + } +@@ -269,7 +268,7 @@ + } + catch(Exception e) + { +- logger.warn ("Failed to generate Encoding " + key, e); ++ logger.warning("Failed to generate Encoding " + key + " : " + e); + } + } + +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/pfm/PfmFontRegistry.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/pfm/PfmFontRegistry.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/pfm/PfmFontRegistry.java 2021-03-12 10:15:06.217353457 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/pfm/PfmFontRegistry.java 2021-03-12 10:28:33.904384084 +0000 +@@ -37,8 +37,7 @@ + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.base.util.StringUtils; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: 21.07.2007, 16:58:06 +@@ -47,7 +46,7 @@ + */ + public class PfmFontRegistry extends AbstractFontFileRegistry + { +- private static final Log logger = LogFactory.getLog(PfmFontRegistry.class); ++ private static final Logger logger = Logger.getLogger(PfmFontRegistry.class.getName()); + + /** + * The font path filter is used to collect font files and directories during +@@ -146,7 +145,7 @@ + filePfb.isFile() == false || + filePfb.canRead() == false) + { +- logger.warn("Cannot embedd font: " + filePfb + " is missing for " + font); ++ logger.warning("Cannot embedd font: " + filePfb + " is missing for " + font); + embedded = false; + } + +@@ -155,7 +154,7 @@ + { + if (pfmFont.isItextCompatible() == false) + { +- logger.warn("Cannot embedd font: pfb-file for " + font + " is not valid (according to iText)."); ++ logger.warning("Cannot embedd font: pfb-file for " + font + " is not valid (according to iText)."); + } + } + registerFont (pfmFont); +@@ -283,7 +282,7 @@ + } + catch (Exception e) + { +- logger.debug("Failed to restore the cache:", e); ++ logger.config("Failed to restore the cache: " + e); + } + } + +@@ -326,14 +325,14 @@ + catch (IOException e) + { + // ignore .. +- logger.debug("Failed to store cached font data", e); ++ logger.config("Failed to store cached font data: " + e); + } + } + } + catch (IOException e) + { + // should not happen +- logger.debug("Failed to store cached font data", e); ++ logger.config("Failed to store cached font data: " + e); + } + } + } +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/registry/AbstractFontFileRegistry.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/registry/AbstractFontFileRegistry.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/registry/AbstractFontFileRegistry.java 2021-03-12 10:15:06.229353599 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/registry/AbstractFontFileRegistry.java 2021-03-12 10:25:43.831607771 +0000 +@@ -25,8 +25,7 @@ + import java.util.Iterator; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.fonts.LibFontBoot; + import org.pentaho.reporting.libraries.fonts.encoding.EncodingRegistry; + import org.pentaho.reporting.libraries.base.util.StringUtils; +@@ -39,7 +38,7 @@ + */ + public abstract class AbstractFontFileRegistry implements FontRegistry + { +- private static final Log logger = LogFactory.getLog(AbstractFontFileRegistry.class); ++ private static final Logger logger = Logger.getLogger(AbstractFontFileRegistry.class.getName()); + + private HashMap seenFiles; + +@@ -74,7 +73,7 @@ + } + catch (Exception e) + { +- logger.warn("Extra font path " + extraDir + " could not be fully registered.", e); ++ logger.warning("Extra font path " + extraDir + " could not be fully registered: " + e); + } + } + } +@@ -98,13 +97,13 @@ + final String jrepath = safeSystemGetProperty("java.home", "."); + final String fs = safeSystemGetProperty("file.separator", File.separator); + +- logger.debug("Running on operating system: " + osname); +- logger.debug("Character encoding used as default: " + encoding); ++ logger.config("Running on operating system: " + osname); ++ logger.config("Character encoding used as default: " + encoding); + + if (safeSystemGetProperty("mrj.version", null) != null) + { + final String userhome = safeSystemGetProperty("user.home", "."); +- logger.debug("Detected MacOS (Property 'mrj.version' is present."); ++ logger.config("Detected MacOS (Property 'mrj.version' is present."); + registerFontPath(new File(userhome + "/Library/Fonts"), encoding); + registerFontPath(new File("/Library/Fonts"), encoding); + registerFontPath(new File("/Network/Library/Fonts"), encoding); +@@ -116,7 +115,7 @@ + } + else + { +- logger.debug("Assuming unix like file structures"); ++ logger.config("Assuming unix like file structures"); + // Assume X11 is installed in the default location. + registerFontPath(new File("/usr/X11R6/lib/X11/fonts"), encoding); + registerFontPath(new File("/usr/share/fonts"), encoding); +@@ -145,7 +144,7 @@ + */ + private void registerWindowsFontPath(final String encoding) + { +- logger.debug("Found 'Windows' in the OS name, assuming DOS/Win32 structures"); ++ logger.config("Found 'Windows' in the OS name, assuming DOS/Win32 structures"); + // Assume windows + // If you are not using windows, ignore this. This just checks if a windows system + // directory exist and includes a font dir. +@@ -182,7 +181,7 @@ + } + } + } +- logger.debug("Fonts located in \"" + fontPath + '\"'); ++ logger.config("Fonts located in \"" + fontPath + '\"'); + if (fontPath != null) + { + final File file = new File(fontPath); +@@ -272,7 +271,7 @@ + } + catch (Exception e) + { +- logger.warn("Font " + file + " is invalid. Message:" + e.getMessage(), e); ++ logger.warning("Font " + file + " is invalid. Message: " + e); + } + } + } +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/text/GraphemeClassifier.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/text/GraphemeClassifier.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/text/GraphemeClassifier.java 2021-03-12 10:15:06.205353315 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/text/GraphemeClassifier.java 2021-03-12 10:29:03.600694237 +0000 +@@ -22,8 +22,7 @@ + import java.io.IOException; + + import org.pentaho.reporting.libraries.fonts.tools.ByteTable; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: 11.06.2006, 17:11:16 +@@ -32,7 +31,7 @@ + */ + public final class GraphemeClassifier + { +- private static final Log logger = LogFactory.getLog(GraphemeClassifier.class); ++ private static final Logger logger = Logger.getLogger(GraphemeClassifier.class.getName()); + + public static final int OTHER = 0; + +@@ -70,7 +69,7 @@ + } + catch(Exception e) + { +- logger.warn ("Unable to load the pre-generated classification data.", e); ++ logger.warning("Unable to load the pre-generated classification data: " + e); + } + finally + { +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFont.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFont.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFont.java 2021-03-12 10:15:06.214353421 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFont.java 2021-03-12 10:29:19.746862875 +0000 +@@ -24,8 +24,7 @@ + import org.pentaho.reporting.libraries.fonts.ByteAccessUtilities; + import org.pentaho.reporting.libraries.fonts.io.FileFontDataInputSource; + import org.pentaho.reporting.libraries.fonts.io.FontDataInputSource; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: 06.11.2005, 18:27:21 +@@ -34,7 +33,7 @@ + */ + public class TrueTypeFont + { +- private static final Log logger = LogFactory.getLog(TrueTypeFont.class); ++ private static final Logger logger = Logger.getLogger(TrueTypeFont.class.getName()); + + private static class TrueTypeFontHeader + { +@@ -327,7 +326,7 @@ + (FontHeaderTable) getTable(FontHeaderTable.TABLE_ID); + if (header == null) + { +- logger.warn("The font '" + filename + "' does not have a 'head' table. The font file is not valid."); ++ logger.warning("The font '" + filename + "' does not have a 'head' table. The font file is not valid."); + return null; + } + final byte[] buffer = +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontMetricsFactory.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontMetricsFactory.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontMetricsFactory.java 2021-03-12 10:15:06.213353409 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontMetricsFactory.java 2021-03-12 10:29:38.442058137 +0000 +@@ -21,8 +21,7 @@ + import java.io.IOException; + import java.util.HashMap; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.fonts.io.FileFontDataInputSource; + import org.pentaho.reporting.libraries.fonts.io.FontDataInputSource; + import org.pentaho.reporting.libraries.fonts.registry.FontContext; +@@ -38,7 +37,7 @@ + */ + public class TrueTypeFontMetricsFactory implements FontMetricsFactory + { +- private static final Log logger = LogFactory.getLog(TrueTypeFontMetricsFactory.class); ++ private static final Logger logger = Logger.getLogger(TrueTypeFontMetricsFactory.class.getName()); + private HashMap fontRecords; + + public TrueTypeFontMetricsFactory() +@@ -77,7 +76,7 @@ + } + catch (IOException e) + { +- logger.warn("Unable to read the font.", e); ++ logger.warning("Unable to read the font: " + e); + // todo: We should throw a better exception instead, shouldnt we? + throw new IllegalStateException(); + } +diff -ru libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontRegistry.java libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontRegistry.java +--- libfonts-1.1.3.orig/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontRegistry.java 2021-03-12 10:15:06.214353421 +0000 ++++ libfonts-1.1.3/source/org/pentaho/reporting/libraries/fonts/truetype/TrueTypeFontRegistry.java 2021-03-12 10:31:15.504071887 +0000 +@@ -28,8 +28,7 @@ + import java.io.Serializable; + import java.util.HashMap; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.fonts.FontException; + import org.pentaho.reporting.libraries.fonts.LibFontBoot; + import org.pentaho.reporting.libraries.fonts.cache.FontCache; +@@ -61,7 +60,7 @@ + return secondLevelCache; + } + +- private static final Log logger = LogFactory.getLog(TrueTypeFontRegistry.class); ++ private static final Logger logger = Logger.getLogger(TrueTypeFontRegistry.class.getName()); + + /** + * The font path filter is used to collect font files and directories during the font path registration. +@@ -180,7 +179,7 @@ + } + catch (Exception e) + { +- logger.info("Unable to register font file " + file, e); ++ logger.info("Unable to register font file " + file + " : " + e); + // An error must not stop us on our holy mission to find and register + // all fonts :) + return false; +@@ -206,7 +205,7 @@ + } + catch (FontException e) + { +- logger.info("The font '" + font.getFilename() + "' is invalid.", e); ++ logger.info("The font '" + font.getFilename() + "' is invalid: " + e); + return; + } + +@@ -347,11 +346,11 @@ + catch (final ClassNotFoundException cnfe) + { + // ignore the exception. +- logger.debug("Failed to restore the cache: Cache was created by a different version of LibFonts"); ++ logger.config("Failed to restore the cache: Cache was created by a different version of LibFonts"); + } + catch (Exception e) + { +- logger.debug("Non-Fatal: Failed to restore the cache. The cache will be rebuilt.", e); ++ logger.config("Non-Fatal: Failed to restore the cache. The cache will be rebuilt: " + e); + } + } + +@@ -394,14 +393,14 @@ + catch (IOException e) + { + // ignore .. +- logger.debug("Failed to store cached font data", e); ++ logger.config("Failed to store cached font data: " + e); + } + } + } + catch (IOException e) + { + // should not happen +- logger.debug("Failed to store cached font data", e); ++ logger.config("Failed to store cached font data: " + e); + } + } + } +--- a/source/org/pentaho/reporting/libraries/fonts/itext/BaseFontSupport.java ++++ b/source/org/pentaho/reporting/libraries/fonts/itext/BaseFontSupport.java +@@ -34,8 +34,8 @@ + import org.pentaho.reporting.libraries.fonts.merge.CompoundFontRecord; + import org.pentaho.reporting.libraries.base.config.ExtendedConfiguration; + import org.pentaho.reporting.libraries.base.util.StringUtils; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * iText font support. +@@ -44,7 +44,7 @@ + */ + public class BaseFontSupport implements FontMapper + { +- private static final Log logger = LogFactory.getLog(BaseFontSupport.class); ++ private static final Logger logger = Logger.getLogger(BaseFontSupport.class.getName()); + /** + * Storage for BaseFont objects created. + */ +@@ -235,7 +235,7 @@ + final FontSource source = (FontSource) registryFontRecord; + if (source.isEmbeddable() == false) + { +- logger.warn("License of font forbids embedded usage for font: " + fontKey); ++ logger.warning("License of font forbids embedded usage for font: " + fontKey); + // strict mode here? + embeddedOverride = false; + } +@@ -286,13 +286,13 @@ + } + catch (Exception e) + { +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("BaseFont.createFont failed. Key = " + fontKey + ": " + e.getMessage(), e); ++ logger.config("BaseFont.createFont failed. Key = " + fontKey + ": " + e); + } +- else if (logger.isWarnEnabled()) ++ else if (logger.isLoggable(Level.WARNING)) + { +- logger.warn("BaseFont.createFont failed. Key = " + fontKey + ": " + e.getMessage()); ++ logger.warning("BaseFont.createFont failed. Key = " + fontKey + ": " + e.getMessage()); + } + } + // fallback .. use BaseFont.HELVETICA as default +@@ -322,7 +322,7 @@ + } + catch (Exception e) + { +- logger.warn("BaseFont.createFont for FALLBACK failed.", e); ++ logger.warning("BaseFont.createFont for FALLBACK failed: " + e); + throw new BaseFontCreateException("Null font = " + fontKey); + } + throw new BaseFontCreateException("BaseFont creation failed, null font: " + fontKey); diff --git a/external/jfreereport/patches/libformula-1.1.3-remove-commons-logging.patch.1 b/external/jfreereport/patches/libformula-1.1.3-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..5a578cf56d08 --- /dev/null +++ b/external/jfreereport/patches/libformula-1.1.3-remove-commons-logging.patch.1 @@ -0,0 +1,266 @@ +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java 2021-02-23 14:41:06.962127389 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java 2021-02-23 14:48:18.016328356 +0000 +@@ -19,8 +19,7 @@ + + import java.io.Serializable; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.formula.lvalues.LValue; + import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair; + import org.pentaho.reporting.libraries.formula.parser.FormulaParseException; +@@ -40,7 +39,7 @@ + */ + public class Formula implements Serializable, Cloneable + { +- private static final Log logger = LogFactory.getLog(Formula.class); ++ private static final Logger logger = Logger.getLogger(Formula.class.getName()); + private LValue rootReference; + private static final long serialVersionUID = -1176925812499923546L; + +@@ -105,7 +104,7 @@ + final Type type = typeValuePair.getType(); + if (type.isFlagSet(Type.ERROR_TYPE)) + { +- logger.debug("Error: " + typeValuePair.getValue()); ++ logger.config("Error: " + typeValuePair.getValue()); + } + else if (type.isFlagSet(Type.ARRAY_TYPE)) + { +@@ -131,7 +130,7 @@ + } + catch (Exception e) + { +- logger.warn("Evaluation failed unexpectedly: ", e); ++ logger.warning("Evaluation failed unexpectedly: " + e); + return new TypeValuePair(ErrorType.TYPE, LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE); + } + } +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java 2021-02-23 14:41:06.980127564 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java 2021-02-23 14:48:29.995445103 +0000 +@@ -25,9 +25,7 @@ + import org.pentaho.reporting.libraries.base.util.HashNMap; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + import org.pentaho.reporting.libraries.base.config.Configuration; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; +- ++import java.util.logging.Logger; + + /** + * Creation-Date: 02.11.2006, 12:48:32 +@@ -36,7 +34,7 @@ + */ + public class DefaultFunctionRegistry implements FunctionRegistry + { +- private static final Log logger = LogFactory.getLog(DefaultFunctionRegistry.class); ++ private static final Logger logger = Logger.getLogger(DefaultFunctionRegistry.class.getName()); + + private static final String FUNCTIONS_PREFIX = "org.pentaho.reporting.libraries.formula.functions."; + private static final String[] EMPTY_ARRAY = new String[0]; +@@ -72,7 +70,7 @@ + final Function function = createFunction(aName); + if (function == null) + { +- logger.debug ("There is no such function: " + aName); ++ logger.config ("There is no such function: " + aName); + } + else + { +@@ -132,7 +130,7 @@ + (functionClass, DefaultFunctionRegistry.class, Function.class); + if (function == null) + { +- logger.debug ("There is no such function: " + name); ++ logger.config ("There is no such function: " + name); + } + else + { +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java 2021-02-23 14:41:06.983127594 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java 2021-02-23 14:48:54.904687864 +0000 +@@ -27,8 +27,7 @@ + import org.pentaho.reporting.libraries.formula.typing.Type; + import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType; + import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * This function returns true if the parameter is of error and not of error type NA. +@@ -37,7 +36,7 @@ + */ + public class IsErrFunction implements Function + { +- private static final Log logger = LogFactory.getLog(IsErrFunction.class); ++ private static final Logger logger = Logger.getLogger(IsErrFunction.class.getName()); + private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE); + private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE); + private static final long serialVersionUID = 6749192734608313367L; +@@ -61,7 +60,7 @@ + + if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue) + { +- logger.warn ("Passing errors around is deprecated. Throw exceptions instead."); ++ logger.warning("Passing errors around is deprecated. Throw exceptions instead."); + final ErrorValue na = (ErrorValue) value; + if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA) + { +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java 2021-02-23 14:41:06.984127603 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java 2021-02-23 14:49:05.917795194 +0000 +@@ -27,8 +27,7 @@ + import org.pentaho.reporting.libraries.formula.typing.Type; + import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType; + import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * This function returns true if the parameter is of error type NA. +@@ -39,7 +38,7 @@ + { + private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE); + private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE); +- private static final Log logger = LogFactory.getLog(IsNaFunction.class); ++ private static final Logger logger = Logger.getLogger(IsNaFunction.class.getName()); + private static final long serialVersionUID = 1205462839536368718L; + + public IsNaFunction() +@@ -61,7 +60,7 @@ + + if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue) + { +- logger.warn ("Passing errors around is deprecated. Throw exceptions instead."); ++ logger.warning("Passing errors around is deprecated. Throw exceptions instead."); + final ErrorValue na = (ErrorValue) value; + if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA) + { +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2021-02-23 14:41:06.988127642 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2021-02-23 14:50:26.354579111 +0000 +@@ -17,8 +17,8 @@ + + package org.pentaho.reporting.libraries.formula.lvalues; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.formula.EvaluationException; + import org.pentaho.reporting.libraries.formula.FormulaContext; + import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue; +@@ -44,7 +44,7 @@ + */ + public class FormulaFunction extends AbstractLValue + { +- private static final Log logger = LogFactory.getLog(FormulaFunction.class); ++ private static final Logger logger = Logger.getLogger(FormulaFunction.class.getName()); + + private static class FormulaParameterCallback implements ParameterCallback + { +@@ -74,9 +74,9 @@ + final TypeValuePair converted = typeRegistry.convertTo(paramType, result); + if (converted == null) + { +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("Failed to evaluate parameter " + pos + " on function " + function); ++ logger.config("Failed to evaluate parameter " + pos + " on function " + function); + } + throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_AUTO_ARGUMENT_VALUE); + } +@@ -228,7 +228,7 @@ + } + catch (Exception e) + { +- logger.error("Unexpected exception while evaluating", e); ++ logger.severe("Unexpected exception while evaluating: " + e); + throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE); + } + } +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java 2021-02-23 14:41:06.961127380 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java 2021-02-23 14:47:11.376678905 +0000 +@@ -35,8 +35,7 @@ + import java.util.List; + import java.util.Locale; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.IOUtils; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; +@@ -66,7 +65,7 @@ + */ + public class DefaultTypeRegistry implements TypeRegistry + { +- private static final Log logger = LogFactory.getLog(DefaultTypeRegistry.class); ++ private static final Logger logger = Logger.getLogger(DefaultTypeRegistry.class.getName()); + + private static class ArrayConverterCallback implements ArrayCallback + { +@@ -599,7 +598,7 @@ + } + else + { +- logger.warn("Assertation failure: Type declared to be a sequence, but no sequence found inside."); ++ logger.warning("Assertation failure: Type declared to be a sequence, but no sequence found inside."); + throw TypeConversionException.getInstance(); + } + } +@@ -612,7 +611,7 @@ + } + else + { +- logger.warn("Assertation failure: Type declared to be array, but no array callback found inside."); ++ logger.warning("Assertation failure: Type declared to be array, but no array callback found inside."); + throw TypeConversionException.getInstance(); + } + } +@@ -651,7 +650,7 @@ + } + else + { +- logger.warn("Assertation failure: Type declared to be array, but no array callback found inside."); ++ logger.warning("Assertation failure: Type declared to be array, but no array callback found inside."); + throw TypeConversionException.getInstance(); + } + } +--- a/source/org/pentaho/reporting/libraries/formula/function/logical/IfNaFunction.java ++++ b/source/org/pentaho/reporting/libraries/formula/function/logical/IfNaFunction.java +@@ -17,8 +17,7 @@ + + package org.pentaho.reporting.libraries.formula.function.logical; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.formula.ErrorValue; + import org.pentaho.reporting.libraries.formula.EvaluationException; + import org.pentaho.reporting.libraries.formula.FormulaContext; +@@ -37,7 +36,7 @@ + */ + public class IfNaFunction implements Function + { +- private static final Log logger = LogFactory.getLog(IfNaFunction.class); ++ private static final Logger logger = Logger.getLogger(IfNaFunction.class.getName()); + private static final long serialVersionUID = -7517668261071087411L; + + public IfNaFunction() +@@ -67,7 +66,7 @@ + value = parameters.getValue(0); + if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue) + { +- logger.warn("Passing errors around is deprecated. Throw exceptions instead."); ++ logger.warning("Passing errors around is deprecated. Throw exceptions instead."); + final ErrorValue na = (ErrorValue) value; + if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA) + { diff --git a/external/jfreereport/patches/liblayout-0.2.10-remove-commons-logging.patch.1 b/external/jfreereport/patches/liblayout-0.2.10-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..5c71a57d2de7 --- /dev/null +++ b/external/jfreereport/patches/liblayout-0.2.10-remove-commons-logging.patch.1 @@ -0,0 +1,860 @@ +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/input/style/parser/CSSValueFactory.java liblayout-0.2.10/source/org/jfree/layouting/input/style/parser/CSSValueFactory.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/input/style/parser/CSSValueFactory.java 2021-04-07 10:34:09.797045462 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/input/style/parser/CSSValueFactory.java 2021-04-07 10:41:20.015338056 +0100 +@@ -49,8 +49,7 @@ + import org.jfree.layouting.input.style.values.CSSStringValue; + import org.jfree.layouting.input.style.values.CSSValue; + import org.w3c.css.sac.LexicalUnit; +-import org.apache.commons.logging.LogFactory; +-import org.apache.commons.logging.Log; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + +@@ -61,7 +60,7 @@ + */ + public class CSSValueFactory + { +- private static final Log logger = LogFactory.getLog(CSSValueFactory.class); ++ private static final Logger logger = Logger.getLogger(CSSValueFactory.class.getName()); + public static final String SIMPLE_PREFIX = "org.jfree.layouting.parser.handlers."; + public static final String COMPOUND_PREFIX = "org.jfree.layouting.parser.compoundhandlers."; + +@@ -99,7 +98,7 @@ + } + else + { +- logger.warn("Invalid module implementation: " + c); ++ logger.warning("Invalid module implementation: " + c); + } + } + +@@ -300,7 +299,7 @@ + (CSSCompoundValueReadHandler) compoundHandlers.get(name); + if (handler == null) + { +- logger.warn("Got no key for inherited value: " + name); ++ logger.warning("Got no key for inherited value: " + name); + return; + } + +@@ -324,7 +323,7 @@ + (CSSCompoundValueReadHandler) compoundHandlers.get(name); + if (handler == null) + { +- logger.warn("Got no key for compound attr function: " + name); ++ logger.warning("Got no key for compound attr function: " + name); + return; + } + +@@ -373,7 +372,7 @@ + { + if (key == null) + { +- // Log.warn("Got no key for attribute-function " + normalizedName); ++ // Log.warning("Got no key for attribute-function " + normalizedName); + setCompundAttrValue(normalizedName, attrFn, rule, important); + return; + } +@@ -387,7 +386,7 @@ + // ATTR function (extended version). + if (key == null) + { +- logger.warn("Got no key for attribute-function " + normalizedName); ++ logger.warning("Got no key for attribute-function " + normalizedName); + return; + } + final CSSAttrFunction attrFn = parseComplexAttrFn(value.getParameters()); +@@ -421,7 +420,7 @@ + return; + } + +- logger.warn("Unparsable value: Got no valid result for " + normalizedName + " (" + value + ')'); ++ logger.warning("Unparsable value: Got no valid result for " + normalizedName + " (" + value + ')'); + return; // ignore this rule .. + } + final Map map = module.createValues(value); +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/input/style/parser/StyleSheetHandler.java liblayout-0.2.10/source/org/jfree/layouting/input/style/parser/StyleSheetHandler.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/input/style/parser/StyleSheetHandler.java 2021-04-07 10:34:09.798045474 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/input/style/parser/StyleSheetHandler.java 2021-04-07 10:48:18.496489721 +0100 +@@ -60,8 +60,7 @@ + import org.pentaho.reporting.libraries.resourceloader.Resource; + import org.pentaho.reporting.libraries.resourceloader.ResourceException; + import org.pentaho.reporting.libraries.base.util.FastStack; +-import org.apache.commons.logging.LogFactory; +-import org.apache.commons.logging.Log; ++import java.util.logging.Logger; + + /** + * Creation-Date: 23.11.2005, 13:06:06 +@@ -70,7 +69,7 @@ + */ + public class StyleSheetHandler implements DocumentHandler, ErrorHandler + { +- private static final Log logger = LogFactory.getLog(StyleSheetHandler.class); ++ private static final Logger logger = Logger.getLogger(StyleSheetHandler.class.getName()); + private HashMap namespaces; + private StyleKeyRegistry registry; + private StyleSheet styleSheet; +@@ -614,7 +613,7 @@ + catch (Exception e) + { + // we catch everything. +- logger.warn("Error parsing style key: " + name, e); ++ logger.warning("Error parsing style key: " + name + " : " + e); + } + + } +@@ -639,7 +638,7 @@ + public void warning(final CSSParseException exception) + throws CSSException + { +- logger.warn("Warning: " + exception.getMessage()); ++ logger.warning("Warning: " + exception.getMessage()); + } + + /** +@@ -665,7 +664,7 @@ + public void error(final CSSParseException exception) + throws CSSException + { +- logger.warn("Error: ", exception); ++ logger.warning("Error: " + exception); + } + + /** +@@ -690,6 +689,6 @@ + public void fatalError(final CSSParseException exception) + throws CSSException + { +- logger.warn("Fatal Error: ", exception); ++ logger.warning("Fatal Error: " + exception); + } + } +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/normalizer/generator/PrintContentGenerator.java liblayout-0.2.10/source/org/jfree/layouting/normalizer/generator/PrintContentGenerator.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/normalizer/generator/PrintContentGenerator.java 2021-04-07 10:34:09.766045081 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/normalizer/generator/PrintContentGenerator.java 2021-04-07 10:47:20.093770766 +0100 +@@ -38,8 +38,7 @@ + import org.jfree.layouting.layouter.context.PageContext; + import org.jfree.layouting.normalizer.content.NormalizationException; + import org.jfree.layouting.renderer.Renderer; +-import org.apache.commons.logging.LogFactory; +-import org.apache.commons.logging.Log; ++import java.util.logging.Logger; + + /** + * Simply prints each incoming call. +@@ -48,7 +47,7 @@ + */ + public class PrintContentGenerator implements ContentGenerator + { +- private static final Log logger = LogFactory.getLog(PrintContentGenerator.class); ++ private static final Logger logger = Logger.getLogger(PrintContentGenerator.class.getName()); + + + private static class PrintContentGeneratorState implements State +@@ -96,56 +95,56 @@ + */ + public void startedDocument(final PageContext pageContext) + { +- logger.debug("<document>"); ++ logger.config("<document>"); + renderer.startedDocument(pageContext); + } + + public void startedFlow(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<flow tag='" + element.getTagName() + "'>"); ++ logger.config("<flow tag='" + element.getTagName() + "'>"); + renderer.startedFlow(element); + } + + public void startedTable(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<table>"); ++ logger.config("<table>"); + renderer.startedTable(element); + } + + public void startedTableColumnGroup(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<table-col-group>"); ++ logger.config("<table-col-group>"); + renderer.startedTableColumnGroup(element); + } + + public void startedTableColumn(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<table-col>"); ++ logger.config("<table-col>"); + renderer.startedTableColumn(element); + } + + public void startedTableSection(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<table-section>"); ++ logger.config("<table-section>"); + renderer.startedTableSection(element); + } + + public void startedTableRow(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<table-row>"); ++ logger.config("<table-row>"); + renderer.startedTableRow(element); + } + + public void startedTableCell(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<table-cell>"); ++ logger.config("<table-cell>"); + renderer.startedTableCell(element); + } + +@@ -153,7 +152,7 @@ + throws NormalizationException + { + final String tagName = element.getTagName(); +- logger.debug("<block tag='" + tagName + "'>"); ++ logger.config("<block tag='" + tagName + "'>"); + renderer.startedBlock(element); + } + +@@ -161,14 +160,14 @@ + throws NormalizationException + { + final String tagName = element.getTagName(); +- logger.debug("<paragraph tag='" + tagName + "'>"); ++ logger.config("<paragraph tag='" + tagName + "'>"); + renderer.startedRootInline(element); + } + + public void startedMarker(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<marker>"); ++ logger.config("<marker>"); + renderer.startedMarker(element); + } + +@@ -176,80 +175,80 @@ + throws NormalizationException + { + final String tagName = element.getTagName(); +- logger.debug("<inline tag='" + tagName + "'>"); ++ logger.config("<inline tag='" + tagName + "'>"); + renderer.startedInline(element); + } + + public void addContent(final LayoutContext node, final ContentToken token) + throws NormalizationException + { +- logger.debug("<content>" + token + "</content>"); ++ logger.config("<content>" + token + "</content>"); + renderer.addContent(node, token); + } + + public void finishedInline() throws NormalizationException + { +- logger.debug("</inline>"); ++ logger.config("</inline>"); + renderer.finishedInline(); + } + + public void finishedMarker() throws NormalizationException + { +- logger.debug("</marker>"); ++ logger.config("</marker>"); + renderer.finishedMarker(); + } + + public void finishedRootInline() throws NormalizationException + { +- logger.debug("</paragraph>"); ++ logger.config("</paragraph>"); + renderer.finishedRootInline(); + } + + public void finishedBlock() throws NormalizationException + { +- logger.debug("</block>"); ++ logger.config("</block>"); + renderer.finishedBlock(); + } + + public void finishedTableCell() throws NormalizationException + { +- logger.debug("</table-cell>"); ++ logger.config("</table-cell>"); + renderer.finishedTableCell(); + } + + public void finishedTableRow() throws NormalizationException + { +- logger.debug("</table-row>"); ++ logger.config("</table-row>"); + renderer.finishedTableRow(); + } + + public void finishedTableSection() throws NormalizationException + { +- logger.debug("</table-section>"); ++ logger.config("</table-section>"); + renderer.finishedTableSection(); + } + + public void finishedTableColumn() throws NormalizationException + { +- logger.debug("</table-col>"); ++ logger.config("</table-col>"); + renderer.finishedTableColumn(); + } + + public void finishedTableColumnGroup() throws NormalizationException + { +- logger.debug("</table-col-group>"); ++ logger.config("</table-col-group>"); + renderer.finishedTableColumnGroup(); + } + + public void finishedTable() throws NormalizationException + { +- logger.debug("</table>"); ++ logger.config("</table>"); + renderer.finishedTable(); + } + + public void finishedFlow() throws NormalizationException + { +- logger.debug("</flow>"); ++ logger.config("</flow>"); + renderer.finishedFlow(); + } + +@@ -259,7 +258,7 @@ + */ + public void finishedDocument() throws NormalizationException + { +- logger.debug("</document>"); ++ logger.config("</document>"); + renderer.finishedDocument(); + } + +@@ -276,7 +275,7 @@ + public void startedPassThrough(final LayoutContext element) + throws NormalizationException + { +- logger.debug("<pass-through>"); ++ logger.config("<pass-through>"); + renderer.startedPassThrough(element); + } + +@@ -284,26 +283,26 @@ + final ContentToken token) + throws NormalizationException + { +- logger.debug("<pass-through-content>" + token + "</pass-through-content>"); ++ logger.config("<pass-through-content>" + token + "</pass-through-content>"); + renderer.addPassThroughContent(node, token); + } + + public void finishedPassThrough() throws NormalizationException + { +- logger.debug("</pass-through>"); ++ logger.config("</pass-through>"); + renderer.finishedPassThrough(); + } + + public void startedTableCaption(final LayoutContext context) + throws NormalizationException + { +- logger.debug("<table-caption>"); ++ logger.config("<table-caption>"); + renderer.startedTableCaption(context); + } + + public void finishedTableCaption() throws NormalizationException + { +- logger.debug("</table-caption>"); ++ logger.config("</table-caption>"); + renderer.finishedTableCaption(); + } + +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/renderer/model/RenderBox.java liblayout-0.2.10/source/org/jfree/layouting/renderer/model/RenderBox.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/renderer/model/RenderBox.java 2021-04-07 10:34:09.779045241 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/renderer/model/RenderBox.java 2021-04-07 10:49:14.499179135 +0100 +@@ -44,8 +44,7 @@ + import org.jfree.layouting.renderer.text.ExtendedBaselineInfo; + import org.jfree.layouting.renderer.text.TextUtility; + import org.pentaho.reporting.libraries.fonts.registry.FontMetrics; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * A render-box corresponds to elements in a DOM tree. +@@ -62,7 +61,7 @@ + */ + public abstract class RenderBox extends RenderNode + { +- private static final Log logger = LogFactory.getLog(RenderBox.class); ++ private static final Logger logger = Logger.getLogger(RenderBox.class.getName()); + public static final boolean LOG_PRUNE = false; + + private RenderNode firstChild; +@@ -930,7 +929,7 @@ + { + if (LOG_PRUNE) + { +- logger.debug("Pruning: " + this); ++ logger.config("Pruning: " + this); + } + getParent().remove(this); + } +@@ -944,7 +943,7 @@ + { + if (LOG_PRUNE) + { +- logger.debug("Pruning: " + lastChild); ++ logger.config("Pruning: " + lastChild); + } + remove(lastChild); + lastChild = getLastChild(); +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/renderer/ModelPrinter.java liblayout-0.2.10/source/org/jfree/layouting/renderer/ModelPrinter.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/renderer/ModelPrinter.java 2021-04-07 10:34:09.786045327 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/renderer/ModelPrinter.java 2021-04-07 10:46:12.757941838 +0100 +@@ -41,8 +41,7 @@ + import org.jfree.layouting.renderer.model.table.cells.TableCell; + import org.jfree.layouting.renderer.model.table.cols.TableColumn; + import org.jfree.layouting.renderer.model.table.cols.TableColumnModel; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: Jan 9, 2007, 2:22:59 PM +@@ -51,7 +50,7 @@ + */ + public class ModelPrinter + { +- private static final Log logger = LogFactory.getLog (ModelPrinter.class); ++ private static final Logger logger = Logger.getLogger(ModelPrinter.class.getName()); + + private ModelPrinter() + { +@@ -66,7 +65,7 @@ + b.append('['); + b.append(Integer.toHexString(System.identityHashCode(node))); + b.append(']'); +- logger.debug (b); ++ logger.config(b.toString()); + node = node.getParent(); + } + } +@@ -96,7 +95,7 @@ + b.append(", height="); + b.append(box.getHeight()); + b.append('}'); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + + b = new StringBuffer(); + for (int i = 0; i < level; i++) +@@ -105,7 +104,7 @@ + } + b.append("- nodeLayoutProperties="); + b.append(box.getNodeLayoutProperties()); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + + b = new StringBuffer(); + for (int i = 0; i < level; i++) +@@ -114,7 +113,7 @@ + } + b.append("- boxLayoutProperties="); + b.append(box.getBoxLayoutProperties()); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + + if (box instanceof TableRowRenderBox) + { +@@ -124,7 +123,7 @@ + for (int i = 0; i < rowInfoStructure.getCellCount(); i++) + { + final TableCell cell = rowInfoStructure.getCellAt(i); +- logger.debug ("CELL: " + i + " = " + cell.getRowSpan() + ' ' + cell.getColSpan() + ' ' + cell); ++ logger.config("CELL: " + i + " = " + cell.getRowSpan() + ' ' + cell.getColSpan() + ' ' + cell); + } + } + else if (box instanceof TableRenderBox) +@@ -134,7 +133,7 @@ + for (int i = 0; i < columnModel.getColumnCount(); i++) + { + final TableColumn col = columnModel.getColumn(i); +- logger.debug ("COLUMN: EffectiveSize: " + col.getEffectiveSize() + " Computed Max Width: " + col.getComputedMaximumWidth() + " Computed ChunkSize: " + col.getComputedMinChunkSize()); ++ logger.config("COLUMN: EffectiveSize: " + col.getEffectiveSize() + " Computed Max Width: " + col.getComputedMaximumWidth() + " Computed ChunkSize: " + col.getComputedMinChunkSize()); + // for (int cs = 1; cs < 3; cs++) + // { + // Log.debug ("* COLUMN: " + i + "(" + cs + ") " + +@@ -149,14 +148,14 @@ + else if (box instanceof TableCellRenderBox) + { + final TableCellRenderBox cellBox = (TableCellRenderBox) box; +- logger.debug ("CELL: Position: " + cellBox.getColumnIndex()); ++ logger.config("CELL: Position: " + cellBox.getColumnIndex()); + } + else if (box instanceof ParagraphRenderBox) + { + final ParagraphRenderBox paraBox = (ParagraphRenderBox) box; +- logger.debug ("-----------------------------------------------------"); ++ logger.config("-----------------------------------------------------"); + printBox(paraBox.getLineboxContainer(), level + 1); +- logger.debug ("-----------------------------------------------------"); ++ logger.config("-----------------------------------------------------"); + } + + printChilds(box, level); +@@ -203,7 +202,7 @@ + b.append(", height="); + b.append(node.getHeight()); + b.append('}'); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + + + b = new StringBuffer(); +@@ -213,7 +212,7 @@ + } + b.append("- nodeLayoutProperties="); + b.append(node.getNodeLayoutProperties()); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + } + + private static void printText(final RenderableText text, final int level) +@@ -238,7 +237,7 @@ + b.append(", text='"); + b.append(text.getRawText()); + b.append("'}"); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + + b = new StringBuffer(); + for (int i = 0; i < level; i++) +@@ -247,7 +246,7 @@ + } + b.append("- nodeLayoutProperties="); + b.append(text.getNodeLayoutProperties()); +- logger.debug(b.toString()); ++ logger.config(b.toString()); + } + + } +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/renderer/PrintingRenderer.java liblayout-0.2.10/source/org/jfree/layouting/renderer/PrintingRenderer.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/renderer/PrintingRenderer.java 2021-04-07 10:34:09.786045327 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/renderer/PrintingRenderer.java 2021-04-07 10:45:03.987095239 +0100 +@@ -37,8 +37,7 @@ + import org.jfree.layouting.layouter.context.LayoutContext; + import org.jfree.layouting.layouter.context.PageContext; + import org.jfree.layouting.normalizer.content.NormalizationException; +-import org.apache.commons.logging.LogFactory; +-import org.apache.commons.logging.Log; ++import java.util.logging.Logger; + + /** + * Creation-Date: 17.07.2006, 17:43:21 +@@ -47,7 +46,7 @@ + */ + public class PrintingRenderer implements Renderer + { +- private static final Log logger = LogFactory.getLog(PrintingRenderer.class); ++ private static final Logger logger = Logger.getLogger(PrintingRenderer.class.getName()); + private static class PrintingRendererState implements State + { + private State parentState; +@@ -89,7 +88,7 @@ + */ + public void startedDocument(final PageContext pageContext) + { +- logger.debug ("<document>"); ++ logger.config("<document>"); + parent.startedDocument(pageContext); + } + +@@ -102,7 +101,7 @@ + public void startedFlow(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<flow " + ++ logger.config("<flow " + + "tag='" + context.getTagName() + "' namespace='" + context.getNamespace() + "'>"); + parent.startedFlow(context); + } +@@ -110,7 +109,7 @@ + public void startedTable(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<table " + ++ logger.config("<table " + + "tag='" + context.getTagName() + "' namespace='" + context.getNamespace() + "'>"); + parent.startedTable(context); + } +@@ -118,7 +117,7 @@ + public void startedTableSection(final LayoutContext layoutContext) + throws NormalizationException + { +- logger.debug ("<table-section " + ++ logger.config("<table-section " + + "tag='" + layoutContext.getTagName() + "' namespace='" + layoutContext.getNamespace() + "'>"); + parent.startedTableSection(layoutContext); + } +@@ -126,7 +125,7 @@ + public void startedTableRow(final LayoutContext layoutContext) + throws NormalizationException + { +- logger.debug ("<table-row " + ++ logger.config("<table-row " + + "tag='" + layoutContext.getTagName() + "' namespace='" + layoutContext.getNamespace() + "'>"); + parent.startedTableRow(layoutContext); + } +@@ -134,7 +133,7 @@ + public void startedTableCell(final LayoutContext layoutContext) + throws NormalizationException + { +- logger.debug ("<table-cell " + ++ logger.config("<table-cell " + + "tag='" + layoutContext.getTagName() + "' namespace='" + layoutContext.getNamespace() + "'>"); + parent.startedTableCell(layoutContext); + } +@@ -142,7 +141,7 @@ + public void startedBlock(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<block " + ++ logger.config("<block " + + "tag='" + context.getTagName() + "' namespace='" + context.getNamespace() + "'>"); + parent.startedBlock(context); + } +@@ -150,7 +149,7 @@ + public void startedMarker(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<marker " + ++ logger.config("<marker " + + "tag='" + context.getTagName() + "' namespace='" + context.getNamespace() + "'>"); + parent.startedMarker(context); + } +@@ -158,7 +157,7 @@ + public void startedRootInline(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<paragraph " + ++ logger.config("<paragraph " + + "tag='" + context.getTagName() + "' namespace='" + context.getNamespace() + "'>"); + parent.startedRootInline(context); + } +@@ -166,7 +165,7 @@ + public void startedInline(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<inline " + ++ logger.config("<inline " + + "tag='" + context.getTagName() + "' namespace='" + context.getNamespace() + "'>"); + parent.startedInline(context); + } +@@ -175,93 +174,93 @@ + final ContentToken content) + throws NormalizationException + { +- logger.debug ("<content>" + content + "</content>"); ++ logger.config("<content>" + content + "</content>"); + parent.addContent(context, content); + } + + public void finishedInline() throws NormalizationException + { +- logger.debug ("</inline>"); ++ logger.config("</inline>"); + parent.finishedInline(); + } + + public void finishedRootInline() throws NormalizationException + { +- logger.debug ("</paragraph>"); ++ logger.config("</paragraph>"); + parent.finishedRootInline(); + } + + public void finishedMarker() throws NormalizationException + { +- logger.debug ("</marker>"); ++ logger.config("</marker>"); + parent.finishedMarker(); + } + + public void finishedBlock() throws NormalizationException + { +- logger.debug ("</block>"); ++ logger.config("</block>"); + parent.finishedBlock(); + } + + public void finishedTableCell() throws NormalizationException + { +- logger.debug ("</table-cell>"); ++ logger.config("</table-cell>"); + parent.finishedTableCell(); + } + + public void finishedTableRow() throws NormalizationException + { +- logger.debug ("</table-row>"); ++ logger.config("</table-row>"); + parent.finishedTableRow(); + } + + public void finishedTableSection() throws NormalizationException + { +- logger.debug ("</table-section>"); ++ logger.config("</table-section>"); + parent.finishedTableSection(); + } + + public void finishedTable() throws NormalizationException + { +- logger.debug ("</table>"); ++ logger.config("</table>"); + parent.finishedTable(); + } + + public void finishedFlow() throws NormalizationException + { +- logger.debug ("</flow>"); ++ logger.config("</flow>"); + parent.finishedFlow(); + } + + public void finishedDocument() throws NormalizationException + { +- logger.debug ("</document>"); ++ logger.config("</document>"); + parent.finishedDocument(); + } + + public void startedTableColumnGroup(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<table-column-group>"); ++ logger.config("<table-column-group>"); + parent.startedTableColumnGroup(context); + } + + public void startedTableColumn(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<table-column>"); ++ logger.config("<table-column>"); + parent.startedTableColumn(context); + } + + public void finishedTableColumnGroup() throws NormalizationException + { +- logger.debug ("</table-column-group>"); ++ logger.config("</table-column-group>"); + parent.finishedTableColumnGroup(); + } + + public void finishedTableColumn() throws NormalizationException + { +- logger.debug ("</table-column>"); ++ logger.config("</table-column>"); + parent.finishedTableColumn(); + } + +@@ -274,14 +273,14 @@ + */ + public void handlePageBreak(final PageContext pageContext) + { +- logger.debug ("<!-- PAGEBREAK ENCOUNTERED -->"); ++ logger.config("<!-- PAGEBREAK ENCOUNTERED -->"); + parent.handlePageBreak(pageContext); + } + + public void startedPassThrough(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<pass-through>"); ++ logger.config("<pass-through>"); + parent.startedPassThrough(context); + } + +@@ -289,13 +288,13 @@ + final ContentToken content) + throws NormalizationException + { +- logger.debug ("<pass-through-content>" + content + "</pass-through-content>"); ++ logger.config("<pass-through-content>" + content + "</pass-through-content>"); + parent.addPassThroughContent(context, content); + } + + public void finishedPassThrough() throws NormalizationException + { +- logger.debug ("</pass-through>"); ++ logger.config("</pass-through>"); + parent.finishedPassThrough(); + } + +@@ -307,13 +306,13 @@ + public void startedTableCaption(final LayoutContext context) + throws NormalizationException + { +- logger.debug ("<table-caption>"); ++ logger.config("<table-caption>"); + parent.startedTableCaption(context); + } + + public void finishedTableCaption() throws NormalizationException + { +- logger.debug ("</table-caption>"); ++ logger.config("</table-caption>"); + parent.finishedTableCaption(); + } + } +diff -ru liblayout-0.2.10.orig/source/org/jfree/layouting/util/AttributeMap.java liblayout-0.2.10/source/org/jfree/layouting/util/AttributeMap.java +--- liblayout-0.2.10.orig/source/org/jfree/layouting/util/AttributeMap.java 2021-04-07 10:34:09.787045339 +0100 ++++ liblayout-0.2.10/source/org/jfree/layouting/util/AttributeMap.java 2021-04-07 10:48:57.444969193 +0100 +@@ -35,8 +35,7 @@ + import java.util.Iterator; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + + /** +@@ -46,7 +45,7 @@ + */ + public class AttributeMap implements Serializable, Cloneable + { +- private static final Log logger = LogFactory.getLog(AttributeMap.class); ++ private static final Logger logger = Logger.getLogger(AttributeMap.class.getName()); + + private static final long serialVersionUID = -7442871030874215436L; + private static final String[] EMPTY_NAMESPACES = new String[0]; +@@ -102,7 +101,7 @@ + } + catch (Exception e) + { +- logger.error("Clone failed for ReportAttributeMap.createUnmodifiableMap", e); ++ logger.severe("Clone failed for ReportAttributeMap.createUnmodifiableMap:" + e); + throw new IllegalStateException("Clone failed for ReportAttributeMap.createUnmodifiableMap"); + } + } diff --git a/external/jfreereport/patches/liblayout.patch b/external/jfreereport/patches/liblayout.patch index cf82b5c05a80..9e68986a86a5 100644 --- a/external/jfreereport/patches/liblayout.patch +++ b/external/jfreereport/patches/liblayout.patch @@ -1,13 +1,12 @@ --- misc/liblayout-0.2.10/build.xml (Revision 6728) +++ misc/build/liblayout-0.2.10/build.xml (Arbeitskopie) -@@ -24,9 +24,16 @@ +@@ -24,9 +24,15 @@ <!-- Setup the compile classpath --> <path id="classpath"> - <fileset dir="lib"> - <include name="*.jar" /> - </fileset> -+ <pathelement path="${commons-logging.jar}"/> + <pathelement path="${flute.jar}"/> + <pathelement path="${libbase.jar}"/> + <pathelement path="${libformula.jar}"/> diff --git a/external/jfreereport/patches/libloader-1.1.3-remove-commons-logging.patch.1 b/external/jfreereport/patches/libloader-1.1.3-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..fad07d59ded8 --- /dev/null +++ b/external/jfreereport/patches/libloader-1.1.3-remove-commons-logging.patch.1 @@ -0,0 +1,635 @@ +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/DefaultResourceManagerBackend.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/DefaultResourceManagerBackend.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/DefaultResourceManagerBackend.java 2021-04-07 10:55:58.343147414 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/DefaultResourceManagerBackend.java 2021-04-07 11:08:48.389599751 +0100 +@@ -22,8 +22,8 @@ + import java.util.Iterator; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + +@@ -34,7 +34,7 @@ + */ + public class DefaultResourceManagerBackend implements ResourceManagerBackend + { +- private static final Log logger = LogFactory.getLog(DefaultResourceManagerBackend.class); ++ private static final Logger logger = Logger.getLogger(DefaultResourceManagerBackend.class.getName()); + + private ArrayList resourceLoaders; + private ArrayList resourceBundleLoaders; +@@ -280,9 +280,9 @@ + { + // ignore it, try the next factory ... + exception = rex; +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("Failed at " + fact.getClass() + ": ", rex); ++ logger.config("Failed at " + fact.getClass() + ": " + rex); + } + } + } +@@ -413,7 +413,7 @@ + { + throw new UnrecognizedLoaderException("Invalid key: No resource-loader registered for schema: " + key.getSchema()); + } +- logger.debug("Loaded " + key); ++ logger.config("Loaded " + key); + return loader.load(key); + } + +@@ -451,7 +451,7 @@ + ResourceLoader.class); + if (loader != null) + { +- //Log.debug("Registering loader for " + loader.getSchema()); ++ //Log.config("Registering loader for " + loader.getSchema()); + registerLoader(loader); + } + } +@@ -465,7 +465,7 @@ + ResourceManager.class, ResourceBundleLoader.class); + if (loader != null) + { +- //Log.debug("Registering loader for " + loader.getSchema()); ++ //Log.config("Registering loader for " + loader.getSchema()); + registerBundleLoader(loader); + } + } +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/factory/drawable/DrawableWrapper.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/factory/drawable/DrawableWrapper.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/factory/drawable/DrawableWrapper.java 2021-04-07 10:55:58.342147402 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/factory/drawable/DrawableWrapper.java 2021-04-07 11:05:40.206289803 +0100 +@@ -27,8 +27,8 @@ + import java.util.Collections; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * Creation-Date: 05.12.2007, 19:15:56 +@@ -37,7 +37,7 @@ + */ + public class DrawableWrapper + { +- private static final Log logger = LogFactory.getLog(DrawableWrapper.class); ++ private static final Logger logger = Logger.getLogger(DrawableWrapper.class.getName()); + private static final Map drawables = Collections.synchronizedMap(new HashMap()); + + private Object backend; +@@ -67,9 +67,9 @@ + Modifier.isAbstract(modifiers) || + Modifier.isStatic(modifiers)) + { +- if (logger.isWarnEnabled()) ++ if (logger.isLoggable(Level.WARNING)) + { +- logger.warn("DrawMethod is not valid: " + aClass + '#' + drawMethod); ++ logger.warning("DrawMethod is not valid: " + aClass + '#' + drawMethod); + } + drawMethod = null; + } +@@ -77,9 +77,9 @@ + catch (NoSuchMethodException e) + { + // ignore exception +- if (logger.isWarnEnabled()) ++ if (logger.isLoggable(Level.WARNING)) + { +- logger.warn("The object is not a drawable: " + aClass); ++ logger.warning("The object is not a drawable: " + aClass); + } + drawMethod = null; + } +@@ -141,9 +141,9 @@ + } + catch (Exception e) + { +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.warn("Invoking draw failed:", e); ++ logger.warning("Invoking draw failed: " + e); + } + } + } +@@ -167,9 +167,9 @@ + } + catch (Exception e) + { +- if (logger.isWarnEnabled()) ++ if (logger.isLoggable(Level.WARNING)) + { +- logger.warn("Invoking getPreferredSize failed:", e); ++ logger.warning("Invoking getPreferredSize failed: " + e); + } + return null; + } +@@ -193,9 +193,9 @@ + } + catch (Exception e) + { +- if (logger.isWarnEnabled()) ++ if (logger.isLoggable(Level.WARNING)) + { +- logger.warn("Invoking isKeepAspectRatio failed:", e); ++ logger.warning("Invoking isKeepAspectRatio failed: " + e); + } + return false; + } +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/file/FileResourceLoader.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/file/FileResourceLoader.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/file/FileResourceLoader.java 2021-04-07 10:55:58.344147426 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/file/FileResourceLoader.java 2021-04-07 11:03:22.711602044 +0100 +@@ -24,8 +24,7 @@ + import java.util.HashMap; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.resourceloader.ResourceKey; + import org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException; +@@ -43,7 +42,7 @@ + public class FileResourceLoader implements ResourceLoader + { + public static final String SCHEMA_NAME = FileResourceLoader.class.getName(); +- private static final Log logger = LogFactory.getLog(FileResourceLoader.class); ++ private static final Logger logger = Logger.getLogger(FileResourceLoader.class.getName()); + + public FileResourceLoader() + { +@@ -210,7 +209,7 @@ + } + + // Log information +- logger.debug("Serializing a File Resource Key..."); ++ logger.config("Serializing a File Resource Key..."); + if (key.getParent() != null) + { + throw new ResourceException +@@ -224,7 +223,7 @@ + final String strIdentifier = file.getCanonicalPath(); + final String result = ResourceKeyUtils.createStringResourceKey + (key.getSchema().toString(), strIdentifier, key.getFactoryParameters()); +- logger.debug("Serialized File Resource Key: [" + result + "]"); ++ logger.config("Serialized File Resource Key: [" + result + "]"); + return result; + } + catch (IOException ioe) +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/raw/RawResourceLoader.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/raw/RawResourceLoader.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/raw/RawResourceLoader.java 2021-04-07 10:55:58.343147414 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/raw/RawResourceLoader.java 2021-04-07 11:01:56.064538444 +0100 +@@ -21,8 +21,7 @@ + import java.util.HashMap; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.resourceloader.ResourceException; + import org.pentaho.reporting.libraries.resourceloader.ResourceKey; +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/resource/ClassloaderResourceLoader.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/resource/ClassloaderResourceLoader.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/resource/ClassloaderResourceLoader.java 2021-04-07 10:55:58.343147414 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/resource/ClassloaderResourceLoader.java 2021-04-07 11:03:14.370499656 +0100 +@@ -21,8 +21,7 @@ + import java.util.Map; + import java.net.URL; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.resourceloader.ResourceKey; + import org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException; +@@ -41,7 +40,7 @@ + public class ClassloaderResourceLoader implements ResourceLoader + { + public static final String SCHEMA_NAME = ClassloaderResourceLoader.class.getName(); +- private static final Log logger = LogFactory.getLog(ClassloaderResourceLoader.class); ++ private static final Logger logger = Logger.getLogger(ClassloaderResourceLoader.class.getName()); + + public ClassloaderResourceLoader() + { +@@ -197,7 +196,7 @@ + } + + // Log information +- logger.debug("Serializing a Classloader Resource Key..."); ++ logger.config("Serializing a Classloader Resource Key..."); + if (key.getParent() != null) + { + throw new ResourceException +@@ -207,7 +206,7 @@ + // Serialize the key + final String result = ResourceKeyUtils.createStringResourceKey(key.getSchema().toString(), + (String) key.getIdentifier(), key.getFactoryParameters()); +- logger.debug("Serialized Classloader Resource Key: [" + result + "]"); ++ logger.config("Serialized Classloader Resource Key: [" + result + "]"); + return result; + } + +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/URLResourceLoader.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/URLResourceLoader.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/URLResourceLoader.java 2021-04-07 10:55:58.344147426 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/URLResourceLoader.java 2021-04-07 11:03:41.998838804 +0100 +@@ -22,8 +22,7 @@ + import java.util.HashMap; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.resourceloader.ResourceKey; + import org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException; +@@ -40,7 +39,7 @@ + public class URLResourceLoader implements ResourceLoader + { + public static final String SCHEMA_NAME = URLResourceLoader.class.getName(); +- private static final Log logger = LogFactory.getLog(URLResourceLoader.class); ++ private static final Logger logger = Logger.getLogger(URLResourceLoader.class.getName()); + + public URLResourceLoader() + { +@@ -188,10 +187,10 @@ + } + + // Log information +- logger.debug("Serializing a Classloader Resource Key..."); ++ logger.config("Serializing a Classloader Resource Key..."); + if (key.getParent() != null) + { +- logger.warn("Serializing a Classloader Resource Key which contains a parent: key=[" + bundleKey + "] parent=[" ++ logger.warning("Serializing a Classloader Resource Key which contains a parent: key=[" + bundleKey + "] parent=[" + + key.getParent() + "]"); + } + +@@ -199,7 +198,7 @@ + final URL url = (URL) key.getIdentifier(); + final String result = ResourceKeyUtils.createStringResourceKey + (key.getSchema().toString(), url.toExternalForm(), key.getFactoryParameters()); +- logger.debug("Serialized Classloader Resource Key: [" + result + "]"); ++ logger.config("Serialized Classloader Resource Key: [" + result + "]"); + return result; + } + +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/zip/ZipResourceLoader.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/zip/ZipResourceLoader.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/loader/zip/ZipResourceLoader.java 2021-04-07 10:55:58.344147426 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/loader/zip/ZipResourceLoader.java 2021-04-07 11:02:18.522814132 +0100 +@@ -21,8 +21,7 @@ + import java.util.HashMap; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.resourceloader.ResourceException; + import org.pentaho.reporting.libraries.resourceloader.ResourceKey; +@@ -40,7 +39,7 @@ + public class ZipResourceLoader implements ResourceLoader + { + public static final String SCHEMA_NAME = ZipResourceLoader.class.getName(); +- private static final Log logger = LogFactory.getLog(ZipResourceLoader.class); ++ private static final Logger logger = Logger.getLogger(ZipResourceLoader.class.getName()); + + public ZipResourceLoader() + { +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHCacheModule.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHCacheModule.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHCacheModule.java 2021-04-07 10:55:58.345147438 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHCacheModule.java 2021-04-07 10:58:52.758288370 +0100 +@@ -20,8 +20,7 @@ + import org.pentaho.reporting.libraries.base.boot.AbstractModule; + import org.pentaho.reporting.libraries.base.boot.ModuleInitializeException; + import org.pentaho.reporting.libraries.base.boot.SubSystem; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: 13.04.2006, 16:29:07 +@@ -30,7 +29,7 @@ + */ + public class EHCacheModule extends AbstractModule + { +- public static final Log CACHE_MONITOR = LogFactory.getLog(EHCacheModule.class.getName() + "#CacheLog"); ++ public static final Logger CACHE_MONITOR = Logger.getLogger(EHCacheModule.class.getName() + "#CacheLog"); + + public EHCacheModule() throws ModuleInitializeException + { +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceFactoryCache.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceFactoryCache.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceFactoryCache.java 2021-04-07 10:55:58.345147438 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceFactoryCache.java 2021-04-07 10:59:17.251589016 +0100 +@@ -20,8 +20,8 @@ + import net.sf.ehcache.Cache; + import net.sf.ehcache.CacheException; + import net.sf.ehcache.Element; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.Resource; + import org.pentaho.reporting.libraries.resourceloader.ResourceKey; + import org.pentaho.reporting.libraries.resourceloader.cache.ResourceFactoryCache; +@@ -110,7 +109,7 @@ + } + } + +- private static final Log logger = LogFactory.getLog(EHResourceFactoryCache.class); ++ private static final Logger logger = Logger.getLogger(EHResourceFactoryCache.class.getName()); + private Cache factoryCache; + + public EHResourceFactoryCache(final Cache factoryCache) +@@ -128,16 +128,16 @@ + final Resource res = getInternal(key, target[i]); + if (res != null) + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Res Cache Hit " + key); ++ EHCacheModule.CACHE_MONITOR.config("Res Cache Hit " + key); + } + return res; + } + } +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Res Cache Miss " + key); ++ EHCacheModule.CACHE_MONITOR.config("Res Cache Miss " + key); + } + return null; + } +@@ -168,9 +168,9 @@ + } + catch (CacheException e) + { +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("Failed to retrieve resource for key " + key, e); ++ logger.config("Failed to retrieve resource for key " + key + ": " + e); + } + return null; + } +@@ -185,9 +185,9 @@ + } + catch (Exception e) + { +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("Failed to store resource for key " + source, e); ++ logger.config("Failed to store resource for key " + source + ": " + e); + } + // ignore ... the object is not serializable .. + } +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/ResourceKeyUtils.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/ResourceKeyUtils.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/ResourceKeyUtils.java 2021-04-07 10:55:58.342147402 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/ResourceKeyUtils.java 2021-04-07 11:06:27.248867251 +0100 +@@ -27,8 +27,8 @@ + import java.util.Iterator; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.util.CSVQuoter; + import org.pentaho.reporting.libraries.base.util.CSVTokenizer; + import org.pentaho.reporting.libraries.base.util.IOUtils; +@@ -42,7 +42,7 @@ + { + private static final String DELIMITER = ";"; + private static final String SERIALIZATION_PREFIX = "resourcekey:"; +- private static final Log logger = LogFactory.getLog(ResourceManager.class); ++ private static final Logger logger = Logger.getLogger(ResourceManager.class.getName()); + + /** + * Returns a string representation of the ResourceKey based on the pieces that are passed as parameters +@@ -169,7 +169,7 @@ + + sb.append(quoter.doQuoting(entrySb.toString())); + } +- logger.debug("Converted ResourceKey's Factory Parameters to String: [" + sb.toString() + "]"); ++ logger.config("Converted ResourceKey's Factory Parameters to String: [" + sb.toString() + "]"); + return sb.toString(); + } + +@@ -226,9 +226,9 @@ + params.put(key, value); + } + +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("Converted ResourceKey's Factory Parameter String to a Map: [" + factoryParameters ++ logger.config("Converted ResourceKey's Factory Parameter String to a Map: [" + factoryParameters + + "] -> map of size " + params.size()); + } + return params; +@@ -369,7 +369,7 @@ + } + catch (IOException e) + { +- logger.error("Error closing input stream", e); ++ logger.severe("Error closing input stream: " + e); + } + } + } +diff -ru libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/ResourceManager.java libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/ResourceManager.java +--- libloader-1.1.3.orig/source/org/pentaho/reporting/libraries/resourceloader/ResourceManager.java 2021-04-07 10:55:58.344147426 +0100 ++++ libloader-1.1.3/source/org/pentaho/reporting/libraries/resourceloader/ResourceManager.java 2021-04-07 11:07:50.557889876 +0100 +@@ -22,8 +22,8 @@ + import java.util.Map; + import java.util.Set; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + import org.pentaho.reporting.libraries.resourceloader.cache.BundleCacheResourceWrapper; +@@ -57,7 +57,7 @@ + */ + public final class ResourceManager + { +- private static final Log logger = LogFactory.getLog(ResourceManager.class); ++ private static final Logger logger = Logger.getLogger(ResourceManager.class.getName()); + private ResourceManagerBackend backend; + + public static final String BUNDLE_LOADER_PREFIX = "org.pentaho.reporting.libraries.resourceloader.bundle.loader."; +@@ -273,7 +273,7 @@ + final ResourceBundleData bundle = loadResourceBundle(key); + if (bundle != null) + { +- logger.debug("Loaded bundle for key " + key); ++ logger.config("Loaded bundle for key " + key); + return bundle; + } + final ResourceKey parent = key.getParent(); +@@ -283,7 +283,7 @@ + final ResourceBundleData parentData = loadResourceBundle(parent); + if (parentData != null) + { +- logger.debug("Loaded bundle for key (derivate) " + key); ++ logger.config("Loaded bundle for key (derivate) " + key); + return parentData.deriveData(key); + } + } +@@ -400,9 +400,9 @@ + newResource = backend.create(derivedManager, resourceBundleData, context, target); + if (isResourceCacheable(newResource)) + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Storing created bundle-resource for key: " + key); ++ EHCacheModule.CACHE_MONITOR.config("Storing created bundle-resource for key: " + key); + } + factoryCache.put(newResource); + if (key != newResource.getSource()) +@@ -412,9 +412,9 @@ + } + else + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Created bundle-resource is not cacheable for " + key); ++ EHCacheModule.CACHE_MONITOR.config("Created bundle-resource is not cacheable for " + key); + } + } + } +@@ -423,17 +423,17 @@ + newResource = backend.create(this, loadedData, context, target); + if (isResourceCacheable(newResource)) + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Storing created resource for key: " + key); ++ EHCacheModule.CACHE_MONITOR.config("Storing created resource for key: " + key); + } + factoryCache.put(newResource); + } + else + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Created resource is not cacheable for " + key); ++ EHCacheModule.CACHE_MONITOR.config("Created resource is not cacheable for " + key); + } + } + } +@@ -556,7 +556,7 @@ + { + if (failedModules.contains(dataCacheProviderClass) == false) + { +- logger.warn("Failed to create data cache: " + e.getLocalizedMessage()); ++ logger.warning("Failed to create data cache: " + e.getLocalizedMessage()); + failedModules.add(dataCacheProviderClass); + } + } +@@ -593,7 +593,7 @@ + { + if (failedModules.contains(dataCacheProviderClass) == false) + { +- logger.warn("Failed to create data cache: " + e.getLocalizedMessage()); ++ logger.warning("Failed to create data cache: " + e.getLocalizedMessage()); + failedModules.add(dataCacheProviderClass); + } + } +@@ -630,7 +630,7 @@ + { + if (failedModules.contains(cacheProviderClass) == false) + { +- logger.warn("Failed to create factory cache: " + e.getLocalizedMessage()); ++ logger.warning("Failed to create factory cache: " + e.getLocalizedMessage()); + failedModules.add(cacheProviderClass); + } + } +--- a/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceBundleDataCache.java ++++ b/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceBundleDataCache.java +@@ -17,6 +17,7 @@ + + package org.pentaho.reporting.libraries.resourceloader.modules.cache.ehcache; + ++import java.util.logging.Level; + import net.sf.ehcache.Cache; + import net.sf.ehcache.CacheException; + import net.sf.ehcache.Element; +@@ -64,17 +65,17 @@ + final Element element = dataCache.get((Object) key); + if (element != null) + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Bund Cache Hit " + key); ++ EHCacheModule.CACHE_MONITOR.config("Bund Cache Hit " + key); + } + return (ResourceBundleDataCacheEntry) element.getObjectValue(); + } + else + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Bund Cache Miss " + key); ++ EHCacheModule.CACHE_MONITOR.config("Bund Cache Miss " + key); + } + return null; + } +@@ -101,9 +102,9 @@ + final Object keyObject = data.getBundleKey(); + final Object valueObject = new DefaultResourceBundleDataCacheEntry(cdata, caller); + final Element element = new Element(keyObject, valueObject); +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Storing Bundle " + keyObject); ++ EHCacheModule.CACHE_MONITOR.config("Storing Bundle " + keyObject); + } + dataCache.put(element); + return cdata; +--- a/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceDataCache.java ++++ b/source/org/pentaho/reporting/libraries/resourceloader/modules/cache/ehcache/EHResourceDataCache.java +@@ -17,6 +17,7 @@ + + package org.pentaho.reporting.libraries.resourceloader.modules.cache.ehcache; + ++import java.util.logging.Level; + import net.sf.ehcache.Cache; + import net.sf.ehcache.CacheException; + import net.sf.ehcache.Element; +@@ -64,15 +65,15 @@ + final Element element = dataCache.get((Object) key); + if (element != null) + { +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Data Cache Hit " + key); ++ EHCacheModule.CACHE_MONITOR.config("Data Cache Hit " + key); + } + return (ResourceDataCacheEntry) element.getObjectValue(); + } +- if (EHCacheModule.CACHE_MONITOR.isDebugEnabled()) ++ if (EHCacheModule.CACHE_MONITOR.isLoggable(Level.CONFIG)) + { +- EHCacheModule.CACHE_MONITOR.debug("Data Cache Miss " + key); ++ EHCacheModule.CACHE_MONITOR.config("Data Cache Miss " + key); + } + return null; + } diff --git a/external/jfreereport/patches/librepository-1.1.3-remove-commons-logging.patch.1 b/external/jfreereport/patches/librepository-1.1.3-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..29acd6043d0a --- /dev/null +++ b/external/jfreereport/patches/librepository-1.1.3-remove-commons-logging.patch.1 @@ -0,0 +1,117 @@ +diff -ru librepository-1.1.3.orig/source/org/pentaho/reporting/libraries/repository/zip/ZipContentLocation.java librepository-1.1.3/source/org/pentaho/reporting/libraries/repository/zip/ZipContentLocation.java +--- librepository-1.1.3.orig/source/org/pentaho/reporting/libraries/repository/zip/ZipContentLocation.java 2021-04-07 11:16:05.369984495 +0100 ++++ librepository-1.1.3/source/org/pentaho/reporting/libraries/repository/zip/ZipContentLocation.java 2021-04-07 11:17:30.417035353 +0100 +@@ -21,8 +21,7 @@ + import java.util.HashMap; + import java.util.zip.ZipEntry; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.repository.ContentCreationException; + import org.pentaho.reporting.libraries.repository.ContentEntity; + import org.pentaho.reporting.libraries.repository.ContentIOException; +@@ -35,7 +34,7 @@ + + public class ZipContentLocation implements ContentLocation + { +- private static final Log logger = LogFactory.getLog(ZipContentLocation.class); ++ private static final Logger logger = Logger.getLogger(ZipContentLocation.class.getName()); + private ZipRepository repository; + private ZipContentLocation parent; + private String comment; +@@ -114,7 +113,7 @@ + final Object entry = entries.get(path); + if (entry instanceof ContentItem) + { +- logger.warn("Directory-Entry with the same name as a Content-Entry encountered: " + path); ++ logger.warning("Directory-Entry with the same name as a Content-Entry encountered: " + path); + return; + } + final ZipContentLocation location; +@@ -164,7 +163,7 @@ + { + if (entry instanceof ContentItem) + { +- logger.warn("Directory-Entry with the same name as a Content-Entry encountered: " + path); ++ logger.warning("Directory-Entry with the same name as a Content-Entry encountered: " + path); + return; + } + +@@ -188,12 +187,12 @@ + { + if (entry instanceof ContentItem) + { +- logger.warn("Duplicate Content-Entry encountered: " + path); ++ logger.warning("Duplicate Content-Entry encountered: " + path); + return; + } + else if (entry != null) + { +- logger.warn("Replacing Directory-Entry with the same name as a Content-Entry: " + path); ++ logger.warning("Replacing Directory-Entry with the same name as a Content-Entry: " + path); + } + final ZipContentItem contentItem = new ZipContentItem(repository, this, zipEntry, data); + entries.put(path, contentItem); +@@ -352,4 +351,4 @@ + { + return (entries.remove(entity.getName()) != null); + } +-} +\ No newline at end of file ++} +diff -ru librepository-1.1.3.orig/source/org/pentaho/reporting/libraries/repository/zipreader/ZipReadContentLocation.java librepository-1.1.3/source/org/pentaho/reporting/libraries/repository/zipreader/ZipReadContentLocation.java +--- librepository-1.1.3.orig/source/org/pentaho/reporting/libraries/repository/zipreader/ZipReadContentLocation.java 2021-04-07 11:16:05.365984446 +0100 ++++ librepository-1.1.3/source/org/pentaho/reporting/libraries/repository/zipreader/ZipReadContentLocation.java 2021-04-07 11:17:22.342935587 +0100 +@@ -21,8 +21,7 @@ + import java.util.HashMap; + import java.util.zip.ZipEntry; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.repository.ContentCreationException; + import org.pentaho.reporting.libraries.repository.ContentEntity; + import org.pentaho.reporting.libraries.repository.ContentIOException; +@@ -39,7 +38,7 @@ + */ + public class ZipReadContentLocation implements ContentLocation + { +- private static final Log logger = LogFactory.getLog(ZipReadContentLocation.class); ++ private static final Logger logger = Logger.getLogger(ZipReadContentLocation.class.getName()); + private ZipReadRepository repository; + private ZipReadContentLocation parent; + private String comment; +@@ -117,7 +116,7 @@ + final Object entry = entries.get(path); + if (entry instanceof ContentItem) + { +- logger.warn("Directory-Entry with the same name as a Content-Entry encountered: " + path); ++ logger.warning("Directory-Entry with the same name as a Content-Entry encountered: " + path); + return; + } + final ZipReadContentLocation location; +@@ -164,7 +163,7 @@ + { + if (entry instanceof ContentItem) + { +- logger.warn("Directory-Entry with the same name as a Content-Entry encountered: " + path); ++ logger.warning("Directory-Entry with the same name as a Content-Entry encountered: " + path); + return; + } + +@@ -188,12 +187,12 @@ + { + if (entry instanceof ContentItem) + { +- logger.warn("Duplicate Content-Entry encountered: " + path); ++ logger.warning("Duplicate Content-Entry encountered: " + path); + return; + } + else if (entry != null) + { +- logger.warn("Replacing Directory-Entry with the same name as a Content-Entry: " + path); ++ logger.warning("Replacing Directory-Entry with the same name as a Content-Entry: " + path); + } + final ZipReadContentItem contentItem = new ZipReadContentItem(repository, this, zipEntry, data); + entries.put(path, contentItem); diff --git a/external/jfreereport/patches/libserializer-1.1.2-remove-commons-logging.patch.1 b/external/jfreereport/patches/libserializer-1.1.2-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..52ee76a77491 --- /dev/null +++ b/external/jfreereport/patches/libserializer-1.1.2-remove-commons-logging.patch.1 @@ -0,0 +1,31 @@ +diff -ru libserializer-1.1.2.orig/source/org/pentaho/reporting/libraries/serializer/SerializerHelper.java libserializer-1.1.2/source/org/pentaho/reporting/libraries/serializer/SerializerHelper.java +--- libserializer-1.1.2.orig/source/org/pentaho/reporting/libraries/serializer/SerializerHelper.java 2021-04-07 11:22:05.509434457 +0100 ++++ libserializer-1.1.2/source/org/pentaho/reporting/libraries/serializer/SerializerHelper.java 2021-04-07 11:23:19.102343782 +0100 +@@ -25,8 +25,7 @@ + import java.util.HashMap; + import java.util.Iterator; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + import org.pentaho.reporting.libraries.base.util.DebugLog; +@@ -41,7 +40,7 @@ + */ + public class SerializerHelper + { +- private static final Log logger = LogFactory.getLog(SerializerHelper.class); ++ private static final Logger logger = Logger.getLogger(SerializerHelper.class.getName()); + /** + * The singleton instance of the serialize helper. + */ +@@ -124,7 +123,7 @@ + } + else + { +- logger.warn("Invalid SerializeMethod implementation: " + c); ++ logger.warning("Invalid SerializeMethod implementation: " + c); + } + } + } diff --git a/external/jfreereport/patches/libxml-1.1.3-remove-commons-logging.patch.1 b/external/jfreereport/patches/libxml-1.1.3-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..ecec88c480ab --- /dev/null +++ b/external/jfreereport/patches/libxml-1.1.3-remove-commons-logging.patch.1 @@ -0,0 +1,313 @@ +diff -ru pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlReadHandler.java pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlReadHandler.java +--- pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlReadHandler.java 2021-04-07 11:34:22.313653786 +0100 ++++ pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlReadHandler.java 2021-04-07 11:48:16.381234640 +0100 +@@ -20,8 +20,8 @@ + import java.util.HashMap; + import java.util.Map; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.DependencyCollector; + import org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey; + import org.pentaho.reporting.libraries.resourceloader.Resource; +@@ -40,7 +40,7 @@ + */ + public abstract class AbstractXmlReadHandler implements XmlReadHandler + { +- private static final Log logger = LogFactory.getLog(AbstractXmlReadHandler.class); ++ private static final Logger logger = Logger.getLogger(AbstractXmlReadHandler.class.getName()); + + /** + * The root handler. +@@ -120,8 +120,8 @@ + final XmlReadHandler childHandler = getHandlerForChild(uri, tagName, attrs); + if (childHandler == null) + { +- logger.warn("Unknown tag <" + uri + ':' + tagName + ">: Start to ignore this element and all of its childs. " + getLocatorString()); +- logger.debug(this.getClass()); ++ logger.warning("Unknown tag <" + uri + ':' + tagName + ">: Start to ignore this element and all of its childs. " + getLocatorString()); ++ logger.config(this.getClass().getName()); + final IgnoreAnyChildReadHandler ignoreAnyChildReadHandler = + new IgnoreAnyChildReadHandler(); + ignoreAnyChildReadHandler.init(getRootHandler(), uri, tagName); +diff -ru pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlResourceFactory.java pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlResourceFactory.java +--- pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlResourceFactory.java 2021-04-07 11:34:22.313653786 +0100 ++++ pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/AbstractXmlResourceFactory.java 2021-04-07 11:44:15.729203631 +0100 +@@ -26,8 +26,7 @@ + import javax.xml.parsers.SAXParser; + import javax.xml.parsers.SAXParserFactory; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.CompoundResource; + import org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey; + import org.pentaho.reporting.libraries.resourceloader.Resource; +@@ -56,7 +55,7 @@ + */ + public abstract class AbstractXmlResourceFactory implements ResourceFactory + { +- private static final Log logger = LogFactory.getLog(AbstractXmlResourceFactory.class); ++ private static final Logger logger = Logger.getLogger(AbstractXmlResourceFactory.class.getName()); + + /** + * A key for the content base. +@@ -115,7 +114,7 @@ + } + catch (SAXException se) + { +- logger.debug("Comments are not supported by this SAX implementation."); ++ logger.config("Comments are not supported by this SAX implementation."); + } + + try +@@ -133,7 +132,7 @@ + } + catch (SAXException e) + { +- logger.warn("No Namespace features will be available. (Yes, this is serious)"); ++ logger.warning("No Namespace features will be available. (Yes, this is serious)"); + } + } + +diff -ru pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/DomTreeResourceFactory.java pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/DomTreeResourceFactory.java +--- pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/DomTreeResourceFactory.java 2021-04-07 11:34:22.314653798 +0100 ++++ pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/DomTreeResourceFactory.java 2021-04-07 11:43:15.934442890 +0100 +@@ -22,8 +22,7 @@ + import javax.xml.parsers.DocumentBuilderFactory; + import javax.xml.parsers.ParserConfigurationException; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.Resource; + import org.pentaho.reporting.libraries.resourceloader.ResourceCreationException; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; +@@ -61,7 +60,7 @@ + } + } + +- private static final Log logger = LogFactory.getLog(DomTreeResourceFactory.class); ++ private static final Logger logger = Logger.getLogger(DomTreeResourceFactory.class.getName()); + + /** + * Creates a resource by interpreting the data given in the resource-data object. If additional datastreams need to +diff -ru pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/LoggingErrorHandler.java pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/LoggingErrorHandler.java +--- pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/LoggingErrorHandler.java 2021-04-07 11:34:22.313653786 +0100 ++++ pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/LoggingErrorHandler.java 2021-04-07 11:49:49.117390246 +0100 +@@ -17,8 +17,8 @@ + + package org.pentaho.reporting.libraries.xmlns.parser; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.xml.sax.ErrorHandler; + import org.xml.sax.SAXException; + import org.xml.sax.SAXParseException; +@@ -30,9 +30,9 @@ + */ + public class LoggingErrorHandler implements ErrorHandler + { +- private static final Log defaultLogContext = LogFactory.getLog(LoggingErrorHandler.class); ++ private static final Logger defaultLogContext = Logger.getLogger(LoggingErrorHandler.class.getName()); + /** @noinspection NonConstantLogger*/ +- private Log logContext; ++ private Logger logContext; + + /** + * Default-Constructor. Logs to a logger configured with this class name as category. +@@ -47,7 +47,7 @@ + * + * @param logContext the logger that should receive the messages. + */ +- public LoggingErrorHandler(final Log logContext) ++ public LoggingErrorHandler(final Logger logContext) + { + if (logContext == null) + { +@@ -78,7 +78,7 @@ + */ + public void warning(final SAXParseException exception) throws SAXException + { +- if (logContext.isDebugEnabled()) ++ if (logContext.isLoggable(Level.CONFIG)) + { + if (exception.getMessage().startsWith("URI was not reported to parser for entity")) + { +@@ -86,7 +86,7 @@ + // the GNU thing complain about it .. + return; + } +- logContext.debug("Parser-Warning", exception); ++ logContext.severe("Parser-Warning: " + exception.getMessage()); + } + } + +@@ -115,15 +115,15 @@ + */ + public void error(final SAXParseException exception) throws SAXException + { +- if (logContext.isWarnEnabled()) ++ if (logContext.isLoggable(Level.WARNING)) + { +- if (logContext.isDebugEnabled()) ++ if (logContext.isLoggable(Level.CONFIG)) + { +- logContext.warn("Recoverable Parser-Error", exception); ++ logContext.warning("Recoverable Parser-Error:" + exception.getMessage()); + } + else + { +- logContext.warn("Recoverable Parser-Error:" + exception.getMessage()); ++ logContext.warning("Recoverable Parser-Error:" + exception.getMessage()); + } + } + } +@@ -156,15 +156,15 @@ + */ + public void fatalError(final SAXParseException exception) throws SAXException + { +- if (logContext.isErrorEnabled()) ++ if (logContext.isLoggable(Level.SEVERE)) + { +- if (logContext.isDebugEnabled()) ++ if (logContext.isLoggable(Level.CONFIG)) + { +- logContext.error("Fatal Parser-Error", exception); ++ logContext.severe("Fatal Parser-Error:" + exception.getMessage()); + } + else + { +- logContext.error("Fatal Parser-Error:" + exception.getMessage()); ++ logContext.severe("Fatal Parser-Error:" + exception.getMessage()); + } + } + } +diff -ru pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/ParserEntityResolver.java pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/ParserEntityResolver.java +--- pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/ParserEntityResolver.java 2021-04-07 11:34:22.314653798 +0100 ++++ pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/ParserEntityResolver.java 2021-04-07 11:43:45.602820344 +0100 +@@ -22,8 +22,7 @@ + import java.net.URL; + import java.util.HashMap; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.xml.sax.EntityResolver; + import org.xml.sax.InputSource; + +@@ -34,7 +33,7 @@ + */ + public final class ParserEntityResolver implements EntityResolver + { +- private static final Log logger = LogFactory.getLog(ParserEntityResolver.class); ++ private static final Logger logger = Logger.getLogger(ParserEntityResolver.class.getName()); + + /** + * The hashtable for the known entities (deprecated DTDs). +@@ -75,7 +74,7 @@ + } + else + { +- logger.warn("Validate location failed for " + publicID + " location: " + location); ++ logger.warning("Validate location failed for " + publicID + " location: " + location); + return false; + } + } +@@ -101,7 +100,7 @@ + } + else + { +- logger.warn("Validate location failed for " + publicID + " location: " + location); ++ logger.warning("Validate location failed for " + publicID + " location: " + location); + return false; + } + } +@@ -195,7 +194,7 @@ + } + catch (IOException ioe) + { +- logger.warn("Unable to open specified DTD", ioe); ++ logger.warning("Unable to open specified DTD: " + ioe); + } + return null; + } +diff -ru pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/ResourceDataInputSource.java pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/ResourceDataInputSource.java +--- pentaho-libxml-1.1.3.orig/source/org/pentaho/reporting/libraries/xmlns/parser/ResourceDataInputSource.java 2021-04-07 11:34:22.312653773 +0100 ++++ pentaho-libxml-1.1.3/source/org/pentaho/reporting/libraries/xmlns/parser/ResourceDataInputSource.java 2021-04-07 11:44:05.484073284 +0100 +@@ -20,8 +20,7 @@ + import java.io.InputStream; + import java.net.URL; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.resourceloader.ResourceData; + import org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException; + import org.pentaho.reporting.libraries.resourceloader.ResourceManager; +@@ -34,7 +33,7 @@ + */ + public class ResourceDataInputSource extends InputSource + { +- private static final Log logger = LogFactory.getLog(ResourceDataInputSource.class); ++ private static final Logger logger = Logger.getLogger(ResourceDataInputSource.class.getName()); + private ResourceData data; + private long version; + private ResourceManager caller; +@@ -103,7 +102,7 @@ + } + catch (ResourceLoadingException e) + { +- logger.error("Unable to create byte-stream: " + data.getKey()); ++ logger.severe("Unable to create byte-stream: " + data.getKey()); + return null; + } + } +--- a/source/org/pentaho/reporting/libraries/xmlns/common/ParserUtil.java ++++ b/source/org/pentaho/reporting/libraries/xmlns/common/ParserUtil.java +@@ -21,8 +21,7 @@ + import org.pentaho.reporting.libraries.xmlns.LibXmlBoot; + import org.xml.sax.Locator; + import org.xml.sax.SAXException; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Basic helper functions to ease up the process of parsing. +@@ -31,7 +30,7 @@ + */ + public class ParserUtil + { +- private static final Log logger = LogFactory.getLog(ParserUtil.class); ++ private static final Logger logger = Logger.getLogger(ParserUtil.class.getName()); + private static boolean strictParsing; + + static +@@ -243,7 +242,7 @@ + return false; + } + +- logger.warn("Invalid value encountered: Expected 'true' or 'false', but got '" + text + "'"); ++ logger.warning("Invalid value encountered: Expected 'true' or 'false', but got '" + text + "'"); + return "true".equalsIgnoreCase(text); + } + } +@@ -281,11 +280,11 @@ + + if (locator == null) + { +- logger.warn("Invalid value encountered for boolean attribute."); ++ logger.warning("Invalid value encountered for boolean attribute."); + } + else + { +- logger.warn("Invalid value encountered for boolean attribute. [Line: " + ++ logger.warning("Invalid value encountered for boolean attribute. [Line: " + + locator.getLineNumber() + " Column: " + locator.getColumnNumber() + "]"); + } + return Boolean.FALSE; diff --git a/external/jfreereport/patches/pentaho-reporting-flow-engine-0.9.4-remove-commons-logging.patch.1 b/external/jfreereport/patches/pentaho-reporting-flow-engine-0.9.4-remove-commons-logging.patch.1 new file mode 100644 index 000000000000..80029e49fe59 --- /dev/null +++ b/external/jfreereport/patches/pentaho-reporting-flow-engine-0.9.4-remove-commons-logging.patch.1 @@ -0,0 +1,101 @@ +diff -ru pentaho-reporting-flow-engine-0.9.4.orig/source/org/jfree/report/JFreeReportBoot.java pentaho-reporting-flow-engine-0.9.4/source/org/jfree/report/JFreeReportBoot.java +--- pentaho-reporting-flow-engine-0.9.4.orig/source/org/jfree/report/JFreeReportBoot.java 2021-04-07 12:09:46.917336778 +0100 ++++ pentaho-reporting-flow-engine-0.9.4/source/org/jfree/report/JFreeReportBoot.java 2021-04-07 12:12:04.794062296 +0100 +@@ -42,8 +42,7 @@ + import org.pentaho.reporting.libraries.base.boot.PackageManager; + import org.pentaho.reporting.libraries.base.versioning.ProjectInformation; + import org.pentaho.reporting.libraries.base.LibBaseBoot; +-import org.apache.commons.logging.LogFactory; +-import org.apache.commons.logging.Log; ++import java.util.logging.Logger; + + /** + * An utility class to safely boot and initialize the JFreeReport library. This class +@@ -66,7 +65,7 @@ + */ + public class JFreeReportBoot extends AbstractBoot + { +- private static final Log logger = LogFactory.getLog(JFreeReportBoot.class); ++ private static final Logger logger = Logger.getLogger(JFreeReportBoot.class.getName()); + + /** + * A wrappper around the user supplied global configuration. +@@ -292,12 +291,12 @@ + // make sure logging is re-initialized after we injected our configuration. + if (isStrictFP() == false) + { +- logger.warn("The used VM seems to use a non-strict floating point arithmetics"); +- logger.warn("Layouts computed with this Java Virtual Maschine may be invalid."); +- logger.warn("JFreeReport and the library 'iText' depend on the strict floating point rules"); +- logger.warn("of Java1.1 as implemented by the Sun Virtual Maschines."); +- logger.warn("If you are using the BEA JRockit VM, start the Java VM with the option"); +- logger.warn("'-Xstrictfp' to restore the default behaviour."); ++ logger.warning("The used VM seems to use a non-strict floating point arithmetics"); ++ logger.warning("Layouts computed with this Java Virtual Maschine may be invalid."); ++ logger.warning("JFreeReport and the library 'iText' depend on the strict floating point rules"); ++ logger.warning("of Java1.1 as implemented by the Sun Virtual Maschines."); ++ logger.warning("If you are using the BEA JRockit VM, start the Java VM with the option"); ++ logger.warning("'-Xstrictfp' to restore the default behaviour."); + } + + final PackageManager mgr = getPackageManager(); +@@ -338,8 +337,8 @@ + } + catch (Exception se) + { +- logger.error +- ("An error occured while checking the system properties for extension modules.", se); ++ logger.severe ++ ("An error occured while checking the system properties for extension modules: " + se); + } + } + +diff -ru pentaho-reporting-flow-engine-0.9.4.orig/source/org/jfree/report/util/ComponentDrawable.java pentaho-reporting-flow-engine-0.9.4/source/org/jfree/report/util/ComponentDrawable.java +--- pentaho-reporting-flow-engine-0.9.4.orig/source/org/jfree/report/util/ComponentDrawable.java 2021-04-07 12:09:46.916336765 +0100 ++++ pentaho-reporting-flow-engine-0.9.4/source/org/jfree/report/util/ComponentDrawable.java 2021-04-07 12:11:25.530570919 +0100 +@@ -42,8 +42,7 @@ + import javax.swing.RepaintManager; + import javax.swing.SwingUtilities; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * Creation-Date: 11.10.2005, 14:03:15 +@@ -52,7 +51,7 @@ + */ + public class ComponentDrawable + { +- private static final Log logger = LogFactory.getLog (ComponentDrawable.class); ++ private static final Logger logger = Logger.getLogger(ComponentDrawable.class.getName()); + + /** + * A runnable that executes the drawing operation on the event-dispatcher thread. +@@ -443,7 +442,7 @@ + } + catch (Exception e) + { +- ComponentDrawable.logger.warn("Failed to compute the preferred size."); ++ ComponentDrawable.logger.warning("Failed to compute the preferred size."); + } + return new Dimension(0, 0); + } +@@ -475,7 +474,7 @@ + } + catch (Exception e) + { +- ComponentDrawable.logger.warn("Failed to compute the defined size."); ++ ComponentDrawable.logger.warning("Failed to compute the defined size."); + } + return new Dimension(0, 0); + } +@@ -563,7 +562,7 @@ + } + catch (Exception e) + { +- ComponentDrawable.logger.warn("Failed to redraw the component."); ++ ComponentDrawable.logger.warning("Failed to redraw the component."); + } + } + } diff --git a/external/languagetool/ExtensionPackage_LanguageTool.mk b/external/languagetool/ExtensionPackage_LanguageTool.mk deleted file mode 100644 index 3b685d707449..000000000000 --- a/external/languagetool/ExtensionPackage_LanguageTool.mk +++ /dev/null @@ -1,14 +0,0 @@ -# -*- 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_ExtensionPackage_ExtensionPackage,LanguageTool,$(call gb_UnpackedTarball_get_dir,languagetool)/dist/LanguageTool.oxt)) - -$(eval $(call gb_ExtensionPackage_use_external_project,LanguageTool,languagetool)) - -# vim: set noet sw=4 ts=4: diff --git a/external/languagetool/ExternalProject_languagetool.mk b/external/languagetool/ExternalProject_languagetool.mk deleted file mode 100644 index ed70df41ad69..000000000000 --- a/external/languagetool/ExternalProject_languagetool.mk +++ /dev/null @@ -1,41 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,languagetool)) - -$(eval $(call gb_ExternalProject_register_targets,languagetool,\ - build \ -)) - -$(eval $(call gb_ExternalProject_use_jars,languagetool,\ - juh \ - jurt \ - ridl \ - unoil \ -)) - -$(call gb_ExternalProject_get_state_target,languagetool,build) : \ - $(call gb_Jar_get_target,libreoffice) - cd "$(call gb_UnpackedTarball_get_dir,languagetool)" && \ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ - $(ICECREAM_RUN) "$(ANT)" \ - $(if $(verbose),-v,-q) \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - -Dsource=$(JAVA_SOURCE_VER) \ - -Dtarget=$(JAVA_TARGET_VER) \ - $(if $(debug),-Dbuild.debug="on") \ - -Dext.ooo.juh.lib="$(call gb_Jar_get_target,juh)" \ - -Dext.ooo.jurt.lib="$(call gb_Jar_get_target,jurt)" \ - -Dext.ooo.ridl.lib="$(call gb_Jar_get_target,ridl)" \ - -Dext.ooo.unoil.lib="$(call gb_Jar_get_target,unoil)" \ - dist && \ - touch $@ - -# vim: set noet sw=4 ts=4: diff --git a/external/languagetool/JLanguageTool-1.4.0-no-hc.patch b/external/languagetool/JLanguageTool-1.4.0-no-hc.patch deleted file mode 100644 index 4337ec6eb697..000000000000 --- a/external/languagetool/JLanguageTool-1.4.0-no-hc.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- misc/build/JLanguageTool-1.7.0/build.xml 2012-02-29 22:18:05.118789546 +0100 -+++ misc/build/JLanguageTool-1.7.0/build.xml 2012-02-29 22:17:02.385235706 +0100 -@@ -82,7 +82,6 @@ - <include name="openoffice/Linguistic.xcu"/> - <include name="openoffice/description.xml"/> - <include name="openoffice/images/dialog.png"/> -- <include name="openoffice/images/dialogh.png"/> - <include name="openoffice/images/LanguageToolBig.png"/> - <include name="openoffice/images/LanguageToolSmall.png"/> - <include name="openoffice/images/dialog.png"/> ---- misc/build/JLanguageTool-1.7.0/openoffice/Linguistic.xcu 2011-06-26 20:29:43.000000000 +0200 -+++ misc/build/JLanguageTool-1.7.0/openoffice/Linguistic.xcu 2012-02-29 22:17:25.551071099 +0100 -@@ -27,9 +27,6 @@ - <prop oor:name="SpellAndGrammarDialogImage" oor:type="xs:string"> - <value>%origin%/images/dialog.png</value> - </prop> -- <prop oor:name="SpellAndGrammarDialogImage_HC" oor:type="xs:string"> -- <value>%origin%/images/dialogh.png</value> -- </prop> - </node> - </node> - </node> diff --git a/external/languagetool/JLanguageTool-1.7.0.patch b/external/languagetool/JLanguageTool-1.7.0.patch deleted file mode 100644 index 782b683af79e..000000000000 --- a/external/languagetool/JLanguageTool-1.7.0.patch +++ /dev/null @@ -1,141 +0,0 @@ -diff -Naur misc/build/JLanguageTool-1.7.0/build.xml misc/build/JLanguageTool-1.7.0_patched/build.xml ---- misc/build/JLanguageTool-1.7.0/build.xml 2012-06-25 08:22:35.000000000 +0200 -+++ misc/build/JLanguageTool-1.7.0_patched/build.xml 2012-06-25 09:27:39.077442000 +0200 -@@ -29,7 +29,9 @@ - <pathelement location="${ext.CJFtransform.lib}" /> - <pathelement location="${ext.commons-validator.lib}" /> - <!-- --> -- <pathelement location="${ext.ooo.juh.lib}" /> -+ <pathelement location="${ext.junit.lib}"/> -+ <!-- --> -+ <pathelement location="${ext.ooo.juh.lib}" /> - <pathelement location="${ext.ooo.unoil.lib}" /> - <pathelement location="${ext.ooo.ridl.lib}" /> - <pathelement location="${ext.ooo.jurt.lib}" /> -@@ -442,11 +444,11 @@ - <!-- ================================================================== --> - - <target name="dist" depends="ooo-internal" description="Builds one ZIP for both OpenOffice.org and stand-alone use"> --<zip compress="yes" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" /> -+<zip compress="yes" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" /> - </target> - - <target name="fast" depends="ooo-internal" description="like dist, but without ZIP compression (for development only)"> --<zip compress="no" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" /> -+<zip compress="no" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" /> - </target> - - <target name="common" depends="clean,init,build,ooo-build"> -@@ -651,7 +653,6 @@ - <copy file="${resource.dir}/ast/asturian.dict" todir="${dist.dir}/resource/ast" /> - <copy file="${resource.dir}/ast/asturian.info" todir="${dist.dir}/resource/ast" /> - -- <copy file="${resource.dir}/xx/dummy.dict" tofile="${dist.dir}/resource/cs/czech.dict" /> - <copy todir="${dist.dir}/rules"> - <fileset dir="src/rules" excludes="CVS" /> - </copy> -@@ -678,7 +678,7 @@ - - <filter filtersFile="ooolocales.properties" /> - <copy filtering="true" encoding="${encoding}" todir="${dist.dir}/"> -- <fileset dir="openoffice/" includes="description.xml,*.xcu,Options.xdl,META-INF/**" /> -+ <fileset dir="openoffice/" includes="components.rdb,description.xml,*.xcu,Options.xdl,META-INF/**" /> - </copy> - <copy todir="${dist.dir}/"> - <fileset dir="openoffice/" includes="images/**,help/**" /> -diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/components.rdb misc/build/JLanguageTool-1.7.0_patched/openoffice/components.rdb ---- misc/build/JLanguageTool-1.7.0/openoffice/components.rdb 1970-01-01 01:00:00.000000000 +0100 -+++ misc/build/JLanguageTool-1.7.0_patched/openoffice/components.rdb 2012-06-25 10:26:23.183633100 +0200 -@@ -0,0 +1,9 @@ -+<?xml version="1.0"?> -+<components xmlns="http://openoffice.org/2010/uno-components"> -+ <component loader="com.sun.star.loader.Java2" uri="./LanguageTool.uno.jar"> -+ <implementation name="org.languagetool.openoffice.Main"> -+ <service name="com.sun.star.linguistic2.Proofreader"/> -+ <service name="org.languagetool.openoffice.Main"/> -+ </implementation> -+ </component> -+</components> -diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/META-INF/manifest.xml misc/build/JLanguageTool-1.7.0_patched/openoffice/META-INF/manifest.xml ---- misc/build/JLanguageTool-1.7.0/openoffice/META-INF/manifest.xml 2012-06-25 08:22:34.000000000 +0200 -+++ misc/build/JLanguageTool-1.7.0_patched/openoffice/META-INF/manifest.xml 2012-06-25 09:39:56.751738000 +0200 -@@ -2,8 +2,8 @@ - <manifest:manifest> - <manifest:file-entry manifest:full-path="Addons.xcu" - manifest:media-type="application/vnd.sun.star.configuration-data" /> -- <manifest:file-entry manifest:full-path="LanguageTool.uno.jar" -- manifest:media-type="application/vnd.sun.star.uno-component;type=Java" /> -+ <manifest:file-entry manifest:full-path="components.rdb" -+ manifest:media-type="application/vnd.sun.star.uno-components" /> - <manifest:file-entry - manifest:media-type="application/vnd.sun.star.configuration-data" - manifest:full-path="Linguistic.xcu" /> -diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/description.xml misc/build/JLanguageTool-1.7.0_patched/openoffice/description.xml ---- misc/build/JLanguageTool-1.7.0/openoffice/description.xml 2012-06-25 08:22:35.000000000 +0200 -+++ misc/build/JLanguageTool-1.7.0_patched/openoffice/description.xml 2012-06-25 10:29:48.520591800 +0200 -@@ -21,7 +21,7 @@ - <name lang="zh">LanguageTool. 开源的语言检查工具</name> - <name lang="br">LanguageTool. Reizher reizhskrivadurel frank.</name> - </display-name> -- <version value="@version@" /> -+ <version value="1.7.1" /> - <release-notes> - <src xlink:href="CHANGES.txt" lang="en" /> - </release-notes> -diff -Naur misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/gui/Configuration.java misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/gui/Configuration.java ---- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/gui/Configuration.java 2012-06-25 08:21:31.000000000 +0200 -+++ misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/gui/Configuration.java 2012-06-25 09:31:40.737466400 +0200 -@@ -23,6 +23,7 @@ - import java.io.FileNotFoundException; - import java.io.FileOutputStream; - import java.io.IOException; -+import java.lang.ClassLoader; - import java.util.*; - - import org.languagetool.Language; -@@ -142,7 +143,18 @@ - - final String motherTongueStr = (String) props.get(MOTHER_TONGUE_CONFIG_KEY); - if (motherTongueStr != null) { -- motherTongue = Language.getLanguageForShortName(motherTongueStr); -+ // FIXME: hack to disable the functionality for JRE 1.5 -+ // javax.xml.bind.JAXBException is part of JRE 1.6 -+ boolean isJRE15 = false; -+ try { -+ ClassLoader cl = ClassLoader.getSystemClassLoader(); -+ cl.loadClass("javax.xml.bind.JAXBException"); -+ } catch (ClassNotFoundException e) { -+ isJRE15 = true; -+ } -+ if (!isJRE15) { -+ motherTongue = Language.getLanguageForShortName(motherTongueStr); -+ } - } - - final String autoDetectStr = (String) props.get(AUTO_DETECT_CONFIG_KEY); -diff -Naur misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/Main.java misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/openoffice/Main.java ---- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/Main.java 2012-06-25 08:21:28.000000000 +0200 -+++ misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/openoffice/Main.java 2012-06-25 09:36:03.778528700 +0200 -@@ -24,6 +24,7 @@ - * @author Marcin Miłkowski - */ - import java.io.File; -+import java.lang.ClassLoader; - import java.util.ArrayList; - import java.util.Arrays; - import java.util.Comparator; -@@ -494,6 +495,14 @@ - */ - @Override - public final Locale[] getLocales() { -+ // FIXME: hack to disable the functionality for JRE 1.5 -+ // javax.xml.bind.JAXBException is part of JRE 1.6 -+ try { -+ ClassLoader cl = ClassLoader.getSystemClassLoader(); -+ cl.loadClass("javax.xml.bind.JAXBException"); -+ } catch (ClassNotFoundException e) { -+ return new Locale[0]; -+ } - try { - int dims = 0; - for (final Language element : Language.LANGUAGES) { diff --git a/external/languagetool/MessageBox-apichange.patch b/external/languagetool/MessageBox-apichange.patch deleted file mode 100644 index ceea259b88ac..000000000000 --- a/external/languagetool/MessageBox-apichange.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/OOoAboutDialog.java 2013-07-11 13:33:26.681387525 +0100 -+++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/OOoAboutDialog.java 2013-07-11 13:34:46.666424549 +0100 -@@ -19,6 +19,7 @@ - package org.languagetool.openoffice; - - import com.sun.star.awt.Rectangle; -+import com.sun.star.awt.MessageBoxType; - import com.sun.star.awt.XMessageBox; - import com.sun.star.awt.XMessageBoxFactory; - import com.sun.star.awt.XWindowPeer; -@@ -49,16 +50,14 @@ - .getString("guiMenuAbout")); - final XMessageBoxFactory messageBoxFactory = (XMessageBoxFactory) UnoRuntime - .queryInterface(XMessageBoxFactory.class, winPeer.getToolkit()); -- final Rectangle messageBoxRectangle = new Rectangle(); - final XMessageBox box = messageBoxFactory - .createMessageBox( - winPeer, -- messageBoxRectangle, -- "infobox", -+ MessageBoxType.INFOBOX, - 0, - aboutDialogTitle, - getAboutText()); - box.execute(); - } - --} -\ No newline at end of file -+} diff --git a/external/languagetool/README b/external/languagetool/README deleted file mode 100644 index 1a33382f7c3a..000000000000 --- a/external/languagetool/README +++ /dev/null @@ -1,5 +0,0 @@ -Style and grammar checker for various languages written in Java, from [http://www.languagetool.org/] - -Shipping this is a compile-time option for LibreOffice, but our -downloadable builds use the light-weight lightproof grammar checker -instead to avoid the Java bootstrapping performance issues. diff --git a/external/languagetool/UnpackedTarball_languagetool.mk b/external/languagetool/UnpackedTarball_languagetool.mk deleted file mode 100644 index 757a4b35e797..000000000000 --- a/external/languagetool/UnpackedTarball_languagetool.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,languagetool)) - -$(eval $(call gb_UnpackedTarball_set_tarball,languagetool,$(LANGUAGETOOL_TARBALL))) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,languagetool,3)) - -$(eval $(call gb_UnpackedTarball_add_patches,languagetool,\ - external/languagetool/JLanguageTool-1.7.0.patch \ - external/languagetool/JLanguageTool-1.4.0-no-hc.patch \ - external/languagetool/MessageBox-apichange.patch \ - external/languagetool/english.ireland.patch \ - external/languagetool/esperanto.territory.patch \ - external/languagetool/french.haiti.patch \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/languagetool/english.ireland.patch b/external/languagetool/english.ireland.patch deleted file mode 100644 index 2e47d3247b65..000000000000 --- a/external/languagetool/english.ireland.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/English.java.orig 2013-11-18 09:41:10.625421948 +0000 -+++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/English.java 2013-11-18 09:41:25.736570684 +0000 -@@ -67,7 +67,7 @@ - - @Override - public final String[] getCountryVariants() { -- return new String[]{"GB", "US", "AU", "CA", "NZ", "ZA"}; -+ return new String[]{"GB", "US", "AU", "CA", "IE", "NZ", "ZA"}; - } - - @Override diff --git a/external/languagetool/esperanto.territory.patch b/external/languagetool/esperanto.territory.patch deleted file mode 100644 index 6037adc43c07..000000000000 --- a/external/languagetool/esperanto.territory.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/Esperanto.java.orig 2013-11-18 10:18:49.111712785 +0000 -+++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/Esperanto.java 2013-11-18 10:18:59.254813036 +0000 -@@ -71,8 +71,7 @@ - - @Override - public String[] getCountryVariants() { -- /* return "ANY" country code as a "country-less" placeholder for OOo: */ -- return new String[] {"ANY"}; -+ return new String[] {""}; - } - - @Override diff --git a/external/languagetool/french.haiti.patch b/external/languagetool/french.haiti.patch deleted file mode 100644 index 207699e70cbf..000000000000 --- a/external/languagetool/french.haiti.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/French.java -+++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/French.java -@@ -54,7 +54,7 @@ - @Override - public String[] getCountryVariants() { - return new String[]{"FR", "", "BE", "CH", "CA", "LU", "MC", "CM", -- "CI", "HI", "ML", "SN", "CD", "MA", "RE"}; -+ "CI", "HT", "ML", "SN", "CD", "MA", "RE"}; - } - - @Override diff --git a/external/lcms2/0001-Added-missing-export.patch.1 b/external/lcms2/0001-Added-missing-export.patch.1 new file mode 100644 index 000000000000..ad131e9533d3 --- /dev/null +++ b/external/lcms2/0001-Added-missing-export.patch.1 @@ -0,0 +1,25 @@ +From f7b3c637c20508655f8b49935a4b556d52937b69 Mon Sep 17 00:00:00 2001 +From: Dirk Lemstra <dirk@lemstra.org> +Date: Sun, 10 Dec 2023 20:31:32 +0100 +Subject: [PATCH] Added missing export. + +--- + src/cmsvirt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cmsvirt.c b/src/cmsvirt.c +index 3d662b2..6615604 100644 +--- a/src/cmsvirt.c ++++ b/src/cmsvirt.c +@@ -676,7 +676,7 @@ cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void) + * + * This virtual profile cannot be saved as an ICC file + */ +-cmsHPROFILE cmsCreate_OkLabProfile(cmsContext ctx) ++cmsHPROFILE CMSEXPORT cmsCreate_OkLabProfile(cmsContext ctx) + { + cmsStage* XYZPCS = _cmsStageNormalizeFromXyzFloat(ctx); + cmsStage* PCSXYZ = _cmsStageNormalizeToXyzFloat(ctx); +-- +2.44.0.windows.1 + diff --git a/external/lcms2/ExternalPackage_lcms2.mk b/external/lcms2/ExternalPackage_lcms2.mk index c0cdc098b6e2..62e2ebad8981 100644 --- a/external/lcms2/ExternalPackage_lcms2.mk +++ b/external/lcms2/ExternalPackage_lcms2.mk @@ -14,15 +14,11 @@ $(eval $(call gb_ExternalPackage_use_external_project,lcms2,lcms2)) ifeq ($(DISABLE_DYNLOADING),) ifeq ($(OS),MACOSX) $(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.2.dylib,src/.libs/liblcms2.2.dylib)) -else ifeq ($(OS),WNT) -ifeq ($(COM),GCC) -$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2-2.dll,src/.libs/liblcms2-2.dll)) else ifeq ($(COM),MSC) $(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/lcms2.dll,bin/lcms2.dll)) -endif # $(COM) -else # $(OS) != WNT/MACOSX -$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.10)) -endif # $(OS) +else +$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.16)) +endif endif # $(DISABLE_DYNLOADING) # vim: set noet sw=4 ts=4: diff --git a/external/lcms2/ExternalProject_lcms2.mk b/external/lcms2/ExternalProject_lcms2.mk index 4bed4a5b705d..47d9089dc764 100644 --- a/external/lcms2/ExternalProject_lcms2.mk +++ b/external/lcms2/ExternalProject_lcms2.mk @@ -19,7 +19,7 @@ $(call gb_ExternalProject_get_state_target,lcms2,build): $(call gb_ExternalProject_run,build,\ MSBuild.exe lcms2_DLL.vcxproj \ $(gb_MSBUILD_CONFIG_AND_PLATFORM) /p:TargetName=lcms2 \ - $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ ,Projects/VC2019/lcms2_DLL) $(call gb_Trace_EndRange,lcms2,EXTERNAL) @@ -27,11 +27,11 @@ else $(call gb_ExternalProject_get_state_target,lcms2,build): $(call gb_Trace_StartRange,lcms2,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --without-jpeg --without-tiff --with-pic \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(gb_RUN_CONFIGURE) ./configure --without-jpeg --without-tiff --with-pic \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ CPPFLAGS=" $(SOLARINC)" \ - CFLAGS='$(CFLAGS) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))' \ + CFLAGS='$(CFLAGS) $(call gb_ExternalProject_get_build_flags,lcms2)' \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ , \ diff --git a/external/lcms2/README b/external/lcms2/README index 10b18a5ad939..2d5fea93a384 100644 --- a/external/lcms2/README +++ b/external/lcms2/README @@ -1,3 +1,5 @@ -lcms2 (little cms engine) -lcms2: Little cms is a small, speed optimized color management engine. -with the new libcdr, writerperfect will depend on lcms2
\ No newline at end of file +lcms2 (Little CMS color engine) +lcms2: Little CMS is a small, speed optimized color management engine. +With the new libcdr, writerperfect depends on lcms2. + +From [https://www.littlecms.com/color-engine/]. diff --git a/external/lcms2/UnpackedTarball_lcms2.mk b/external/lcms2/UnpackedTarball_lcms2.mk index 932f8c63c81c..f44683e03809 100644 --- a/external/lcms2/UnpackedTarball_lcms2.mk +++ b/external/lcms2/UnpackedTarball_lcms2.mk @@ -15,13 +15,17 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,lcms2)) $(eval $(call gb_UnpackedTarball_set_patchlevel,lcms2,3)) +ifneq ($(MSYSTEM),) +# use binary flag so patch from git-bash won't choke on mixed line-endings in patches +$(eval $(call gb_UnpackedTarball_set_patchflags,lcms2,--binary)) +endif + +# external/lcms2/0001-Added-missing-export.patch.1: +# backport of https://github.com/mm2/Little-CMS/commit/f7b3c637c20508655f8b49935a4b556d52937b69 $(eval $(call gb_UnpackedTarball_add_patches,lcms2,\ + external/lcms2/0001-Added-missing-export.patch.1 \ external/lcms2/lcms2-2.4-windows.patch \ - external/lcms2/c++17.patch.1 \ - external/lcms2/lcms2-win-arm64.patch.1 \ + external/lcms2/lcms2-windows_aarch64_outdir.patch.1 \ )) -# Can't include in ARM64 patch, as diff fails to detect text in it -$(eval $(call gb_UnpackedTarball_add_file,lcms2,Projects/VC2019/lcms2.sln,external/lcms2/lcms2_sln)) - # vim: set noet sw=4 ts=4: diff --git a/external/lcms2/c++17.patch.1 b/external/lcms2/c++17.patch.1 deleted file mode 100644 index dc5b2ccde46c..000000000000 --- a/external/lcms2/c++17.patch.1 +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/lcms2.h b/include/lcms2.h -index cf52014..926e2a0 100644 ---- a/include/lcms2.h -+++ b/include/lcms2.h -@@ -62,7 +62,7 @@ - // #define CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT - - // Uncomment this to remove the "register" storage class --// #define CMS_NO_REGISTER_KEYWORD 1 -+#define CMS_NO_REGISTER_KEYWORD 1 - - // ********** End of configuration toggles ****************************** - diff --git a/external/lcms2/lcms2-2.4-windows.patch b/external/lcms2/lcms2-2.4-windows.patch index 749a81200b11..1b5dfdffe8a2 100644 --- a/external/lcms2/lcms2-2.4-windows.patch +++ b/external/lcms2/lcms2-2.4-windows.patch @@ -1,20 +1,30 @@ -TODO: Is this still needed? +This patch is necessary for Windows (32-bit) build. ---- misc/lcms2-2.4/include/lcms2.h 2011-12-15 16:45:47.000000000 +0100 -+++ misc/build/lcms2-2.4/include/lcms2.h 2012-03-17 22:53:28.731585981 +0100 -@@ -192,6 +192,15 @@ typedef int cmsBool; +(In Jenkins' build message) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsGetColorSpace referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsChannelsOf referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsOpenProfileFromMem referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsCloseProfile referenced in function "public: void __thiscall fxcodec::`anonymous namespace'::CmsProfileDeleter::operator()(void *)" (??RCmsProfileDeleter@?A0xf5ac6891@fxcodec@@QAEXPAX@Z) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsCreate_sRGBProfile referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsCreateTransform referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsDeleteTransform referenced in function "public: __thiscall fxcodec::IccTransform::~IccTransform(void)" (??1IccTransform@fxcodec@@QAE@XZ) +> icc_transform.o : error LNK2019: unresolved external symbol _cmsDoTransform referenced in function "public: void __thiscall fxcodec::IccTransform::Translate(class pdfium::span<float const >,class pdfium::span<float>)" (?Translate@IccTransform@fxcodec@@QAEXV?$span@$$CBM@pdfium@@V?$span@M@4@@Z) +> +> C:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\instdir\program\pdfiumlo.dll : fatal error LNK1120: 8 unresolved externals + +--- misc/lcms2/include/lcms2.h 2023-03-01 03:53:11.000000000 +0900 ++++ misc/build/lcms2/include/lcms2.h 2023-11-29 15:47:08.535240600 +0900 +@@ -226,6 +226,13 @@ typedef int cmsBool; #endif // CMS_USE_BIG_ENDIAN +// LibreOffice always builds this as DLL and with the stdcall calling +// convention, so make this usable from outside without having to +// specify CMS_DLL manually whenever the library is used. -+#ifndef CMS_DLL_BUILD -+#ifndef CMS_DLL ++#if !defined(CMS_DLL_BUILD) && !defined(CMS_DLL) && defined(_MSC_VER) && defined(_M_IX86) +#define CMS_DLL +#endif -+#endif + // Calling convention -- this is hardly platform and compiler dependent - #ifdef CMS_IS_WINDOWS_ + #if defined(CMS_IS_WINDOWS_) && !defined(__GNUC__) # if defined(CMS_DLL) || defined(CMS_DLL_BUILD) diff --git a/external/lcms2/lcms2-win-arm64.patch.1 b/external/lcms2/lcms2-win-arm64.patch.1 deleted file mode 100644 index 42244b742797..000000000000 --- a/external/lcms2/lcms2-win-arm64.patch.1 +++ /dev/null @@ -1,1523 +0,0 @@ -diff -urbaN lcms2-2.11.orig/Projects/VC2019/jpegicc/jpegicc.vcxproj lcms2-2.11/Projects/VC2019/jpegicc/jpegicc.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/jpegicc/jpegicc.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/jpegicc/jpegicc.vcxproj 2020-07-09 18:28:37.881727697 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -71,32 +96,44 @@ - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);;C:\code\jpeg-9a</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IncludePath);;C:\code\jpeg-9a</IncludePath> -+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(IncludePath);;C:\code\jpeg-9a</IncludePath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);;C:\code\jpeg-9a</LibraryPath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);;C:\code\jpeg-9a</LibraryPath> -+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(LibraryPath);;C:\code\jpeg-9a</LibraryPath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);;C:\code\jpeg-9a</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IncludePath);;C:\code\jpeg-9a</IncludePath> -+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(IncludePath);;C:\code\jpeg-9a</IncludePath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);;C:\code\jpeg-9a</LibraryPath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);;C:\code\jpeg-9a</LibraryPath> -+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(LibraryPath);;C:\code\jpeg-9a</LibraryPath> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -140,6 +177,26 @@ - <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <AdditionalDependencies>libjpeg.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>Full</Optimization> -@@ -197,6 +254,32 @@ - <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>Full</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level3</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> -+ <OmitFramePointers>true</OmitFramePointers> -+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <AdditionalDependencies>libjpeg.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\utils\common\vprf.c" /> - <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj lcms2-2.11/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj 2020-07-09 18:28:38.049726437 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>DynamicLibrary</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>DynamicLibrary</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,28 +94,40 @@ - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> -+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> -+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>lcms2</TargetName> -@@ -99,9 +134,15 @@ - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>lcms2</TargetName> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <TargetName>lcms2</TargetName> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>lcms2</TargetName> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <TargetName>lcms2</TargetName> -+ </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> -@@ -144,6 +185,27 @@ - <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CMS_DLL_BUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ <StringPooling>false</StringPooling> -+ </ClCompile> -+ <Link> -+ <ModuleDefinitionFile> -+ </ModuleDefinitionFile> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Windows</SubSystem> -+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>Full</Optimization> -@@ -203,6 +265,34 @@ - <EnableCOMDATFolding>true</EnableCOMDATFolding> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>Full</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> -+ <OmitFramePointers>true</OmitFramePointers> -+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CMS_DLL_BUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <StringPooling>true</StringPooling> -+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <ModuleDefinitionFile> -+ </ModuleDefinitionFile> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Windows</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\src\cmsalpha.c" /> - <ClCompile Include="..\..\..\src\cmscam02.c" /> -@@ -234,7 +324,9 @@ - <ItemGroup> - <CustomBuild Include="..\..\..\src\lcms2.def"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> -+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> -+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild> - </CustomBuild> - </ItemGroup> - <ItemGroup> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/lcms2_static/lcms2_static.vcxproj lcms2-2.11/Projects/VC2019/lcms2_static/lcms2_static.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/lcms2_static/lcms2_static.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/lcms2_static/lcms2_static.vcxproj 2020-07-09 18:28:38.173725507 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>StaticLibrary</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>StaticLibrary</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,22 +94,30 @@ - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\Lib\MS\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\Lib\MS\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\Lib\MS\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -120,6 +153,23 @@ - <CompileAs>Default</CompileAs> - </ClCompile> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <FunctionLevelLinking> -+ </FunctionLevelLinking> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ <CompileAs>Default</CompileAs> -+ </ClCompile> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> -@@ -169,6 +219,28 @@ - <StringPooling>true</StringPooling> - </ClCompile> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>MaxSpeed</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> -+ <OmitFramePointers>true</OmitFramePointers> -+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> -+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> -+ <ExceptionHandling>false</ExceptionHandling> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ <EnableParallelCodeGeneration>true</EnableParallelCodeGeneration> -+ <StringPooling>true</StringPooling> -+ </ClCompile> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\src\cmsalpha.c" /> - <ClCompile Include="..\..\..\src\cmscam02.c" /> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/linkicc/linkicc.vcxproj lcms2-2.11/Projects/VC2019/linkicc/linkicc.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/linkicc/linkicc.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/linkicc/linkicc.vcxproj 2020-07-09 18:28:38.297724577 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,26 +94,36 @@ - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -128,6 +163,24 @@ - <SubSystem>Console</SubSystem> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> -@@ -175,6 +228,27 @@ - <EnableCOMDATFolding>true</EnableCOMDATFolding> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>MaxSpeed</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\utils\linkicc\linkicc.c" /> - <ClCompile Include="..\..\..\utils\common\vprf.c" /> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/psicc/psicc.vcxproj lcms2-2.11/Projects/VC2019/psicc/psicc.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/psicc/psicc.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/psicc/psicc.vcxproj 2020-07-09 18:28:38.421723648 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,26 +94,36 @@ - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -128,6 +163,24 @@ - <SubSystem>Console</SubSystem> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> -@@ -175,6 +228,27 @@ - <EnableCOMDATFolding>true</EnableCOMDATFolding> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>MaxSpeed</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\utils\psicc\psicc.c" /> - <ClCompile Include="..\..\..\utils\common\vprf.c" /> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/testbed/testbed.vcxproj lcms2-2.11/Projects/VC2019/testbed/testbed.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/testbed/testbed.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/testbed/testbed.vcxproj 2020-07-09 18:28:38.577722478 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,37 +75,53 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\testbed\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\testbed\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\testbed\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\testbed\</OutDir> - </PropertyGroup> -@@ -130,6 +165,25 @@ - <Profile>false</Profile> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level3</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <Profile>false</Profile> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>Full</Optimization> -@@ -191,6 +245,34 @@ - <Profile>false</Profile> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>Full</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> -+ <OmitFramePointers>true</OmitFramePointers> -+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> -+ <AdditionalIncludeDirectories>../../../include;../../../src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> -+ <BufferSecurityCheck>false</BufferSecurityCheck> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level3</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <CallingConvention>Cdecl</CallingConvention> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ <Profile>false</Profile> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> - <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/tiffdiff/tiffdiff.vcxproj lcms2-2.11/Projects/VC2019/tiffdiff/tiffdiff.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/tiffdiff/tiffdiff.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/tiffdiff/tiffdiff.vcxproj 2020-07-09 18:28:38.701721548 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,34 +94,48 @@ - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath> -+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath> -+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath> -+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath> -+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -140,6 +179,26 @@ - <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <AdditionalDependencies>libtiff.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> -@@ -193,6 +252,30 @@ - <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>MaxSpeed</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <AdditionalDependencies>libtiff.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> -+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\utils\common\vprf.c" /> - <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/tifficc/tifficc.vcxproj lcms2-2.11/Projects/VC2019/tifficc/tifficc.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/tifficc/tifficc.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/tifficc/tifficc.vcxproj 2020-07-09 18:28:38.821720648 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,34 +94,48 @@ - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath> -+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath> -+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath> -+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath> - <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath> -+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -140,6 +179,26 @@ - <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level3</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <AdditionalDependencies>libtiff.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> -@@ -191,6 +250,29 @@ - <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>MaxSpeed</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <AdditionalDependencies>libtiff.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\utils\common\vprf.c" /> - <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> -diff -urbaN lcms2-2.11.orig/Projects/VC2019/transicc/transicc.vcxproj lcms2-2.11/Projects/VC2019/transicc/transicc.vcxproj ---- lcms2-2.11.orig/Projects/VC2019/transicc/transicc.vcxproj 2020-06-16 19:10:37.000000000 +0200 -+++ lcms2-2.11/Projects/VC2019/transicc/transicc.vcxproj 2020-07-09 18:28:38.945719719 +0200 -@@ -1,6 +1,10 @@ - <?xml version="1.0" encoding="utf-8"?> - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> -+ <ProjectConfiguration Include="Debug|ARM64"> -+ <Configuration>Debug</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> -@@ -9,6 +13,10 @@ - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> -+ <ProjectConfiguration Include="Release|ARM64"> -+ <Configuration>Release</Configuration> -+ <Platform>ARM64</Platform> -+ </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> -@@ -37,6 +45,12 @@ - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <WholeProgramOptimization>true</WholeProgramOptimization> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> -@@ -47,6 +61,11 @@ - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> -+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> -+ <ConfigurationType>Application</ConfigurationType> -+ <CharacterSet>Unicode</CharacterSet> -+ <PlatformToolset>v142</PlatformToolset> -+ </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> -@@ -56,12 +75,18 @@ - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> -+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> -+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> -+ </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> -@@ -69,26 +94,36 @@ - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir> -+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> -+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> -+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> -+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" /> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> -@@ -128,6 +163,24 @@ - <SubSystem>Console</SubSystem> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> -+ <ClCompile> -+ <Optimization>Disabled</Optimization> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> -+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ </Link> -+ </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> -@@ -175,9 +228,31 @@ - <EnableCOMDATFolding>true</EnableCOMDATFolding> - </Link> - </ItemDefinitionGroup> -+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> -+ <ClCompile> -+ <Optimization>MaxSpeed</Optimization> -+ <IntrinsicFunctions>true</IntrinsicFunctions> -+ <AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> -+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> -+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> -+ <FunctionLevelLinking>true</FunctionLevelLinking> -+ <PrecompiledHeader> -+ </PrecompiledHeader> -+ <WarningLevel>Level4</WarningLevel> -+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> -+ <MultiProcessorCompilation>true</MultiProcessorCompilation> -+ </ClCompile> -+ <Link> -+ <GenerateDebugInformation>true</GenerateDebugInformation> -+ <SubSystem>Console</SubSystem> -+ <OptimizeReferences>true</OptimizeReferences> -+ <EnableCOMDATFolding>true</EnableCOMDATFolding> -+ </Link> -+ </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\..\utils\transicc\transicc.c"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild> -+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="..\..\..\utils\common\vprf.c" /> - <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> diff --git a/external/lcms2/lcms2-windows_aarch64_outdir.patch.1 b/external/lcms2/lcms2-windows_aarch64_outdir.patch.1 new file mode 100644 index 000000000000..aa27b1b77923 --- /dev/null +++ b/external/lcms2/lcms2-windows_aarch64_outdir.patch.1 @@ -0,0 +1,26 @@ +diff -ur lcms2.org/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj lcms2/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj +--- lcms2.org/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj 2023-12-08 18:49:59.819483000 +0100 ++++ lcms2/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj 2023-12-08 18:50:59.460115500 +0100 +@@ -92,6 +92,7 @@ + <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">..\..\..\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir>
+@@ -100,6 +101,7 @@ + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">..\..\..\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir>
+@@ -340,4 +342,4 @@ + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+-</Project> +\ No newline at end of file ++</Project>
diff --git a/external/lcms2/lcms2_sln b/external/lcms2/lcms2_sln Binary files differdeleted file mode 100644 index 6a3d35afaa15..000000000000 --- a/external/lcms2/lcms2_sln +++ /dev/null diff --git a/external/libabw/ExternalProject_libabw.mk b/external/libabw/ExternalProject_libabw.mk index 50e66fdb76ca..48edebf6a282 100644 --- a/external/libabw/ExternalProject_libabw.mk +++ b/external/libabw/ExternalProject_libabw.mk @@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libabw,build) : $(call gb_Trace_StartRange,libabw,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -36,9 +36,10 @@ $(call gb_ExternalProject_get_state_target,libabw,build) : --disable-werror \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libabw)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libabw)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libabw,EXTERNAL) diff --git a/external/libassuan/ExternalPackage_libassuan.mk b/external/libassuan/ExternalPackage_libassuan.mk index 7a08028adbdd..77dc05a665f1 100644 --- a/external/libassuan/ExternalPackage_libassuan.mk +++ b/external/libassuan/ExternalPackage_libassuan.mk @@ -15,7 +15,7 @@ ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.8.3)) +$(eval $(call gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.8.7)) else ifeq ($(OS),MACOSX) diff --git a/external/libassuan/ExternalProject_libassuan.mk b/external/libassuan/ExternalProject_libassuan.mk index e4e24aeac7fd..d73935b212e4 100644 --- a/external/libassuan/ExternalProject_libassuan.mk +++ b/external/libassuan/ExternalProject_libassuan.mk @@ -25,13 +25,13 @@ $(call gb_ExternalProject_get_state_target,libassuan,build): $(call gb_Executabl $(call gb_Trace_StartRange,libassuan,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(gb_WIN_GPG_cross_setup_exports) \ - && autoreconf \ - && ./configure \ + && $(WSL) autoreconf \ + && $(gb_RUN_CONFIGURE) ./configure \ --enable-static \ --disable-shared \ --disable-doc \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(CXXFLAGS)" \ + CFLAGS="$(CFLAGS) -D__STDC__=1 $(call gb_ExternalProject_get_build_flags,libassuan)" \ GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \ GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \ $(gb_WIN_GPG_platform_switches) \ @@ -44,14 +44,15 @@ $(call gb_ExternalProject_get_state_target,libassuan,build): $(call gb_Trace_StartRange,libassuan,EXTERNAL) $(call gb_ExternalProject_run,build,\ autoreconf \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --disable-doc \ + CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,libassuan)" \ GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \ GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \ $(if $(filter LINUX,$(OS)), \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ && $(MAKE) \ diff --git a/external/libassuan/UnpackedTarball_libassuan.mk b/external/libassuan/UnpackedTarball_libassuan.mk index 295b87d49677..3604fa36a395 100644 --- a/external/libassuan/UnpackedTarball_libassuan.mk +++ b/external/libassuan/UnpackedTarball_libassuan.mk @@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libassuan, \ $(if $(filter MSC,$(COM)),external/libassuan/w32-build-fixes.patch.1) \ external/libassuan/w32-build-fixes-2.patch \ $(if $(filter LINUX,$(OS)),external/libassuan/rpath.patch) \ + external/libassuan/w32-stdc.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libassuan/w32-build-fixes.patch.1 b/external/libassuan/w32-build-fixes.patch.1 index cac6ea1045bc..8d77eef37cd5 100644 --- a/external/libassuan/w32-build-fixes.patch.1 +++ b/external/libassuan/w32-build-fixes.patch.1 @@ -33,19 +33,6 @@ diff -ru libassuan.orig/src/Makefile.am libassuan/src/Makefile.am `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \ sed -e 's/-I/--include-dir /g;s/-D/--define /g'` -@@ -148,9 +148,9 @@ - $(DESTDIR)$(bindir)/gpgcedev.dll - endif - -+mkheader$(EXEEXT): mkheader.c Makefile --mkheader: mkheader.c Makefile - $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c - -+assuan.h: assuan.h.in mkheader$(EXEEXT) $(parts_of_assuan_h) -+ ./mkheader$(EXEEXT) $(host_os) $(srcdir)/assuan.h.in \ --assuan.h: assuan.h.in mkheader $(parts_of_assuan_h) -- ./mkheader $(host_os) $(srcdir)/assuan.h.in \ - $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@ diff -ru libassuan.orig/src/assuan-handler.c libassuan/src/assuan-handler.c --- libassuan.orig/src/assuan-handler.c 2016-06-25 16:27:49.000000000 +0200 +++ libassuan/src/assuan-handler.c 2017-09-24 15:32:51.200956200 +0200 diff --git a/external/libassuan/w32-stdc.patch b/external/libassuan/w32-stdc.patch new file mode 100644 index 000000000000..def3dea833af --- /dev/null +++ b/external/libassuan/w32-stdc.patch @@ -0,0 +1,74 @@ +--- src/assuan-handler.c ++++ src/assuan-handler.c +@@ -938,7 +938,7 @@ + #if defined(HAVE_W32CE_SYSTEM) + fdarray[n++] = (void*)fileno (ctx->outbound.data.fp); + #elif defined(HAVE_W32_SYSTEM) +- fdarray[n++] = (void*)_get_osfhandle (fileno (ctx->outbound.data.fp)); ++ fdarray[n++] = (void*)_get_osfhandle (_fileno (ctx->outbound.data.fp)); + #else + fdarray[n++] = fileno (ctx->outbound.data.fp); + #endif +--- src/assuan-logging.c ++++ src/assuan-logging.c +@@ -30,10 +30,15 @@ + # ifdef HAVE_WINSOCK2_H + # include <winsock2.h> + # endif ++# include <process.h> ++# define getpid _getpid + # include <windows.h> + #endif /*HAVE_W32_SYSTEM*/ + #include <errno.h> + #include <ctype.h> ++#if defined HAVE_W32_SYSTEM ++#define isascii __isascii ++#endif + + #include "assuan-defs.h" + +--- src/assuan-pipe-connect.c ++++ src/assuan-pipe-connect.c +@@ -47,6 +47,8 @@ + # ifdef HAVE_WINSOCK2_H + # include <winsock2.h> + # endif ++# include <process.h> ++# define getpid _getpid + # include <windows.h> + #endif + +--- src/assuan-socket.c ++++ src/assuan-socket.c +@@ -27,6 +27,8 @@ + #include <stdlib.h> + #ifdef HAVE_W32_SYSTEM + # define WIN32_LEAN_AND_MEAN ++# include <process.h> ++# define getpid _getpid + # include <windows.h> + # include <wincrypt.h> + #ifndef HAVE_W32CE_SYSTEM +--- src/conversion.c ++++ src/conversion.c +@@ -27,6 +27,9 @@ + #include <string.h> + #include <errno.h> + #include <ctype.h> ++#if defined HAVE_W32_SYSTEM ++#define isascii __isascii ++#endif + + #include "assuan-defs.h" + #include "debug.h" +--- src/system-w32.c ++++ src/system-w32.c +@@ -453,7 +453,7 @@ + + /* Dup stderr to /dev/null unless it is in the list of FDs to be + passed to the child. */ +- fd = assuan_fd_from_posix_fd (fileno (stderr)); ++ fd = assuan_fd_from_posix_fd (_fileno (stderr)); + fdp = fd_child_list; + if (fdp) + { diff --git a/external/libatomic_ops/ExternalProject_libatomic_ops.mk b/external/libatomic_ops/ExternalProject_libatomic_ops.mk index 20cefa39b4fe..4f848fcccc72 100644 --- a/external/libatomic_ops/ExternalProject_libatomic_ops.mk +++ b/external/libatomic_ops/ExternalProject_libatomic_ops.mk @@ -18,9 +18,15 @@ $(eval $(call gb_ExternalProject_register_targets,libatomic_ops,\ $(call gb_ExternalProject_get_state_target,libatomic_ops,build) : $(call gb_Trace_StartRange,libatomic_ops,EXTERNAL) $(call gb_ExternalProject_run,build,\ - $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))") \ - ./configure \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(if $(filter TRUE, \ + $(DISABLE_DYNLOADING)) \ + , \ + CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(call gb_ExternalProject_get_build_flags,libatomic_ops)" \ + CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(call gb_ExternalProject_get_build_flags,libatomic_ops)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libatomic_ops)") \ + $(gb_RUN_CONFIGURE) ./configure \ + --disable-gpl \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libatomic_ops,EXTERNAL) diff --git a/external/libcdr/ExternalProject_libcdr.mk b/external/libcdr/ExternalProject_libcdr.mk index b3e78f469cbf..3a4be9d9ce73 100644 --- a/external/libcdr/ExternalProject_libcdr.mk +++ b/external/libcdr/ExternalProject_libcdr.mk @@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libcdr,build) : $(call gb_Trace_StartRange,libcdr,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -38,9 +38,10 @@ $(call gb_ExternalProject_get_state_target,libcdr,build) : --disable-weffc \ $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libcdr)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libcdr)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libcdr,EXTERNAL) diff --git a/external/libcdr/UnpackedTarball_libcdr.mk b/external/libcdr/UnpackedTarball_libcdr.mk index d8742f3c5f5a..f0e80f06f05f 100644 --- a/external/libcdr/UnpackedTarball_libcdr.mk +++ b/external/libcdr/UnpackedTarball_libcdr.mk @@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libcdr)) $(eval $(call gb_UnpackedTarball_add_patches,libcdr, \ external/libcdr/libcdr-visibility-win.patch \ - external/libcdr/libcdr-no-icu-boolean.patch.1 \ external/libcdr/ax_gcc_func_attribute.m4.patch \ )) diff --git a/external/libcdr/libcdr-no-icu-boolean.patch.1 b/external/libcdr/libcdr-no-icu-boolean.patch.1 deleted file mode 100644 index 65884fbbf873..000000000000 --- a/external/libcdr/libcdr-no-icu-boolean.patch.1 +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libcdr.org/src/lib/libcdr_utils.cpp libcdr/src/lib/libcdr_utils.cpp ---- libcdr.org/src/lib/libcdr_utils.cpp 2020-02-02 16:30:44.000000000 +0100 -+++ libcdr/src/lib/libcdr_utils.cpp 2020-11-16 21:08:04.092927628 +0100 -@@ -108,7 +108,7 @@ - csd = ucsdet_open(&status); - if (U_FAILURE(status) || !csd) - return 0; -- ucsdet_enableInputFilter(csd, TRUE); -+ ucsdet_enableInputFilter(csd, true); - ucsdet_setText(csd, (const char *)buffer, bufferLength, &status); - if (U_FAILURE(status)) - throw libcdr::EncodingException(); diff --git a/external/libcmis/0001-Fix-warning-C4589-when-building-with-MSVC.patch b/external/libcmis/0001-Fix-warning-C4589-when-building-with-MSVC.patch new file mode 100644 index 000000000000..0883d708f3af --- /dev/null +++ b/external/libcmis/0001-Fix-warning-C4589-when-building-with-MSVC.patch @@ -0,0 +1,222 @@ +From c86638560b3cb39b847d4e84ae9b8492f0c5fa22 Mon Sep 17 00:00:00 2001 +From: Mike Kaganski <mikekaganski@hotmail.com> +Date: Thu, 22 Feb 2024 20:47:48 +0600 +Subject: [PATCH] Fix warning C4589 when building with MSVC + +C:\libcmis\inc\libcmis/document.hxx(51): warning C4589: Constructor of abstract class 'libcmis::Document' ignores initializer for virtual base class 'libcmis::Object' +C:\libcmis\inc\libcmis/document.hxx(51): note: virtual base classes are only initialized by the most-derived type +C:\libcmis\inc\libcmis/folder.hxx(58): warning C4589: Constructor of abstract class 'libcmis::Folder' ignores initializer for virtual base class 'libcmis::Object' +C:\libcmis\inc\libcmis/folder.hxx(58): note: virtual base classes are only initialized by the most-derived type +--- + inc/libcmis/document.hxx | 1 - + inc/libcmis/folder.hxx | 1 - + src/libcmis/atom-document.cxx | 2 -- + src/libcmis/atom-folder.cxx | 1 - + src/libcmis/gdrive-document.cxx | 2 -- + src/libcmis/gdrive-folder.cxx | 2 -- + src/libcmis/onedrive-document.cxx | 2 -- + src/libcmis/onedrive-folder.cxx | 2 -- + src/libcmis/sharepoint-document.cxx | 2 -- + src/libcmis/sharepoint-folder.cxx | 2 -- + src/libcmis/ws-document.cxx | 1 - + src/libcmis/ws-folder.cxx | 1 - + 12 files changed, 19 deletions(-) + +diff --git a/inc/libcmis/document.hxx b/inc/libcmis/document.hxx +index 8f44313..ca18a84 100644 +--- a/inc/libcmis/document.hxx ++++ b/inc/libcmis/document.hxx +@@ -48,7 +48,6 @@ namespace libcmis + class LIBCMIS_API Document : public virtual Object + { + public: +- Document( Session* session ) : Object( session ) { } + virtual ~Document( ) { } + + /** Get the folder parents for the document. +diff --git a/inc/libcmis/folder.hxx b/inc/libcmis/folder.hxx +index 0010dbd..24f4ac4 100644 +--- a/inc/libcmis/folder.hxx ++++ b/inc/libcmis/folder.hxx +@@ -55,7 +55,6 @@ namespace libcmis + class LIBCMIS_API Folder : public virtual Object + { + public: +- Folder( Session* session ) : Object( session ) { } + virtual ~Folder() { } + + virtual std::vector< std::string > getPaths( ); +diff --git a/src/libcmis/atom-document.cxx b/src/libcmis/atom-document.cxx +index e0400b1..8871dbc 100644 +--- a/src/libcmis/atom-document.cxx ++++ b/src/libcmis/atom-document.cxx +@@ -43,7 +43,6 @@ using namespace libcmis; + + AtomDocument::AtomDocument( AtomPubSession* session ) : + libcmis::Object( session ), +- libcmis::Document( session ), + AtomObject( session ), + m_contentUrl( ) + { +@@ -52,7 +51,6 @@ AtomDocument::AtomDocument( AtomPubSession* session ) : + + AtomDocument::AtomDocument( AtomPubSession* session, xmlNodePtr entryNd ) : + libcmis::Object( session ), +- libcmis::Document( session ), + AtomObject( session ), + m_contentUrl( ) + { +diff --git a/src/libcmis/atom-folder.cxx b/src/libcmis/atom-folder.cxx +index 5e41194..25276a1 100644 +--- a/src/libcmis/atom-folder.cxx ++++ b/src/libcmis/atom-folder.cxx +@@ -46,7 +46,6 @@ namespace + + AtomFolder::AtomFolder( AtomPubSession* session, xmlNodePtr entryNd ) : + libcmis::Object( session ), +- libcmis::Folder( session ), + AtomObject( session ) + { + xmlDocPtr doc = libcmis::wrapInDoc( entryNd ); +diff --git a/src/libcmis/gdrive-document.cxx b/src/libcmis/gdrive-document.cxx +index ecb13d6..a826cf7 100644 +--- a/src/libcmis/gdrive-document.cxx ++++ b/src/libcmis/gdrive-document.cxx +@@ -40,7 +40,6 @@ using namespace libcmis; + + GDriveDocument::GDriveDocument( GDriveSession* session ) : + libcmis::Object( session), +- libcmis::Document( session ), + GDriveObject( session ), + m_isGoogleDoc( false ) + { +@@ -48,7 +47,6 @@ GDriveDocument::GDriveDocument( GDriveSession* session ) : + + GDriveDocument::GDriveDocument( GDriveSession* session, Json json, string id, string name ) : + libcmis::Object( session), +- libcmis::Document( session ), + GDriveObject( session, json, id, name ), + m_isGoogleDoc( false ) + { +diff --git a/src/libcmis/gdrive-folder.cxx b/src/libcmis/gdrive-folder.cxx +index 26de89b..3aa5faf 100644 +--- a/src/libcmis/gdrive-folder.cxx ++++ b/src/libcmis/gdrive-folder.cxx +@@ -38,14 +38,12 @@ using namespace libcmis; + + GDriveFolder::GDriveFolder( GDriveSession* session ): + libcmis::Object( session ), +- libcmis::Folder( session ), + GDriveObject( session ) + { + } + + GDriveFolder::GDriveFolder( GDriveSession* session, Json json ): + libcmis::Object( session ), +- libcmis::Folder( session ), + GDriveObject( session, json ) + { + } +diff --git a/src/libcmis/onedrive-document.cxx b/src/libcmis/onedrive-document.cxx +index 863a92f..ced64e0 100644 +--- a/src/libcmis/onedrive-document.cxx ++++ b/src/libcmis/onedrive-document.cxx +@@ -40,14 +40,12 @@ using namespace libcmis; + + OneDriveDocument::OneDriveDocument( OneDriveSession* session ) : + libcmis::Object( session), +- libcmis::Document( session ), + OneDriveObject( session ) + { + } + + OneDriveDocument::OneDriveDocument( OneDriveSession* session, Json json, string id, string name ) : + libcmis::Object( session), +- libcmis::Document( session ), + OneDriveObject( session, json, id, name ) + { + } +diff --git a/src/libcmis/onedrive-folder.cxx b/src/libcmis/onedrive-folder.cxx +index c1980c8..3fa455a 100644 +--- a/src/libcmis/onedrive-folder.cxx ++++ b/src/libcmis/onedrive-folder.cxx +@@ -38,14 +38,12 @@ using namespace libcmis; + + OneDriveFolder::OneDriveFolder( OneDriveSession* session ): + libcmis::Object( session ), +- libcmis::Folder( session ), + OneDriveObject( session ) + { + } + + OneDriveFolder::OneDriveFolder( OneDriveSession* session, Json json ): + libcmis::Object( session ), +- libcmis::Folder( session ), + OneDriveObject( session, json ) + { + } +diff --git a/src/libcmis/sharepoint-document.cxx b/src/libcmis/sharepoint-document.cxx +index dec5527..61b4431 100644 +--- a/src/libcmis/sharepoint-document.cxx ++++ b/src/libcmis/sharepoint-document.cxx +@@ -37,14 +37,12 @@ using namespace libcmis; + + SharePointDocument::SharePointDocument( SharePointSession* session ) : + libcmis::Object( session), +- libcmis::Document( session ), + SharePointObject( session ) + { + } + + SharePointDocument::SharePointDocument( SharePointSession* session, Json json, string parentId, string name ) : + libcmis::Object( session), +- libcmis::Document( session ), + SharePointObject( session, json, parentId, name ) + { + } +diff --git a/src/libcmis/sharepoint-folder.cxx b/src/libcmis/sharepoint-folder.cxx +index e4da4a3..8bcb2db 100644 +--- a/src/libcmis/sharepoint-folder.cxx ++++ b/src/libcmis/sharepoint-folder.cxx +@@ -38,14 +38,12 @@ using namespace libcmis; + + SharePointFolder::SharePointFolder( SharePointSession* session ): + libcmis::Object( session ), +- libcmis::Folder( session ), + SharePointObject( session ) + { + } + + SharePointFolder::SharePointFolder( SharePointSession* session, Json json, string parentId ): + libcmis::Object( session ), +- libcmis::Folder( session ), + SharePointObject( session, json, parentId ) + { + } +diff --git a/src/libcmis/ws-document.cxx b/src/libcmis/ws-document.cxx +index ba2f2bc..c085d5b 100644 +--- a/src/libcmis/ws-document.cxx ++++ b/src/libcmis/ws-document.cxx +@@ -33,7 +33,6 @@ using libcmis::PropertyPtrMap; + + WSDocument::WSDocument( const WSObject& object ) : + libcmis::Object( object ), +- libcmis::Document( const_cast< WSObject& >( object ).getSession( ) ), + WSObject( object ) + { + } +diff --git a/src/libcmis/ws-folder.cxx b/src/libcmis/ws-folder.cxx +index 4e82ac2..aca0543 100644 +--- a/src/libcmis/ws-folder.cxx ++++ b/src/libcmis/ws-folder.cxx +@@ -33,7 +33,6 @@ using libcmis::PropertyPtrMap; + + WSFolder::WSFolder( const WSObject& object ) : + libcmis::Object( object ), +- libcmis::Folder( const_cast< WSObject& >( object ).getSession( ) ), + WSObject( object ) + { + } +-- +2.43.0.windows.1 + diff --git a/external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch b/external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch new file mode 100644 index 000000000000..ff022a82867e --- /dev/null +++ b/external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch @@ -0,0 +1,69 @@ +From ca078137dfa94664275f021c5fbf08a34f3fbc10 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 14 Jan 2024 20:41:06 +0000 +Subject: [PATCH] cid#1545775 COPY_INSTEAD_OF_MOVE + +and + +cid#1546321 COPY_INSTEAD_OF_MOVE +cid#1546272 COPY_INSTEAD_OF_MOVE +cid#1546287 COPY_INSTEAD_OF_MOVE +cid#1545443 COPY_INSTEAD_OF_MOVE +--- + inc/libcmis/exception.hxx | 4 ++-- + inc/libcmis/property-type.hxx | 10 +++++----- + inc/libcmis/session-factory.hxx | 2 +- + 3 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/inc/libcmis/exception.hxx b/inc/libcmis/exception.hxx +index aa42ae7..565bff0 100644 +--- a/inc/libcmis/exception.hxx ++++ b/inc/libcmis/exception.hxx +@@ -44,8 +44,8 @@ namespace libcmis + public: + Exception( std::string message, std::string type = "runtime" ) : + exception( ), +- m_message( message ), +- m_type( type ) ++ m_message( std::move(message) ), ++ m_type( std::move(type) ) + { + } + +diff --git a/inc/libcmis/property-type.hxx b/inc/libcmis/property-type.hxx +index 350a7b2..e6b3779 100644 +--- a/inc/libcmis/property-type.hxx ++++ b/inc/libcmis/property-type.hxx +@@ -102,11 +102,11 @@ namespace libcmis + bool isOrderable( ) { return m_orderable; } + bool isOpenChoice( ) { return m_openChoice; } + +- void setId( std::string id ) { m_id = id; } +- void setLocalName( std::string localName ) { m_localName = localName; } +- void setLocalNamespace( std::string localNamespace ) { m_localNamespace = localNamespace; } +- void setDisplayName( std::string displayName ) { m_displayName = displayName; } +- void setQueryName( std::string queryName ) { m_queryName = queryName; } ++ void setId( const std::string& id ) { m_id = id; } ++ void setLocalName( const std::string& localName ) { m_localName = localName; } ++ void setLocalNamespace( const std::string& localNamespace ) { m_localNamespace = localNamespace; } ++ void setDisplayName( const std::string& displayName ) { m_displayName = displayName; } ++ void setQueryName( const std::string& queryName ) { m_queryName = queryName; } + void setType( Type type ) { m_type = type; } + void setMultiValued( bool multivalued ) { m_multiValued = multivalued; } + void setUpdatable( bool updatable ) { m_updatable = updatable; } +diff --git a/inc/libcmis/session-factory.hxx b/inc/libcmis/session-factory.hxx +index 227ac4d..1887254 100644 +--- a/inc/libcmis/session-factory.hxx ++++ b/inc/libcmis/session-factory.hxx +@@ -111,7 +111,7 @@ namespace libcmis + /** Set the handler to ask the user what to do with invalid SSL certificates. If not set, + every invalid certificate will raise an exception. + */ +- static void setCertificateValidationHandler( CertValidationHandlerPtr handler ) { s_certValidationHandler = handler; } ++ static void setCertificateValidationHandler(const CertValidationHandlerPtr& handler ) { s_certValidationHandler = handler; } + static CertValidationHandlerPtr getCertificateValidationHandler( ) { return s_certValidationHandler; } + + static void setCurlInitProtocolsFunction(CurlInitProtocolsFunction); +-- +2.43.0 + diff --git a/external/libcmis/0001-rename-class-GetObject-to-avoid-name-clash-on-Window.patch b/external/libcmis/0001-rename-class-GetObject-to-avoid-name-clash-on-Window.patch deleted file mode 100644 index f82c82f819f8..000000000000 --- a/external/libcmis/0001-rename-class-GetObject-to-avoid-name-clash-on-Window.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 219e6d6586c8280dfd9c4851cee0d14d68b6ad65 Mon Sep 17 00:00:00 2001 -From: David Tardon <dtardon@redhat.com> -Date: Fri, 28 Dec 2018 15:26:28 +0100 -Subject: [PATCH] rename class GetObject to avoid name clash on Windows - ---- - src/libcmis/ws-objectservice.cxx | 2 +- - src/libcmis/ws-requests.cxx | 2 +- - src/libcmis/ws-requests.hxx | 7 +++---- - 3 files changed, 5 insertions(+), 6 deletions(-) - -diff --git a/src/libcmis/ws-objectservice.cxx b/src/libcmis/ws-objectservice.cxx -index 9e40085..d57f3cc 100644 ---- a/src/libcmis/ws-objectservice.cxx -+++ b/src/libcmis/ws-objectservice.cxx -@@ -71,7 +71,7 @@ libcmis::ObjectPtr ObjectService::getObject( string repoId, string id ) - { - libcmis::ObjectPtr object; - -- class GetObject request( repoId, id ); -+ GetObjectRequest request( repoId, id ); - vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); - if ( responses.size( ) == 1 ) - { -diff --git a/src/libcmis/ws-requests.cxx b/src/libcmis/ws-requests.cxx -index f8bc245..408d053 100644 ---- a/src/libcmis/ws-requests.cxx -+++ b/src/libcmis/ws-requests.cxx -@@ -269,7 +269,7 @@ SoapResponsePtr GetTypeChildrenResponse::create( xmlNodePtr node, RelatedMultipa - return SoapResponsePtr( response ); - } - --void GetObject::toXml( xmlTextWriterPtr writer ) -+void GetObjectRequest::toXml( xmlTextWriterPtr writer ) - { - xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getObject" ) ); - xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); -diff --git a/src/libcmis/ws-requests.hxx b/src/libcmis/ws-requests.hxx -index 2c4ae92..534d9a4 100644 ---- a/src/libcmis/ws-requests.hxx -+++ b/src/libcmis/ws-requests.hxx -@@ -203,21 +203,20 @@ class GetTypeChildrenResponse : public SoapResponse - std::vector< libcmis::ObjectTypePtr > getChildren( ) { return m_children; } - }; - --#undef GetObject --class GetObject : public SoapRequest -+class GetObjectRequest : public SoapRequest - { - private: - std::string m_repositoryId; - std::string m_id; - - public: -- GetObject( std::string repoId, std::string id ) : -+ GetObjectRequest( std::string repoId, std::string id ) : - m_repositoryId( repoId ), - m_id( id ) - { - } - -- ~GetObject( ) { } -+ ~GetObjectRequest( ) { } - - void toXml( xmlTextWriterPtr writer ); - }; --- -2.19.2 - diff --git a/external/libcmis/UnpackedTarball_libcmis.mk b/external/libcmis/UnpackedTarball_libcmis.mk index a5be3078c95a..e9c22b9b9338 100644 --- a/external/libcmis/UnpackedTarball_libcmis.mk +++ b/external/libcmis/UnpackedTarball_libcmis.mk @@ -13,10 +13,11 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libcmis,$(LIBCMIS_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,libcmis,1)) -$(eval $(call gb_UnpackedTarball_add_patches,libcmis, \ - external/libcmis/libcmis-libxml2_compatibility.patch \ - external/libcmis/0001-rename-class-GetObject-to-avoid-name-clash-on-Window.patch \ - external/libcmis/libcmis_onedrive.patch \ +# 0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch is upstreamed + +$(eval $(call gb_UnpackedTarball_add_patches,libcmis,\ + external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch \ + external/libcmis/0001-Fix-warning-C4589-when-building-with-MSVC.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libcmis/libcmis-libxml2_compatibility.patch b/external/libcmis/libcmis-libxml2_compatibility.patch deleted file mode 100644 index 240b85b4d38e..000000000000 --- a/external/libcmis/libcmis-libxml2_compatibility.patch +++ /dev/null @@ -1,14 +0,0 @@ -# -*- Mode: Diff -*- ---- a/src/libcmis/oauth2-providers.cxx -+++ b/src/libcmis/oauth2-providers.cxx -@@ -34,6 +34,10 @@ - - using namespace std; - -+#if LIBXML_VERSION < 20621 -+#define HTML_PARSE_RECOVER 0 -+#endif -+ - namespace { - - // Encodes the given data according to the application/x-www-form-urlencoded format, see diff --git a/external/libcmis/libcmis_onedrive.patch b/external/libcmis/libcmis_onedrive.patch deleted file mode 100644 index 60d7e7b3be69..000000000000 --- a/external/libcmis/libcmis_onedrive.patch +++ /dev/null @@ -1,445 +0,0 @@ -diff --git a/src/libcmis/http-session.cxx b/src/libcmis/http-session.cxx -index 2638482..227667e 100644 ---- a/src/libcmis/http-session.cxx -+++ b/src/libcmis/http-session.cxx -@@ -293,6 +293,94 @@ libcmis::HttpResponsePtr HttpSession::httpGetRequest( string url ) - return response; - } - -+libcmis::HttpResponsePtr HttpSession::httpPatchRequest( string url, istream& is, vector< string > headers ) -+{ -+ checkOAuth2( url ); -+ -+ // Duplicate istream in case we need to retry -+ string isStr( static_cast< stringstream const&>( stringstream( ) << is.rdbuf( ) ).str( ) ); -+ -+ istringstream isOriginal( isStr ), isBackup( isStr ); -+ -+ // Reset the handle for the request -+ curl_easy_reset( m_curlHandle ); -+ initProtocols( ); -+ -+ libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) ); -+ -+ curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_WRITEDATA, response->getData( ).get( ) ); -+ -+ curl_easy_setopt( m_curlHandle, CURLOPT_HEADERFUNCTION, &lcl_getHeaders ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_WRITEHEADER, response.get() ); -+ -+ curl_easy_setopt( m_curlHandle, CURLOPT_MAXREDIRS, 20); -+ -+ // Get the stream length -+ is.seekg( 0, ios::end ); -+ long size = is.tellg( ); -+ is.seekg( 0, ios::beg ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_INFILESIZE, size ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_READDATA, &isOriginal ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_READFUNCTION, lcl_readStream ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_UPLOAD, 1 ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_CUSTOMREQUEST, "PATCH" ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLDATA, &isOriginal ); -+ -+ // If we know for sure that 100-Continue won't be accepted, -+ // don't even try with it to save one HTTP request. -+ if ( m_no100Continue ) -+ headers.push_back( "Expect:" ); -+ try -+ { -+ httpRunRequest( url, headers ); -+ response->getData( )->finish(); -+ } -+ catch ( const CurlException& ) -+ { -+ long status = getHttpStatus( ); -+ /** If we had a HTTP 417 response, this is likely to be due to some -+ HTTP 1.0 proxy / server not accepting the "Expect: 100-continue" -+ header. Try to disable this header and try again. -+ */ -+ if ( status == 417 && !m_no100Continue) -+ { -+ // Remember that we don't want 100-Continue for the future requests -+ m_no100Continue = true; -+ response = httpPutRequest( url, isBackup, headers ); -+ } -+ -+ // If the access token is expired, we get 401 error, -+ // Need to use the refresh token to get a new one. -+ if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) -+ { -+ -+ // Refresh the token -+ oauth2Refresh(); -+ -+ // Resend the query -+ try -+ { -+ // Avoid infinite recursive call -+ m_refreshedToken = true; -+ response = httpPutRequest( url, isBackup, headers ); -+ m_refreshedToken = false; -+ } -+ catch (const CurlException&) -+ { -+ m_refreshedToken = false; -+ throw; -+ } -+ } -+ // Has tried but failed -+ if ( ( status != 417 || m_no100Continue ) && -+ ( status != 401 || getRefreshToken( ).empty( ) || m_refreshedToken ) ) throw; -+ } -+ m_refreshedToken = false; -+ return response; -+} -+ - libcmis::HttpResponsePtr HttpSession::httpPutRequest( string url, istream& is, vector< string > headers ) - { - checkOAuth2( url ); -diff --git a/src/libcmis/http-session.hxx b/src/libcmis/http-session.hxx -index 851d52d..29de64d 100644 ---- a/src/libcmis/http-session.hxx -+++ b/src/libcmis/http-session.hxx -@@ -132,6 +132,9 @@ class HttpSession - virtual void setOAuth2Data( libcmis::OAuth2DataPtr oauth2 ); - - libcmis::HttpResponsePtr httpGetRequest( std::string url ); -+ libcmis::HttpResponsePtr httpPatchRequest( std::string url, -+ std::istream& is, -+ std::vector< std::string > headers ); - libcmis::HttpResponsePtr httpPutRequest( std::string url, - std::istream& is, - std::vector< std::string > headers ); -diff --git a/src/libcmis/oauth2-handler.cxx b/src/libcmis/oauth2-handler.cxx -index a3320e3..842769f 100644 ---- a/src/libcmis/oauth2-handler.cxx -+++ b/src/libcmis/oauth2-handler.cxx -@@ -91,8 +91,8 @@ void OAuth2Handler::fetchTokens( string authCode ) - string post = - "code=" + authCode + - "&client_id=" + m_data->getClientId() + -- "&client_secret=" + m_data->getClientSecret() + - "&redirect_uri=" + m_data->getRedirectUri() + -+ "&scope=" + libcmis::escape( m_data->getScope() ) + - "&grant_type=authorization_code" ; - - istringstream is( post ); -@@ -121,7 +121,6 @@ void OAuth2Handler::refresh( ) - string post = - "refresh_token=" + m_refresh + - "&client_id=" + m_data->getClientId() + -- "&client_secret=" + m_data->getClientSecret() + - "&grant_type=refresh_token" ; - - istringstream is( post ); -diff --git a/src/libcmis/oauth2-providers.cxx b/src/libcmis/oauth2-providers.cxx -index 8cf9652..654021f 100644 ---- a/src/libcmis/oauth2-providers.cxx -+++ b/src/libcmis/oauth2-providers.cxx -@@ -312,7 +312,7 @@ OAuth2Parser OAuth2Providers::getOAuth2Parser( const std::string& url ) - return OAuth2Alfresco; - else if ( boost::starts_with( url, "https://www.googleapis.com/drive/v2" ) ) - return OAuth2Gdrive; -- else if ( boost::starts_with( url, "https://apis.live.net/v5.0" ) ) -+ else if ( boost::starts_with( url, "https://graph.microsoft.com/v1.0" ) ) - return OAuth2Onedrive; - - return OAuth2Gdrive; -diff --git a/src/libcmis/onedrive-document.cxx b/src/libcmis/onedrive-document.cxx -index f753b42..863a92f 100644 ---- a/src/libcmis/onedrive-document.cxx -+++ b/src/libcmis/onedrive-document.cxx -@@ -73,7 +73,7 @@ boost::shared_ptr< istream > OneDriveDocument::getContentStream( string /*stream - boost::shared_ptr< istream > stream; - string streamUrl = getStringProperty( "source" ); - if ( streamUrl.empty( ) ) -- throw libcmis::Exception( "can not found stream url" ); -+ throw libcmis::Exception( "could not find stream url" ); - - try - { -@@ -89,15 +89,15 @@ boost::shared_ptr< istream > OneDriveDocument::getContentStream( string /*stream - void OneDriveDocument::setContentStream( boost::shared_ptr< ostream > os, - string /*contentType*/, - string fileName, -- bool /*overwrite*/ ) -+ bool bReplaceExisting ) - { - if ( !os.get( ) ) - throw libcmis::Exception( "Missing stream" ); -- -+ - string metaUrl = getUrl( ); - - // Update file name meta information -- if ( !fileName.empty( ) && fileName != getContentFilename( ) ) -+ if ( bReplaceExisting && !fileName.empty( ) && fileName != getContentFilename( ) ) - { - Json metaJson; - Json fileJson( fileName.c_str( ) ); -@@ -108,7 +108,7 @@ void OneDriveDocument::setContentStream( boost::shared_ptr< ostream > os, - headers.push_back( "Content-Type: application/json" ); - try - { -- getSession()->httpPutRequest( metaUrl, is, headers ); -+ getSession()->httpPatchRequest( metaUrl, is, headers ); - } - catch ( const CurlException& e ) - { -@@ -117,9 +117,9 @@ void OneDriveDocument::setContentStream( boost::shared_ptr< ostream > os, - } - - fileName = libcmis::escape( getStringProperty( "cmis:name" ) ); -- string putUrl = getSession( )->getBindingUrl( ) + "/" + -- getStringProperty( "cmis:parentId" ) + "/files/" + -- fileName + "?overwrite=true"; -+ string putUrl = getSession( )->getBindingUrl( ) + "/me/drive/items/" + -+ getStringProperty( "cmis:parentId" ) + ":/" + -+ fileName + ":/content"; - - // Upload stream - boost::shared_ptr< istream> is ( new istream ( os->rdbuf( ) ) ); -@@ -142,6 +142,7 @@ void OneDriveDocument::setContentStream( boost::shared_ptr< ostream > os, - libcmis::DocumentPtr OneDriveDocument::checkOut( ) - { - // OneDrive doesn't have CheckOut, so just return the same document here -+ // TODO: no longer true - onedrive now has checkout/checkin - libcmis::ObjectPtr obj = getSession( )->getObject( getId( ) ); - libcmis::DocumentPtr checkout = - boost::dynamic_pointer_cast< libcmis::Document > ( obj ); -diff --git a/src/libcmis/onedrive-folder.cxx b/src/libcmis/onedrive-folder.cxx -index a9ae694..c1980c8 100644 ---- a/src/libcmis/onedrive-folder.cxx -+++ b/src/libcmis/onedrive-folder.cxx -@@ -57,7 +57,9 @@ OneDriveFolder::~OneDriveFolder( ) - vector< libcmis::ObjectPtr > OneDriveFolder::getChildren( ) - { - vector< libcmis::ObjectPtr > children; -- string query = getSession( )->getBindingUrl( ) + "/" + getId( ) + "/files"; -+ // TODO: limited to 200 items by default - to get more one would have to -+ // follow @odata.nextLink or change pagination size -+ string query = getSession( )->getBindingUrl( ) + "/me/drive/items/" + getId( ) + "/children"; - - string res; - try -@@ -70,7 +72,7 @@ vector< libcmis::ObjectPtr > OneDriveFolder::getChildren( ) - } - - Json jsonRes = Json::parse( res ); -- Json::JsonVector objs = jsonRes["data"].getList( ); -+ Json::JsonVector objs = jsonRes["value"].getList( ); - - // Create children objects from Json objects - for(unsigned int i = 0; i < objs.size(); i++) -@@ -85,8 +87,7 @@ libcmis::FolderPtr OneDriveFolder::createFolder( - const PropertyPtrMap& properties ) - { - Json propsJson = OneDriveUtils::toOneDriveJson( properties ); -- -- string uploadUrl = getSession( )->getBindingUrl( ) + "/" + getId( ); -+ string uploadUrl = getSession( )->getBindingUrl( ) + "/me/drive/items/" + getId( ) + "/children"; - - std::istringstream is( propsJson.toString( ) ); - string response; -@@ -126,9 +127,10 @@ libcmis::DocumentPtr OneDriveFolder::createDocument( - } - } - -+ // TODO: limited to 4MB, larger uploads need dedicated UploadSession - fileName = libcmis::escape( fileName ); -- string newDocUrl = getSession( )->getBindingUrl( ) + "/" + -- getId( ) + "/files/" + fileName; -+ string newDocUrl = getSession( )->getBindingUrl( ) + "/me/drive/items/" + -+ getId( ) + ":/" + fileName + ":/content"; - boost::shared_ptr< istream> is ( new istream ( os->rdbuf( ) ) ); - vector< string > headers; - string res; -diff --git a/src/libcmis/onedrive-object.cxx b/src/libcmis/onedrive-object.cxx -index 976a97b..8deb591 100644 ---- a/src/libcmis/onedrive-object.cxx -+++ b/src/libcmis/onedrive-object.cxx -@@ -65,7 +65,7 @@ void OneDriveObject::initializeFromJson ( Json json, string /*id*/, string /*nam - Json::JsonObject objs = json.getObjects( ); - Json::JsonObject::iterator it; - PropertyPtr property; -- bool isFolder = json["type"].toString( ) == "folder"; -+ bool isFolder = json["folder"].toString( ) != ""; - for ( it = objs.begin( ); it != objs.end( ); ++it) - { - property.reset( new OneDriveProperty( it->first, it->second ) ); -@@ -74,7 +74,12 @@ void OneDriveObject::initializeFromJson ( Json json, string /*id*/, string /*nam - { - property.reset( new OneDriveProperty( "cmis:contentStreamFileName", it->second ) ); - m_properties[ property->getPropertyType( )->getId()] = property; -- } -+ } else if ( it->first == "parentReference" ) { -+ if (it->second["id"].toString() != "") { -+ property.reset( new OneDriveProperty( "cmis:parentId", it->second["id"] ) ); -+ m_properties[ property->getPropertyType( )->getId()] = property; -+ } -+ } - } - - m_refreshTimestamp = time( NULL ); -@@ -122,7 +127,7 @@ void OneDriveObject::remove( bool /*allVersions*/ ) - - string OneDriveObject::getUrl( ) - { -- return getSession( )->getBindingUrl( ) + "/" + getId( ); -+ return getSession( )->getBindingUrl( ) + "/me/drive/items/" + getId( ); - } - - string OneDriveObject::getUploadUrl( ) -@@ -152,7 +157,7 @@ libcmis::ObjectPtr OneDriveObject::updateProperties( - { - vector< string > headers; - headers.push_back( "Content-Type: application/json" ); -- response = getSession( )->httpPutRequest( getUrl( ), is, headers ); -+ response = getSession( )->httpPatchRequest( getUrl( ), is, headers ); - } - catch ( const CurlException& e ) - { -diff --git a/src/libcmis/onedrive-repository.cxx b/src/libcmis/onedrive-repository.cxx -index 3eaac9c..b01f5c2 100644 ---- a/src/libcmis/onedrive-repository.cxx -+++ b/src/libcmis/onedrive-repository.cxx -@@ -35,7 +35,7 @@ OneDriveRepository::OneDriveRepository( ) : - m_description = "One Drive repository"; - m_productName = "One Drive"; - m_productVersion = "v5"; -- m_rootId = "me/skydrive"; -+ m_rootId = "/me/drive/root"; - - m_capabilities[ ACL ] = "discover"; - m_capabilities[ AllVersionsSearchable ] = "true"; -diff --git a/src/libcmis/onedrive-session.cxx b/src/libcmis/onedrive-session.cxx -index c6f4270..a603278 100644 ---- a/src/libcmis/onedrive-session.cxx -+++ b/src/libcmis/onedrive-session.cxx -@@ -79,7 +79,9 @@ libcmis::ObjectPtr OneDriveSession::getObject( string objectId ) - { - // Run the http request to get the properties definition - string res; -- string objectLink = m_bindingUrl + "/" + objectId; -+ string objectLink = m_bindingUrl + "/me/drive/items/" + objectId; -+ if (objectId == getRootId()) -+ objectLink = m_bindingUrl + objectId; - try - { - res = httpGetRequest( objectLink )->getStream()->str(); -@@ -95,12 +97,11 @@ libcmis::ObjectPtr OneDriveSession::getObject( string objectId ) - libcmis::ObjectPtr OneDriveSession::getObjectFromJson( Json& jsonRes ) - { - libcmis::ObjectPtr object; -- string kind = jsonRes["type"].toString( ); -- if ( kind == "folder" || kind == "album" ) -+ if ( jsonRes["folder"].toString() != "" ) - { - object.reset( new OneDriveFolder( this, jsonRes ) ); - } -- else if ( kind == "file" ) -+ else if ( jsonRes["file"].toString() != "" ) - { - object.reset( new OneDriveDocument( this, jsonRes ) ); - } -@@ -113,44 +114,18 @@ libcmis::ObjectPtr OneDriveSession::getObjectFromJson( Json& jsonRes ) - - libcmis::ObjectPtr OneDriveSession::getObjectByPath( string path ) - { -- string id; -- if ( path == "/" ) -- { -- id = "me/skydrive"; -- } -- else -+ string res; -+ string objectQuery = m_bindingUrl + "/me/drive/root:" + libcmis::escape( path ); -+ try - { -- path = "/SkyDrive" + path; -- size_t pos = path.rfind("/"); -- string name = libcmis::escape( path.substr( pos + 1, path.size( ) ) ); -- string res; -- string objectQuery = m_bindingUrl + "/me/skydrive/search?q=" + name; -- try -- { -- res = httpGetRequest( objectQuery )->getStream( )->str( ); -- } -- catch ( const CurlException& e ) -- { -- throw e.getCmisException( ); -- } -- Json jsonRes = Json::parse( res ); -- Json::JsonVector objs = jsonRes["data"].getList( ); -- -- // Searching for a match in the path to the object -- for ( unsigned int i = 0; i < objs.size( ); i++ ) -- { -- if ( isAPathMatch( objs[i], path ) ) -- { -- id = objs[i]["id"].toString( ); -- break; -- } -- } -+ res = httpGetRequest( objectQuery )->getStream( )->str( ); - } -- if ( id.empty( ) ) -+ catch ( const CurlException& e ) - { -- throw libcmis::Exception( "No file could be found" ); -+ throw libcmis::Exception( "No file could be found for path " + path + ": " + e.what() ); - } -- return getObject( id ); -+ Json jsonRes = Json::parse( res ); -+ return getObjectFromJson( jsonRes ); - } - - bool OneDriveSession::isAPathMatch( Json objectJson, string path ) -diff --git a/src/libcmis/onedrive-utils.cxx b/src/libcmis/onedrive-utils.cxx -index dc6ec5d..17ed324 100644 ---- a/src/libcmis/onedrive-utils.cxx -+++ b/src/libcmis/onedrive-utils.cxx -@@ -44,16 +44,16 @@ string OneDriveUtils::toCmisKey( const string& key ) - convertedKey = "cmis:createdBy"; - else if ( key == "description" ) - convertedKey = "cmis:description"; -- else if ( key == "created_time" ) -+ else if ( key == "createdDateTime" ) - convertedKey = "cmis:creationDate"; -- else if ( key == "updated_time" ) -+ else if ( key == "lastModifiedDateTime" ) - convertedKey = "cmis:lastModificationDate"; - else if ( key == "name" ) - convertedKey = "cmis:name"; - else if ( key == "size" ) - convertedKey = "cmis:contentStreamLength"; -- else if ( key == "parent_id" ) -- convertedKey = "cmis:parentId"; -+ else if ( key == "@microsoft.graph.downloadUrl" ) -+ convertedKey = "source"; - else convertedKey = key; - return convertedKey; - } -@@ -75,8 +75,6 @@ string OneDriveUtils::toOneDriveKey( const string& key ) - convertedKey = "name"; - else if ( key == "cmis:contentStreamLength" ) - convertedKey = "file_size"; -- else if ( key == "cmis:parentId" ) -- convertedKey = "parent_id"; - else convertedKey = key; - return convertedKey; - } -diff --git a/src/libcmis/session-factory.cxx b/src/libcmis/session-factory.cxx -index ba55cd9..e740afb 100644 ---- a/src/libcmis/session-factory.cxx -+++ b/src/libcmis/session-factory.cxx -@@ -71,7 +71,7 @@ namespace libcmis - session = new GDriveSession( bindingUrl, username, password, - oauth2, verbose ); - } -- else if ( bindingUrl == "https://apis.live.net/v5.0" ) -+ else if ( bindingUrl == "https://graph.microsoft.com/v1.0" ) - { - session = new OneDriveSession( bindingUrl, username, password, - oauth2, verbose); diff --git a/external/libebook/ExternalProject_libebook.mk b/external/libebook/ExternalProject_libebook.mk index 8ee2c7293e11..e1b04df38087 100644 --- a/external/libebook/ExternalProject_libebook.mk +++ b/external/libebook/ExternalProject_libebook.mk @@ -28,7 +28,7 @@ $(call gb_ExternalProject_get_state_target,libebook,build) : $(call gb_Trace_StartRange,libebook,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -39,13 +39,14 @@ $(call gb_ExternalProject_get_state_target,libebook,build) : $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ --disable-werror \ --disable-weffc \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ - CPPFLAGS="$(CPPFLAGS) $(ICU_UCHAR_TYPE) $(BOOST_CPPFLAGS)" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libebook)" \ + CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libebook)" \ LANGTAG_CFLAGS="$(LIBLANGTAG_CFLAGS)" \ LANGTAG_LIBS="$(LIBLANGTAG_LIBS)" \ XML_CFLAGS="$(LIBXML_CFLAGS)" \ XML_LIBS="$(LIBXML_LIBS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libebook,EXTERNAL) diff --git a/external/libebook/UnpackedTarball_libebook.mk b/external/libebook/UnpackedTarball_libebook.mk index 4a6dd2bce5ce..b294b69b19aa 100644 --- a/external/libebook/UnpackedTarball_libebook.mk +++ b/external/libebook/UnpackedTarball_libebook.mk @@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libebook,0)) $(eval $(call gb_UnpackedTarball_add_patches,libebook, \ external/libebook/libebook-no-icu-boolean.patch.1 \ external/libebook/include.patch \ + external/libebook/enumarith.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libebook/enumarith.patch b/external/libebook/enumarith.patch new file mode 100644 index 000000000000..f82c29d61747 --- /dev/null +++ b/external/libebook/enumarith.patch @@ -0,0 +1,17 @@ +--- src/lib/EBOOKDocument.cpp ++++ src/lib/EBOOKDocument.cpp +@@ -147,11 +147,11 @@ + { + const char *const name = char_cast(xmlTextReaderConstLocalName(reader.get())); + const char *const uri = char_cast(xmlTextReaderConstNamespaceUri(reader.get())); +- if ((EBOOKHTMLToken::html | EBOOKHTMLToken::NS_html) == getHTMLTokenId(name, uri)) ++ if ((+EBOOKHTMLToken::html | EBOOKHTMLToken::NS_html) == getHTMLTokenId(name, uri)) + type = EBOOKDocument::TYPE_XHTML; +- else if ((EPubToken::container | EPubToken::NS_container) == getEPubTokenId(name, uri)) ++ else if ((+EPubToken::container | EPubToken::NS_container) == getEPubTokenId(name, uri)) + type = EBOOKDocument::TYPE_EPUB; +- else if ((EBOOKOPFToken::package | EBOOKOPFToken::NS_opf) == getOPFTokenId(name, uri)) ++ else if ((+EBOOKOPFToken::package | EBOOKOPFToken::NS_opf) == getOPFTokenId(name, uri)) + type = EBOOKDocument::TYPE_EPUB; + else if (EBOOKOPFToken::package == getOPFTokenId(name, uri)) + type = EBOOKDocument::TYPE_OPENEBOOK; diff --git a/external/libeot/ExternalProject_libeot.mk b/external/libeot/ExternalProject_libeot.mk index 75e8054a0a4c..6e5f465333cc 100644 --- a/external/libeot/ExternalProject_libeot.mk +++ b/external/libeot/ExternalProject_libeot.mk @@ -18,12 +18,11 @@ $(call gb_ExternalProject_get_state_target,libeot,build) : $(call gb_ExternalProject_run,build,\ touch Makefile.in \ && export PKG_CONFIG="" \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ --disable-debug \ - CFLAGS='$(filter-out -std=gnu89,$(CFLAGS))' \ && $(MAKE) $(if $(verbose),V=1) \ ) $(call gb_Trace_EndRange,libeot,EXTERNAL) diff --git a/external/libepubgen/ExternalProject_libepubgen.mk b/external/libepubgen/ExternalProject_libepubgen.mk index 54a9a3d68bdc..0f34d10665e4 100644 --- a/external/libepubgen/ExternalProject_libepubgen.mk +++ b/external/libepubgen/ExternalProject_libepubgen.mk @@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libepubgen,build) : $(call gb_Trace_StartRange,libepubgen,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -32,9 +32,10 @@ $(call gb_ExternalProject_get_state_target,libepubgen,build) : $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \ --disable-werror \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libepubgen)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libepubgen)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libepubgen,EXTERNAL) diff --git a/external/libetonyek/0001-add-missing-include-for-std-for_each.patch b/external/libetonyek/0001-add-missing-include-for-std-for_each.patch deleted file mode 100644 index 09aaba58b7e3..000000000000 --- a/external/libetonyek/0001-add-missing-include-for-std-for_each.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 4b4d879a6db69ea05b89fdf99df8cb5d902d16b6 Mon Sep 17 00:00:00 2001 -From: Roland Illig <roland.illig@gmx.de> -Date: Tue, 19 May 2020 08:43:39 +0200 -Subject: [PATCH] add missing include for std::for_each - -On NetBSD 8.0 x86_64, gcc complains: - NUM3Parser.cpp: In member function 'virtual bool libetonyek::NUM3Parser::parseDocument()': - NUM3Parser.cpp:46:3: error: 'for_each' is not a member of 'std' - std::for_each(sheetListRefs.begin(), sheetListRefs.end(), std::bind(&NUM3Parser::parseSheet, this, std::placeholders::_1)); - -Change-Id: I723ba1bcbd10ed9215ceea8c5b224fdc5242be65 -Reviewed-on: https://gerrit.libreoffice.org/c/libetonyek/+/94450 -Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> -Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> ---- - src/lib/NUM3Parser.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git src/lib/NUM3Parser.cpp src/lib/NUM3Parser.cpp -index 66fb195..c19b611 100644 ---- src/lib/NUM3Parser.cpp -+++ src/lib/NUM3Parser.cpp -@@ -7,6 +7,7 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -+#include <algorithm> - #include <functional> - - #include "NUM3Parser.h" --- -2.28.0 - diff --git a/external/libetonyek/0001-allow-0-size-message.patch.1 b/external/libetonyek/0001-allow-0-size-message.patch.1 new file mode 100644 index 000000000000..62e584b815a0 --- /dev/null +++ b/external/libetonyek/0001-allow-0-size-message.patch.1 @@ -0,0 +1,30 @@ +From 54762245feee35ce6885f7443da8f8443fccd5b5 Mon Sep 17 00:00:00 2001 +From: David Tardon <dtardon@redhat.com> +Date: Wed, 26 May 2021 20:39:41 +0200 +Subject: [PATCH] allow 0-size message + +It likely means the input is broken, but there is no need to reject it. +Let's just produce a dummy, empty message. + +Change-Id: I03a1e9827f21f6a0ce69d7e16dfcf2e9a0f2d44f +--- + src/lib/IWAMessage.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/lib/IWAMessage.cpp b/src/lib/IWAMessage.cpp +index c01b1b6..9456444 100644 +--- a/src/lib/IWAMessage.cpp ++++ b/src/lib/IWAMessage.cpp +@@ -42,7 +42,8 @@ IWAMessage::IWAMessage(const RVNGInputStreamPtr_t &input, unsigned long length) + : m_input(input) + , m_fields() + { +- assert(length > 0); ++ if (length == 0) ++ return; + + parse(length); + } +-- +2.31.1 + diff --git a/external/libetonyek/0001-fix-build-with-MSVC.patch.1 b/external/libetonyek/0001-fix-build-with-MSVC.patch.1 new file mode 100644 index 000000000000..2a72844dc79a --- /dev/null +++ b/external/libetonyek/0001-fix-build-with-MSVC.patch.1 @@ -0,0 +1,28 @@ +From 1aa22c746b41a688296f4daf4fc35710d2045a33 Mon Sep 17 00:00:00 2001 +From: David Tardon <dtardon@redhat.com> +Date: Wed, 19 May 2021 19:43:43 +0200 +Subject: [PATCH] fix build with MSVC + +error C2664: 'libetonyek::IWORKFormula::IWORKFormula(const boost::optional<unsigned int> &)': cannot convert argument 1 from 'int' to 'const boost::optional<unsigned int> &' + +Change-Id: Iaa3de2d0ef8f960495e5d5afebb75c5063955177 +--- + src/lib/IWAParser.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp +index 7fd95c3..a2bd292 100644 +--- a/src/lib/IWAParser.cpp ++++ b/src/lib/IWAParser.cpp +@@ -3403,7 +3403,7 @@ bool IWAParser::parseFormula(const IWAMessage &msg, IWORKFormulaPtr_t &formula) + } + else + { +- formula.reset(new IWORKFormula(0)); ++ formula.reset(new IWORKFormula(boost::make_optional(0u))); + formula->parse(stack[0]); + } + return ok; +-- +2.31.1 + diff --git a/external/libetonyek/0002-fix-build-with-MSVC.patch.1 b/external/libetonyek/0002-fix-build-with-MSVC.patch.1 new file mode 100644 index 000000000000..0eadb0912f6a --- /dev/null +++ b/external/libetonyek/0002-fix-build-with-MSVC.patch.1 @@ -0,0 +1,55 @@ +From 7b69af66227309e9c258beca3bc3934be454a221 Mon Sep 17 00:00:00 2001 +From: David Tardon <dtardon@redhat.com> +Date: Wed, 19 May 2021 21:11:40 +0200 +Subject: [PATCH] fix build with MSVC + +C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\xutility(138): error C2668: 'libetonyek::IWORKStyle::IWORKStyle': ambiguous call to overloaded function +C:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\UnpackedTarball\libetonyek\src\lib\IWORKStyle.h(32): note: could be 'libetonyek::IWORKStyle::IWORKStyle(const libetonyek::IWORKPropertyMap &,const boost::optional<std::string> &,const libetonyek::IWORKStylePtr_t &)' +C:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\UnpackedTarball\libetonyek\src\lib\IWORKStyle.h(31): note: or 'libetonyek::IWORKStyle::IWORKStyle(const libetonyek::IWORKPropertyMap &,const boost::optional<std::string> &,const boost::optional<std::string> &)' +C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\xutility(137): note: while trying to match the argument list '(libetonyek::IWORKPropertyMap, const boost::none_t, _Ty)' + with + [ + _Ty=nullptr + ] +C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\memory(2186): note: see reference to function template instantiation 'void std::_Construct_in_place<_Ty,libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(_Ty &,libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&) noexcept(false)' being compiled + with + [ + _Ty=libetonyek::IWORKStyle + ] +C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\memory(2906): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&)' being compiled + with + [ + _Ty=libetonyek::IWORKStyle + ] +C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\memory(2907): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&)' being compiled + with + [ + _Ty=libetonyek::IWORKStyle + ] +C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/UnpackedTarball/libetonyek/src/lib/IWAParser.cpp(2358): note: see reference to function template instantiation 'std::shared_ptr<libetonyek::IWORKStyle> std::make_shared<libetonyek::IWORKStyle,libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&)' being compiled + +Change-Id: Idf871474b2a20f252073846388d018cccc15bc11 +--- + src/lib/IWAParser.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp +index a2bd292..1fdeae7 100644 +--- a/src/lib/IWAParser.cpp ++++ b/src/lib/IWAParser.cpp +@@ -2355,10 +2355,10 @@ void IWAParser::parseAuthorInComment(unsigned id) + IWORKPropertyMap props; + // normally yellow, but blue may be better in LO + props.put<property::FontColor>(IWORKColor(0,0,1,1)); +- spans[0]=std::make_shared<IWORKStyle>(props, boost::none, nullptr); ++ spans[0]=std::make_shared<IWORKStyle>(props, boost::none, IWORKStylePtr_t()); + // reset color to default, if not, comment will be blue colored + props.put<property::FontColor>(IWORKColor(0,0,0,1)); +- spans[unsigned(len)]=std::make_shared<IWORKStyle>(props, boost::none, nullptr); ++ spans[unsigned(len)]=std::make_shared<IWORKStyle>(props, boost::none, IWORKStylePtr_t()); + text.setSpans(spans); + text.parse(*m_currentText); + } +-- +2.31.1 + diff --git a/external/libetonyek/ExternalProject_libetonyek.mk b/external/libetonyek/ExternalProject_libetonyek.mk index 0eabfe5f4ffb..e0f2f3e08eb1 100644 --- a/external/libetonyek/ExternalProject_libetonyek.mk +++ b/external/libetonyek/ExternalProject_libetonyek.mk @@ -29,7 +29,7 @@ $(call gb_ExternalProject_get_state_target,libetonyek,build) : $(call gb_Trace_StartRange,libetonyek,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ @@ -49,12 +49,12 @@ $(call gb_ExternalProject_get_state_target,libetonyek,build) : 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libetonyek)" \ LANGTAG_CFLAGS="$(LIBLANGTAG_CFLAGS)" \ LANGTAG_LIBS="$(LIBLANGTAG_LIBS)" \ XML_CFLAGS="$(LIBXML_CFLAGS)" \ XML_LIBS="$(LIBXML_LIBS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ diff --git a/external/libetonyek/Library_etonyek.mk b/external/libetonyek/Library_etonyek.mk index cbbe08458410..87e21fc4b78a 100644 --- a/external/libetonyek/Library_etonyek.mk +++ b/external/libetonyek/Library_etonyek.mk @@ -118,6 +118,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\ UnpackedTarball/libetonyek/src/lib/contexts/IWORKBinaryElement \ UnpackedTarball/libetonyek/src/lib/contexts/IWORKBrContext \ UnpackedTarball/libetonyek/src/lib/contexts/IWORKCalcEngineContext \ + UnpackedTarball/libetonyek/src/lib/contexts/IWORKCellCommentDrawableInfoElement \ UnpackedTarball/libetonyek/src/lib/contexts/IWORKChartInfoElement \ UnpackedTarball/libetonyek/src/lib/contexts/IWORKColorElement \ UnpackedTarball/libetonyek/src/lib/contexts/IWORKCoreImageFilterDescriptorElement \ diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk index d1550f47e02a..80b3f5c318af 100644 --- a/external/libetonyek/UnpackedTarball_libetonyek.mk +++ b/external/libetonyek/UnpackedTarball_libetonyek.mk @@ -16,12 +16,14 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libetonyek,0)) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libetonyek)) $(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\ - external/libetonyek/glm-force-dmat3-initialization-needed-from-v0.9.9.0.patch.1 \ external/libetonyek/win_build.patch.1 \ external/libetonyek/ubsan.patch \ external/libetonyek/rpath.patch \ external/libetonyek/warnings.patch \ - external/libetonyek/0001-add-missing-include-for-std-for_each.patch \ + external/libetonyek/0001-fix-build-with-MSVC.patch.1 \ + external/libetonyek/0002-fix-build-with-MSVC.patch.1 \ + external/libetonyek/0001-allow-0-size-message.patch.1 \ + external/libetonyek/enumarith.patch \ )) ifneq ($(OS),MACOSX) diff --git a/external/libetonyek/enumarith.patch b/external/libetonyek/enumarith.patch new file mode 100644 index 000000000000..b618e5cab921 --- /dev/null +++ b/external/libetonyek/enumarith.patch @@ -0,0 +1,5836 @@ +--- src/lib/EtonyekDocument.cpp ++++ src/lib/EtonyekDocument.cpp +@@ -139,17 +139,17 @@ + + const char *const name = char_cast(xmlTextReaderConstLocalName(reader.get())); + const char *const ns = char_cast(xmlTextReaderConstNamespaceUri(reader.get())); +- if (probeXMLFormat(FORMAT_XML2, EtonyekDocument::TYPE_KEYNOTE, KEY2Token::NS_URI_KEY | KEY2Token::presentation, ++ if (probeXMLFormat(FORMAT_XML2, EtonyekDocument::TYPE_KEYNOTE, +KEY2Token::NS_URI_KEY | KEY2Token::presentation, + KEY2Token::getTokenizer(), name, ns, info)) + return true; +- if (probeXMLFormat(FORMAT_XML2, EtonyekDocument::TYPE_NUMBERS, NUM1Token::NS_URI_LS | NUM1Token::document, ++ if (probeXMLFormat(FORMAT_XML2, EtonyekDocument::TYPE_NUMBERS, +NUM1Token::NS_URI_LS | NUM1Token::document, + NUM1Token::getTokenizer(), name, ns, info)) + return true; +- if (probeXMLFormat(FORMAT_XML2, EtonyekDocument::TYPE_PAGES, PAG1Token::NS_URI_SL | PAG1Token::document, ++ if (probeXMLFormat(FORMAT_XML2, EtonyekDocument::TYPE_PAGES, +PAG1Token::NS_URI_SL | PAG1Token::document, + PAG1Token::getTokenizer(), name, ns, info)) + return true; + // Keynote 1 files define the document type with <!DOCTYPE APXL> +- if (probeXMLFormat(FORMAT_XML1, EtonyekDocument::TYPE_KEYNOTE, KEY1Token::NS_URI_KEY | KEY1Token::presentation, ++ if (probeXMLFormat(FORMAT_XML1, EtonyekDocument::TYPE_KEYNOTE, +KEY1Token::NS_URI_KEY | KEY1Token::presentation, + KEY1Token::getTokenizer(), name, (ns||!checkAPXL) ? ns : "http://developer.apple.com/schemas/APXL", info)) + return true; + return false; +--- src/lib/IWORKDiscardContext.cpp ++++ src/lib/IWORKDiscardContext.cpp +@@ -82,41 +82,41 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::bezier : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bezier : + return std::make_shared<IWORKBezierElement>(m_state, m_data->m_path); +- case IWORKToken::NS_URI_SF | IWORKToken::binary : ++ case +IWORKToken::NS_URI_SF | IWORKToken::binary : + return std::make_shared<IWORKBinaryElement>(m_state, m_data->m_mediaContent); +- case IWORKToken::NS_URI_SF | IWORKToken::cell_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cell_style : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::characterstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::characterstyle : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_characterStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_descriptor : ++ case +IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_descriptor : + return std::make_shared<IWORKCoreImageFilterDescriptorElement>(m_state, m_data->m_isShadow); +- case IWORKToken::NS_URI_SF | IWORKToken::data : ++ case +IWORKToken::NS_URI_SF | IWORKToken::data : + m_data->m_data.reset(); + return std::make_shared<IWORKDataElement>(m_state, m_data->m_data, m_data->m_fillColor); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::liststyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::liststyle : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_listStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::listLabelIndents : ++ case +IWORKToken::NS_URI_SF | IWORKToken::listLabelIndents : + return std::make_shared<IWORKListLabelIndentsProperty>(m_state, m_data->m_propertyMap); +- case IWORKToken::NS_URI_SF | IWORKToken::list_label_geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::list_label_geometry : + return std::make_shared<IWORKListLabelGeometryElement>(m_state, m_data->m_listLabelGeometry); +- case IWORKToken::NS_URI_SF | IWORKToken::list_label_typeinfo : ++ case +IWORKToken::NS_URI_SF | IWORKToken::list_label_typeinfo : + return std::make_shared<IWORKListLabelTypeinfoElement>(m_state, m_data->m_listLabelTypeInfo); +- case IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::slide_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::slide_style : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_slideStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tabs : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabs : + m_data->m_tabStops.clear(); + return std::make_shared<IWORKTabsElement>(m_state, m_data->m_tabStops); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_style : + return std::make_shared<IWORKStyleContext>(m_state, &m_state.getDictionary().m_tabularStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::text_label : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_label : + return std::make_shared<IWORKTextLabelElement>(m_state, m_data->m_listLabelTypeInfo); +- case IWORKToken::NS_URI_SF | IWORKToken::unfiltered : ++ case +IWORKToken::NS_URI_SF | IWORKToken::unfiltered : + m_data->m_mediaContent.reset(); + return std::make_shared<IWORKUnfilteredElement>(m_state, m_data->m_mediaContent); + default: +--- src/lib/IWORKXMLContextBase.cpp ++++ src/lib/IWORKXMLContextBase.cpp +@@ -35,7 +35,7 @@ + + void IWORKXMLContextElement::attribute(const int name, const char *const value) + { +- if ((IWORKToken::NS_URI_SFA | IWORKToken::ID) == name) ++ if ((+IWORKToken::NS_URI_SFA | IWORKToken::ID) == name) + m_id = value; + } + +@@ -81,10 +81,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + m_id = value; + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::IDREF : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::IDREF : + m_ref = value; + break; + default: +--- src/lib/KEY1Parser.cpp ++++ src/lib/KEY1Parser.cpp +@@ -265,7 +265,7 @@ + { + switch (name) + { +- case KEY1Token::bullet_characters | KEY1Token::NS_URI_KEY : // README ++ case +KEY1Token::bullet_characters | KEY1Token::NS_URI_KEY : // README + break; + default : + ETONYEK_DEBUG_MSG(("BulletCharacterStyleElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -347,12 +347,12 @@ + ensureOpened(); + switch (name) + { +- case KEY1Token::character_bullet_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::character_bullet_style | KEY1Token::NS_URI_KEY : + return std::make_shared<BulletCharacterStyleElement>(getState()); +- case KEY1Token::image_bullet_style | KEY1Token::NS_URI_KEY : // README +- case KEY1Token::sequence_bullet_style | KEY1Token::NS_URI_KEY : // README ++ case +KEY1Token::image_bullet_style | KEY1Token::NS_URI_KEY : // README ++ case +KEY1Token::sequence_bullet_style | KEY1Token::NS_URI_KEY : // README + break; +- case KEY1Token::content | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::content | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1ContentElement>(getState()); + default : + ETONYEK_DEBUG_MSG(("BulletElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -411,7 +411,7 @@ + { + switch (name) + { +- case KEY1Token::bullet | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::bullet | KEY1Token::NS_URI_KEY : + return std::make_shared<BulletElement>(getState()); + default : + ETONYEK_DEBUG_MSG(("BulletsElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -493,7 +493,7 @@ + { + switch (name) + { +- case KEY1Token::styles | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::styles | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1StylesContext>(getState(), m_style, IWORKStylePtr_t()); + default : + ETONYEK_DEBUG_MSG(("BasicShapeElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -929,7 +929,7 @@ + { + switch (name) + { +- case KEY1Token::text_attributes | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::text_attributes | KEY1Token::NS_URI_KEY : + return std::make_shared<TextAttributesElement>(getState(), m_spanStyle, m_paragraphStyle); + default: + break; +@@ -1117,7 +1117,7 @@ + { + switch (name) + { +- case KEY1Token::content | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::content | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1ContentElement>(getState()); + default: + break; +@@ -1202,18 +1202,18 @@ + { + switch (name) + { +- case KEY1Token::array | KEY1Token::NS_URI_KEY : // with list of number +- case KEY1Token::chart_prototype | KEY1Token::NS_URI_KEY : +- case KEY1Token::color | KEY1Token::NS_URI_KEY : +- case KEY1Token::content | KEY1Token::NS_URI_KEY : +- case KEY1Token::dict | KEY1Token::NS_URI_KEY : // with child size, rect, ... +- case KEY1Token::dash_style | KEY1Token::NS_URI_KEY : +- case KEY1Token::fill_style | KEY1Token::NS_URI_KEY : +- case KEY1Token::number | KEY1Token::NS_URI_KEY : +- case KEY1Token::reference | KEY1Token::NS_URI_KEY : // style reference +- case KEY1Token::string | KEY1Token::NS_URI_KEY : // with value dictionary, root ++ case +KEY1Token::array | KEY1Token::NS_URI_KEY : // with list of number ++ case +KEY1Token::chart_prototype | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::color | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::content | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::dict | KEY1Token::NS_URI_KEY : // with child size, rect, ... ++ case +KEY1Token::dash_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::fill_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::number | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::reference | KEY1Token::NS_URI_KEY : // style reference ++ case +KEY1Token::string | KEY1Token::NS_URI_KEY : // with value dictionary, root + break; +- case KEY1Token::table | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::table | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1TableElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("PluginDataElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -1275,9 +1275,9 @@ + { + switch (name) + { +- case KEY1Token::plugin_data | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::plugin_data | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginDataElement>(getState(), m_size, false); +- case KEY1Token::prototype_data | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_data | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginDataElement>(getState(), m_size, true); + default : + return BasicShapeElement::element(name); +@@ -1348,19 +1348,19 @@ + { + switch (name) + { +- case KEY1Token::g | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::g | KEY1Token::NS_URI_KEY : + return std::make_shared<GroupElement>(getState()); +- case KEY1Token::image | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::image | KEY1Token::NS_URI_KEY : + return std::make_shared<ImageElement>(getState()); +- case KEY1Token::line | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::line | KEY1Token::NS_URI_KEY : + return std::make_shared<LineElement>(getState()); +- case KEY1Token::page_number | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::page_number | KEY1Token::NS_URI_KEY : + return std::make_shared<PageNumberElement>(getState()); +- case KEY1Token::plugin | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::plugin | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginElement>(getState()); +- case KEY1Token::shape | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::shape | KEY1Token::NS_URI_KEY : + return std::make_shared<ShapeElement>(getState()); +- case KEY1Token::textbox | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::textbox | KEY1Token::NS_URI_KEY : + return std::make_shared<TextboxElement>(getState()); + default : + return BasicShapeElement::element(name); +@@ -1403,23 +1403,23 @@ + { + switch (name) + { +- case KEY1Token::body | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::body | KEY1Token::NS_URI_KEY : + return std::make_shared<BodyElement>(getState()); +- case KEY1Token::g | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::g | KEY1Token::NS_URI_KEY : + return std::make_shared<GroupElement>(getState()); +- case KEY1Token::image | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::image | KEY1Token::NS_URI_KEY : + return std::make_shared<ImageElement>(getState()); +- case KEY1Token::line | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::line | KEY1Token::NS_URI_KEY : + return std::make_shared<LineElement>(getState()); +- case KEY1Token::page_number | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::page_number | KEY1Token::NS_URI_KEY : + return std::make_shared<PageNumberElement>(getState()); +- case KEY1Token::plugin | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::plugin | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginElement>(getState()); +- case KEY1Token::shape | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::shape | KEY1Token::NS_URI_KEY : + return std::make_shared<ShapeElement>(getState()); +- case KEY1Token::textbox | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::textbox | KEY1Token::NS_URI_KEY : + return std::make_shared<TextboxElement>(getState()); +- case KEY1Token::title | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::title | KEY1Token::NS_URI_KEY : + return std::make_shared<TitleElement>(getState()); + default : + ETONYEK_DEBUG_MSG(("DrawablesElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -1470,7 +1470,7 @@ + { + switch (name) + { +- case KEY1Token::prototype_plugin | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_plugin | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginElement>(getState()); + default : + ETONYEK_DEBUG_MSG(("PluginsElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -1564,25 +1564,25 @@ + { + switch (name) + { +- case KEY1Token::bullets | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::bullets | KEY1Token::NS_URI_KEY : + return std::make_shared<BulletsElement>(getState(), false); +- case KEY1Token::drawables | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::drawables | KEY1Token::NS_URI_KEY : + return std::make_shared<DrawablesElement>(getState(), false); +- case KEY1Token::guides | KEY1Token::NS_URI_KEY : // list of guide, safe to ignore? ++ case +KEY1Token::guides | KEY1Token::NS_URI_KEY : // list of guide, safe to ignore? + break; +- case KEY1Token::notes | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::notes | KEY1Token::NS_URI_KEY : + return std::make_shared<CDATAElement>(getState(), m_notes); +- case KEY1Token::prototype_bullets | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_bullets | KEY1Token::NS_URI_KEY : + return std::make_shared<BulletsElement>(getState(), true); +- case KEY1Token::prototype_drawables | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_drawables | KEY1Token::NS_URI_KEY : + return std::make_shared<DrawablesElement>(getState(), true); +- case KEY1Token::prototype_plugins | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_plugins | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginsElement>(getState(), true); +- case KEY1Token::background_fill_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::background_fill_style | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1FillElement>(getState(), m_background); +- case KEY1Token::transition_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::transition_style | KEY1Token::NS_URI_KEY : + return std::make_shared<TransitionStyleElement>(getState()); +- case KEY1Token::thumbnails | KEY1Token::NS_URI_KEY : // ok to ignore ++ case +KEY1Token::thumbnails | KEY1Token::NS_URI_KEY : // ok to ignore + break; + default : + ETONYEK_DEBUG_MSG(("SlideElement::element[KEY1Parser.cpp]: unknown element\n")); +@@ -1693,7 +1693,7 @@ + { + switch (name) + { +- case KEY1Token::slide | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::slide | KEY1Token::NS_URI_KEY : + return std::make_shared<SlideElement>(getState(), false); + default : + ETONYEK_DEBUG_MSG(("SlideListElement::element[KEY1Parser.cpp]: unexpected element\n")); +@@ -1740,7 +1740,7 @@ + { + switch (name) + { +- case KEY1Token::master_slide | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::master_slide | KEY1Token::NS_URI_KEY : + return std::make_shared<SlideElement>(getState(), true); + default : + ETONYEK_DEBUG_MSG(("MasterSlidesElement::element[KEY1Parser.cpp]: unexpected element\n")); +@@ -1799,13 +1799,13 @@ + { + switch (name) + { +- case KEY1Token::description | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::description | KEY1Token::NS_URI_KEY : + return std::make_shared<CDATAElement>(getState(), m_description); +- case KEY1Token::prototype_drawables | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_drawables | KEY1Token::NS_URI_KEY : + return std::make_shared<DrawablesElement>(getState(), true); +- case KEY1Token::prototype_plugins | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::prototype_plugins | KEY1Token::NS_URI_KEY : + return std::make_shared<PluginsElement>(getState(), true); +- case KEY1Token::master_slides | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::master_slides | KEY1Token::NS_URI_KEY : + return std::make_shared<MasterSlidesElement>(getState()); + default : + ETONYEK_DEBUG_MSG(("ThemeElement::element[KEY1Parser.cpp]: unexpected element\n")); +@@ -1862,13 +1862,13 @@ + { + switch (name) + { +- case KEY1Token::metadata | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::metadata | KEY1Token::NS_URI_KEY : + return std::make_shared<MetadataElement>(getState()); +- case KEY1Token::theme | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::theme | KEY1Token::NS_URI_KEY : + return std::make_shared<ThemeElement>(getState()); +- case KEY1Token::slide_list | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::slide_list | KEY1Token::NS_URI_KEY : + return std::make_shared<SlideListElement>(getState()); +- case KEY1Token::ui_state | KEY1Token::NS_URI_KEY : // safe to ignore ++ case +KEY1Token::ui_state | KEY1Token::NS_URI_KEY : // safe to ignore + break; + default : + ETONYEK_DEBUG_MSG(("PresentationElement::element[KEY1Parser.cpp]: unexpected element\n")); +@@ -1910,7 +1910,7 @@ + { + switch (name) + { +- case KEY1Token::presentation | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::presentation | KEY1Token::NS_URI_KEY : + return std::make_shared<PresentationElement>(m_state); + default: + ETONYEK_DEBUG_MSG(("XMLDocument::element[KEY1Parser.cpp]: unexpected element\n")); +--- src/lib/KEY2Parser.cpp ++++ src/lib/KEY2Parser.cpp +@@ -102,7 +102,7 @@ + + IWORKXMLContextPtr_t StringContentContext::element(const int name) + { +- if (name == (KEY2Token::NS_URI_KEY | KEY2Token::string)) ++ if (name == (+KEY2Token::NS_URI_KEY | KEY2Token::string)) + return std::make_shared<IWORKStringElement>(getState(), m_value); + return IWORKXMLContextPtr_t(); + } +@@ -141,13 +141,13 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::authors : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::authors : + return std::make_shared<StringContentContext>(getState(), m_author); +- case KEY2Token::NS_URI_KEY | KEY2Token::comment : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::comment : + return std::make_shared<StringContentContext>(getState(), m_comment); +- case KEY2Token::NS_URI_KEY | KEY2Token::keywords : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::keywords : + return std::make_shared<StringContentContext>(getState(), m_keywords); +- case KEY2Token::NS_URI_KEY | KEY2Token::title : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::title : + return std::make_shared<StringContentContext>(getState(), m_title); + default: + break; +@@ -196,10 +196,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::placeholder_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::placeholder_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_placeholderStyles); +- case KEY2Token::NS_URI_KEY | KEY2Token::slide_style : // v5 +- case IWORKToken::NS_URI_SF | IWORKToken::slide_style : // v2-v4 ++ case +KEY2Token::NS_URI_KEY | KEY2Token::slide_style : // v5 ++ case +IWORKToken::NS_URI_SF | IWORKToken::slide_style : // v2-v4 + return std::make_shared<KEY2StyleContext>(getState(), &getState().getDictionary().m_slideStyles); + default: + break; +@@ -236,11 +236,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::styles : + return std::make_shared<StylesContext>(getState(), false); +- case IWORKToken::NS_URI_SF | IWORKToken::anon_styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::anon_styles : + return std::make_shared<StylesContext>(getState(), true); +- case IWORKToken::NS_URI_SF | IWORKToken::parent_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::parent_ref : + return std::make_shared<IWORKRefContext>(getState(), m_parent); + default: + break; +@@ -291,7 +291,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::layer_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layer_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + break; +@@ -362,7 +362,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::connection_style, IWORKToken::NS_URI_SF | IWORKToken::connection_style_ref> ConnectionStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::connection_style, +IWORKToken::NS_URI_SF | IWORKToken::connection_style_ref> ConnectionStyleContext; + + class ConnectionLineElement : public KEY2XMLElementContextBase + { +@@ -388,11 +388,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : + return std::make_shared<IWORKPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : + return std::make_shared<ConnectionStyleContext>(getState(), m_style, getState().getDictionary().m_graphicStyles); + default: + break; +@@ -453,10 +453,10 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::depth : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::depth : + m_depth=try_int_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + KEY2XMLElementContextBase::attribute(name, value); + break; + default: +@@ -476,9 +476,9 @@ + ensureOpened(); + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::style_ref : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::style_ref : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::text : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::text : + return std::make_shared<IWORKTextElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("HeadlineElement::element[KEY2Parser.cpp]: unknown element\n")); +@@ -512,7 +512,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::graphic_style, IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::graphic_style, +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; + } + + namespace +@@ -551,15 +551,15 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::path : // use me ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : // use me + return std::make_shared<IWORKPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::style : // use me ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : // use me + return std::make_shared<GraphicStyleContext>(getState(), m_graphicStyle, getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text : + return std::make_shared<IWORKTextElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::wrap : // README ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap : // README + return IWORKXMLContextPtr_t(); + default: + ETONYEK_DEBUG_MSG(("StickyNoteElement::element[KEY2Parser.cpp]: unknown element\n")); +@@ -618,7 +618,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::headline : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::headline : + return std::make_shared<HeadlineElement>(getState()); + default: + break; +@@ -672,31 +672,31 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::body_placeholder_ref : +- case KEY2Token::NS_URI_KEY | KEY2Token::body_placeholder_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::body_placeholder_ref : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::body_placeholder_ref : + return std::make_shared<PlaceholderRefContext>(getState(), PLACEHOLDER_BODY); +- case IWORKToken::NS_URI_SF | IWORKToken::connection_line : ++ case +IWORKToken::NS_URI_SF | IWORKToken::connection_line : + return std::make_shared<ConnectionLineElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::group : ++ case +IWORKToken::NS_URI_SF | IWORKToken::group : + return std::make_shared<IWORKGroupElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image : + return std::make_shared<IWORKImageElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::line : ++ case +IWORKToken::NS_URI_SF | IWORKToken::line : + return std::make_shared<IWORKLineElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::media : + return std::make_shared<IWORKMediaElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::shape : + return std::make_shared<IWORKShapeContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::sticky_note : ++ case +IWORKToken::NS_URI_SF | IWORKToken::sticky_note : + return std::make_shared<StickyNoteElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::table_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_info : + return std::make_shared<IWORKTableInfoElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_info : + return std::make_shared<IWORKTabularInfoElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::title_placeholder_ref : +- case KEY2Token::NS_URI_KEY | KEY2Token::title_placeholder_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::title_placeholder_ref : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::title_placeholder_ref : + return std::make_shared<PlaceholderRefContext>(getState(), PLACEHOLDER_TITLE); +- case KEY2Token::NS_URI_KEY | KEY2Token::sticky_note : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::sticky_note : + return std::make_shared<StickyNoteElement>(getState()); + default: + break; +@@ -742,7 +742,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::drawables : ++ case +IWORKToken::NS_URI_SF | IWORKToken::drawables : + return std::make_shared<DrawablesElement>(getState()); + default: + break; +@@ -789,9 +789,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::layer : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layer : + return std::make_shared<LayerElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::proxy_master_layer : ++ case +IWORKToken::NS_URI_SF | IWORKToken::proxy_master_layer : + return std::make_shared<ProxyMasterLayerElement>(getState()); + default: + break; +@@ -829,9 +829,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); +- case IWORKToken::NS_URI_SF | IWORKToken::layers : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layers : + return std::make_shared<LayersElement>(getState()); + default: + break; +@@ -869,7 +869,7 @@ + + IWORKXMLContextPtr_t StyleElement::element(const int name) + { +- if ((IWORKToken::NS_URI_SF | IWORKToken::placeholder_style_ref) == name) ++ if ((+IWORKToken::NS_URI_SF | IWORKToken::placeholder_style_ref) == name) + return std::make_shared<IWORKRefContext>(getState(), m_ref); + + return IWORKXMLContextPtr_t(); +@@ -918,12 +918,12 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + // ignore; the real geometry comes from style + break; +- case IWORKToken::NS_URI_SF | IWORKToken::style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : + return std::make_shared<StyleElement>(getState(), m_styleRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::text : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::text : + return std::make_shared<IWORKTextElement>(getState()); + default: + break; +@@ -993,7 +993,7 @@ + { + switch (name) + { +- case IWORKToken::text_storage | IWORKToken::NS_URI_SF : ++ case +IWORKToken::text_storage | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKTextStorageElement>(getState()); + default: + break; +@@ -1035,7 +1035,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::sticky_note : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::sticky_note : + return std::make_shared<StickyNoteElement>(getState()); + default: + break; +@@ -1096,12 +1096,12 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::name : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::name : + m_name=value; + break; +- case KEY2Token::NS_URI_KEY | KEY2Token::depth : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::depth : + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + KEY2XMLElementContextBase::attribute(name, value); + break; + default: +@@ -1120,27 +1120,27 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::bullets : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::bullets : + return std::make_shared<BulletsElement>(getState(), m_bodyText, m_titleText); +- case KEY2Token::NS_URI_KEY | KEY2Token::notes : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::notes : + return std::make_shared<NotesElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::page : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::page : + return std::make_shared<PageElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::master_ref : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::master_ref : + return std::make_shared<IWORKRefContext>(getState(), m_masterRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::sticky_notes : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::sticky_notes : + return std::make_shared<StickyNotesElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::style_ref : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::style_ref : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::stylesheet : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::stylesheet : + return std::make_shared<StylesheetElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::body_placeholder : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::body_placeholder : + return std::make_shared<PlaceholderContext>(getState(), PLACEHOLDER_BODY, m_bodyRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::object_placeholder : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::object_placeholder : + return std::make_shared<PlaceholderContext>(getState(), PLACEHOLDER_OBJECT, m_objectRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::slide_number_placeholder : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::slide_number_placeholder : + return std::make_shared<PlaceholderContext>(getState(), PLACEHOLDER_SLIDENUMBER, m_slidenumberRef); +- case KEY2Token::NS_URI_KEY | KEY2Token::title_placeholder : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::title_placeholder : + return std::make_shared<PlaceholderContext>(getState(), PLACEHOLDER_TITLE, m_titleRef); + default: + break; +@@ -1268,7 +1268,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::slide : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::slide : + return std::make_shared<SlideElement>(getState(), false); + default: + break; +@@ -1314,7 +1314,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::master_slide : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::master_slide : + return std::make_shared<SlideElement>(getState(), true); + default: + break; +@@ -1356,11 +1356,11 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | IWORKToken::size : ++ case +KEY2Token::NS_URI_KEY | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); +- case KEY2Token::NS_URI_KEY | KEY2Token::stylesheet : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::stylesheet : + return std::make_shared<StylesheetElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::master_slides : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::master_slides : + return std::make_shared<MasterSlidesElement>(getState()); + default: + break; +@@ -1400,7 +1400,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::theme : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::theme : + return std::make_shared<ThemeElement>(getState()); + default: + break; +@@ -1453,7 +1453,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::version : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::version : + { + const unsigned version = getVersion(getToken(value)); + if (0 == version) +@@ -1481,13 +1481,13 @@ + + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::metadata : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::metadata : + return std::make_shared<MetadataElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::theme_list : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::theme_list : + return std::make_shared<ThemeListElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::slide_list : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::slide_list : + return std::make_shared<SlideListElement>(getState()); +- case KEY2Token::NS_URI_KEY | KEY2Token::size : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::size : + m_pendingSize = true; + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: +@@ -1529,7 +1529,7 @@ + { + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::presentation : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::presentation : + return std::make_shared<PresentationElement>(m_state); + default: + break; +@@ -1574,12 +1574,12 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::placeholder_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::placeholder_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_placeholderStyles); +- case KEY2Token::NS_URI_KEY | KEY2Token::slide_style : // v5 +- case IWORKToken::NS_URI_SF | IWORKToken::slide_style : // v2-v4 ++ case +KEY2Token::NS_URI_KEY | KEY2Token::slide_style : // v5 ++ case +IWORKToken::NS_URI_SF | IWORKToken::slide_style : // v2-v4 + return std::make_shared<KEY2StyleContext>(getState(), &getState().getDictionary().m_slideStyles); +- case KEY2Token::NS_URI_KEY | KEY2Token::stylesheet : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::stylesheet : + if (!m_savedStylesheet) + { + // this can only happen in a broken document +--- src/lib/NUM1Parser.cpp ++++ src/lib/NUM1Parser.cpp +@@ -86,21 +86,21 @@ + } + } + +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::graphic_style, IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::graphic_style, +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; + + IWORKXMLContextPtr_t StickyNoteElement::element(const int name) + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::path : // use me ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : // use me + return std::make_shared<IWORKPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::style : // use me ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : // use me + return std::make_shared<GraphicStyleContext>(getState(), m_graphicStyle, getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text : + return std::make_shared<IWORKTextElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::wrap : // README ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap : // README + return IWORKXMLContextPtr_t(); + default: + ETONYEK_DEBUG_MSG(("StickyNoteElement::element[NUM1Parser.cpp]: unknown element\n")); +@@ -158,25 +158,25 @@ + { + // case IWORKToken::NS_URI_SF | IWORKToken::body_placeholder_ref : + // return std::make_shared<PlaceholderRefContext>(getState(), false); +- case IWORKToken::NS_URI_SF | IWORKToken::cell_comment_drawable_info: ++ case +IWORKToken::NS_URI_SF | IWORKToken::cell_comment_drawable_info: + return std::make_shared<IWORKCellCommentDrawableInfoElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::chart_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::chart_info : + return std::make_shared<IWORKChartInfoElement>(getState()); + // case IWORKToken::NS_URI_SF | IWORKToken::connection_line : + // return std::make_shared<ConnectionLineElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::group : ++ case +IWORKToken::NS_URI_SF | IWORKToken::group : + return std::make_shared<IWORKGroupElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image : + return std::make_shared<IWORKImageElement>(getState()); + // case IWORKToken::NS_URI_SF | IWORKToken::line : + // return std::make_shared<LineElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::media : + return std::make_shared<IWORKMediaElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::shape : + return std::make_shared<IWORKShapeContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::sticky_note : ++ case +IWORKToken::NS_URI_SF | IWORKToken::sticky_note : + return std::make_shared<StickyNoteElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_info : + return std::make_shared<IWORKTabularInfoElement>(getState()); + // case IWORKToken::NS_URI_SF | IWORKToken::title_placeholder_ref : + // return std::make_shared<PlaceholderRefContext>(getState(), true); +@@ -216,7 +216,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::drawables : ++ case +IWORKToken::NS_URI_SF | IWORKToken::drawables : + return std::make_shared<DrawablesElement>(getState()); + default: + break; +@@ -248,7 +248,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::layer : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layer : + return std::make_shared<LayerElement>(getState()); + default: + break; +@@ -281,7 +281,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::layers : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layers : + return std::make_shared<LayersElement>(getState()); + default: + break; +@@ -317,8 +317,8 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::workspace_style : +- case NUM1Token::NS_URI_LS | NUM1Token::workspace_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::workspace_style : ++ case +NUM1Token::NS_URI_LS | NUM1Token::workspace_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_workspaceStyles); + default: + break; +@@ -348,9 +348,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::styles : + return std::make_shared<StylesContext>(getState(), false); +- case IWORKToken::NS_URI_SF | IWORKToken::anon_styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::anon_styles : + return std::make_shared<StylesContext>(getState(), true); + default: + break; +@@ -387,7 +387,7 @@ + { + switch (name) + { +- case NUM1Token::NS_URI_LS | NUM1Token::workspace_name: ++ case +NUM1Token::NS_URI_LS | NUM1Token::workspace_name: + m_spaceName = value; + break; + default: +@@ -405,7 +405,7 @@ + } + switch (name) + { +- case NUM1Token::NS_URI_LS | NUM1Token::page_info: ++ case +NUM1Token::NS_URI_LS | NUM1Token::page_info: + return std::make_shared<PageInfoElement>(getState()); + default: + break; +@@ -443,7 +443,7 @@ + { + switch (name) + { +- case NUM1Token::NS_URI_LS | NUM1Token::workspace: ++ case +NUM1Token::NS_URI_LS | NUM1Token::workspace: + return std::make_shared<WorkSpaceElement>(getState()); + default: + break; +@@ -484,7 +484,7 @@ + { + switch (name) + { +- case NUM1Token::NS_URI_LS | NUM1Token::version : ++ case +NUM1Token::NS_URI_LS | NUM1Token::version : + { + const unsigned version = getVersion(getToken(value)); + if (0 == version) +@@ -502,11 +502,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::metadata : ++ case +IWORKToken::NS_URI_SF | IWORKToken::metadata : + return std::make_shared<IWORKMetadataElement>(getState()); +- case NUM1Token::NS_URI_LS | NUM1Token::stylesheet : ++ case +NUM1Token::NS_URI_LS | NUM1Token::stylesheet : + return std::make_shared<StylesheetElement>(getState()); +- case NUM1Token::NS_URI_LS | NUM1Token::workspace_array : ++ case +NUM1Token::NS_URI_LS | NUM1Token::workspace_array : + return std::make_shared<WorkSpaceArrayElement>(getState()); + default: + break; +@@ -544,7 +544,7 @@ + { + switch (name) + { +- case NUM1Token::NS_URI_LS | NUM1Token::document : ++ case +NUM1Token::NS_URI_LS | NUM1Token::document : + return std::make_shared<DocumentElement>(m_state); + default: + break; +@@ -576,9 +576,9 @@ + { + switch (name) + { +- case NUM1Token::NS_URI_LS | NUM1Token::stylesheet : ++ case +NUM1Token::NS_URI_LS | NUM1Token::stylesheet : + return std::make_shared<StylesheetElement>(getState()); +- case NUM1Token::NS_URI_LS | NUM1Token::workspace_style : ++ case +NUM1Token::NS_URI_LS | NUM1Token::workspace_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_workspaceStyles); + default: + break; +--- src/lib/PAG1Parser.cpp ++++ src/lib/PAG1Parser.cpp +@@ -90,7 +90,7 @@ + + IWORKXMLContextPtr_t AnnotationsElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::annotation)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::annotation)) + return std::make_shared<PAG1AnnotationContext>(getState(), + std::bind(&PAGCollector::collectAnnotation, std::ref(getCollector()), _1)); + return IWORKXMLContextPtr_t(); +@@ -114,7 +114,7 @@ + + IWORKXMLContextPtr_t FootersElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::footer)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::footer)) + return std::make_shared<IWORKHeaderFooterContext>(getState(), + std::bind(&IWORKCollector::collectFooter, std::ref(getCollector()), _1)); + return IWORKXMLContextPtr_t(); +@@ -142,10 +142,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : + PAG1XMLContextBase<IWORKGroupElement>::ensureClosed(); + return std::make_shared<PAG1ShapeContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::group : ++ case +IWORKToken::NS_URI_SF | IWORKToken::group : + PAG1XMLContextBase<IWORKGroupElement>::ensureClosed(); + return std::make_shared<GroupElement>(getState()); + default: +@@ -176,7 +176,7 @@ + + IWORKXMLContextPtr_t HeadersElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::header)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::header)) + return std::make_shared<IWORKHeaderFooterContext>(getState(), + std::bind(&IWORKCollector::collectHeader, std::ref(getCollector()), _1)); + return IWORKXMLContextPtr_t(); +@@ -205,11 +205,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::sectionstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::sectionstyle : + // TODO: setting of the default parent would also be a good candidate for leaveElement(), + // if we ever add this, as it seems to be limited to a few style types. + return std::make_shared<PAG1StyleContext>(getState(), &getState().getDictionary().m_sectionStyles, "section-style-default"); +- case IWORKToken::NS_URI_SF | IWORKToken::sectionstyle_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::sectionstyle_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_sectionStyles); + default: + break; +@@ -241,9 +241,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::anon_styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::anon_styles : + return std::make_shared<StylesContext>(getState(), true); +- case IWORKToken::NS_URI_SF | IWORKToken::styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::styles : + return std::make_shared<StylesContext>(getState(), false); + default: + break; +@@ -273,7 +273,7 @@ + + IWORKXMLContextPtr_t PrototypeElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::stylesheet)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::stylesheet)) + return std::make_shared<StylesheetElement>(getState()); + return IWORKXMLContextPtr_t(); + } +@@ -299,7 +299,7 @@ + + IWORKXMLContextPtr_t SectionPrototypesElement::element(const int name) + { +- if (name == (PAG1Token::NS_URI_SL | PAG1Token::prototype)) ++ if (name == (+PAG1Token::NS_URI_SL | PAG1Token::prototype)) + return std::make_shared<PrototypeElement>(getState()); + return IWORKXMLContextPtr_t(); + } +@@ -329,7 +329,7 @@ + + void DateElement::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::val)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::val)) + m_value = value; + } + +@@ -358,7 +358,7 @@ + + IWORKXMLContextPtr_t SLCreationDatePropertyElement::element(const int name) + { +- if (name == (PAG1Token::NS_URI_SL | PAG1Token::SLCreationDateProperty)) ++ if (name == (+PAG1Token::NS_URI_SL | PAG1Token::SLCreationDateProperty)) + return std::make_shared<DateElement>(getState(), m_value); + return IWORKXMLContextPtr_t(); + } +@@ -424,8 +424,8 @@ + namespace + { + +-typedef DocumentPropertyContext<double, IWORKNumberElement<double>, PAG1Token::NS_URI_SL | PAG1Token::number> KSFWPFootnoteGapPropertyElement; +-typedef DocumentPropertyContext<PAGFootnoteKind, IWORKNumberElement<PAGFootnoteKind>, PAG1Token::NS_URI_SL | PAG1Token::number> KSFWPFootnoteKindPropertyElement; ++typedef DocumentPropertyContext<double, IWORKNumberElement<double>, +PAG1Token::NS_URI_SL | PAG1Token::number> KSFWPFootnoteGapPropertyElement; ++typedef DocumentPropertyContext<PAGFootnoteKind, IWORKNumberElement<PAGFootnoteKind>, +PAG1Token::NS_URI_SL | PAG1Token::number> KSFWPFootnoteKindPropertyElement; + + } + +@@ -457,11 +457,11 @@ + { + switch (name) + { +- case PAG1Token::NS_URI_SL | PAG1Token::kSFWPFootnoteGapProperty : ++ case +PAG1Token::NS_URI_SL | PAG1Token::kSFWPFootnoteGapProperty : + return std::make_shared<KSFWPFootnoteGapPropertyElement>(getState(), m_pubInfo.m_footnoteGap); +- case PAG1Token::NS_URI_SL | PAG1Token::kSFWPFootnoteKindProperty : ++ case +PAG1Token::NS_URI_SL | PAG1Token::kSFWPFootnoteKindProperty : + return std::make_shared<KSFWPFootnoteKindPropertyElement>(getState(), m_footnoteKind); +- case PAG1Token::NS_URI_SL | PAG1Token::SLCreationDateProperty : ++ case +PAG1Token::NS_URI_SL | PAG1Token::SLCreationDateProperty : + return std::make_shared<SLCreationDatePropertyElement>(getState(), m_pubInfo.m_creationDate); + default: + { +@@ -515,28 +515,28 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + PAG1XMLElementContextBase::attribute(name,value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::bottom: ++ case +IWORKToken::NS_URI_SF | IWORKToken::bottom: + m_printInfo.m_marginBottom=try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::left: ++ case +IWORKToken::NS_URI_SF | IWORKToken::left: + m_printInfo.m_marginLeft=try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::right: ++ case +IWORKToken::NS_URI_SF | IWORKToken::right: + m_printInfo.m_marginRight=try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::top: ++ case +IWORKToken::NS_URI_SF | IWORKToken::top: + m_printInfo.m_marginTop=try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::footer: ++ case +IWORKToken::NS_URI_SF | IWORKToken::footer: + m_printInfo.m_footerHeight=try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::header: ++ case +IWORKToken::NS_URI_SF | IWORKToken::header: + m_printInfo.m_headerHeight=try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::facing_pages: // a bool ++ case +IWORKToken::NS_URI_SF | IWORKToken::facing_pages: // a bool + break; + default: + ETONYEK_DEBUG_MSG(("PageMarginsElement::attribute[PAG1Parser.cpp]: find unknown attribute\n")); +@@ -583,15 +583,15 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + PAG1XMLElementContextBase::attribute(name,value); + break; +- case PAG1Token::NS_URI_SL | PAG1Token::page_height: ++ case +PAG1Token::NS_URI_SL | PAG1Token::page_height: + m_printInfo.m_height=try_double_cast(value); + break; +- case PAG1Token::NS_URI_SL | PAG1Token::page_scale: ++ case +PAG1Token::NS_URI_SL | PAG1Token::page_scale: + break; +- case PAG1Token::NS_URI_SL | PAG1Token::page_width: ++ case +PAG1Token::NS_URI_SL | PAG1Token::page_width: + m_printInfo.m_width=try_double_cast(value); + break; + default: +@@ -604,9 +604,9 @@ + { + switch (name) + { +- case PAG1Token::NS_URI_SL | PAG1Token::print_info: ++ case +PAG1Token::NS_URI_SL | PAG1Token::print_info: + break; +- case IWORKToken::NS_URI_SF | IWORKToken::page_margins: ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_margins: + return std::make_shared<PageMarginsElement>(getState(), m_printInfo); + default: + ETONYEK_DEBUG_MSG(("SLPrintInfoElement::element[PAG1Parser.cpp]: find unknown element\n")); +@@ -658,10 +658,10 @@ + switch (name) + { + // TODO: what is the exact relation of sl:page and sl:rpage attrs? +- case PAG1Token::NS_URI_SL | PAG1Token::page : ++ case +PAG1Token::NS_URI_SL | PAG1Token::page : + m_page = try_int_cast(value); + break; +- case PAG1Token::NS_URI_SL | PAG1Token::rpage : ++ case +PAG1Token::NS_URI_SL | PAG1Token::rpage : + m_rpage = try_int_cast(value); + break; + default: +@@ -676,17 +676,17 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : + return std::make_shared<PAG1ShapeContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::group : ++ case +IWORKToken::NS_URI_SF | IWORKToken::group : + return std::make_shared<GroupElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::line : ++ case +IWORKToken::NS_URI_SF | IWORKToken::line : + return std::make_shared<IWORKLineElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image : + return std::make_shared<IWORKImageElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::media : + return std::make_shared<IWORKMediaElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_info : + return std::make_shared<IWORKTabularInfoElement>(getState()); + default: + break; +@@ -740,7 +740,7 @@ + { + switch (name) + { +- case PAG1Token::NS_URI_SL | PAG1Token::page_group : ++ case +PAG1Token::NS_URI_SL | PAG1Token::page_group : + return std::make_shared<PageGroupElement>(getState()); + // see also sl:master-groups which contains sl:section-drawables + default: +@@ -785,7 +785,7 @@ + { + switch (name) + { +- case PAG1Token::NS_URI_SL | PAG1Token::version : ++ case +PAG1Token::NS_URI_SL | PAG1Token::version : + { + const unsigned version = getVersion(getToken(value)); + if (0 == version) +@@ -803,27 +803,27 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::annotations : ++ case +IWORKToken::NS_URI_SF | IWORKToken::annotations : + return std::make_shared<AnnotationsElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::calc_engine : ++ case +IWORKToken::NS_URI_SF | IWORKToken::calc_engine : + return std::make_shared<IWORKCalcEngineContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::headers : ++ case +IWORKToken::NS_URI_SF | IWORKToken::headers : + return std::make_shared<HeadersElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::footers : ++ case +IWORKToken::NS_URI_SF | IWORKToken::footers : + return std::make_shared<FootersElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::metadata : ++ case +IWORKToken::NS_URI_SF | IWORKToken::metadata : + return std::make_shared<IWORKMetadataElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::text_storage : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_storage : + return std::make_shared<PAG1TextStorageElement>(getState()); +- case PAG1Token::NS_URI_SL | PAG1Token::drawables : ++ case +PAG1Token::NS_URI_SL | PAG1Token::drawables : + return std::make_shared<DrawablesElement>(getState()); +- case PAG1Token::NS_URI_SL | PAG1Token::publication_info : ++ case +PAG1Token::NS_URI_SL | PAG1Token::publication_info : + return std::make_shared<PublicationInfoElement>(getState()); +- case PAG1Token::NS_URI_SL | PAG1Token::section_prototypes : ++ case +PAG1Token::NS_URI_SL | PAG1Token::section_prototypes : + return std::make_shared<SectionPrototypesElement>(getState()); +- case PAG1Token::NS_URI_SL | PAG1Token::slprint_info : ++ case +PAG1Token::NS_URI_SL | PAG1Token::slprint_info : + return std::make_shared<SLPrintInfoElement>(getState()); +- case PAG1Token::NS_URI_SL | PAG1Token::stylesheet : ++ case +PAG1Token::NS_URI_SL | PAG1Token::stylesheet : + return std::make_shared<StylesheetElement>(getState()); + default: + break; +@@ -861,7 +861,7 @@ + { + switch (name) + { +- case PAG1Token::NS_URI_SL | PAG1Token::document : ++ case +PAG1Token::NS_URI_SL | PAG1Token::document : + return std::make_shared<DocumentElement>(m_state); + default: + break; +@@ -892,10 +892,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::sectionstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::sectionstyle : + return std::make_shared<PAG1StyleContext>(getState(), &getState().getDictionary().m_sectionStyles, "section-style-default"); +- case IWORKToken::NS_URI_SF | IWORKToken::stylesheet : +- case PAG1Token::NS_URI_SL | PAG1Token::stylesheet : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stylesheet : ++ case +PAG1Token::NS_URI_SL | PAG1Token::stylesheet : + return std::make_shared<StylesheetElement>(getState()); + default: + break; +--- src/lib/contexts/IWORKBezierElement.cpp ++++ src/lib/contexts/IWORKBezierElement.cpp +@@ -30,7 +30,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::path : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::path : + try + { + m_path = std::make_shared<IWORKPath>(value); +--- src/lib/contexts/IWORKBinaryElement.cpp ++++ src/lib/contexts/IWORKBinaryElement.cpp +@@ -33,9 +33,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::data : ++ case +IWORKToken::NS_URI_SF | IWORKToken::data : + return std::make_shared<IWORKDataElement>(getState(), m_data, m_fillColor); +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + break; +--- src/lib/contexts/IWORKCalcEngineContext.cpp ++++ src/lib/contexts/IWORKCalcEngineContext.cpp +@@ -42,7 +42,7 @@ + { + switch (name) + { +- case IWORKToken::tabular_model | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tabular_model | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKTabularModelElement>(getState(), true); + default: + break; +@@ -62,7 +62,7 @@ + { + switch (name) + { +- case IWORKToken::calc_engine_entities | IWORKToken::NS_URI_SF : ++ case +IWORKToken::calc_engine_entities | IWORKToken::NS_URI_SF : + return std::make_shared<CalcEngineEntities>(getState()); + default: + break; +--- src/lib/contexts/IWORKCellCommentDrawableInfoElement.cpp ++++ src/lib/contexts/IWORKCellCommentDrawableInfoElement.cpp +@@ -49,16 +49,16 @@ + { + switch (name) + { +- case IWORKToken::geometry | IWORKToken::NS_URI_SF : ++ case +IWORKToken::geometry | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::path | IWORKToken::NS_URI_SF : ++ case +IWORKToken::path | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKPathElement>(getState()); +- case IWORKToken::style | IWORKToken::NS_URI_SF : ++ case +IWORKToken::style | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_cellCommentStyles); +- case IWORKToken::bubble_cellid | IWORKToken::NS_URI_SF : // sf:row sf:column +- case IWORKToken::bubble_offset | IWORKToken::NS_URI_SF : // sfa:h and sfa:w ++ case +IWORKToken::bubble_cellid | IWORKToken::NS_URI_SF : // sf:row sf:column ++ case +IWORKToken::bubble_offset | IWORKToken::NS_URI_SF : // sfa:h and sfa:w + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text : + return std::make_shared<IWORKTextElement>(getState()); + default: + break; +--- src/lib/contexts/IWORKChartInfoElement.cpp ++++ src/lib/contexts/IWORKChartInfoElement.cpp +@@ -66,7 +66,7 @@ + + IWORKXMLContextPtr_t CachedDataElement::element(const int name) + { +- if (name == (IWORKToken::mutable_array | IWORKToken::NS_URI_SF)) ++ if (name == (+IWORKToken::mutable_array | IWORKToken::NS_URI_SF)) + return std::make_shared<MutableArrayElement>(getState()); + + return IWORKXMLContextPtr_t(); +@@ -127,17 +127,17 @@ + { + switch (name) + { +- case IWORKToken::chart_column_names | IWORKToken::NS_URI_SF : ++ case +IWORKToken::chart_column_names | IWORKToken::NS_URI_SF : + return std::make_shared<ChartRowColumnNamesElement>(getState(), m_chart.m_columnNames); +- case IWORKToken::chart_row_names | IWORKToken::NS_URI_SF : ++ case +IWORKToken::chart_row_names | IWORKToken::NS_URI_SF : + return std::make_shared<ChartRowColumnNamesElement>(getState(), m_chart.m_rowNames); +- case IWORKToken::chart_name | IWORKToken::NS_URI_SF : ++ case +IWORKToken::chart_name | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_chart.m_chartName); +- case IWORKToken::value_title | IWORKToken::NS_URI_SF : ++ case +IWORKToken::value_title | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_chart.m_valueTitle); +- case IWORKToken::category_title | IWORKToken::NS_URI_SF : ++ case +IWORKToken::category_title | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_chart.m_categoryTitle); +- case IWORKToken::cached_data | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cached_data | IWORKToken::NS_URI_SF : + return std::make_shared<CachedDataElement>(getState()); + default: + break; +@@ -174,7 +174,7 @@ + { + switch (name) + { +- case IWORKToken::formula_chart_model | IWORKToken::NS_URI_SF : ++ case +IWORKToken::formula_chart_model | IWORKToken::NS_URI_SF : + return std::make_shared<FormulaChartModelElement>(getState(), m_chart); + default: + break; +@@ -202,7 +202,7 @@ + { + switch (name) + { +- case IWORKToken::chart_type | IWORKToken::NS_URI_SF : ++ case +IWORKToken::chart_type | IWORKToken::NS_URI_SF : + m_chart.m_chartType = (unsigned) int_cast(value); + default: + break; +@@ -213,9 +213,9 @@ + { + switch (name) + { +- case IWORKToken::geometry | IWORKToken::NS_URI_SF : ++ case +IWORKToken::geometry | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::chart_model_object | IWORKToken::NS_URI_SF : ++ case +IWORKToken::chart_model_object | IWORKToken::NS_URI_SF : + return std::make_shared<ChartModelObjectElement>(getState(), m_chart); + default: + break; +--- src/lib/contexts/IWORKColorElement.cpp ++++ src/lib/contexts/IWORKColorElement.cpp +@@ -44,34 +44,34 @@ + switch (name) + { + // TODO: check xsi:type too +- case IWORKToken::NS_URI_SFA | IWORKToken::a : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::a : + m_a = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::b : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::b : + m_b = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::c : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::c : + m_c = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::g : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::g : + m_g = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::k : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::k : + m_k = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::m : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::m : + m_m = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::r : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::r : + m_r = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::w : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::w : + m_w = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::y : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::y : + m_y = lexical_cast<double>(value); + break; +- case IWORKToken::NS_URI_XSI | IWORKToken::type : ++ case +IWORKToken::NS_URI_XSI | IWORKToken::type : + m_type = value; + break; + default: +@@ -88,7 +88,7 @@ + { + switch (name) + { +- case IWORKToken::custom_space_color | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::custom_space_color | IWORKToken::NS_URI_SFA : + { + static bool first=true; + if (first) +--- src/lib/contexts/IWORKContainerContext.h ++++ src/lib/contexts/IWORKContainerContext.h +@@ -59,7 +59,7 @@ + return m_collector.template makeContext<NestedParser>(getState()); + else if ((RefId != 0) && (name == RefId)) + return std::make_shared<IWORKRefContext>(getState(), m_ref); +- else if (name!=(IWORKToken::NS_URI_SF | IWORKToken::null)) ++ else if (name!=(+IWORKToken::NS_URI_SF | IWORKToken::null)) + { + ETONYEK_DEBUG_MSG(("IWORKContainerContext::handleRef: find unknown element %d\n", int(name))); + } +--- src/lib/contexts/IWORKCoreImageFilterDescriptorElement.cpp ++++ src/lib/contexts/IWORKCoreImageFilterDescriptorElement.cpp +@@ -25,7 +25,7 @@ + + void IWORKCoreImageFilterDescriptorElement::attribute(const int name, const char *const value) + { +- if ((IWORKToken::NS_URI_SF | IWORKToken::filterClassName) == name) ++ if ((+IWORKToken::NS_URI_SF | IWORKToken::filterClassName) == name) + m_isShadow = getState().getTokenizer().getId(value) == IWORKToken::SFIUDropShadow; + else + IWORKXMLEmptyContextBase::attribute(name, value); +--- src/lib/contexts/IWORKDataElement.cpp ++++ src/lib/contexts/IWORKDataElement.cpp +@@ -35,10 +35,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::displayname : ++ case +IWORKToken::NS_URI_SF | IWORKToken::displayname : + m_displayName = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::hfs_type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::hfs_type : + { + switch (getState().getTokenizer().getId(value)) + { +@@ -62,7 +62,7 @@ + } + break; + } +- case IWORKToken::NS_URI_SF | IWORKToken::path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : + m_stream.reset(getState().getParser().getPackage()->getSubStreamByName(value)); + if (!m_stream) + { +--- src/lib/contexts/IWORKFieldElement.cpp ++++ src/lib/contexts/IWORKFieldElement.cpp +@@ -30,10 +30,10 @@ + { + switch (name) + { +- case IWORKToken::val | IWORKToken::NS_URI_SF : // date-time ++ case +IWORKToken::val | IWORKToken::NS_URI_SF : // date-time + m_val=value; + break; +- case IWORKToken::value | IWORKToken::NS_URI_SF : // page-count, page-number ++ case +IWORKToken::value | IWORKToken::NS_URI_SF : // page-count, page-number + m_value=int_cast(value); + break; + default: +@@ -50,7 +50,7 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::span : ++ case +IWORKToken::NS_URI_SF | IWORKToken::span : + return std::make_shared<IWORKSpanElement>(getState()); + default: + break; +--- src/lib/contexts/IWORKFillElement.cpp ++++ src/lib/contexts/IWORKFillElement.cpp +@@ -64,13 +64,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::fraction : ++ case +IWORKToken::NS_URI_SF | IWORKToken::fraction : + m_fraction = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::inflection : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inflection : + m_inflection = double_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -82,7 +82,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::color : ++ case +IWORKToken::NS_URI_SF | IWORKToken::color : + return std::make_shared<IWORKColorElement>(getState(), m_color); + default: + ETONYEK_DEBUG_MSG(("GradientStopElement::element[IWORKFillElement.cpp]: find unknown element\n")); +@@ -110,7 +110,7 @@ + namespace + { + +-typedef IWORKContainerContext<IWORKGradientStop, GradientStopElement, IWORKDirectCollector, IWORKToken::NS_URI_SF | IWORKToken::gradient_stop, IWORKToken::NS_URI_SF | IWORKToken::gradient_stop_ref> StopsElement; ++typedef IWORKContainerContext<IWORKGradientStop, GradientStopElement, IWORKDirectCollector, +IWORKToken::NS_URI_SF | IWORKToken::gradient_stop, +IWORKToken::NS_URI_SF | IWORKToken::gradient_stop_ref> StopsElement; + + } + +@@ -149,13 +149,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::angle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::angle : + m_angle = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::opacity : ++ case +IWORKToken::NS_URI_SF | IWORKToken::opacity : + m_opacity = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::type : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::linear : +@@ -168,7 +168,7 @@ + ETONYEK_DEBUG_MSG(("AngleGradientElement::attribute[IWORKFillElement.cpp]: unknown type attribute\n")); + } + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -180,7 +180,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::stops : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stops : + return std::make_shared<StopsElement>(getState(), getState().getDictionary().m_gradientStops, m_stops); + default: + ETONYEK_DEBUG_MSG(("AngleGradientElement::element[IWORKFillElement.cpp]: unknown element\n")); +@@ -244,10 +244,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::opacity : ++ case +IWORKToken::NS_URI_SF | IWORKToken::opacity : + m_opacity = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::type : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::linear : +@@ -260,7 +260,7 @@ + ETONYEK_DEBUG_MSG(("TransformGradientElement::attribute[IWORKFillElement.cpp]: unknown type\n")); + } + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -272,13 +272,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::baseSize : ++ case +IWORKToken::NS_URI_SF | IWORKToken::baseSize : + return std::make_shared<IWORKSizeElement>(getState(), m_baseSize); +- case IWORKToken::NS_URI_SF | IWORKToken::end : ++ case +IWORKToken::NS_URI_SF | IWORKToken::end : + return std::make_shared<IWORKPositionElement>(getState(), m_endPosition); +- case IWORKToken::NS_URI_SF | IWORKToken::stops : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stops : + return std::make_shared<StopsElement>(getState(), getState().getDictionary().m_gradientStops, m_stops); +- case IWORKToken::NS_URI_SF | IWORKToken::start : ++ case +IWORKToken::NS_URI_SF | IWORKToken::start : + return std::make_shared<IWORKPositionElement>(getState(), m_startPosition); + default: + ETONYEK_DEBUG_MSG(("TransformGradientElement::element[IWORKFillElement.cpp]: unknown element\n")); +@@ -337,9 +337,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_XSI | IWORKToken::type : ++ case +IWORKToken::NS_URI_XSI | IWORKToken::type : + break; +- case IWORKToken::NS_URI_SF | IWORKToken::technique : ++ case +IWORKToken::NS_URI_SF | IWORKToken::technique : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::natural : +@@ -362,7 +362,7 @@ + break; + } + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -375,15 +375,15 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::color : ++ case +IWORKToken::NS_URI_SF | IWORKToken::color : + return std::make_shared<IWORKColorElement>(getState(), m_color); +- case IWORKToken::NS_URI_SF | IWORKToken::filtered_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filtered_image : + return std::make_shared<IWORKFilteredImageElement>(getState(), m_content); +- case IWORKToken::NS_URI_SF | IWORKToken::filtered_image_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filtered_image_ref : + return std::make_shared<IWORKRefContext>(getState(), m_filteredImageRef); +- case IWORKToken::NS_URI_SF | IWORKToken::image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image : + return std::make_shared<IWORKImageElement>(getState(), m_content); +- case IWORKToken::NS_URI_SF | IWORKToken::image_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image_ref : + return std::make_shared<IWORKRefContext>(getState(), m_imageRef); + default: + ETONYEK_DEBUG_MSG(("TexturedFillElement::element[IWORKFillElement.cpp]: unknown element\n")); +@@ -443,22 +443,22 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::angle_gradient : ++ case +IWORKToken::NS_URI_SF | IWORKToken::angle_gradient : + return std::make_shared<AngleGradientElement>(getState(), m_gradient); +- case IWORKToken::NS_URI_SF | IWORKToken::angle_gradient_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::angle_gradient_ref : + return std::make_shared<IWORKRefContext>(getState(), m_gradientRef); +- case IWORKToken::NS_URI_SF | IWORKToken::color : ++ case +IWORKToken::NS_URI_SF | IWORKToken::color : + return std::make_shared<IWORKColorElement>(getState(), m_color); +- case IWORKToken::NS_URI_SF | IWORKToken::texture_fill : // CHECKME: a dictionary +- case IWORKToken::NS_URI_SF | IWORKToken::texture_fill_ref : // CHECKME: ref to previous element ++ case +IWORKToken::NS_URI_SF | IWORKToken::texture_fill : // CHECKME: a dictionary ++ case +IWORKToken::NS_URI_SF | IWORKToken::texture_fill_ref : // CHECKME: ref to previous element + break; +- case IWORKToken::NS_URI_SF | IWORKToken::textured_fill : ++ case +IWORKToken::NS_URI_SF | IWORKToken::textured_fill : + return std::make_shared<TexturedFillElement>(getState(), m_bitmap); +- case IWORKToken::NS_URI_SF | IWORKToken::textured_fill_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::textured_fill_ref : + return std::make_shared<IWORKRefContext>(getState(), m_texturedFillRef); +- case IWORKToken::NS_URI_SF | IWORKToken::transform_gradient : ++ case +IWORKToken::NS_URI_SF | IWORKToken::transform_gradient : + return std::make_shared<TransformGradientElement>(getState(), m_gradient); +- case IWORKToken::NS_URI_SF | IWORKToken::null : ++ case +IWORKToken::NS_URI_SF | IWORKToken::null : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKFillElement::element: unknown element\n")); +--- src/lib/contexts/IWORKFilteredImageElement.cpp ++++ src/lib/contexts/IWORKFilteredImageElement.cpp +@@ -43,16 +43,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::unfiltered : ++ case +IWORKToken::NS_URI_SF | IWORKToken::unfiltered : + return std::make_shared<IWORKUnfilteredElement>(getState(), m_unfiltered); +- case IWORKToken::NS_URI_SF | IWORKToken::unfiltered_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::unfiltered_ref : + return std::make_shared<IWORKRefContext>(getState(), m_unfilteredId); +- case IWORKToken::NS_URI_SF | IWORKToken::filtered : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filtered : + return std::make_shared<IWORKFilteredElement>(getState(), m_filtered); +- case IWORKToken::NS_URI_SF | IWORKToken::leveled : ++ case +IWORKToken::NS_URI_SF | IWORKToken::leveled : + return std::make_shared<LeveledElement>(getState(), m_leveled); +- case IWORKToken::NS_URI_SF | IWORKToken::extent : // TODO readme +- case IWORKToken::NS_URI_SF | IWORKToken::filter_properties : ++ case +IWORKToken::NS_URI_SF | IWORKToken::extent : // TODO readme ++ case +IWORKToken::NS_URI_SF | IWORKToken::filter_properties : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKFilteredImageElement::element: unknown element\n")); +--- src/lib/contexts/IWORKFormatElement.cpp ++++ src/lib/contexts/IWORKFormatElement.cpp +@@ -38,10 +38,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::fmt: ++ case +IWORKToken::NS_URI_SF | IWORKToken::fmt: + get(m_value).m_format = value; + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default: +@@ -67,10 +67,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::fmt: ++ case +IWORKToken::NS_URI_SF | IWORKToken::fmt: + get(m_value).m_format = value; + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default: +@@ -96,44 +96,44 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::format_base : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_base : + get(m_value).m_base = int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_base_places : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_base_places : + get(m_value).m_basePlaces = int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_base_use_minus_sign : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_base_use_minus_sign : + get(m_value).m_baseUseMinusSign = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_currency_code : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_currency_code : + get(m_value).m_currencyCode = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_decimal_places : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_decimal_places : + get(m_value).m_decimalPlaces = int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_fraction_accuracy : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_fraction_accuracy : + get(m_value).m_fractionAccuracy = int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_negative_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_negative_style : + get(m_value).m_negativeStyle = int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_show_thousands_separator : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_show_thousands_separator : + get(m_value).m_thousandsSeparator = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_string : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_string : + get(m_value).m_string = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_type : + get(m_value).m_type = get(IWORKNumberConverter<IWORKCellNumberType>::convert(value)); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format_use_accounting_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_use_accounting_style : + get(m_value).m_accountingStyle = bool_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLEmptyContextBase::attribute(name, value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::custom : +- case IWORKToken::NS_URI_SF | IWORKToken::format_name : ++ case +IWORKToken::NS_URI_SF | IWORKToken::custom : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format_name : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKNumberFormatElement::attribute[IWORKFormatElement.cpp]: find unknown attribute\n")); +--- src/lib/contexts/IWORKFormulaElement.cpp ++++ src/lib/contexts/IWORKFormulaElement.cpp +@@ -75,10 +75,10 @@ + { + switch (name) + { +- case IWORKToken::column | IWORKToken::NS_URI_SF: ++ case +IWORKToken::column | IWORKToken::NS_URI_SF: + m_col = int_cast(value); + break; +- case IWORKToken::row | IWORKToken::NS_URI_SF: ++ case +IWORKToken::row | IWORKToken::NS_URI_SF: + m_row = int_cast(value); + break; + default : +@@ -122,10 +122,10 @@ + { + switch (name) + { +- case IWORKToken::x_coordinate | IWORKToken::NS_URI_SF: ++ case +IWORKToken::x_coordinate | IWORKToken::NS_URI_SF: + m_x = int_cast(value); + break; +- case IWORKToken::y_coordinate | IWORKToken::NS_URI_SF: ++ case +IWORKToken::y_coordinate | IWORKToken::NS_URI_SF: + m_y = int_cast(value); + break; + default : +@@ -162,16 +162,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID: ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID: + m_id = value; + break; +- case IWORKToken::fs | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fs | IWORKToken::NS_URI_SF : + m_formula=value; + break; +- case IWORKToken::hc | IWORKToken::NS_URI_SF : ++ case +IWORKToken::hc | IWORKToken::NS_URI_SF : + m_hc=int_cast(value); + break; +- case IWORKToken::ht | IWORKToken::NS_URI_SF : // big string ++ case +IWORKToken::ht | IWORKToken::NS_URI_SF : // big string + break; + default : + IWORKXMLEmptyContextBase::attribute(name, value); +@@ -183,7 +183,7 @@ + { + switch (name) + { +- case IWORKToken::fm | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fm | IWORKToken::NS_URI_SF : + return std::make_shared<FmElement>(getState()); + break; + default: +@@ -219,7 +219,7 @@ + { + switch (name) + { +- case IWORKToken::hc | IWORKToken::NS_URI_SF : ++ case +IWORKToken::hc | IWORKToken::NS_URI_SF : + m_hc=int_cast(value); + break; + default : +@@ -232,10 +232,10 @@ + { + switch (name) + { +- case IWORKToken::fm | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fm | IWORKToken::NS_URI_SF : + return std::make_shared<FmElement>(getState()); + break; +- case IWORKToken::mf_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::mf_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + break; +@@ -280,7 +280,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID: ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID: + m_id = value; + break; + default : +@@ -293,11 +293,11 @@ + { + switch (name) + { +- case IWORKToken::formula_string | IWORKToken::NS_URI_SF : ++ case +IWORKToken::formula_string | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_formula); +- case IWORKToken::host_cell_ID | IWORKToken::NS_URI_SF : ++ case +IWORKToken::host_cell_ID | IWORKToken::NS_URI_SF : + return std::make_shared<HostCellIdElement>(getState()); +- case IWORKToken::host_table_ID | IWORKToken::NS_URI_SF : ++ case +IWORKToken::host_table_ID | IWORKToken::NS_URI_SF : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKFormulaElement::element: find unknown element %d\n", name)); +@@ -336,7 +336,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID: ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID: + m_id = value; + break; + default : +@@ -349,11 +349,11 @@ + { + switch (name) + { +- case IWORKToken::formula_string | IWORKToken::NS_URI_SF : ++ case +IWORKToken::formula_string | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_formula); +- case IWORKToken::cell_address | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_address | IWORKToken::NS_URI_SF : + return std::make_shared<CellAddressElement>(getState()); +- case IWORKToken::host_table_ID | IWORKToken::NS_URI_SF : ++ case +IWORKToken::host_table_ID | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_tableId); + default: + ETONYEK_DEBUG_MSG(("IWORKTableCellFormulaElement::element: find unknown element %d\n", name)); +--- src/lib/contexts/IWORKGeometryElement.cpp ++++ src/lib/contexts/IWORKGeometryElement.cpp +@@ -60,25 +60,25 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::angle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::angle : + m_angle = -deg2rad(lexical_cast<double>(value)); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::aspectRatioLocked : ++ case +IWORKToken::NS_URI_SF | IWORKToken::aspectRatioLocked : + m_aspectRatioLocked = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::horizontalFlip : ++ case +IWORKToken::NS_URI_SF | IWORKToken::horizontalFlip : + m_horizontalFlip = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::shearXAngle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::shearXAngle : + m_shearXAngle = deg2rad(lexical_cast<double>(value)); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::shearYAngle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::shearYAngle : + m_shearYAngle = deg2rad(lexical_cast<double>(value)); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::sizesLocked : ++ case +IWORKToken::NS_URI_SF | IWORKToken::sizesLocked : + m_sizesLocked = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::verticalFlip : ++ case +IWORKToken::NS_URI_SF | IWORKToken::verticalFlip : + m_verticalFlip = bool_cast(value); + break; + default : +@@ -91,11 +91,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::naturalSize : ++ case +IWORKToken::NS_URI_SF | IWORKToken::naturalSize : + return std::make_shared<IWORKSizeElement>(getState(), m_naturalSize); +- case IWORKToken::NS_URI_SF | IWORKToken::position : ++ case +IWORKToken::NS_URI_SF | IWORKToken::position : + return std::make_shared<IWORKPositionElement>(getState(), m_pos); +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("IWORKGeometryElement::element: find unknown element\n")); +--- src/lib/contexts/IWORKGroupElement.cpp ++++ src/lib/contexts/IWORKGroupElement.cpp +@@ -42,28 +42,28 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::group : ++ case +IWORKToken::NS_URI_SF | IWORKToken::group : + ensureClosed(); // checkme: creating a group in a group must be often possible + return std::make_shared<IWORKGroupElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image : + ensureOpened(); + return std::make_shared<IWORKImageElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::line : ++ case +IWORKToken::NS_URI_SF | IWORKToken::line : + ensureOpened(); + return std::make_shared<IWORKLineElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::media : + ensureOpened(); + return std::make_shared<IWORKMediaElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : +- case IWORKToken::NS_URI_SF | IWORKToken::shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::shape : + ensureOpened(); + return std::make_shared<IWORKShapeContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::table_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_info : + ensureClosed(); + return std::make_shared<IWORKTableInfoElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_info : + ensureClosed(); + return std::make_shared<IWORKTabularInfoElement>(getState()); + default: +--- src/lib/contexts/IWORKHeaderFooterContext.cpp ++++ src/lib/contexts/IWORKHeaderFooterContext.cpp +@@ -37,7 +37,7 @@ + + void IWORKHeaderFooterContext::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::name)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::name)) + m_name = value; + else + IWORKXMLElementContextBase::attribute(name, value); +@@ -45,7 +45,7 @@ + + IWORKXMLContextPtr_t IWORKHeaderFooterContext::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::text_storage)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::text_storage)) + return std::make_shared<IWORKTextStorageElement>(getState()); + return IWORKXMLContextPtr_t(); + } +--- src/lib/contexts/IWORKImageContext.cpp ++++ src/lib/contexts/IWORKImageContext.cpp +@@ -32,9 +32,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::data : ++ case +IWORKToken::NS_URI_SF | IWORKToken::data : + return std::make_shared<IWORKDataElement>(getState(), m_data, m_fillColor); +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("IWORKImageContext::element: find unknown element\n")); +--- src/lib/contexts/IWORKImageElement.cpp ++++ src/lib/contexts/IWORKImageElement.cpp +@@ -29,7 +29,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::graphic_style, IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::graphic_style, +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; + } + + IWORKImageElement::IWORKImageElement(IWORKXMLParserState &state, IWORKMediaContentPtr_t &content) +@@ -74,9 +74,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::version : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::version : + break; +- case IWORKToken::NS_URI_SF | IWORKToken::locked : ++ case +IWORKToken::NS_URI_SF | IWORKToken::locked : + m_locked = bool_cast(value); + break; + default : +@@ -89,19 +89,19 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::binary : ++ case +IWORKToken::NS_URI_SF | IWORKToken::binary : + return std::make_shared<IWORKBinaryElement>(getState(), m_content); +- case IWORKToken::NS_URI_SF | IWORKToken::binary_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::binary_ref : + return std::make_shared<IWORKRefContext>(getState(), m_binaryRef); +- case IWORKToken::NS_URI_SF | IWORKToken::crop_geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::crop_geometry : + return std::make_shared<IWORKGeometryElement>(getState(), m_cropGeometry); +- case IWORKToken::NS_URI_SF | IWORKToken::data : ++ case +IWORKToken::NS_URI_SF | IWORKToken::data : + return std::make_shared<IWORKDataElement>(getState(), m_data, m_fillColor); +- case IWORKToken::NS_URI_SF | IWORKToken::filtered_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filtered_image : + return std::make_shared<IWORKFilteredImageElement>(getState(), m_filteredImage); +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::masking_shape_path_source : ++ case +IWORKToken::NS_URI_SF | IWORKToken::masking_shape_path_source : + { + static bool first=true; + if (first) +@@ -111,11 +111,11 @@ + } + break; + } +- case IWORKToken::NS_URI_SF | IWORKToken::placeholder_size : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::placeholder_size : // USEME + return std::make_shared<IWORKSizeElement>(getState(),m_placeholderSize); +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(),m_size); +- case IWORKToken::NS_URI_SF | IWORKToken::style : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : // USEME + return std::make_shared<GraphicStyleContext>(getState(), m_style, getState().getDictionary().m_graphicStyles); + default: + ETONYEK_DEBUG_MSG(("IWORKImageElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKLayoutElement.cpp ++++ src/lib/contexts/IWORKLayoutElement.cpp +@@ -28,7 +28,7 @@ + + void IWORKLayoutElement::attribute(const int name, const char *const value) + { +- if ((IWORKToken::NS_URI_SF | IWORKToken::style) == name) ++ if ((+IWORKToken::NS_URI_SF | IWORKToken::style) == name) + m_style=getState().getStyleByName(value, getState().getDictionary().m_layoutStyles); + else // also sfa:ID + { +@@ -41,7 +41,7 @@ + if (!m_opened) + open(); + +- if ((IWORKToken::NS_URI_SF | IWORKToken::p) == name) ++ if ((+IWORKToken::NS_URI_SF | IWORKToken::p) == name) + return std::make_shared<IWORKPElement>(getState()); + + return IWORKXMLContextPtr_t(); +--- src/lib/contexts/IWORKLineElement.cpp ++++ src/lib/contexts/IWORKLineElement.cpp +@@ -22,7 +22,7 @@ + { + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::graphic_style, IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::graphic_style, +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; + } + + IWORKLineElement::IWORKLineElement(IWORKXMLParserState &state) +@@ -43,13 +43,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::head : ++ case +IWORKToken::NS_URI_SF | IWORKToken::head : + return std::make_shared<IWORKPositionElement>(getState(), m_head); +- case IWORKToken::NS_URI_SF | IWORKToken::style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : + return std::make_shared<GraphicStyleContext>(getState(), m_style, getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tail : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tail : + return std::make_shared<IWORKPositionElement>(getState(), m_tail); + default: + break; +--- src/lib/contexts/IWORKLineEndElement.cpp ++++ src/lib/contexts/IWORKLineEndElement.cpp +@@ -45,13 +45,13 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + m_id=value; + break; +- case IWORKToken::path | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::path | IWORKToken::NS_URI_SFA : + m_value=value; + break; +- case IWORKToken::version | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::version | IWORKToken::NS_URI_SFA : + break; + default : + ETONYEK_DEBUG_MSG(("PathElement::attribute[IWORKLineEndElement]: find unknown attribute\n")); +@@ -78,21 +78,21 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + /* checkme: do we need to store this element in the dictionary ? + I never seen sf:line-end-ref so maybe not + */ + m_id=value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::filled : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filled : + m_value->m_filled = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::identifier : // needed ? ++ case +IWORKToken::NS_URI_SF | IWORKToken::identifier : // needed ? + break; +- case IWORKToken::NS_URI_SF | IWORKToken::scale : ++ case +IWORKToken::NS_URI_SF | IWORKToken::scale : + m_value->m_scale = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::path_join : ++ case +IWORKToken::NS_URI_SF | IWORKToken::path_join : + m_value->m_pathJoin = int_cast(value); + break; + default: +@@ -104,9 +104,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : + return std::make_shared<PathElement>(getState(), m_value->m_path); +- case IWORKToken::NS_URI_SF | IWORKToken::end_point : ++ case +IWORKToken::NS_URI_SF | IWORKToken::end_point : + return std::make_shared<IWORKPositionElement>(getState(), m_value->m_endPoint); + default: + break; +--- src/lib/contexts/IWORKLinkElement.cpp ++++ src/lib/contexts/IWORKLinkElement.cpp +@@ -37,7 +37,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::span : ++ case +IWORKToken::NS_URI_SF | IWORKToken::span : + return std::make_shared<IWORKSpanElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("IWORKLinkElement::element: find unknown element\n")); +--- src/lib/contexts/IWORKListLabelGeometriesProperty.cpp ++++ src/lib/contexts/IWORKListLabelGeometriesProperty.cpp +@@ -25,7 +25,7 @@ + namespace + { + +-typedef IWORKMutableArrayElement<IWORKListLabelGeometry, IWORKListLabelGeometryElement, IWORKPushCollector, IWORKToken::NS_URI_SF | IWORKToken::list_label_geometry, IWORKToken::NS_URI_SF | IWORKToken::list_label_geometry_ref> MutableArrayElement; ++typedef IWORKMutableArrayElement<IWORKListLabelGeometry, IWORKListLabelGeometryElement, IWORKPushCollector, +IWORKToken::NS_URI_SF | IWORKToken::list_label_geometry, +IWORKToken::NS_URI_SF | IWORKToken::list_label_geometry_ref> MutableArrayElement; + } + + IWORKListLabelGeometriesProperty::IWORKListLabelGeometriesProperty(IWORKXMLParserState &state, IWORKPropertyMap &propMap) +@@ -40,13 +40,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::array: +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array: ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array : + return std::make_shared<MutableArrayElement>(getState(), getState().getDictionary().m_listLabelGeometriesArrays, + getState().getDictionary().m_listLabelGeometries, + m_elements); +- case IWORKToken::NS_URI_SF | IWORKToken::array_ref: +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array_ref: ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + break; +--- src/lib/contexts/IWORKListLabelGeometryElement.cpp ++++ src/lib/contexts/IWORKListLabelGeometryElement.cpp +@@ -30,13 +30,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::scale : ++ case +IWORKToken::NS_URI_SF | IWORKToken::scale : + m_scale = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::offset : ++ case +IWORKToken::NS_URI_SF | IWORKToken::offset : + m_offset = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::scale_with_text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::scale_with_text : + m_scaleWithText = try_bool_cast(value); + break; + default: +--- src/lib/contexts/IWORKListLabelIndentsProperty.cpp ++++ src/lib/contexts/IWORKListLabelIndentsProperty.cpp +@@ -24,7 +24,7 @@ + namespace + { + +-typedef IWORKMutableArrayElement<double, IWORKNumberElement<double>, IWORKPushCollector, IWORKToken::NS_URI_SF | IWORKToken::number> MutableArrayElement; ++typedef IWORKMutableArrayElement<double, IWORKNumberElement<double>, IWORKPushCollector, +IWORKToken::NS_URI_SF | IWORKToken::number> MutableArrayElement; + + } + +@@ -40,11 +40,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::array : +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array : ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array : + return std::make_shared<MutableArrayElement>(getState(), getState().getDictionary().m_doubleArrays, m_elements); +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : +- case IWORKToken::NS_URI_SF | IWORKToken::array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + break; +--- src/lib/contexts/IWORKListLabelTypeinfoElement.cpp ++++ src/lib/contexts/IWORKListLabelTypeinfoElement.cpp +@@ -37,7 +37,7 @@ + + void IWORKListLabelTypeinfoElement::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::type)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::type)) + { + switch (getState().getTokenizer().getId(value)) + { +@@ -62,13 +62,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::binary : ++ case +IWORKToken::NS_URI_SF | IWORKToken::binary : + return std::make_shared<IWORKBinaryElement>(getState(), m_image); +- case IWORKToken::NS_URI_SF | IWORKToken::binary_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::binary_ref : + return std::make_shared<IWORKRefContext>(getState(), m_imageRef); +- case IWORKToken::NS_URI_SF | IWORKToken::text_label : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_label : + return std::make_shared<IWORKTextLabelElement>(getState(), m_text); +- case IWORKToken::NS_URI_SF | IWORKToken::text_label_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_label_ref : + return std::make_shared<IWORKRefContext>(getState(), m_textRef); + default: + break; +--- src/lib/contexts/IWORKListLabelTypesProperty.cpp ++++ src/lib/contexts/IWORKListLabelTypesProperty.cpp +@@ -25,7 +25,7 @@ + + namespace + { +-typedef IWORKMutableArrayElement<IWORKListLabelTypeInfo_t, IWORKListLabelTypeinfoElement, IWORKPushCollector, IWORKToken::NS_URI_SF | IWORKToken::list_label_typeinfo, IWORKToken::NS_URI_SF | IWORKToken::list_label_typeinfo_ref> MutableArrayElement; ++typedef IWORKMutableArrayElement<IWORKListLabelTypeInfo_t, IWORKListLabelTypeinfoElement, IWORKPushCollector, +IWORKToken::NS_URI_SF | IWORKToken::list_label_typeinfo, +IWORKToken::NS_URI_SF | IWORKToken::list_label_typeinfo_ref> MutableArrayElement; + } + + IWORKListLabelTypesProperty::IWORKListLabelTypesProperty(IWORKXMLParserState &state, IWORKPropertyMap &propMap) +@@ -40,12 +40,12 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::array: +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array: ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array : + return std::make_shared<MutableArrayElement>(getState(), getState().getDictionary().m_listLabelTypesArrays, + getState().getDictionary().m_listLabelTypeInfos, m_elements); +- case IWORKToken::NS_URI_SF | IWORKToken::array_ref : +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + break; +--- src/lib/contexts/IWORKListTextIndentsProperty.cpp ++++ src/lib/contexts/IWORKListTextIndentsProperty.cpp +@@ -23,7 +23,7 @@ + + namespace + { +-typedef IWORKMutableArrayElement<double, IWORKNumberElement<double>, IWORKPushCollector, IWORKToken::NS_URI_SF | IWORKToken::number> MutableArrayElement; ++typedef IWORKMutableArrayElement<double, IWORKNumberElement<double>, IWORKPushCollector, +IWORKToken::NS_URI_SF | IWORKToken::number> MutableArrayElement; + } + + IWORKListTextIndentsProperty::IWORKListTextIndentsProperty(IWORKXMLParserState &state, IWORKPropertyMap &propMap) +@@ -38,11 +38,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::array : +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array : ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array : + return std::make_shared<MutableArrayElement>(getState(), getState().getDictionary().m_doubleArrays, m_elements); +- case IWORKToken::NS_URI_SF | IWORKToken::array_ref : +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::array_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + break; +--- src/lib/contexts/IWORKMediaElement.cpp ++++ src/lib/contexts/IWORKMediaElement.cpp +@@ -62,11 +62,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::alpha_mask_path : // README ++ case +IWORKToken::NS_URI_SF | IWORKToken::alpha_mask_path : // README + break; +- case IWORKToken::NS_URI_SF | IWORKToken::filtered_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filtered_image : + return std::make_shared<IWORKFilteredImageElement>(getState(), m_content); +- case IWORKToken::NS_URI_SF | IWORKToken::traced_path : // README ++ case +IWORKToken::NS_URI_SF | IWORKToken::traced_path : // README + break; + default: + ETONYEK_DEBUG_MSG(("ImageMediaElement::element[IWORKMediaElement.cpp]: unknown element %d\n", name)); +@@ -107,9 +107,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::data : ++ case +IWORKToken::NS_URI_SF | IWORKToken::data : + return std::make_shared<IWORKDataElement>(getState(), m_data, m_fillColor); +- case IWORKToken::NS_URI_SF | IWORKToken::data_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::data_ref : + return std::make_shared<IWORKRefContext>(getState(), m_dataRef); + default: + ETONYEK_DEBUG_MSG(("OtherDatasElement::element[IWORKMediaElement.cpp]: unknown element %d\n", name)); +@@ -166,11 +166,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::main_movie : ++ case +IWORKToken::NS_URI_SF | IWORKToken::main_movie : + return std::make_shared<IWORKDataElement>(getState(), m_data, m_fillColor); +- case IWORKToken::NS_URI_SF | IWORKToken::main_movie_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::main_movie_ref : + return std::make_shared<IWORKRefContext>(getState(), m_mainMovieRef); +- case IWORKToken::NS_URI_SF | IWORKToken::other_datas : ++ case +IWORKToken::NS_URI_SF | IWORKToken::other_datas : + return std::make_shared<OtherDatasElement>(getState(), m_otherData); + default: + ETONYEK_DEBUG_MSG(("SelfContainedMovieElement::element[IWORKMediaElement.cpp]: unknown element %d\n", name)); +@@ -234,13 +234,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::audio_only_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::audio_only_image : + return std::make_shared<IWORKBinaryElement>(getState(), m_audioOnlyImage); +- case IWORKToken::NS_URI_SF | IWORKToken::audio_only_image_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::audio_only_image_ref : + return std::make_shared<IWORKRefContext>(getState(), m_audioOnlyImageRef); +- case IWORKToken::NS_URI_SF | IWORKToken::poster_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::poster_image : + return std::make_shared<IWORKBinaryElement>(getState(), m_posterImage); +- case IWORKToken::NS_URI_SF | IWORKToken::self_contained_movie : ++ case +IWORKToken::NS_URI_SF | IWORKToken::self_contained_movie : + return std::make_shared<SelfContainedMovieElement>(getState(), m_data); + default: + ETONYEK_DEBUG_MSG(("MovieMediaElement::element[IWORKMediaElement.cpp]: unknown element %d\n", name)); +@@ -305,9 +305,9 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::image_media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::image_media : + return std::make_shared<ImageMediaElement>(getState(), m_content); +- case IWORKToken::NS_URI_SF | IWORKToken::movie_media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::movie_media : + return std::make_shared<MovieMediaElement>(getState(), m_content); + default: + ETONYEK_DEBUG_MSG(("ContentElement::element[IWORKMediaElement.cpp]: unknown element %d\n", name)); +@@ -320,7 +320,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::graphic_style, IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::graphic_style, +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; + } + + IWORKMediaElement::IWORKMediaElement(IWORKXMLParserState &state) +@@ -342,7 +342,7 @@ + { + switch (name) + { +- case PAG1Token::order | PAG1Token::NS_URI_SL : ++ case +PAG1Token::order | PAG1Token::NS_URI_SL : + m_order=try_int_cast(value); + break; + default: +@@ -360,17 +360,17 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::audio_only_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::audio_only_image : + return std::make_shared<IWORKBinaryElement>(getState(), m_audioOnlyImage); +- case IWORKToken::NS_URI_SF | IWORKToken::audio_only_image_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::audio_only_image_ref : + return std::make_shared<IWORKRefContext>(getState(), m_audioOnlyImageRef); +- case IWORKToken::NS_URI_SF | IWORKToken::content : ++ case +IWORKToken::NS_URI_SF | IWORKToken::content : + return std::make_shared<ContentElement>(getState(), m_content); +- case IWORKToken::NS_URI_SF | IWORKToken::crop_geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::crop_geometry : + return std::make_shared<IWORKGeometryElement>(getState(), m_cropGeometry); +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::masking_shape_path_source : ++ case +IWORKToken::NS_URI_SF | IWORKToken::masking_shape_path_source : + { + static bool first=true; + if (first) +@@ -380,15 +380,15 @@ + } + break; + } +- case IWORKToken::NS_URI_SF | IWORKToken::placeholder_size : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::placeholder_size : // USEME + return std::make_shared<IWORKSizeElement>(getState(),m_placeholderSize); +- case IWORKToken::NS_URI_SF | IWORKToken::poster_image : ++ case +IWORKToken::NS_URI_SF | IWORKToken::poster_image : + return std::make_shared<IWORKBinaryElement>(getState(), m_posterImage); +- case IWORKToken::NS_URI_SF | IWORKToken::self_contained_movie : ++ case +IWORKToken::NS_URI_SF | IWORKToken::self_contained_movie : + return std::make_shared<SelfContainedMovieElement>(getState(), m_movieData); +- case IWORKToken::NS_URI_SF | IWORKToken::style : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : // USEME + return std::make_shared<GraphicStyleContext>(getState(), m_style, getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME + return std::make_shared<IWORKWrapElement>(getState(), m_wrap); + default: + ETONYEK_DEBUG_MSG(("IWORKMediaElement::element: find some unknown elements\n")); +--- src/lib/contexts/IWORKMetadataElement.cpp ++++ src/lib/contexts/IWORKMetadataElement.cpp +@@ -45,7 +45,7 @@ + + IWORKXMLContextPtr_t StringContext::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::string)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::string)) + return std::make_shared<IWORKStringElement>(getState(), m_value); + return IWORKXMLContextPtr_t(); + } +@@ -65,16 +65,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::authors : ++ case +IWORKToken::NS_URI_SF | IWORKToken::authors : + return std::make_shared<StringContext>(getState(), m_author); +- case IWORKToken::NS_URI_SF | IWORKToken::comment : ++ case +IWORKToken::NS_URI_SF | IWORKToken::comment : + return std::make_shared<StringContext>(getState(), m_comment); +- case IWORKToken::NS_URI_SF | IWORKToken::keywords : ++ case +IWORKToken::NS_URI_SF | IWORKToken::keywords : + return std::make_shared<StringContext>(getState(), m_keywords); +- case IWORKToken::NS_URI_SF | IWORKToken::title : ++ case +IWORKToken::NS_URI_SF | IWORKToken::title : + return std::make_shared<StringContext>(getState(), m_title); +- case IWORKToken::NS_URI_SF | IWORKToken::copyright : +- case IWORKToken::NS_URI_SF | IWORKToken::projects : ++ case +IWORKToken::NS_URI_SF | IWORKToken::copyright : ++ case +IWORKToken::NS_URI_SF | IWORKToken::projects : + // TODO: retrieve them as generic metadata + return IWORKXMLContextPtr_t(); + default: +--- src/lib/contexts/IWORKNumberElement.h ++++ src/lib/contexts/IWORKNumberElement.h +@@ -42,11 +42,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::number : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::number : + m_value = IWORKNumberConverter<T>::convert(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::sfclass : // with value number +- case IWORKToken::NS_URI_SFA | IWORKToken::type : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::sfclass : // with value number ++ case +IWORKToken::NS_URI_SFA | IWORKToken::type : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKNumberElement<...>::attribute: found unexpected attribute\n")); +--- src/lib/contexts/IWORKNumericPropertyContext.h ++++ src/lib/contexts/IWORKNumericPropertyContext.h +@@ -17,9 +17,9 @@ + { + + template<class Property, int TokenId2=0> +-class IWORKNumericPropertyContext : public IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, IWORKToken::NS_URI_SF | IWORKToken::number, TokenId2> ++class IWORKNumericPropertyContext : public IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, +IWORKToken::NS_URI_SF | IWORKToken::number, TokenId2> + { +- typedef IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, IWORKToken::NS_URI_SF | IWORKToken::number, TokenId2> Parent_t; ++ typedef IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, +IWORKToken::NS_URI_SF | IWORKToken::number, TokenId2> Parent_t; + + public: + IWORKNumericPropertyContext(IWORKXMLParserState &state, IWORKPropertyMap &propMap); +--- src/lib/contexts/IWORKPElement.cpp ++++ src/lib/contexts/IWORKPElement.cpp +@@ -47,10 +47,10 @@ + { + switch (name) + { +- case IWORKToken::localize | IWORKToken::NS_URI_SF : // a bool ++ case +IWORKToken::localize | IWORKToken::NS_URI_SF : // a bool + break; +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : +- case IWORKToken::IDREF | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::IDREF | IWORKToken::NS_URI_SFA : + /* storeme? */ + IWORKXMLEmptyContextBase::attribute(name, value); + break; +@@ -64,27 +64,27 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::br : // ok to ignore? ++ case +IWORKToken::NS_URI_SF | IWORKToken::br : // ok to ignore? + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::crbr : +- case IWORKToken::NS_URI_SF | IWORKToken::intratopicbr : +- case IWORKToken::NS_URI_SF | IWORKToken::lnbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::crbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::intratopicbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::lnbr : + return std::make_shared<IWORKBrContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::pgbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pgbr : + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::span : ++ case +IWORKToken::NS_URI_SF | IWORKToken::span : + return std::make_shared<IWORKSpanElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tab : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tab : + return std::make_shared<IWORKTabElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::link : ++ case +IWORKToken::NS_URI_SF | IWORKToken::link : + return std::make_shared<IWORKLinkElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::date_time : ++ case +IWORKToken::NS_URI_SF | IWORKToken::date_time : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_DATETIME); +- case IWORKToken::NS_URI_SF | IWORKToken::filename : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filename : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_FILENAME); +- case IWORKToken::NS_URI_SF | IWORKToken::page_count : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_count : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_PAGECOUNT); +- case IWORKToken::NS_URI_SF | IWORKToken::page_number : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_number : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_PAGENUMBER); + default: + ETONYEK_DEBUG_MSG(("GhostTextElement::element[IWORKPElement.cpp]: find unknown element\n")); +@@ -119,13 +119,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::list_level : ++ case +IWORKToken::NS_URI_SF | IWORKToken::list_level : + m_listLevel = try_int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::restart_list : ++ case +IWORKToken::NS_URI_SF | IWORKToken::restart_list : + m_restartList = try_bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : + m_style = getState().getStyleByName(value, getState().getDictionary().m_paragraphStyles); + break; + default: +@@ -140,34 +140,34 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::br : // ok to ignore? ++ case +IWORKToken::NS_URI_SF | IWORKToken::br : // ok to ignore? + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::crbr : +- case IWORKToken::NS_URI_SF | IWORKToken::intratopicbr : +- case IWORKToken::NS_URI_SF | IWORKToken::lnbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::crbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::intratopicbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::lnbr : + return std::make_shared<IWORKBrContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::pgbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pgbr : + m_delayedPageBreak=true; + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::span : ++ case +IWORKToken::NS_URI_SF | IWORKToken::span : + return std::make_shared<IWORKSpanElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tab : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tab : + return std::make_shared<IWORKTabElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::link : ++ case +IWORKToken::NS_URI_SF | IWORKToken::link : + return std::make_shared<IWORKLinkElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::date_time : ++ case +IWORKToken::NS_URI_SF | IWORKToken::date_time : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_DATETIME); +- case IWORKToken::NS_URI_SF | IWORKToken::filename : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filename : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_FILENAME); +- case IWORKToken::NS_URI_SF | IWORKToken::ghost_text : +- case IWORKToken::NS_URI_SF | IWORKToken::ghost_text_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::ghost_text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::ghost_text_ref : + /* checkme: sf:ghost-text and sf:ghost-text-ref seems similar, but maybe + sf:ghost-text-ref can also be called without the text data... + */ + return std::make_shared<GhostTextElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::page_count : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_count : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_PAGECOUNT); +- case IWORKToken::NS_URI_SF | IWORKToken::page_number : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_number : + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_PAGENUMBER); + default: + ETONYEK_DEBUG_MSG(("IWORKPElement::element: find unknown element\n")); +--- src/lib/contexts/IWORKPathElement.cpp ++++ src/lib/contexts/IWORKPathElement.cpp +@@ -60,9 +60,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::point : ++ case +IWORKToken::NS_URI_SF | IWORKToken::point : + return std::make_shared<IWORKPositionElement>(getState(), m_point); +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("ConnectionPathElement::element[IWORKPathElement.cpp]: find unknown element\n")); +@@ -118,7 +118,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::type : + { + switch (getToken(value)) + { +@@ -146,9 +146,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::point : ++ case +IWORKToken::NS_URI_SF | IWORKToken::point : + return std::make_shared<IWORKPositionElement>(getState(), m_point); +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("PointPathElement::element[IWORKPathElement.cpp]: find unknown element\n")); +@@ -215,10 +215,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::scalar : ++ case +IWORKToken::NS_URI_SF | IWORKToken::scalar : + m_value = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::type : + { + switch (getToken(value)) + { +@@ -243,7 +243,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("ScalarPathElement::element[IWORKPathElement.cpp]: find unknown element\n")); +@@ -296,9 +296,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::bezier : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bezier : + return std::make_shared<IWORKBezierElement>(getState(), m_path); +- case IWORKToken::NS_URI_SF | IWORKToken::bezier_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bezier_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + ETONYEK_DEBUG_MSG(("BezierPathElement::element[IWORKPathElement.cpp]: find unknown element\n")); +@@ -364,19 +364,19 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::cornerRadius : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cornerRadius : + m_cornerRadius = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::tailAtCenter : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tailAtCenter : + m_tailAtCenter = bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::tailPositionX : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tailPositionX : + m_tailPosX = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::tailPositionY : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tailPositionY : + m_tailPosY = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::tailSize : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tailSize : + m_tailSize = double_cast(value); + break; + default : +@@ -389,7 +389,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::size : + return std::make_shared<IWORKSizeElement>(getState(), m_size); + default: + ETONYEK_DEBUG_MSG(("Callout2PathElement::element[IWORKPathElement.cpp]: find unknown element\n")); +@@ -415,16 +415,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::bezier_path : +- case IWORKToken::NS_URI_SF | IWORKToken::editable_bezier_path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bezier_path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::editable_bezier_path : + return std::make_shared<BezierPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::callout2_path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::callout2_path : + return std::make_shared<Callout2PathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::connection_path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::connection_path : + return std::make_shared<ConnectionPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::point_path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::point_path : + return std::make_shared<PointPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::scalar_path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::scalar_path : + return std::make_shared<ScalarPathElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("IWORKPathElement::element: find unknown element\n")); +--- src/lib/contexts/IWORKPositionElement.cpp ++++ src/lib/contexts/IWORKPositionElement.cpp +@@ -30,10 +30,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::x : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::x : + m_x = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::y : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::y : + m_y = try_double_cast(value); + break; + default: +--- src/lib/contexts/IWORKPropertyContext.h ++++ src/lib/contexts/IWORKPropertyContext.h +@@ -46,7 +46,7 @@ + m_default = false; + if (TokenId == name || (TokenId2 != 0 && TokenId2 == name)) + return std::make_shared<Context>(getState(), m_value); +- else if (name != (IWORKToken::NS_URI_SF | IWORKToken::null)) ++ else if (name != (+IWORKToken::NS_URI_SF | IWORKToken::null)) + { + ETONYEK_DEBUG_MSG(("IWORKPropertyContext<...>::element: found unexpected element %d\n", name)); + } +--- src/lib/contexts/IWORKPropertyMapElement.cpp ++++ src/lib/contexts/IWORKPropertyMapElement.cpp +@@ -127,7 +127,7 @@ + return std::make_shared<Context>(getState(), m_data); + case RefTokenId : + return std::make_shared<IWORKRefContext>(getState(), m_ref); +- case IWORKToken::NS_URI_SF | IWORKToken::null: ++ case +IWORKToken::NS_URI_SF | IWORKToken::null: + return IWORKXMLContextPtr_t(); + default: + break; +@@ -228,9 +228,9 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::tabs : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabs : + return std::make_shared<IWORKTabsElement>(getState(), m_tabs); +- case IWORKToken::NS_URI_SF | IWORKToken::tabs_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabs_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + ETONYEK_DEBUG_MSG(("TabsProperty::element[IWORKPropertyMapElement.cpp]: find unknown element\n")); +@@ -293,13 +293,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::amt : ++ case +IWORKToken::NS_URI_SF | IWORKToken::amt : + m_amount = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::mode : ++ case +IWORKToken::NS_URI_SF | IWORKToken::mode : + m_relative = IWORKToken::relative == getToken(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default: +@@ -344,13 +344,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::spacing : ++ case +IWORKToken::NS_URI_SF | IWORKToken::spacing : + m_value.m_spacing = get_optional_value_or(try_double_cast(value), 0); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::width : ++ case +IWORKToken::NS_URI_SF | IWORKToken::width : + m_value.m_width = get_optional_value_or(try_double_cast(value), 0); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::index : // column index, probably save to ignore ++ case +IWORKToken::NS_URI_SF | IWORKToken::index : // column index, probably save to ignore + break; + default: + ETONYEK_DEBUG_MSG(("ColumnElement::attribute[IWORKPropertyMapElement.cpp]: find unknown attribute\n")); +@@ -387,10 +387,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::equal_columns : ++ case +IWORKToken::NS_URI_SF | IWORKToken::equal_columns : + get(m_value).m_equal = get_optional_value_or(try_bool_cast(value), false); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -403,7 +403,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::column : ++ case +IWORKToken::NS_URI_SF | IWORKToken::column : + get(m_value).m_columns.push_back(IWORKColumns::Column()); + return std::make_shared<ColumnElement>(getState(), get(m_value).m_columns.back()); + default: +@@ -447,19 +447,19 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::bottom : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bottom : + get(m_value).m_bottom = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::left : ++ case +IWORKToken::NS_URI_SF | IWORKToken::left : + get(m_value).m_left = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::right : ++ case +IWORKToken::NS_URI_SF | IWORKToken::right : + get(m_value).m_right = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::top : ++ case +IWORKToken::NS_URI_SF | IWORKToken::top : + get(m_value).m_top = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default: +@@ -502,9 +502,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::string: ++ case +IWORKToken::NS_URI_SF | IWORKToken::string: + return std::make_shared<IWORKStringElement>(getState(), m_lang); +- case IWORKToken::NS_URI_SF | IWORKToken::null: ++ case +IWORKToken::NS_URI_SF | IWORKToken::null: + break; + default: + ETONYEK_DEBUG_MSG(("LanguageElement::element[IWORKPropertyMapElement.cpp]: find unknown element\n")); +@@ -540,9 +540,9 @@ + + note: This is probably similar for duration */ + template <typename Property> +-class PropertyDateTimeFormatElement : public RefPropertyContext<Property, IWORKDateTimeFormatElement, IWORKToken::NS_URI_SF | IWORKToken::date_format, IWORKToken::NS_URI_SF | IWORKToken::date_format_ref> ++class PropertyDateTimeFormatElement : public RefPropertyContext<Property, IWORKDateTimeFormatElement, +IWORKToken::NS_URI_SF | IWORKToken::date_format, +IWORKToken::NS_URI_SF | IWORKToken::date_format_ref> + { +- typedef RefPropertyContext<Property, IWORKDateTimeFormatElement, IWORKToken::NS_URI_SF | IWORKToken::date_format, IWORKToken::NS_URI_SF | IWORKToken::date_format_ref> Parent; ++ typedef RefPropertyContext<Property, IWORKDateTimeFormatElement, +IWORKToken::NS_URI_SF | IWORKToken::date_format, +IWORKToken::NS_URI_SF | IWORKToken::date_format_ref> Parent; + typedef std::unordered_map<ID_t, IWORKDateTimeFormat> RedirectMap_t; + + public: +@@ -554,7 +554,7 @@ + private: + IWORKXMLContextPtr_t element(int name) override + { +- if (name==(IWORKToken::NS_URI_SF | IWORKToken::string)) ++ if (name==(+IWORKToken::NS_URI_SF | IWORKToken::string)) + return std::make_shared<IWORKStringElement>(Parent::getState(), m_string); + else + return Parent::element(name); +@@ -582,8 +582,8 @@ + OverridesElement(IWORKXMLParserState &state, IWORKShadow &value); + + private: +- typedef IWORKValueContext<double, IWORKNumberElement<double>, IWORKToken::NS_URI_SF | IWORKToken::number> NumberProperty; +- typedef IWORKValueContext<IWORKColor, IWORKColorElement, IWORKToken::NS_URI_SF | IWORKToken::color> ColorProperty; ++ typedef IWORKValueContext<double, IWORKNumberElement<double>, +IWORKToken::NS_URI_SF | IWORKToken::number> NumberProperty; ++ typedef IWORKValueContext<IWORKColor, IWORKColorElement, +IWORKToken::NS_URI_SF | IWORKToken::color> ColorProperty; + + private: + void attribute(int name, const char *value) override; +@@ -604,7 +604,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -617,17 +617,17 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::inputAngle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inputAngle : + return std::make_shared<NumberProperty>(getState(), m_value.m_angle); +- case IWORKToken::NS_URI_SF | IWORKToken::inputColor : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inputColor : + return std::make_shared<ColorProperty>(getState(), m_value.m_color); +- case IWORKToken::NS_URI_SF | IWORKToken::inputDistance : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inputDistance : + return std::make_shared<NumberProperty>(getState(), m_value.m_offset); +- case IWORKToken::NS_URI_SF | IWORKToken::inputGlossiness : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inputGlossiness : + return std::make_shared<NumberProperty>(getState(), m_value.m_glossiness); +- case IWORKToken::NS_URI_SF | IWORKToken::inputOpacity : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inputOpacity : + return std::make_shared<NumberProperty>(getState(), m_value.m_opacity); +- case IWORKToken::NS_URI_SF | IWORKToken::inputRadius : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inputRadius : + return std::make_shared<NumberProperty>(getState(), m_value.m_radius); + default: + ETONYEK_DEBUG_MSG(("OverridesElement::element[IWORKPropertyMapElement.cpp]: find unknown element\n")); +@@ -677,7 +677,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + case IWORKToken::filter_visibility: // USEME? a bool +@@ -692,13 +692,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_descriptor : ++ case +IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_descriptor : + return std::make_shared<IWORKCoreImageFilterDescriptorElement>(getState(), m_isShadow); +- case IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_descriptor_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_descriptor_ref : + return std::make_shared<IWORKRefContext>(getState(), m_descriptorRef); +- case IWORKToken::NS_URI_SF | IWORKToken::overrides : ++ case +IWORKToken::NS_URI_SF | IWORKToken::overrides : + return std::make_shared<OverridesElement>(getState(), m_value); +- case IWORKToken::NS_URI_SF | IWORKToken::overrides_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::overrides_ref : + return std::make_shared<IWORKRefContext>(getState(), m_overridesRef); + default: + ETONYEK_DEBUG_MSG(("CoreImageFilterInfoElement::element[IWORKPropertyMapElement.cpp]: find unknown element\n")); +@@ -743,7 +743,7 @@ + + class FiltersElement : public IWORKXMLElementContextBase + { +- typedef IWORKMutableArrayElement<IWORKShadow, CoreImageFilterInfoElement, IWORKDirectCollector, IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_info, IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_info_ref> MutableArrayElement; ++ typedef IWORKMutableArrayElement<IWORKShadow, CoreImageFilterInfoElement, IWORKDirectCollector, +IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_info, +IWORKToken::NS_URI_SF | IWORKToken::core_image_filter_info_ref> MutableArrayElement; + + public: + FiltersElement(IWORKXMLParserState &state, IWORKPropertyMap &propMap); +@@ -768,21 +768,21 @@ + { + } + +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> FiltersLayoutStyle; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> FiltersLayoutStyle; + + IWORKXMLContextPtr_t FiltersElement::element(const int name) + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array: +- case IWORKToken::NS_URI_SF | IWORKToken::array: ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array: ++ case +IWORKToken::NS_URI_SF | IWORKToken::array: + return std::make_shared<MutableArrayElement>(getState(), getState().getDictionary().m_filters, getState().getDictionary().m_coreImageFilterInfos, m_elements); +- case IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref: +- case IWORKToken::NS_URI_SF | IWORKToken::array_ref: ++ case +IWORKToken::NS_URI_SF | IWORKToken::mutable_array_ref: ++ case +IWORKToken::NS_URI_SF | IWORKToken::array_ref: + return std::make_shared<IWORKRefContext>(getState(), m_ref); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutStyle: // useme ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutStyle: // useme + return std::make_shared<FiltersLayoutStyle>(getState(), m_layout, getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::null: ++ case +IWORKToken::NS_URI_SF | IWORKToken::null: + break; + default: + ETONYEK_DEBUG_MSG(("FiltersElement::element[FiltersElements.cpp]: find unknown element\n")); +@@ -814,37 +814,37 @@ + namespace + { + +-typedef RefPropertyContext<property::Columns, ColumnsElement, IWORKToken::NS_URI_SF | IWORKToken::columns, IWORKToken::NS_URI_SF | IWORKToken::columns_ref> ColumnsPropertyElement; +-typedef RefPropertyContext<property::ExternalTextWrap, IWORKExternalTextWrapElement, IWORKToken::NS_URI_SF | IWORKToken::external_text_wrap, IWORKToken::NS_URI_SF | IWORKToken::external_text_wrap_ref> ExternalTextWrapElement; ++typedef RefPropertyContext<property::Columns, ColumnsElement, +IWORKToken::NS_URI_SF | IWORKToken::columns, +IWORKToken::NS_URI_SF | IWORKToken::columns_ref> ColumnsPropertyElement; ++typedef RefPropertyContext<property::ExternalTextWrap, IWORKExternalTextWrapElement, +IWORKToken::NS_URI_SF | IWORKToken::external_text_wrap, +IWORKToken::NS_URI_SF | IWORKToken::external_text_wrap_ref> ExternalTextWrapElement; + typedef RedirectPropertyContext<property::Fill, IWORKFillElement> FillPropertyElement; +-typedef IWORKPropertyContext<property::FontColor, IWORKColorElement, IWORKToken::NS_URI_SF | IWORKToken::color> FontColorElement; +-typedef IWORKPropertyContext<property::FontName, IWORKStringElement, IWORKToken::NS_URI_SF | IWORKToken::string> FontNameElement; +-typedef IWORKPropertyContext<property::HeadLineEnd, IWORKLineEndElement, IWORKToken::NS_URI_SF | IWORKToken::line_end> HeadLineEndElement; +-typedef RefPropertyContext<property::LayoutMargins, PaddingElement, IWORKToken::NS_URI_SF | IWORKToken::padding, IWORKToken::NS_URI_SF | IWORKToken::padding_ref> LayoutMarginsElement; +-typedef RefPropertyContext<property::LineSpacing, LinespacingElement, IWORKToken::NS_URI_SF | IWORKToken::linespacing, IWORKToken::NS_URI_SF | IWORKToken::linespacing_ref> LineSpacingElement; +-typedef RefPropertyContext<property::Padding, PaddingElement, IWORKToken::NS_URI_SF | IWORKToken::padding, IWORKToken::NS_URI_SF | IWORKToken::padding_ref> PaddingContext; +-typedef IWORKPropertyContext<property::ParagraphFill, IWORKColorElement, IWORKToken::NS_URI_SF | IWORKToken::color> ParagraphFillElement; ++typedef IWORKPropertyContext<property::FontColor, IWORKColorElement, +IWORKToken::NS_URI_SF | IWORKToken::color> FontColorElement; ++typedef IWORKPropertyContext<property::FontName, IWORKStringElement, +IWORKToken::NS_URI_SF | IWORKToken::string> FontNameElement; ++typedef IWORKPropertyContext<property::HeadLineEnd, IWORKLineEndElement, +IWORKToken::NS_URI_SF | IWORKToken::line_end> HeadLineEndElement; ++typedef RefPropertyContext<property::LayoutMargins, PaddingElement, +IWORKToken::NS_URI_SF | IWORKToken::padding, +IWORKToken::NS_URI_SF | IWORKToken::padding_ref> LayoutMarginsElement; ++typedef RefPropertyContext<property::LineSpacing, LinespacingElement, +IWORKToken::NS_URI_SF | IWORKToken::linespacing, +IWORKToken::NS_URI_SF | IWORKToken::linespacing_ref> LineSpacingElement; ++typedef RefPropertyContext<property::Padding, PaddingElement, +IWORKToken::NS_URI_SF | IWORKToken::padding, +IWORKToken::NS_URI_SF | IWORKToken::padding_ref> PaddingContext; ++typedef IWORKPropertyContext<property::ParagraphFill, IWORKColorElement, +IWORKToken::NS_URI_SF | IWORKToken::color> ParagraphFillElement; + typedef RedirectPropertyContext<property::ParagraphStroke, IWORKStrokeContext> ParagraphStrokeElement; +-typedef IWORKPropertyContext<property::TailLineEnd, IWORKLineEndElement, IWORKToken::NS_URI_SF | IWORKToken::line_end> TailLineEndElement; ++typedef IWORKPropertyContext<property::TailLineEnd, IWORKLineEndElement, +IWORKToken::NS_URI_SF | IWORKToken::line_end> TailLineEndElement; + typedef PropertyDateTimeFormatElement<property::SFTCellStylePropertyDateTimeFormat> SFTCellStylePropertyDateTimeFormatElement; +-typedef RefPropertyContext<property::SFTCellStylePropertyDurationFormat, IWORKDurationFormatElement, IWORKToken::NS_URI_SF | IWORKToken::duration_format, IWORKToken::NS_URI_SF | IWORKToken::duration_format_ref> SFTCellStylePropertyDurationFormatElement; +-typedef RefPropertyContext<property::SFTCellStylePropertyNumberFormat, IWORKNumberFormatElement, IWORKToken::NS_URI_SF | IWORKToken::number_format, IWORKToken::NS_URI_SF | IWORKToken::number_format_ref> SFTCellStylePropertyNumberFormatElement; ++typedef RefPropertyContext<property::SFTCellStylePropertyDurationFormat, IWORKDurationFormatElement, +IWORKToken::NS_URI_SF | IWORKToken::duration_format, +IWORKToken::NS_URI_SF | IWORKToken::duration_format_ref> SFTCellStylePropertyDurationFormatElement; ++typedef RefPropertyContext<property::SFTCellStylePropertyNumberFormat, IWORKNumberFormatElement, +IWORKToken::NS_URI_SF | IWORKToken::number_format, +IWORKToken::NS_URI_SF | IWORKToken::number_format_ref> SFTCellStylePropertyNumberFormatElement; + typedef RedirectPropertyContext<property::SFTStrokeProperty, IWORKStrokeContext> SFTStrokePropertyElement; + typedef RedirectPropertyContext<property::Stroke, IWORKStrokeContext> StrokePropertyElement; +-typedef IWORKPropertyContext<property::TextBackground, IWORKColorElement, IWORKToken::NS_URI_SF | IWORKToken::color> TextBackgroundElement; ++typedef IWORKPropertyContext<property::TextBackground, IWORKColorElement, +IWORKToken::NS_URI_SF | IWORKToken::color> TextBackgroundElement; + +-typedef IWORKPtrPropertyContext<property::Geometry, IWORKGeometryElement, IWORKToken::NS_URI_SF | IWORKToken::geometry> GeometryElement; ++typedef IWORKPtrPropertyContext<property::Geometry, IWORKGeometryElement, +IWORKToken::NS_URI_SF | IWORKToken::geometry> GeometryElement; + +-typedef StylePropertyContext<property::FollowingLayoutStyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> FollowingLayoutStyleElement; +-typedef StylePropertyContext<property::FollowingParagraphStyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> FollowingParagraphStyleElement; +-typedef StylePropertyContext<property::LabelCharacterStyle, IWORKToken::NS_URI_SF | IWORKToken::characterstyle, IWORKToken::NS_URI_SF | IWORKToken::characterstyle_ref> LabelCharacterStyleElement; +-typedef StylePropertyContext<property::LayoutParagraphStyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> LayoutParagraphStyleElement; +-typedef StylePropertyContext<property::LayoutStyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> LayoutStyleElement; +-typedef StylePropertyContext<property::ListStyle, IWORKToken::NS_URI_SF | IWORKToken::liststyle, IWORKToken::NS_URI_SF | IWORKToken::liststyle_ref> ListStyleElement; ++typedef StylePropertyContext<property::FollowingLayoutStyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> FollowingLayoutStyleElement; ++typedef StylePropertyContext<property::FollowingParagraphStyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> FollowingParagraphStyleElement; ++typedef StylePropertyContext<property::LabelCharacterStyle, +IWORKToken::NS_URI_SF | IWORKToken::characterstyle, +IWORKToken::NS_URI_SF | IWORKToken::characterstyle_ref> LabelCharacterStyleElement; ++typedef StylePropertyContext<property::LayoutParagraphStyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> LayoutParagraphStyleElement; ++typedef StylePropertyContext<property::LayoutStyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> LayoutStyleElement; ++typedef StylePropertyContext<property::ListStyle, +IWORKToken::NS_URI_SF | IWORKToken::liststyle, +IWORKToken::NS_URI_SF | IWORKToken::liststyle_ref> ListStyleElement; + // in Pages, followed by a tocstyle, in Number by a paragraph-style ? +-typedef StylePropertyContext<property::TocStyle, IWORKToken::NS_URI_SF | IWORKToken::tocstyle, IWORKToken::NS_URI_SF | IWORKToken::tocstyle_ref +-, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> TocStyleElement; +-typedef StylePropertyContext<property::SFSeries, IWORKToken::NS_URI_SF | IWORKToken::chart_series_style, IWORKToken::NS_URI_SF | IWORKToken::chart_series_style_ref> SFSeriesElement; ++typedef StylePropertyContext<property::TocStyle, +IWORKToken::NS_URI_SF | IWORKToken::tocstyle, +IWORKToken::NS_URI_SF | IWORKToken::tocstyle_ref ++, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> TocStyleElement; ++typedef StylePropertyContext<property::SFSeries, +IWORKToken::NS_URI_SF | IWORKToken::chart_series_style, +IWORKToken::NS_URI_SF | IWORKToken::chart_series_style_ref> SFSeriesElement; + typedef RedirectPropertyContext<property::SFC2DAreaFillProperty, IWORKFillElement> SFC2DAreaFillPropertyElement; + typedef RedirectPropertyContext<property::SFC2DColumnFillProperty, IWORKFillElement> SFC2DColumnFillPropertyElement; + typedef RedirectPropertyContext<property::SFC2DMixedColumnFillProperty, IWORKFillElement> SFC2DMixedColumnFillPropertyElement; +@@ -853,25 +853,25 @@ + typedef RedirectPropertyContext<property::SFC3DColumnFillProperty, IWORKFillElement> SFC3DColumnFillPropertyElement; + typedef RedirectPropertyContext<property::SFC3DPieFillProperty, IWORKFillElement> SFC3DPieFillPropertyElement; + typedef RedirectPropertyContext<property::SFTableCellStylePropertyFill, IWORKFillElement> SFTableCellStylePropertyFillElement; +-typedef StylePropertyContext<property::SFTableStylePropertyCellStyle, IWORKToken::NS_URI_SF | IWORKToken::table_cell_style, IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref> SFTableStylePropertyCellStyleElement; +-typedef StylePropertyContext<property::SFTableStylePropertyHeaderColumnCellStyle, IWORKToken::NS_URI_SF | IWORKToken::table_cell_style, IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref> SFTableStylePropertyHeaderColumnCellStyleElement; +-typedef StylePropertyContext<property::SFTableStylePropertyHeaderRowCellStyle, IWORKToken::NS_URI_SF | IWORKToken::table_cell_style, IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref> SFTableStylePropertyHeaderRowCellStyleElement; +-typedef StylePropertyContext<property::SFTCellStylePropertyLayoutStyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> SFTCellStylePropertyLayoutStylePropertyElement; +-typedef StylePropertyContext<property::SFTCellStylePropertyParagraphStyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> SFTCellStylePropertyParagraphStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultBodyCellStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::cell_style, IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultBodyCellStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultBodyVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultBodyVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultBorderVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultBorderVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultFooterBodyVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultFooterBodyVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultFooterRowCellStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::cell_style, IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultFooterRowCellStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultFooterSeparatorVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultFooterSeparatorVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultGroupingLevelVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultGroupingLevelVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultGroupingRowCellStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::cell_style, IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultGroupingRowCellStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultHeaderBodyVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultHeaderBodyVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultHeaderColumnCellStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::cell_style, IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultHeaderColumnCellStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultHeaderRowCellStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::cell_style, IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultHeaderRowCellStylePropertyElement; +-typedef StylePropertyContext<property::SFTDefaultHeaderSeparatorVectorStyleProperty, IWORKToken::NS_URI_SF | IWORKToken::vector_style, IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultHeaderSeparatorVectorStylePropertyElement; +-typedef StylePropertyContext<property::SFTTableNameStylePropertyLayoutStyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> SFTTableNameStylePropertyLayoutStyleElement; +-typedef StylePropertyContext<property::SFTTableNameStylePropertyParagraphStyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> SFTTableNameStylePropertyParagraphStyleElement; ++typedef StylePropertyContext<property::SFTableStylePropertyCellStyle, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref> SFTableStylePropertyCellStyleElement; ++typedef StylePropertyContext<property::SFTableStylePropertyHeaderColumnCellStyle, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref> SFTableStylePropertyHeaderColumnCellStyleElement; ++typedef StylePropertyContext<property::SFTableStylePropertyHeaderRowCellStyle, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref> SFTableStylePropertyHeaderRowCellStyleElement; ++typedef StylePropertyContext<property::SFTCellStylePropertyLayoutStyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> SFTCellStylePropertyLayoutStylePropertyElement; ++typedef StylePropertyContext<property::SFTCellStylePropertyParagraphStyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> SFTCellStylePropertyParagraphStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultBodyCellStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::cell_style, +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultBodyCellStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultBodyVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultBodyVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultBorderVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultBorderVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultFooterBodyVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultFooterBodyVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultFooterRowCellStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::cell_style, +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultFooterRowCellStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultFooterSeparatorVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultFooterSeparatorVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultGroupingLevelVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultGroupingLevelVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultGroupingRowCellStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::cell_style, +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultGroupingRowCellStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultHeaderBodyVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultHeaderBodyVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultHeaderColumnCellStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::cell_style, +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultHeaderColumnCellStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultHeaderRowCellStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::cell_style, +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref> SFTDefaultHeaderRowCellStylePropertyElement; ++typedef StylePropertyContext<property::SFTDefaultHeaderSeparatorVectorStyleProperty, +IWORKToken::NS_URI_SF | IWORKToken::vector_style, +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref> SFTDefaultHeaderSeparatorVectorStylePropertyElement; ++typedef StylePropertyContext<property::SFTTableNameStylePropertyLayoutStyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle, +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref> SFTTableNameStylePropertyLayoutStyleElement; ++typedef StylePropertyContext<property::SFTTableNameStylePropertyParagraphStyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle, +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref> SFTTableNameStylePropertyParagraphStyleElement; + + typedef IWORKNumericPropertyContext<property::Alignment> AlignmentElement; + typedef IWORKNumericPropertyContext<property::Baseline> SuperscriptElement; +@@ -923,206 +923,206 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::alignment : ++ case +IWORKToken::NS_URI_SF | IWORKToken::alignment : + return std::make_shared<AlignmentElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::baselineShift : ++ case +IWORKToken::NS_URI_SF | IWORKToken::baselineShift : + return std::make_shared<BaselineShiftElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::bold : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bold : + return std::make_shared<BoldElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::capitalization : ++ case +IWORKToken::NS_URI_SF | IWORKToken::capitalization : + return std::make_shared<CapitalizationElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::columns : ++ case +IWORKToken::NS_URI_SF | IWORKToken::columns : + return std::make_shared<ColumnsPropertyElement>(getState(), *m_propMap, getState().getDictionary().m_columnSets); +- case IWORKToken::NS_URI_SF | IWORKToken::externalTextWrap: ++ case +IWORKToken::NS_URI_SF | IWORKToken::externalTextWrap: + return std::make_shared<ExternalTextWrapElement>(getState(), *m_propMap, getState().getDictionary().m_externalTextWraps); +- case IWORKToken::NS_URI_SF | IWORKToken::fill : ++ case +IWORKToken::NS_URI_SF | IWORKToken::fill : + return std::make_shared<FillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::filters : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filters : + return std::make_shared<FiltersElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::firstLineIndent : ++ case +IWORKToken::NS_URI_SF | IWORKToken::firstLineIndent : + return std::make_shared<FirstLineIndentElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::followingLayoutStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::followingLayoutStyle : + return std::make_shared<FollowingLayoutStyleElement>(getState(), *m_propMap, getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::followingParagraphStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::followingParagraphStyle : + return std::make_shared<FollowingParagraphStyleElement>(getState(), *m_propMap, getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::fontColor : ++ case +IWORKToken::NS_URI_SF | IWORKToken::fontColor : + return std::make_shared<FontColorElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::fontName : ++ case +IWORKToken::NS_URI_SF | IWORKToken::fontName : + return std::make_shared<FontNameElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::fontSize : ++ case +IWORKToken::NS_URI_SF | IWORKToken::fontSize : + return std::make_shared<FontSizeElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<GeometryElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::headLineEnd : ++ case +IWORKToken::NS_URI_SF | IWORKToken::headLineEnd : + return std::make_shared<HeadLineEndElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::italic : ++ case +IWORKToken::NS_URI_SF | IWORKToken::italic : + return std::make_shared<ItalicElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::keepLinesTogether : ++ case +IWORKToken::NS_URI_SF | IWORKToken::keepLinesTogether : + return std::make_shared<KeepLinesTogetherElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::keepWithNext : ++ case +IWORKToken::NS_URI_SF | IWORKToken::keepWithNext : + return std::make_shared<KeepWithNextElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle1 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle2 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle3 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle4 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle5 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle6 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle7 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle8 : +- case IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle9 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle1 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle2 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle3 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle4 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle5 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle6 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle7 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle8 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::labelCharacterStyle9 : + // CHANGE: this must be used to retrieve some Wingdings bullet character + return std::make_shared<LabelCharacterStyleElement>(getState(), *m_propMap, getState().getDictionary().m_characterStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::language : ++ case +IWORKToken::NS_URI_SF | IWORKToken::language : + return std::make_shared<LanguageElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutMargins : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutMargins : + return std::make_shared<LayoutMarginsElement>(getState(), *m_propMap, getState().getDictionary().m_paddings); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutParagraphStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutParagraphStyle : + return std::make_shared<LayoutParagraphStyleElement>(getState(), *m_propMap, getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutStyle : + return std::make_shared<LayoutStyleElement>(getState(), *m_propMap, getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::leftIndent : ++ case +IWORKToken::NS_URI_SF | IWORKToken::leftIndent : + return std::make_shared<LeftIndentElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::lineSpacing : ++ case +IWORKToken::NS_URI_SF | IWORKToken::lineSpacing : + return std::make_shared<LineSpacingElement>(getState(), *m_propMap, getState().getDictionary().m_lineSpacings); +- case IWORKToken::NS_URI_SF | IWORKToken::listLabelGeometries : ++ case +IWORKToken::NS_URI_SF | IWORKToken::listLabelGeometries : + return std::make_shared<IWORKListLabelGeometriesProperty>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::listLabelIndents : ++ case +IWORKToken::NS_URI_SF | IWORKToken::listLabelIndents : + return std::make_shared<IWORKListLabelIndentsProperty>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::listLabelTypes : ++ case +IWORKToken::NS_URI_SF | IWORKToken::listLabelTypes : + return std::make_shared<IWORKListLabelTypesProperty>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::listStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::listStyle : + return std::make_shared<ListStyleElement>(getState(), *m_propMap, getState().getDictionary().m_listStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::listTextIndents : ++ case +IWORKToken::NS_URI_SF | IWORKToken::listTextIndents : + return std::make_shared<IWORKListTextIndentsProperty>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::opacity : ++ case +IWORKToken::NS_URI_SF | IWORKToken::opacity : + return std::make_shared<OpacityElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::outline : ++ case +IWORKToken::NS_URI_SF | IWORKToken::outline : + return std::make_shared<OutlineElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::padding : ++ case +IWORKToken::NS_URI_SF | IWORKToken::padding : + return std::make_shared<PaddingContext>(getState(), *m_propMap, getState().getDictionary().m_paddings); +- case IWORKToken::NS_URI_SF | IWORKToken::pageBreakBefore : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pageBreakBefore : + return std::make_shared<PageBreakBeforeElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::paragraphBorderType : ++ case +IWORKToken::NS_URI_SF | IWORKToken::paragraphBorderType : + return std::make_shared<ParagraphBorderTypeElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::paragraphFill : ++ case +IWORKToken::NS_URI_SF | IWORKToken::paragraphFill : + return std::make_shared<ParagraphFillElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::paragraphStroke : ++ case +IWORKToken::NS_URI_SF | IWORKToken::paragraphStroke : + return std::make_shared<ParagraphStrokeElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::rightIndent : ++ case +IWORKToken::NS_URI_SF | IWORKToken::rightIndent : + return std::make_shared<RightIndentElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::tailLineEnd : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tailLineEnd : + return std::make_shared<TailLineEndElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::Series_0 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_1 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_2 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_3 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_4 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_5 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_6 : +- case IWORKToken::NS_URI_SF | IWORKToken::Series_7 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_0 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_1 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_2 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_3 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_4 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_5 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_6 : ++ case +IWORKToken::NS_URI_SF | IWORKToken::Series_7 : + // CHANGEME + return std::make_shared<SFSeriesElement>(getState(), *m_propMap, getState().getDictionary().m_chartSeriesStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC2DAreaFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC2DAreaFillProperty : + return std::make_shared<SFC2DAreaFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC2DColumnFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC2DColumnFillProperty : + return std::make_shared<SFC2DColumnFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC2DMixedColumnFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC2DMixedColumnFillProperty : + return std::make_shared<SFC2DMixedColumnFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC2DPieFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC2DPieFillProperty : + return std::make_shared<SFC2DPieFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC3DAreaFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC3DAreaFillProperty : + return std::make_shared<SFC3DAreaFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC3DColumnFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC3DColumnFillProperty : + return std::make_shared<SFC3DColumnFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFC3DPieFillProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFC3DPieFillProperty : + return std::make_shared<SFC2DPieFillPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTableCellStylePropertyFill : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTableCellStylePropertyFill : + return std::make_shared<SFTableCellStylePropertyFillElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTableStylePropertyCellStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTableStylePropertyCellStyle : + return std::make_shared<SFTableStylePropertyCellStyleElement>(getState(), *m_propMap, getState().getDictionary().m_tableCellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTableStylePropertyHeaderColumnCellStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTableStylePropertyHeaderColumnCellStyle : + return std::make_shared<SFTableStylePropertyHeaderColumnCellStyleElement>(getState(), *m_propMap, getState().getDictionary().m_tableCellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTableStylePropertyHeaderRowCellStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTableStylePropertyHeaderRowCellStyle : + return std::make_shared<SFTableStylePropertyHeaderRowCellStyleElement>(getState(), *m_propMap, getState().getDictionary().m_tableCellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyNumberFormat : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyNumberFormat : + return std::make_shared<SFTCellStylePropertyNumberFormatElement>(getState(), *m_propMap, getState().getDictionary().m_numberFormats); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyDateTimeFormat : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyDateTimeFormat : + return std::make_shared<SFTCellStylePropertyDateTimeFormatElement>(getState(), *m_propMap, getState().getDictionary().m_dateTimeFormats); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyDurationFormat : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyDurationFormat : + return std::make_shared<SFTCellStylePropertyDurationFormatElement>(getState(), *m_propMap, getState().getDictionary().m_durationFormats); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyLayoutStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyLayoutStyle : + return std::make_shared<SFTCellStylePropertyLayoutStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyParagraphStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTCellStylePropertyParagraphStyle : + return std::make_shared<SFTCellStylePropertyParagraphStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultBodyCellStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultBodyCellStyleProperty : + return std::make_shared<SFTDefaultBodyCellStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultBodyVectorStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultBodyVectorStyleProperty : + return std::make_shared<SFTDefaultBodyVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultBorderVectorStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultBorderVectorStyleProperty : + return std::make_shared<SFTDefaultBorderVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultFooterBodyVectorStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultFooterBodyVectorStyleProperty : + return std::make_shared<SFTDefaultFooterBodyVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultFooterRowCellStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultFooterRowCellStyleProperty : + return std::make_shared<SFTDefaultFooterRowCellStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultFooterSeparatorVectorStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultFooterSeparatorVectorStyleProperty : + return std::make_shared<SFTDefaultFooterSeparatorVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel0VectorStyleProperty: +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel1VectorStyleProperty: +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel2VectorStyleProperty: +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel3VectorStyleProperty: +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel4VectorStyleProperty: +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel5VectorStyleProperty: ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel0VectorStyleProperty: ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel1VectorStyleProperty: ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel2VectorStyleProperty: ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel3VectorStyleProperty: ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel4VectorStyleProperty: ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingLevel5VectorStyleProperty: + return std::make_shared<SFTDefaultGroupingLevelVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell0StyleProperty : +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell1StyleProperty : +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell2StyleProperty : +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell3StyleProperty : +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell4StyleProperty : +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell5StyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell0StyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell1StyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell2StyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell3StyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell4StyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultGroupingRowCell5StyleProperty : + return std::make_shared<SFTDefaultGroupingRowCellStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderBodyVectorStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderBodyVectorStyleProperty : + return std::make_shared<SFTDefaultHeaderBodyVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderColumnCellStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderColumnCellStyleProperty : + return std::make_shared<SFTDefaultHeaderColumnCellStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderRowCellStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderRowCellStyleProperty : + return std::make_shared<SFTDefaultHeaderRowCellStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderSeparatorVectorStyleProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTDefaultHeaderSeparatorVectorStyleProperty : + return std::make_shared<SFTDefaultHeaderSeparatorVectorStylePropertyElement>(getState(), *m_propMap, getState().getDictionary().m_vectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTTableNameStylePropertyLayoutStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTTableNameStylePropertyLayoutStyle : + return std::make_shared<SFTTableNameStylePropertyLayoutStyleElement>(getState(), *m_propMap, getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTTableNameStylePropertyParagraphStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTTableNameStylePropertyParagraphStyle : + return std::make_shared<SFTTableNameStylePropertyParagraphStyleElement>(getState(), *m_propMap, getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTHeaderColumnRepeatsProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTHeaderColumnRepeatsProperty : + return std::make_shared<SFTHeaderColumnRepeatsPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTHeaderRowRepeatsProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTHeaderRowRepeatsProperty : + return std::make_shared<SFTHeaderRowRepeatsPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTStrokeProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTStrokeProperty : + return std::make_shared<SFTStrokePropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::SFTTableBandedRowsProperty : ++ case +IWORKToken::NS_URI_SF | IWORKToken::SFTTableBandedRowsProperty : + return std::make_shared<SFTTableBandedRowsPropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::spaceAfter : ++ case +IWORKToken::NS_URI_SF | IWORKToken::spaceAfter : + return std::make_shared<SpaceAfterElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::spaceBefore : ++ case +IWORKToken::NS_URI_SF | IWORKToken::spaceBefore : + return std::make_shared<SpaceBeforeElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::strikethru : ++ case +IWORKToken::NS_URI_SF | IWORKToken::strikethru : + return std::make_shared<StrikethruElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::stroke : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stroke : + return std::make_shared<StrokePropertyElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::superscript : ++ case +IWORKToken::NS_URI_SF | IWORKToken::superscript : + return std::make_shared<SuperscriptElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::tabs : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabs : + return std::make_shared<TabsProperty>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::textBackground : ++ case +IWORKToken::NS_URI_SF | IWORKToken::textBackground : + return std::make_shared<TextBackgroundElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::tocStyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tocStyle : + return std::make_shared<TocStyleElement>(getState(), *m_propMap, getState().getDictionary().m_tocStyles, getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tracking : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tracking : + return std::make_shared<TrackingElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::underline : ++ case +IWORKToken::NS_URI_SF | IWORKToken::underline : + return std::make_shared<UnderlineElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::verticalAlignment : ++ case +IWORKToken::NS_URI_SF | IWORKToken::verticalAlignment : + return std::make_shared<VerticalAlignmentElement>(getState(), *m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::widowControl : ++ case +IWORKToken::NS_URI_SF | IWORKToken::widowControl : + return std::make_shared<WidowControlElement>(getState(), *m_propMap); + default: + if (name) +--- src/lib/contexts/IWORKShapeContext.cpp ++++ src/lib/contexts/IWORKShapeContext.cpp +@@ -30,7 +30,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::graphic_style, IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::graphic_style, +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref> GraphicStyleContext; + } + + IWORKShapeContext::IWORKShapeContext(IWORKXMLParserState &state) +@@ -46,12 +46,12 @@ + { + switch (name) + { +- case IWORKToken::sfclass | IWORKToken::NS_URI_SFA : // shape ++ case +IWORKToken::sfclass | IWORKToken::NS_URI_SFA : // shape + break; +- case IWORKToken::locked | IWORKToken::NS_URI_SF : ++ case +IWORKToken::locked | IWORKToken::NS_URI_SF : + m_locked=bool_cast(value); + break; +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + IWORKXMLElementContextBase::attribute(name, value); + break; + default : +@@ -82,15 +82,15 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : + return std::make_shared<IWORKPathElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : + return std::make_shared<GraphicStyleContext>(getState(), m_style, getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text : + return std::make_shared<IWORKTextElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME + return std::make_shared<IWORKWrapElement>(getState(), m_wrap); + default: + ETONYEK_DEBUG_MSG(("IWORKShapeContext::element: find some unknown element\n")); +--- src/lib/contexts/IWORKSizeElement.cpp ++++ src/lib/contexts/IWORKSizeElement.cpp +@@ -30,10 +30,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::w : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::w : + m_width = try_double_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::h : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::h : + m_height = try_double_cast(value); + break; + default: +--- src/lib/contexts/IWORKSpanElement.cpp ++++ src/lib/contexts/IWORKSpanElement.cpp +@@ -32,7 +32,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::style : + m_style=getState().getStyleByName(value, getState().getDictionary().m_characterStyles); + break; + default: +@@ -45,35 +45,35 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::br : // ok to ignore ? ++ case +IWORKToken::NS_URI_SF | IWORKToken::br : // ok to ignore ? + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::crbr : +- case IWORKToken::NS_URI_SF | IWORKToken::intratopicbr : +- case IWORKToken::NS_URI_SF | IWORKToken::lnbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::crbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::intratopicbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::lnbr : + ensureOpened(); + return std::make_shared<IWORKBrContext>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::contbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::contbr : + m_delayedBreak=IWORK_BREAK_COLUMN; + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::pgbr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pgbr : + m_delayedBreak=IWORK_BREAK_PAGE; + return IWORKXMLContextPtr_t(); +- case IWORKToken::NS_URI_SF | IWORKToken::tab : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tab : + ensureOpened(); + return std::make_shared<IWORKTabElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::date_time : ++ case +IWORKToken::NS_URI_SF | IWORKToken::date_time : + ensureOpened(); + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_DATETIME); +- case IWORKToken::NS_URI_SF | IWORKToken::filename : ++ case +IWORKToken::NS_URI_SF | IWORKToken::filename : + ensureOpened(); + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_FILENAME); +- case IWORKToken::NS_URI_SF | IWORKToken::page_count : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_count : + ensureOpened(); + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_PAGECOUNT); +- case IWORKToken::NS_URI_SF | IWORKToken::page_number : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_number : + ensureOpened(); + return std::make_shared<IWORKFieldElement>(getState(),IWORK_FIELD_PAGENUMBER); +- case IWORKToken::NS_URI_SF | IWORKToken::insertion_point : ++ case +IWORKToken::NS_URI_SF | IWORKToken::insertion_point : + return IWORKXMLContextPtr_t(); + default: + ETONYEK_DEBUG_MSG(("IWORKSpanElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKStringElement.cpp ++++ src/lib/contexts/IWORKStringElement.cpp +@@ -22,7 +22,7 @@ + + void IWORKStringElement::attribute(const int name, const char *const value) + { +- if ((IWORKToken::NS_URI_SFA | IWORKToken::string) == name) ++ if ((+IWORKToken::NS_URI_SFA | IWORKToken::string) == name) + m_string = value; + } + +--- src/lib/contexts/IWORKStrokeContext.cpp ++++ src/lib/contexts/IWORKStrokeContext.cpp +@@ -46,7 +46,7 @@ + + void ElementElement::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::val)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::val)) + m_value = double_cast(value); + } + +@@ -78,7 +78,7 @@ + + IWORKXMLContextPtr_t PatternContainerElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::element)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::element)) + { + if (m_element) + { +@@ -128,7 +128,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::type: ++ case +IWORKToken::NS_URI_SF | IWORKToken::type: + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::empty : +@@ -145,9 +145,9 @@ + break; + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::phase: ++ case +IWORKToken::NS_URI_SF | IWORKToken::phase: + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID: ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID: + return IWORKXMLElementContextBase::attribute(name, value); + default: + ETONYEK_DEBUG_MSG(("PatternElement::attribute[IWORKStrokeContext.cpp]: unknown attribute\n")); +@@ -156,7 +156,7 @@ + + IWORKXMLContextPtr_t PatternElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::pattern)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::pattern)) + return std::make_shared<PatternContainerElement>(getState(), m_pattern->m_values); + return IWORKXMLContextPtr_t(); + } +@@ -250,7 +250,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::cap : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cap : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::butt : +@@ -263,7 +263,7 @@ + ETONYEK_DEBUG_MSG(("StrokeElement::attribute[IWORKStrokeContext.cpp]: find unknown cap\n")); + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::join : ++ case +IWORKToken::NS_URI_SF | IWORKToken::join : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::miter : +@@ -276,10 +276,10 @@ + ETONYEK_DEBUG_MSG(("StrokeElement::attribute[IWORKStrokeContext.cpp]: find unknown join\n")); + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::width : ++ case +IWORKToken::NS_URI_SF | IWORKToken::width : + m_width = double_cast(value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; + default: +@@ -292,13 +292,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::color : ++ case +IWORKToken::NS_URI_SF | IWORKToken::color : + return std::make_shared<IWORKColorElement>(getState(), m_color); +- case IWORKToken::NS_URI_SF | IWORKToken::parameters : // in calligraphy-stroke defines angle, chisel, scale ++ case +IWORKToken::NS_URI_SF | IWORKToken::parameters : // in calligraphy-stroke defines angle, chisel, scale + break; +- case IWORKToken::NS_URI_SF | IWORKToken::pattern : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pattern : + return std::make_shared<PatternElement>(getState(), m_pattern); +- case IWORKToken::NS_URI_SF | IWORKToken::pattern_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pattern_ref : + return std::make_shared<IWORKRefContext>(getState(), m_patternRef); + default: + ETONYEK_DEBUG_MSG(("StrokeElement::element[IWORKStrokeContext.cpp]: find unknown element\n")); +@@ -345,15 +345,15 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::frame : ++ case +IWORKToken::NS_URI_SF | IWORKToken::frame : + return std::make_shared<FrameElement>(getState(), m_value); +- case IWORKToken::NS_URI_SF | IWORKToken::calligraphy_stroke : +- case IWORKToken::NS_URI_SF | IWORKToken::manipulated_stroke : +- case IWORKToken::NS_URI_SF | IWORKToken::stroke : ++ case +IWORKToken::NS_URI_SF | IWORKToken::calligraphy_stroke : ++ case +IWORKToken::NS_URI_SF | IWORKToken::manipulated_stroke : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stroke : + return std::make_shared<StrokeElement>(getState(), m_value); +- case IWORKToken::NS_URI_SF | IWORKToken::stroke_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stroke_ref : + return std::make_shared<IWORKRefContext>(getState(), m_ref); +- case IWORKToken::NS_URI_SF | IWORKToken::null : ++ case +IWORKToken::NS_URI_SF | IWORKToken::null : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKStrokeContext::element: unknown element\n")); +--- src/lib/contexts/IWORKStyleContainer.h ++++ src/lib/contexts/IWORKStyleContainer.h +@@ -82,7 +82,7 @@ + return m_context; + case RefTokenId : + return std::make_shared<IWORKRefContext>(getState(), m_ref); +- case IWORKToken::NS_URI_SF | IWORKToken::null: ++ case +IWORKToken::NS_URI_SF | IWORKToken::null: + return IWORKXMLContextPtr_t(); + case IWORKToken::INVALID_TOKEN: // TokenId2 and RefTokenId2 are optional, so avoid unintentional match + break; +--- src/lib/contexts/IWORKStyleContext.cpp ++++ src/lib/contexts/IWORKStyleContext.cpp +@@ -49,21 +49,21 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::ident : ++ case +IWORKToken::NS_URI_SF | IWORKToken::ident : + m_ident = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::parent_ident : ++ case +IWORKToken::NS_URI_SF | IWORKToken::parent_ident : + m_parentIdent = value; + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::sfclass : +- case IWORKToken::NS_URI_SF | IWORKToken::cell_style_default_line_height : // attribute of cell-style USEME +- case IWORKToken::NS_URI_SF | IWORKToken::locked : // attribute of graphic-style +- case IWORKToken::NS_URI_SF | IWORKToken::name : +- case IWORKToken::NS_URI_SF | IWORKToken::seriesIndex : // attribute of chart-series-style +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_style_name_internal : // attribute of tabular-style ++ case +IWORKToken::NS_URI_SFA | IWORKToken::sfclass : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cell_style_default_line_height : // attribute of cell-style USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::locked : // attribute of graphic-style ++ case +IWORKToken::NS_URI_SF | IWORKToken::name : ++ case +IWORKToken::NS_URI_SF | IWORKToken::seriesIndex : // attribute of chart-series-style ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_style_name_internal : // attribute of tabular-style + break; + default : + ETONYEK_DEBUG_MSG(("IWORKStyleContext::attribute: find some unknown attribute\n")); +@@ -76,7 +76,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::property_map : ++ case +IWORKToken::NS_URI_SF | IWORKToken::property_map : + return std::make_shared<IWORKPropertyMapElement>(getState(), m_props); + default : + ETONYEK_DEBUG_MSG(("IWORKStyleContext::element: find some unknown element\n")); +--- src/lib/contexts/IWORKStylesContext.cpp ++++ src/lib/contexts/IWORKStylesContext.cpp +@@ -28,68 +28,68 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::connection_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::connection_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::headline_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::headline_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_headlineStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::liststyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::liststyle : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_listStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::cell_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cell_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::chart_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::chart_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_chartStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::chart_series_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::chart_series_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_chartSeriesStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::graphic_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::graphic_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::characterstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::characterstyle : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_characterStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::table_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tableStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::table_cell_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tableCellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::table_vector_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_vector_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tableVectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tabularStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tocstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tocstyle : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tocStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::vector_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::vector_style : + return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_vectorStyles); + +- case IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_cellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::characterstyle_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::characterstyle_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_characterStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::chart_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::chart_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_chartStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::chart_series_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::chart_series_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_chartSeriesStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::connection_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::connection_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_graphicStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_layoutStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::liststyle_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::liststyle_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_listStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_paragraphStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::table_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tableStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tableCellStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::table_vector_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::table_vector_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tableVectorStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tabularStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::tocstyle_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tocstyle_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tocStyles); +- case IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref : + return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_vectorStyles); + default: + ETONYEK_DEBUG_MSG(("IWORKStylesContext::element: find some unknown element %d\n", int(name))); +--- src/lib/contexts/IWORKStylesheetBase.cpp ++++ src/lib/contexts/IWORKStylesheetBase.cpp +@@ -37,9 +37,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::styles : + return std::make_shared<IWORKStylesContext>(getState(), false); +- case IWORKToken::NS_URI_SF | IWORKToken::anon_styles : ++ case +IWORKToken::NS_URI_SF | IWORKToken::anon_styles : + return std::make_shared<IWORKStylesContext>(getState(), true); + default: + ETONYEK_DEBUG_MSG(("IWORKStylesContext::element: find some unknown element\n")); +--- src/lib/contexts/IWORKTableInfoElement.cpp ++++ src/lib/contexts/IWORKTableInfoElement.cpp +@@ -36,7 +36,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::table_style, IWORKToken::NS_URI_SF | IWORKToken::table_style_ref> TableStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::table_style, +IWORKToken::NS_URI_SF | IWORKToken::table_style_ref> TableStyleContext; + } + + namespace +@@ -66,7 +66,7 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + IWORKXMLElementContextBase::attribute(name, value); + break; + default : +@@ -79,7 +79,7 @@ + { + switch (name) + { +- case IWORKToken::text_storage | IWORKToken::NS_URI_SF : ++ case +IWORKToken::text_storage | IWORKToken::NS_URI_SF : + getState().m_tableData->m_type = IWORK_CELL_TYPE_TEXT; + return std::make_shared<IWORKTextStorageElement>(getState()); + default : +@@ -124,7 +124,7 @@ + { + switch (name) + { +- case IWORKToken::number | IWORKToken::NS_URI_SF : ++ case +IWORKToken::number | IWORKToken::NS_URI_SF : + getState().m_tableData->m_type = IWORK_CELL_TYPE_NUMBER; + return std::make_shared<IWORKNumberElement<double> >(getState(), m_value); + default: +@@ -177,10 +177,10 @@ + { + switch (name) + { +- case IWORKToken::tableCellPreferredHeight | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellPreferredHeight | IWORKToken::NS_URI_SF : + get(m_value).m_preferredHeight=try_double_cast(value); + break; +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : // must we store this element ? ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : // must we store this element ? + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default : +@@ -193,21 +193,21 @@ + { + switch (name) + { +- case IWORKToken::tableCellStyle_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellStyle_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); +- case IWORKToken::tableCellMinXSide_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellMinXSide_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_minXBorderRef); +- case IWORKToken::tableCellMaxXSide_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellMaxXSide_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_maxXBorderRef); +- case IWORKToken::tableCellMinYSide_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellMinYSide_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_minYBorderRef); +- case IWORKToken::tableCellMaxYSide_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellMaxYSide_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_maxYBorderRef); +- case IWORKToken::tableCellContent | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellContent | IWORKToken::NS_URI_SF : + return std::make_shared<TableCellContentElement>(getState()); +- case IWORKToken::tableCellFormula | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellFormula | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKTableCellFormulaElement>(getState()); +- case IWORKToken::tableCellValue | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellValue | IWORKToken::NS_URI_SF : + return std::make_shared<TableCellValueElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("TableCellElement::element[IWORKTableInfoElement.cpp]: find some unknown element\n")); +@@ -341,7 +341,7 @@ + + namespace + { +-typedef IWORKMutableArrayElement<IWORKTableCell, TableCellElement, IWORKPushCollector, IWORKToken::NS_URI_SF | IWORKToken::table_cell, IWORKToken::NS_URI_SF | IWORKToken::table_cell_ref> TableCellArrayElement; ++typedef IWORKMutableArrayElement<IWORKTableCell, TableCellElement, IWORKPushCollector, +IWORKToken::NS_URI_SF | IWORKToken::table_cell, +IWORKToken::NS_URI_SF | IWORKToken::table_cell_ref> TableCellArrayElement; + } + + namespace +@@ -371,9 +371,9 @@ + { + switch (name) + { +- case IWORKToken::tableCellArrayCellsByColumn | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellArrayCellsByColumn | IWORKToken::NS_URI_SF : + return std::make_shared<TableCellArrayElement>(getState(), m_dict, getState().getDictionary().m_tableCells, m_columnsCell); +- case IWORKToken::tableCellArrayCellsByRow | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableCellArrayCellsByRow | IWORKToken::NS_URI_SF : + return std::make_shared<TableCellArrayElement>(getState(), m_dict, getState().getDictionary().m_tableCells, m_rowsCell); + default: + ETONYEK_DEBUG_MSG(("TableModelCellsElement::element[IWORKTableInfoElement.cpp]: find some unknown element\n")); +@@ -414,19 +414,19 @@ + { + switch (name) + { +- case IWORKToken::tableVectorAlong | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorAlong | IWORKToken::NS_URI_SF : + get(m_value).m_along=try_double_cast(value); + break; +- case IWORKToken::tableVectorAxis | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorAxis | IWORKToken::NS_URI_SF : + get(m_value).m_axis=try_int_cast(value); + break; +- case IWORKToken::tableVectorBegin | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorBegin | IWORKToken::NS_URI_SF : + get(m_value).m_beginCell=try_int_cast(value); + break; +- case IWORKToken::tableVectorEnd | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorEnd | IWORKToken::NS_URI_SF : + get(m_value).m_endCell=try_int_cast(value); + break; +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default : +@@ -439,7 +439,7 @@ + { + switch (name) + { +- case IWORKToken::tableVectorStyle_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorStyle_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); + default: + ETONYEK_DEBUG_MSG(("TableVectorElement::element[IWORKTableInfoElement.cpp]: find some unknown element\n")); +@@ -459,7 +459,7 @@ + + namespace + { +-typedef IWORKMutableArrayElement<IWORKTableVector, TableVectorElement, IWORKPushCollector, IWORKToken::NS_URI_SF | IWORKToken::table_vector> TableVectorArrayElement; ++typedef IWORKMutableArrayElement<IWORKTableVector, TableVectorElement, IWORKPushCollector, +IWORKToken::NS_URI_SF | IWORKToken::table_vector> TableVectorArrayElement; + } + + namespace +@@ -489,9 +489,9 @@ + { + switch (name) + { +- case IWORKToken::tableVectorArrayColumnVectors | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorArrayColumnVectors | IWORKToken::NS_URI_SF : + return std::make_shared<TableVectorArrayElement>(getState(), m_dict, getState().getDictionary().m_tableVectors, m_columnsVector); +- case IWORKToken::tableVectorArrayRowVectors | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableVectorArrayRowVectors | IWORKToken::NS_URI_SF : + return std::make_shared<TableVectorArrayElement>(getState(), m_dict, getState().getDictionary().m_tableVectors, m_rowsVector); + default: + ETONYEK_DEBUG_MSG(("TableModelVectorsElement::element[IWORKTableInfoElement.cpp]: find some unknown element\n")); +@@ -592,13 +592,13 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + m_id=value; + break; +- case IWORKToken::tableModelIsHeaderColumn | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableModelIsHeaderColumn | IWORKToken::NS_URI_SF : + m_hasHeaderColumn =bool_cast(value); + break; +- case IWORKToken::tableModelIsHeaderRow | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableModelIsHeaderRow | IWORKToken::NS_URI_SF : + m_hasHeaderRow =bool_cast(value); + break; + default: +@@ -616,15 +616,15 @@ + { + switch (name) + { +- case IWORKToken::tableModelStyle_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableModelStyle_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); +- case IWORKToken::tableModelPartitionSource | IWORKToken::NS_URI_SF : // contains id + frame data ++ case +IWORKToken::tableModelPartitionSource | IWORKToken::NS_URI_SF : // contains id + frame data + break; +- case IWORKToken::tableModelVectors | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableModelVectors | IWORKToken::NS_URI_SF : + return std::make_shared<TableModelVectorsElement>(getState(), m_columnsVector, m_rowsVector); +- case IWORKToken::tableModelCells | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableModelCells | IWORKToken::NS_URI_SF : + return std::make_shared<TableModelCellsElement>(getState(), m_columnsCell, m_rowsCell); +- case IWORKToken::tableModelTableID | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableModelTableID | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKStringElement>(getState(), m_tableId); + default: + ETONYEK_DEBUG_MSG(("TableInfoTableElement::element[IWORKTableInfoElement.cpp]: find some unknown element\n")); +@@ -669,13 +669,13 @@ + { + switch (name) + { +- case IWORKToken::geometry | IWORKToken::NS_URI_SF : ++ case +IWORKToken::geometry | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::style | IWORKToken::NS_URI_SF : ++ case +IWORKToken::style | IWORKToken::NS_URI_SF : + return std::make_shared<TableStyleContext>(getState(), m_style, getState().getDictionary().m_tableStyles); +- case IWORKToken::tableInfoTable | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tableInfoTable | IWORKToken::NS_URI_SF : + return std::make_shared<TableInfoTableElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME + return std::make_shared<IWORKWrapElement>(getState(), m_wrap); + default: + ETONYEK_DEBUG_MSG(("IWORKTableInfoElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKTabsElement.cpp ++++ src/lib/contexts/IWORKTabsElement.cpp +@@ -48,7 +48,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::align : ++ case +IWORKToken::NS_URI_SF | IWORKToken::align : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::center : +@@ -67,7 +67,7 @@ + ETONYEK_DEBUG_MSG(("TabstopElement::attribute: unknown alignment %s\n", value)); + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::pos : ++ case +IWORKToken::NS_URI_SF | IWORKToken::pos : + get(m_tab).m_pos = double_cast(value); + break; + default : +@@ -92,7 +92,7 @@ + m_current.reset(); + } + +- if ((IWORKToken::NS_URI_SF | IWORKToken::tabstop) == name) ++ if ((+IWORKToken::NS_URI_SF | IWORKToken::tabstop) == name) + return std::make_shared<TabstopElement>(getState(), m_current); + + return IWORKXMLContextPtr_t(); +--- src/lib/contexts/IWORKTabularInfoElement.cpp ++++ src/lib/contexts/IWORKTabularInfoElement.cpp +@@ -33,7 +33,7 @@ + + namespace + { +-typedef IWORKStyleContainer<IWORKToken::NS_URI_SF | IWORKToken::tabular_style, IWORKToken::NS_URI_SF | IWORKToken::tabular_style_ref> TabularStyleContext; ++typedef IWORKStyleContainer<+IWORKToken::NS_URI_SF | IWORKToken::tabular_style, +IWORKToken::NS_URI_SF | IWORKToken::tabular_style_ref> TabularStyleContext; + } + + IWORKTabularInfoElement::IWORKTabularInfoElement(IWORKXMLParserState &state) +@@ -49,7 +49,7 @@ + { + switch (name) + { +- case PAG1Token::order | PAG1Token::NS_URI_SL : ++ case +PAG1Token::order | PAG1Token::NS_URI_SL : + m_order=try_int_cast(value); + break; + default: +@@ -70,15 +70,15 @@ + { + switch (name) + { +- case IWORKToken::geometry | IWORKToken::NS_URI_SF : ++ case +IWORKToken::geometry | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKGeometryElement>(getState()); +- case IWORKToken::style | IWORKToken::NS_URI_SF : ++ case +IWORKToken::style | IWORKToken::NS_URI_SF : + return std::make_shared<TabularStyleContext>(getState(), m_style, getState().getDictionary().m_tabularStyles); +- case IWORKToken::tabular_model | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tabular_model | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKTabularModelElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_model_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_model_ref : + return std::make_shared<IWORKRefContext>(getState(), m_tableRef); +- case IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap : // USEME + return std::make_shared<IWORKWrapElement>(getState(), m_wrap); + default: + ETONYEK_DEBUG_MSG(("IWORKTabularInfoElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKTabularModelElement.cpp ++++ src/lib/contexts/IWORKTabularModelElement.cpp +@@ -64,10 +64,10 @@ + { + switch (name) + { +- case IWORKToken::column | IWORKToken::NS_URI_SF : ++ case +IWORKToken::column | IWORKToken::NS_URI_SF : + m_column=lexical_cast<unsigned>(value); + break; +- case IWORKToken::row | IWORKToken::NS_URI_SF : ++ case +IWORKToken::row | IWORKToken::NS_URI_SF : + m_row=lexical_cast<unsigned>(value); + break; + default : // none +@@ -103,7 +103,7 @@ + { + switch (name) + { +- case IWORKToken::cell_coordinates | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_coordinates | IWORKToken::NS_URI_SF : + return std::make_shared<CellCoordinates>(getState(), m_coordinates); + default: + return IWORKXMLEmptyContextBase::element(name); +@@ -134,9 +134,9 @@ + { + switch (name) + { +- case IWORKToken::value_ref | IWORKToken::NS_URI_SFA : // attributes: sfa:IDREF and sfa:class ++ case +IWORKToken::value_ref | IWORKToken::NS_URI_SFA : // attributes: sfa:IDREF and sfa:class + return std::make_shared<IWORKRefContext>(getState(), m_ref); +- case IWORKToken::key | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::key | IWORKToken::NS_URI_SFA : + return std::make_shared<CellCommentMappingKey>(getState(), m_coordinates); + default: + return IWORKXMLEmptyContextBase::element(name); +@@ -172,7 +172,7 @@ + { + switch (name) + { +- case IWORKToken::pair | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::pair | IWORKToken::NS_URI_SFA : + return std::make_shared<CellCommentMappingPair>(getState(), m_coordinateCommentRefMap); + default: + return IWORKXMLEmptyContextBase::element(name); +@@ -210,9 +210,9 @@ + { + switch (name) + { +- case IWORKToken::implicit_format_type | IWORKToken::NS_URI_SF : // find 256|261|269 ++ case +IWORKToken::implicit_format_type | IWORKToken::NS_URI_SF : // find 256|261|269 + break; +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : // must we store this element ? ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : // must we store this element ? + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default : +@@ -225,11 +225,11 @@ + { + switch (name) + { +- case IWORKToken::date_format | IWORKToken::NS_URI_SF : // USEME ++ case +IWORKToken::date_format | IWORKToken::NS_URI_SF : // USEME + return std::make_shared<IWORKDateTimeFormatElement>(getState(), m_dateTimeFormat); +- case IWORKToken::duration_format | IWORKToken::NS_URI_SF : // USEME ++ case +IWORKToken::duration_format | IWORKToken::NS_URI_SF : // USEME + return std::make_shared<IWORKDurationFormatElement>(getState(), m_durationFormat); +- case IWORKToken::number_format | IWORKToken::NS_URI_SF : // USEME ++ case +IWORKToken::number_format | IWORKToken::NS_URI_SF : // USEME + return std::make_shared<IWORKNumberFormatElement>(getState(), m_numberFormat); + default: + ETONYEK_DEBUG_MSG(("CfElement::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -267,23 +267,23 @@ + { + switch (name) + { +- case IWORKToken::col_span | IWORKToken::NS_URI_SF : ++ case +IWORKToken::col_span | IWORKToken::NS_URI_SF : + getState().m_tableData->m_columnSpan = lexical_cast<unsigned>(value); + break; +- case IWORKToken::ct | IWORKToken::NS_URI_SF : ++ case +IWORKToken::ct | IWORKToken::NS_URI_SF : + getState().m_tableData->m_cellMove = lexical_cast<unsigned>(value); + break; +- case IWORKToken::row_span | IWORKToken::NS_URI_SF : ++ case +IWORKToken::row_span | IWORKToken::NS_URI_SF : + getState().m_tableData->m_rowSpan = lexical_cast<unsigned>(value); + break; +- case IWORKToken::s | IWORKToken::NS_URI_SF : ++ case +IWORKToken::s | IWORKToken::NS_URI_SF : + getState().m_tableData->m_style = getState().getStyleByName(value, getState().getDictionary().m_cellStyles); + break; +- case IWORKToken::f | IWORKToken::NS_URI_SF : // format? +- case IWORKToken::h | IWORKToken::NS_URI_SF : // height +- case IWORKToken::w | IWORKToken::NS_URI_SF : // width ++ case +IWORKToken::f | IWORKToken::NS_URI_SF : // format? ++ case +IWORKToken::h | IWORKToken::NS_URI_SF : // height ++ case +IWORKToken::w | IWORKToken::NS_URI_SF : // width + break; +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : // can appear in result, store me? ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : // can appear in result, store me? + IWORKXMLEmptyContextBase::attribute(name,value); + break; + default: +@@ -295,9 +295,9 @@ + { + switch (name) + { +- case IWORKToken::cf | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cf | IWORKToken::NS_URI_SF : + return std::make_shared<CfElement>(getState()); +- case IWORKToken::cf_ref | IWORKToken::NS_URI_SF: ++ case +IWORKToken::cf_ref | IWORKToken::NS_URI_SF: + return std::make_shared<IWORKRefContext>(getState(), m_ref); + default: + ETONYEK_DEBUG_MSG(("CellContextBase::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -399,14 +399,14 @@ + { + switch (name) + { +- case IWORKToken::fitting_width | IWORKToken::NS_URI_SF : +- case IWORKToken::nc | IWORKToken::NS_URI_SF : // look like the number of cells in column +- case IWORKToken::ncoc | IWORKToken::NS_URI_SF : +- case IWORKToken::nsc | IWORKToken::NS_URI_SF : // look like the number of special cells in column, ie covered cell +- case IWORKToken::manually_sized | IWORKToken::NS_URI_SF : +- case IWORKToken::preferred_width | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fitting_width | IWORKToken::NS_URI_SF : ++ case +IWORKToken::nc | IWORKToken::NS_URI_SF : // look like the number of cells in column ++ case +IWORKToken::ncoc | IWORKToken::NS_URI_SF : ++ case +IWORKToken::nsc | IWORKToken::NS_URI_SF : // look like the number of special cells in column, ie covered cell ++ case +IWORKToken::manually_sized | IWORKToken::NS_URI_SF : ++ case +IWORKToken::preferred_width | IWORKToken::NS_URI_SF : + break; +- case IWORKToken::width | IWORKToken::NS_URI_SF : ++ case +IWORKToken::width | IWORKToken::NS_URI_SF : + getState().m_tableData->m_columnSizes.push_back(IWORKColumnRowSize(lexical_cast<double>(value))); + break; + default : +@@ -419,7 +419,7 @@ + { + switch (name) + { +- case IWORKToken::grouping_display | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grouping_display | IWORKToken::NS_URI_SF : + { + static bool first=true; + if (first) +@@ -459,7 +459,7 @@ + { + switch (name) + { +- case IWORKToken::grid_column | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grid_column | IWORKToken::NS_URI_SF : + return std::make_shared<GridColumnElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("ColumnsElement::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -491,7 +491,7 @@ + { + switch (name) + { +- case IWORKToken::v | IWORKToken::NS_URI_SF : ++ case +IWORKToken::v | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + break; + default : +@@ -523,7 +523,7 @@ + { + switch (name) + { +- case IWORKToken::cell_date | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_date | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + break; + default : +@@ -554,7 +554,7 @@ + { + switch (name) + { +- case IWORKToken::du | IWORKToken::NS_URI_SF : ++ case +IWORKToken::du | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + getState().m_tableData->m_type = IWORK_CELL_TYPE_DURATION; + break; +@@ -587,8 +587,8 @@ + { + switch (name) + { +- case IWORKToken::s | IWORKToken::NS_URI_SFA : +- case IWORKToken::string | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::s | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::string | IWORKToken::NS_URI_SFA : + getState().m_tableData->m_content = value; + getState().m_tableData->m_type = IWORK_CELL_TYPE_TEXT; + break; +@@ -602,8 +602,8 @@ + { + switch (name) + { +- case IWORKToken::so | IWORKToken::NS_URI_SF : +- case IWORKToken::cell_storage | IWORKToken::NS_URI_SF : ++ case +IWORKToken::so | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_storage | IWORKToken::NS_URI_SF : + if (getState().m_tableData->m_content) + { + ETONYEK_DEBUG_MSG(("found a text cell with both simple and formatted content\n")); +@@ -641,7 +641,7 @@ + { + switch (name) + { +- case IWORKToken::v | IWORKToken::NS_URI_SF : ++ case +IWORKToken::v | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + break; + default : +@@ -672,7 +672,7 @@ + { + switch (name) + { +- case IWORKToken::ho | IWORKToken::NS_URI_SF : // horizontal overlap? ++ case +IWORKToken::ho | IWORKToken::NS_URI_SF : // horizontal overlap? + break; + default : + CellContextBase::attribute(name, value); +@@ -717,7 +717,7 @@ + { + switch (name) + { +- case IWORKToken::ct | IWORKToken::NS_URI_SF : ++ case +IWORKToken::ct | IWORKToken::NS_URI_SF : + if (m_isResult && !getState().m_currentText) + getState().m_currentText = getCollector().createText(getState().m_langManager, false); + return std::make_shared<CtElement>(getState()); +@@ -751,7 +751,7 @@ + { + switch (name) + { +- case IWORKToken::v | IWORKToken::NS_URI_SF : ++ case +IWORKToken::v | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + break; + default : +@@ -781,16 +781,16 @@ + { + switch (name) + { +- case IWORKToken::rb | IWORKToken::NS_URI_SF : ++ case +IWORKToken::rb | IWORKToken::NS_URI_SF : + return std::make_shared<RbElement>(getState()); + break; +- case IWORKToken::rd | IWORKToken::NS_URI_SF : ++ case +IWORKToken::rd | IWORKToken::NS_URI_SF : + return std::make_shared<DElement>(getState(), true); + break; +- case IWORKToken::rn | IWORKToken::NS_URI_SF : ++ case +IWORKToken::rn | IWORKToken::NS_URI_SF : + return std::make_shared<NElement>(getState(), true); + break; +- case IWORKToken::rt | IWORKToken::NS_URI_SF : ++ case +IWORKToken::rt | IWORKToken::NS_URI_SF : + return std::make_shared<TElement>(getState(), true); + break; + default: +@@ -824,11 +824,11 @@ + { + switch (name) + { +- case IWORKToken::fo | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fo | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKFoElement>(getState()); +- case IWORKToken::of | IWORKToken::NS_URI_SF : ++ case +IWORKToken::of | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKOfElement>(getState()); +- case IWORKToken::r | IWORKToken::NS_URI_SF : ++ case +IWORKToken::r | IWORKToken::NS_URI_SF : + return std::make_shared<RElement>(getState()); + default: + break; +@@ -877,9 +877,9 @@ + { + switch (name) + { +- case IWORKToken::group_formula_string | IWORKToken::NS_URI_SF : // value +- case IWORKToken::group_formula_value | IWORKToken::NS_URI_SF : // value +- case IWORKToken::group_formula_value_valid | IWORKToken::NS_URI_SF : // true or false ++ case +IWORKToken::group_formula_string | IWORKToken::NS_URI_SF : // value ++ case +IWORKToken::group_formula_value | IWORKToken::NS_URI_SF : // value ++ case +IWORKToken::group_formula_value_valid | IWORKToken::NS_URI_SF : // true or false + break; + default : + CellContextBase::attribute(name, value); +@@ -890,7 +890,7 @@ + { + switch (name) + { +- case IWORKToken::groupings_element | IWORKToken::NS_URI_SF : ++ case +IWORKToken::groupings_element | IWORKToken::NS_URI_SF : + { + static bool first=true; + if (first) +@@ -900,7 +900,7 @@ + } + return IWORKXMLContextPtr_t(); + } +- case IWORKToken::fo | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fo | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKFoElement>(getState()); + default: + break; +@@ -1026,7 +1026,7 @@ + + IWORKXMLContextPtr_t MenuChoicesElement::element(int name) + { +- if (name == (IWORKToken::t | IWORKToken::NS_URI_SF)) ++ if (name == (+IWORKToken::t | IWORKToken::NS_URI_SF)) + return std::make_shared<TElementInMenu>(getState(), m_contentMap); + + return IWORKXMLContextPtr_t(); +@@ -1040,10 +1040,10 @@ + { + switch (name) + { +- case IWORKToken::menu_choices | IWORKToken::NS_URI_SF : ++ case +IWORKToken::menu_choices | IWORKToken::NS_URI_SF : + return std::make_shared<MenuChoicesElement>(getState(), m_contentMap); + break; +- case IWORKToken::proxied_cell_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::proxied_cell_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_ref); + break; + default: +@@ -1101,11 +1101,11 @@ + { + switch (name) + { +- case IWORKToken::ct | IWORKToken::NS_URI_SF : ++ case +IWORKToken::ct | IWORKToken::NS_URI_SF : + getState().m_tableData->m_cellMove = lexical_cast<unsigned>(value); + break; +- case IWORKToken::ho | IWORKToken::NS_URI_SF : // offset to main cell +- case IWORKToken::vo | IWORKToken::NS_URI_SF : ++ case +IWORKToken::ho | IWORKToken::NS_URI_SF : // offset to main cell ++ case +IWORKToken::vo | IWORKToken::NS_URI_SF : + break; + default : + CellContextBase::attribute(name,value); +@@ -1141,14 +1141,14 @@ + { + switch (name) + { +- case IWORKToken::v | IWORKToken::NS_URI_SF : ++ case +IWORKToken::v | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + break; +- case IWORKToken::increment | IWORKToken::NS_URI_SF : +- case IWORKToken::min_value | IWORKToken::NS_URI_SF : +- case IWORKToken::max_value | IWORKToken::NS_URI_SF : +- case IWORKToken::slider_orientation | IWORKToken::NS_URI_SF : +- case IWORKToken::slider_position | IWORKToken::NS_URI_SF : ++ case +IWORKToken::increment | IWORKToken::NS_URI_SF : ++ case +IWORKToken::min_value | IWORKToken::NS_URI_SF : ++ case +IWORKToken::max_value | IWORKToken::NS_URI_SF : ++ case +IWORKToken::slider_orientation | IWORKToken::NS_URI_SF : ++ case +IWORKToken::slider_position | IWORKToken::NS_URI_SF : + break; + default : + CellContextBase::attribute(name, value); +@@ -1179,12 +1179,12 @@ + { + switch (name) + { +- case IWORKToken::v | IWORKToken::NS_URI_SF : ++ case +IWORKToken::v | IWORKToken::NS_URI_SF : + getState().m_tableData->m_content = value; + break; +- case IWORKToken::increment | IWORKToken::NS_URI_SF : +- case IWORKToken::min_value | IWORKToken::NS_URI_SF : +- case IWORKToken::max_value | IWORKToken::NS_URI_SF : ++ case +IWORKToken::increment | IWORKToken::NS_URI_SF : ++ case +IWORKToken::min_value | IWORKToken::NS_URI_SF : ++ case +IWORKToken::max_value | IWORKToken::NS_URI_SF : + break; + default : + CellContextBase::attribute(name, value); +@@ -1214,8 +1214,8 @@ + { + switch (name) + { +- case IWORKToken::h | IWORKToken::NS_URI_SFA : // horizontal size +- case IWORKToken::w | IWORKToken::NS_URI_SFA : // vertical size ++ case +IWORKToken::h | IWORKToken::NS_URI_SFA : // horizontal size ++ case +IWORKToken::w | IWORKToken::NS_URI_SFA : // vertical size + break; + default : + ETONYEK_DEBUG_MSG(("ContentSizeElement::attribute[IWORKTabularModelElement.cpp]: found unexpected attribute\n")); +@@ -1267,25 +1267,25 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + if (!m_isResult) + { + ETONYEK_DEBUG_MSG(("GenericCellElement::attribute: found unexpected id field\n")); + } + m_id=value; + break; +- case IWORKToken::col | IWORKToken::NS_URI_SF : ++ case +IWORKToken::col | IWORKToken::NS_URI_SF : + getState().m_tableData->m_column = (unsigned) int_cast(value); + break; +- case IWORKToken::flags | IWORKToken::NS_URI_SF : // find 4 ? ++ case +IWORKToken::flags | IWORKToken::NS_URI_SF : // find 4 ? + break; +- case IWORKToken::row | IWORKToken::NS_URI_SF : ++ case +IWORKToken::row | IWORKToken::NS_URI_SF : + getState().m_tableData->m_row = (unsigned) int_cast(value); + break; +- case IWORKToken::col_span | IWORKToken::NS_URI_SF : ++ case +IWORKToken::col_span | IWORKToken::NS_URI_SF : + getState().m_tableData->m_columnSpan = lexical_cast<unsigned>(value); + break; +- case IWORKToken::row_span | IWORKToken::NS_URI_SF : ++ case +IWORKToken::row_span | IWORKToken::NS_URI_SF : + getState().m_tableData->m_rowSpan = lexical_cast<unsigned>(value); + break; + default : +@@ -1297,9 +1297,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); +- case IWORKToken::NS_URI_SF | IWORKToken::content_size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::content_size : + return std::make_shared<ContentSizeElement>(getState()); + default: + break; +@@ -1383,7 +1383,7 @@ + { + switch (name) + { +- case IWORKToken::value | IWORKToken::NS_URI_SF : ++ case +IWORKToken::value | IWORKToken::NS_URI_SF : + getState().m_tableData->m_type = IWORK_CELL_TYPE_BOOL; + getState().m_tableData->m_content = value; + break; +@@ -1416,7 +1416,7 @@ + { + switch (name) + { +- case IWORKToken::cell_date | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_date | IWORKToken::NS_URI_SF : + { + IWORKDateTimeData time; + if (value && sscanf(value,"%d-%d-%dT%d:%d:%f",&time.m_year, &time.m_month, &time.m_day, &time.m_hour, &time.m_minute, &time.m_second)==6) +@@ -1458,7 +1458,7 @@ + { + switch (name) + { +- case IWORKToken::value | IWORKToken::NS_URI_SF : ++ case +IWORKToken::value | IWORKToken::NS_URI_SF : + getState().m_tableData->m_type = IWORK_CELL_TYPE_NUMBER; + getState().m_tableData->m_content = value; + break; +@@ -1489,8 +1489,8 @@ + { + switch (name) + { +- case IWORKToken::horizontal_offset | IWORKToken::NS_URI_SF : +- case IWORKToken::vertical_offset | IWORKToken::NS_URI_SF : ++ case +IWORKToken::horizontal_offset | IWORKToken::NS_URI_SF : ++ case +IWORKToken::vertical_offset | IWORKToken::NS_URI_SF : + break; + default: + return GenericCellElement::attribute(name,value); +@@ -1534,7 +1534,7 @@ + { + switch (name) + { +- case IWORKToken::cell_text | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_text | IWORKToken::NS_URI_SF : + return std::make_shared<CtElement>(getState()); + default: + break; +@@ -1568,13 +1568,13 @@ + { + switch (name) + { +- case IWORKToken::result_bool_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::result_bool_cell | IWORKToken::NS_URI_SF : + return std::make_shared<BoolCellElement>(getState(), true); +- case IWORKToken::result_date_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::result_date_cell | IWORKToken::NS_URI_SF : + return std::make_shared<DateCellElement>(getState(), true); +- case IWORKToken::result_number_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::result_number_cell | IWORKToken::NS_URI_SF : + return std::make_shared<NumberCellElement>(getState(), true); +- case IWORKToken::result_text_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::result_text_cell | IWORKToken::NS_URI_SF : + return std::make_shared<TextCellElement>(getState(), true); + default: + break; +@@ -1605,9 +1605,9 @@ + { + switch (name) + { +- case IWORKToken::formula | IWORKToken::NS_URI_SF : ++ case +IWORKToken::formula | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKFormulaElement>(getState()); +- case IWORKToken::result_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::result_cell | IWORKToken::NS_URI_SF : + return std::make_shared<ResultCellElement>(getState()); + default: + break; +@@ -1651,43 +1651,43 @@ + { + switch (name) + { +- case IWORKToken::cb | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cb | IWORKToken::NS_URI_SF : + return std::make_shared<CbElement>(getState()); +- case IWORKToken::d | IWORKToken::NS_URI_SF : ++ case +IWORKToken::d | IWORKToken::NS_URI_SF : + return std::make_shared<DElement>(getState()); +- case IWORKToken::du | IWORKToken::NS_URI_SF : ++ case +IWORKToken::du | IWORKToken::NS_URI_SF : + return std::make_shared<DuElement>(getState()); +- case IWORKToken::f | IWORKToken::NS_URI_SF : ++ case +IWORKToken::f | IWORKToken::NS_URI_SF : + return std::make_shared<FElement>(getState()); +- case IWORKToken::g | IWORKToken::NS_URI_SF : ++ case +IWORKToken::g | IWORKToken::NS_URI_SF : + return std::make_shared<GElement>(getState()); +- case IWORKToken::grouping | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grouping | IWORKToken::NS_URI_SF : + return std::make_shared<GroupingElement>(getState()); +- case IWORKToken::n | IWORKToken::NS_URI_SF : ++ case +IWORKToken::n | IWORKToken::NS_URI_SF : + return std::make_shared<NElement>(getState()); +- case IWORKToken::o | IWORKToken::NS_URI_SF : ++ case +IWORKToken::o | IWORKToken::NS_URI_SF : + return std::make_shared<OElement>(getState()); +- case IWORKToken::pm | IWORKToken::NS_URI_SF : ++ case +IWORKToken::pm | IWORKToken::NS_URI_SF : + return std::make_shared<PmElement>(getState()); +- case IWORKToken::s | IWORKToken::NS_URI_SF : ++ case +IWORKToken::s | IWORKToken::NS_URI_SF : + return std::make_shared<SElement>(getState()); +- case IWORKToken::sl | IWORKToken::NS_URI_SF : ++ case +IWORKToken::sl | IWORKToken::NS_URI_SF : + return std::make_shared<SlElement>(getState()); +- case IWORKToken::st | IWORKToken::NS_URI_SF : ++ case +IWORKToken::st | IWORKToken::NS_URI_SF : + return std::make_shared<StElement>(getState()); +- case IWORKToken::t | IWORKToken::NS_URI_SF : ++ case +IWORKToken::t | IWORKToken::NS_URI_SF : + return std::make_shared<TElement>(getState()); +- case IWORKToken::date_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::date_cell | IWORKToken::NS_URI_SF : + return std::make_shared<DateCellElement>(getState()); +- case IWORKToken::generic_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::generic_cell | IWORKToken::NS_URI_SF : + return std::make_shared<GenericCellElement>(getState()); +- case IWORKToken::formula_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::formula_cell | IWORKToken::NS_URI_SF : + return std::make_shared<FormulaCellElement>(getState()); +- case IWORKToken::number_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::number_cell | IWORKToken::NS_URI_SF : + return std::make_shared<NumberCellElement>(getState()); +- case IWORKToken::span_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::span_cell | IWORKToken::NS_URI_SF : + return std::make_shared<SpanCellElement>(getState()); +- case IWORKToken::text_cell | IWORKToken::NS_URI_SF : ++ case +IWORKToken::text_cell | IWORKToken::NS_URI_SF : + return std::make_shared<TextCellElement>(getState()); + default: + break; +@@ -1729,10 +1729,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::start_index : ++ case +IWORKToken::NS_URI_SF | IWORKToken::start_index : + m_startIndex = int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::stop_index : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stop_index : + m_stopIndex = int_cast(value); + break; + default: +@@ -1784,10 +1784,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::gridline_index : ++ case +IWORKToken::NS_URI_SF | IWORKToken::gridline_index : + m_gridlineIndex_=int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::count : // number of element ++ case +IWORKToken::NS_URI_SF | IWORKToken::count : // number of element + m_count=int_cast(value); + break; + default : +@@ -1800,7 +1800,7 @@ + { + switch (name) + { +- case IWORKToken::vector_style_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::vector_style_ref | IWORKToken::NS_URI_SF : + return std::make_shared<VectorStyleRefElement>(getState(), m_line); + default: + ETONYEK_DEBUG_MSG(("StyleRunElement::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -1862,7 +1862,7 @@ + { + switch (name) + { +- case IWORKToken::style_run | IWORKToken::NS_URI_SF : ++ case +IWORKToken::style_run | IWORKToken::NS_URI_SF : + return std::make_shared<StyleRunElement>(getState(), m_gridLines, m_maxLines); + default: + ETONYEK_DEBUG_MSG(("GridlineElement::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -1894,15 +1894,15 @@ + { + switch (name) + { +- case IWORKToken::height | IWORKToken::NS_URI_SF : ++ case +IWORKToken::height | IWORKToken::NS_URI_SF : + getState().m_tableData->m_rowSizes.push_back(IWORKColumnRowSize(lexical_cast<double>(value))); + break; +- case IWORKToken::fitting_height | IWORKToken::NS_URI_SF : +- case IWORKToken::manually_sized | IWORKToken::NS_URI_SF : +- case IWORKToken::nc | IWORKToken::NS_URI_SF : // look like the number of cells in row... +- case IWORKToken::ncoc | IWORKToken::NS_URI_SF : +- case IWORKToken::nsc | IWORKToken::NS_URI_SF : // look like the number of special cells in row, ie covered cell +- case IWORKToken::preferred_height | IWORKToken::NS_URI_SF : ++ case +IWORKToken::fitting_height | IWORKToken::NS_URI_SF : ++ case +IWORKToken::manually_sized | IWORKToken::NS_URI_SF : ++ case +IWORKToken::nc | IWORKToken::NS_URI_SF : // look like the number of cells in row... ++ case +IWORKToken::ncoc | IWORKToken::NS_URI_SF : ++ case +IWORKToken::nsc | IWORKToken::NS_URI_SF : // look like the number of special cells in row, ie covered cell ++ case +IWORKToken::preferred_height | IWORKToken::NS_URI_SF : + break; + default : + ETONYEK_DEBUG_MSG(("GridRowElement::attribute[IWORKTabularModelElement.cpp]: find some unknown attribute\n")); +@@ -1934,7 +1934,7 @@ + { + switch (name) + { +- case IWORKToken::grid_row | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grid_row | IWORKToken::NS_URI_SF : + return std::make_shared<GridRowElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("RowsElement::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -1967,10 +1967,10 @@ + { + switch (name) + { +- case IWORKToken::numcols | IWORKToken::NS_URI_SF : ++ case +IWORKToken::numcols | IWORKToken::NS_URI_SF : + getState().m_tableData->m_numColumns = (unsigned) int_cast(value); + break; +- case IWORKToken::numrows | IWORKToken::NS_URI_SF : ++ case +IWORKToken::numrows | IWORKToken::NS_URI_SF : + getState().m_tableData->m_numRows = (unsigned) int_cast(value); + break; + default : +@@ -1983,15 +1983,15 @@ + { + switch (name) + { +- case IWORKToken::columns | IWORKToken::NS_URI_SF : ++ case +IWORKToken::columns | IWORKToken::NS_URI_SF : + return std::make_shared<ColumnsElement>(getState()); +- case IWORKToken::datasource | IWORKToken::NS_URI_SF : ++ case +IWORKToken::datasource | IWORKToken::NS_URI_SF : + return std::make_shared<DatasourceElement>(getState()); +- case IWORKToken::rows | IWORKToken::NS_URI_SF : ++ case +IWORKToken::rows | IWORKToken::NS_URI_SF : + return std::make_shared<RowsElement>(getState()); +- case IWORKToken::vertical_gridline_styles | IWORKToken::NS_URI_SF : ++ case +IWORKToken::vertical_gridline_styles | IWORKToken::NS_URI_SF : + return std::make_shared<GridlineElement>(getState(), getState().m_tableData->m_verticalLines, getState().m_tableData->m_numRows); +- case IWORKToken::horizontal_gridline_styles | IWORKToken::NS_URI_SF : ++ case +IWORKToken::horizontal_gridline_styles | IWORKToken::NS_URI_SF : + return std::make_shared<GridlineElement>(getState(), getState().m_tableData->m_horizontalLines, getState().m_tableData->m_numColumns); + default: + ETONYEK_DEBUG_MSG(("GridElement::element[IWORKTabularModelElement.cpp]: find some unknown element\n")); +@@ -2020,22 +2020,22 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + m_id=value; + break; +- case IWORKToken::name | IWORKToken::NS_URI_SF : ++ case +IWORKToken::name | IWORKToken::NS_URI_SF : + m_tableName = value; + break; +- case IWORKToken::num_footer_rows | IWORKToken::NS_URI_SF : ++ case +IWORKToken::num_footer_rows | IWORKToken::NS_URI_SF : + m_footerRows = try_int_cast(value); + break; +- case IWORKToken::num_header_columns | IWORKToken::NS_URI_SF : ++ case +IWORKToken::num_header_columns | IWORKToken::NS_URI_SF : + m_headerColumns = try_int_cast(value); + break; +- case IWORKToken::num_header_rows | IWORKToken::NS_URI_SF : ++ case +IWORKToken::num_header_rows | IWORKToken::NS_URI_SF : + m_headerRows = try_int_cast(value); + break; +- case IWORKToken::id | IWORKToken::NS_URI_SF : ++ case +IWORKToken::id | IWORKToken::NS_URI_SF : + m_tableId = "SFTGlobalID_" + string(value); + break; + default: +@@ -2058,18 +2058,18 @@ + { + switch (name) + { +- case IWORKToken::grid | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grid | IWORKToken::NS_URI_SF : + return std::make_shared<GridElement>(getState()); +- case IWORKToken::tabular_style_ref | IWORKToken::NS_URI_SF : ++ case +IWORKToken::tabular_style_ref | IWORKToken::NS_URI_SF : + return std::make_shared<IWORKRefContext>(getState(), m_styleRef); + +- case IWORKToken::cell_comment_mapping | IWORKToken::NS_URI_SF : ++ case +IWORKToken::cell_comment_mapping | IWORKToken::NS_URI_SF : + return std::make_shared<CellCommentMapping>(getState(), m_coordinateCommentRefMap); +- case IWORKToken::error_warning_mapping | IWORKToken::NS_URI_SF : +- case IWORKToken::filterset | IWORKToken::NS_URI_SF : +- case IWORKToken::grouping_order | IWORKToken::NS_URI_SF : +- case IWORKToken::grouping_state | IWORKToken::NS_URI_SF : +- case IWORKToken::sort | IWORKToken::NS_URI_SF : ++ case +IWORKToken::error_warning_mapping | IWORKToken::NS_URI_SF : ++ case +IWORKToken::filterset | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grouping_order | IWORKToken::NS_URI_SF : ++ case +IWORKToken::grouping_state | IWORKToken::NS_URI_SF : ++ case +IWORKToken::sort | IWORKToken::NS_URI_SF : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKTabularModelElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKTextBodyElement.cpp ++++ src/lib/contexts/IWORKTextBodyElement.cpp +@@ -31,7 +31,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::layout : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layout : + if (m_layout || m_para) + { + ETONYEK_DEBUG_MSG(("IWORKTextBodyElement::element: layout following another element, not allowed, skipping\n")); +@@ -42,7 +42,7 @@ + return std::make_shared<IWORKLayoutElement>(getState()); + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::p : ++ case +IWORKToken::NS_URI_SF | IWORKToken::p : + if (m_layout) + { + ETONYEK_DEBUG_MSG(("IWORKTextBodyElement::element: paragraph following layout, not allowed, skipping\n")); +@@ -57,9 +57,9 @@ + return std::make_shared<IWORKPElement>(getState()); + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::insertion_point : +- case IWORKToken::NS_URI_SF | IWORKToken::page_start : // with attribute page-index +- case IWORKToken::NS_URI_SF | IWORKToken::selection_end : ++ case +IWORKToken::NS_URI_SF | IWORKToken::insertion_point : ++ case +IWORKToken::NS_URI_SF | IWORKToken::page_start : // with attribute page-index ++ case +IWORKToken::NS_URI_SF | IWORKToken::selection_end : + break; + default: + ETONYEK_DEBUG_MSG(("IWORKTextBodyElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKTextElement.cpp ++++ src/lib/contexts/IWORKTextElement.cpp +@@ -30,13 +30,13 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : // TODO: storeme ? ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : // TODO: storeme ? + IWORKXMLElementContextBase::attribute(name, value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : ++ case +IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : + m_layoutStyleRef = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::tscale : // find one time with value 90 ++ case +IWORKToken::NS_URI_SF | IWORKToken::tscale : // find one time with value 90 + break; + default: + ETONYEK_DEBUG_MSG(("IWORKTextElement::attribute: find some unknown attribute\n")); +@@ -47,7 +47,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::text_storage : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_storage : + return std::make_shared<IWORKTextStorageElement>(getState(), m_stylesheet); + default: + ETONYEK_DEBUG_MSG(("IWORKTextElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKTextLabelElement.cpp ++++ src/lib/contexts/IWORKTextLabelElement.cpp +@@ -83,16 +83,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLEmptyContextBase::attribute(name, value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::first : ++ case +IWORKToken::NS_URI_SF | IWORKToken::first : + m_first = try_int_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::format : ++ case +IWORKToken::NS_URI_SF | IWORKToken::format : + m_format = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::type : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::bullet : +--- src/lib/contexts/IWORKTextStorageElement.cpp ++++ src/lib/contexts/IWORKTextStorageElement.cpp +@@ -41,9 +41,9 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::stylesheet_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::stylesheet_ref : + return std::make_shared<IWORKRefContext>(getState(), m_stylesheetId); +- case IWORKToken::NS_URI_SF | IWORKToken::text_body : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_body : + return std::make_shared<IWORKTextBodyElement>(getState()); + default: + ETONYEK_DEBUG_MSG(("IWORKTextStorageElement::element: find some unknown element\n")); +--- src/lib/contexts/IWORKWrapElement.cpp ++++ src/lib/contexts/IWORKWrapElement.cpp +@@ -48,7 +48,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::path : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::path : + try + { + m_path = std::make_shared<IWORKPath>(value); +@@ -58,10 +58,10 @@ + ETONYEK_DEBUG_MSG(("PathElement::attribute[IWORKWrapElement.cpp]: '%s' is not a valid path\n", value)); + } + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : // USEME ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : // USEME + IWORKXMLEmptyContextBase::attribute(name, value); + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::version : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::version : + break; + default: + ETONYEK_DEBUG_MSG(("PathElement::attribute[IWORKWrapElement.cpp]: unexpected attribute\n")); +@@ -73,7 +73,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::bezier : ++ case +IWORKToken::NS_URI_SF | IWORKToken::bezier : + return std::make_shared<IWORKBezierElement>(getState(), m_path); + default: + ETONYEK_DEBUG_MSG(("PathElement::element[IWORKWrapElement.cpp]: find unknown element\n")); +@@ -97,10 +97,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + IWORKXMLElementContextBase::attribute(name, value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::attachment_wrap_type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::attachment_wrap_type : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::aligned: +@@ -114,10 +114,10 @@ + break; + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::alpha_threshold : ++ case +IWORKToken::NS_URI_SF | IWORKToken::alpha_threshold : + get(m_wrap).m_alphaThreshold=double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::direction : ++ case +IWORKToken::NS_URI_SF | IWORKToken::direction : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::both : +@@ -134,10 +134,10 @@ + break; + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::floating_wrap_enabled : ++ case +IWORKToken::NS_URI_SF | IWORKToken::floating_wrap_enabled : + get(m_wrap).m_floatingWrapEnabled=bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::floating_wrap_type : ++ case +IWORKToken::NS_URI_SF | IWORKToken::floating_wrap_type : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::directional: +@@ -154,13 +154,13 @@ + break; + } + break; +- case IWORKToken::NS_URI_SF | IWORKToken::inline_wrap_enabled : ++ case +IWORKToken::NS_URI_SF | IWORKToken::inline_wrap_enabled : + get(m_wrap).m_inlineWrapEnabled=bool_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::margin : ++ case +IWORKToken::NS_URI_SF | IWORKToken::margin : + get(m_wrap).m_margin=double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::wrap_style : ++ case +IWORKToken::NS_URI_SF | IWORKToken::wrap_style : + switch (getState().getTokenizer().getId(value)) + { + case IWORKToken::regular : +@@ -219,9 +219,9 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::path : ++ case +IWORKToken::NS_URI_SF | IWORKToken::path : + return std::make_shared<PathElement>(getState(), get(m_wrap).m_path); +- case IWORKToken::NS_URI_SF | IWORKToken::geometry : ++ case +IWORKToken::NS_URI_SF | IWORKToken::geometry : + return std::make_shared<IWORKGeometryElement>(getState(), get(m_wrap).m_geometry); + default: + ETONYEK_DEBUG_MSG(("IWORKWrapElement::element: find unknown element\n")); +--- src/lib/contexts/KEY1ContentElement.cpp ++++ src/lib/contexts/KEY1ContentElement.cpp +@@ -48,9 +48,9 @@ + { + switch (name) + { +- case KEY1Token::div | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::div | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1DivElement>(getState(), m_spanStyle.getStyle(), m_divStyle.getStyle(), m_delayedLineBreak); +- case KEY1Token::span | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::span | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1SpanElement>(getState(), m_spanStyle.getStyle(), m_delayedLineBreak); + default: + ETONYEK_DEBUG_MSG(("KEY1ContentElement::element: unknown element\n")); +--- src/lib/contexts/KEY1DivElement.cpp ++++ src/lib/contexts/KEY1DivElement.cpp +@@ -157,7 +157,7 @@ + { + switch (name) + { +- case KEY1Token::span | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::span | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1SpanElement>(getState(), m_spanStyle.getStyle(), m_delayedLineBreak); + default: + ETONYEK_DEBUG_MSG(("KEY1DivElement::element: unknown element\n")); +--- src/lib/contexts/KEY1StylesContext.cpp ++++ src/lib/contexts/KEY1StylesContext.cpp +@@ -246,15 +246,15 @@ + { + switch (name) + { +- case KEY1Token::dash_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::dash_style | KEY1Token::NS_URI_KEY : + return std::make_shared<PatternStyleElement>(getState(), m_pattern); +- case KEY1Token::fill_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::fill_style | KEY1Token::NS_URI_KEY : + return std::make_shared<KEY1FillElement>(getState(), m_fill); +- case KEY1Token::line_head_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::line_head_style | KEY1Token::NS_URI_KEY : + return std::make_shared<MarkerStyleElement>(getState(), m_lineHead); +- case KEY1Token::line_tail_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::line_tail_style | KEY1Token::NS_URI_KEY : + return std::make_shared<MarkerStyleElement>(getState(), m_lineTail); +- case KEY1Token::shadow_style | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::shadow_style | KEY1Token::NS_URI_KEY : + return std::make_shared<ShadowStyleElement>(getState(), m_shadow); + default : + ETONYEK_DEBUG_MSG(("KEY1StylesContext::element[KEY1StylesContext.cpp]: unknown element\n")); +--- src/lib/contexts/KEY1TableElement.cpp ++++ src/lib/contexts/KEY1TableElement.cpp +@@ -269,16 +269,16 @@ + { + switch (name) + { +- case KEY1Token::content | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::content | KEY1Token::NS_URI_KEY : + if (isCollector()) + { + assert(!getState().m_currentText); + getState().m_currentText = getCollector().createText(getState().m_langManager, false); + } + return std::make_shared<KEY1ContentElement>(getState()); +- case KEY1Token::dict | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::dict | KEY1Token::NS_URI_KEY : + break; +- case KEY1Token::node | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::node | KEY1Token::NS_URI_KEY : + return std::make_shared<NodeElement>(getState(), m_table); + default: + ETONYEK_DEBUG_MSG(("ElementElement::element[KEY1TableElement.cpp]: unknown element\n")); +@@ -360,7 +360,7 @@ + { + switch (name) + { +- case KEY1Token::dict | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::dict | KEY1Token::NS_URI_KEY : + break; + default: + ETONYEK_DEBUG_MSG(("SegmentElement::element[KEY1TableElement.cpp]: unknown element\n")); +@@ -418,11 +418,11 @@ + { + switch (name) + { +- case KEY1Token::dict | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::dict | KEY1Token::NS_URI_KEY : + break; +- case KEY1Token::element | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::element | KEY1Token::NS_URI_KEY : + return std::make_shared<ElementElement>(getState(), *m_tableData); +- case KEY1Token::segment | KEY1Token::NS_URI_KEY : ++ case +KEY1Token::segment | KEY1Token::NS_URI_KEY : + return std::make_shared<SegmentElement>(getState(), *m_tableData); + default: + ETONYEK_DEBUG_MSG(("KEY1TableElement::element: unknown element\n")); +--- src/lib/contexts/KEY2StyleContext.cpp ++++ src/lib/contexts/KEY2StyleContext.cpp +@@ -32,20 +32,20 @@ + namespace + { + template<class Property> +-class NumericPropertyContext : public IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, IWORKToken::NS_URI_SF | IWORKToken::number, KEY2Token::NS_URI_KEY | KEY2Token::number> ++class NumericPropertyContext : public IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, +IWORKToken::NS_URI_SF | IWORKToken::number, +KEY2Token::NS_URI_KEY | KEY2Token::number> + { +- typedef IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, IWORKToken::NS_URI_SF | IWORKToken::number, KEY2Token::NS_URI_KEY | KEY2Token::number> Parent_t; ++ typedef IWORKPropertyContext<Property, IWORKNumberElement<typename IWORKPropertyInfo<Property>::ValueType>, +IWORKToken::NS_URI_SF | IWORKToken::number, +KEY2Token::NS_URI_KEY | KEY2Token::number> Parent_t; + + public: + NumericPropertyContext(IWORKXMLParserState &state, IWORKPropertyMap &propMap); + }; + +-typedef IWORKValueContext<bool, IWORKNumberElement<bool>, IWORKToken::NS_URI_SF | IWORKToken::number, KEY2Token::NS_URI_KEY | KEY2Token::number> BoolProperty; +-typedef IWORKValueContext<double, IWORKNumberElement<double>, IWORKToken::NS_URI_SF | IWORKToken::number, KEY2Token::NS_URI_KEY | KEY2Token::number> DoubleProperty; +-typedef IWORKValueContext<int, IWORKNumberElement<int>, IWORKToken::NS_URI_SF | IWORKToken::number, KEY2Token::NS_URI_KEY | KEY2Token::number> IntProperty; +-typedef IWORKNumericPropertyContext<property::AnimationAutoPlay, KEY2Token::NS_URI_KEY | KEY2Token::number> AnimationAutoPlayPropertyElement; +-typedef IWORKNumericPropertyContext<property::AnimationDelay, KEY2Token::NS_URI_KEY | KEY2Token::number> AnimationDelayPropertyElement; +-typedef IWORKNumericPropertyContext<property::AnimationDuration, KEY2Token::NS_URI_KEY | KEY2Token::number> AnimationDurationPropertyElement; ++typedef IWORKValueContext<bool, IWORKNumberElement<bool>, +IWORKToken::NS_URI_SF | IWORKToken::number, +KEY2Token::NS_URI_KEY | KEY2Token::number> BoolProperty; ++typedef IWORKValueContext<double, IWORKNumberElement<double>, +IWORKToken::NS_URI_SF | IWORKToken::number, +KEY2Token::NS_URI_KEY | KEY2Token::number> DoubleProperty; ++typedef IWORKValueContext<int, IWORKNumberElement<int>, +IWORKToken::NS_URI_SF | IWORKToken::number, +KEY2Token::NS_URI_KEY | KEY2Token::number> IntProperty; ++typedef IWORKNumericPropertyContext<property::AnimationAutoPlay, +KEY2Token::NS_URI_KEY | KEY2Token::number> AnimationAutoPlayPropertyElement; ++typedef IWORKNumericPropertyContext<property::AnimationDelay, +KEY2Token::NS_URI_KEY | KEY2Token::number> AnimationDelayPropertyElement; ++typedef IWORKNumericPropertyContext<property::AnimationDuration, +KEY2Token::NS_URI_KEY | KEY2Token::number> AnimationDurationPropertyElement; + } + + namespace +@@ -74,10 +74,10 @@ + { + switch (name) + { +- case IWORKToken::ID | IWORKToken::NS_URI_SFA : ++ case +IWORKToken::ID | IWORKToken::NS_URI_SFA : + KEY2XMLElementContextBase::attribute(name, value); + break; +- case KEY2Token::type | KEY2Token::NS_URI_KEY : ++ case +KEY2Token::type | KEY2Token::NS_URI_KEY : + { + std::string val(value); + if (val=="none") +@@ -108,18 +108,18 @@ + // find <animationAuto/animationDelay/animationDuration... in Keynote 5 files + switch (name) + { +- case KEY2Token::NS_URI_KEY | KEY2Token::animationAuto : +- case KEY2Token::animationAuto : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::animationAuto : ++ case +KEY2Token::animationAuto : + return std::make_shared<BoolProperty>(getState(), get(m_transition).m_automatic); +- case KEY2Token::animationDelay : +- case KEY2Token::NS_URI_KEY | KEY2Token::animationDelay : ++ case +KEY2Token::animationDelay : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::animationDelay : + return std::make_shared<DoubleProperty>(getState(), get(m_transition).m_delay); +- case KEY2Token::animationDuration : +- case KEY2Token::NS_URI_KEY | KEY2Token::animationDuration : ++ case +KEY2Token::animationDuration : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::animationDuration : + return std::make_shared<DoubleProperty>(getState(), get(m_transition).m_duration); +- case KEY2Token::NS_URI_KEY | KEY2Token::direction : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::direction : + return std::make_shared<IntProperty>(getState(), get(m_transition).m_direction); +- case KEY2Token::NS_URI_KEY | KEY2Token::BGBuildDurationProperty : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::BGBuildDurationProperty : + break; + default: + { +@@ -173,7 +173,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::transition_attributes : ++ case +IWORKToken::NS_URI_SF | IWORKToken::transition_attributes : + return std::make_shared<TransitionAttributesElement>(getState(), m_transition); + default: + ETONYEK_DEBUG_MSG(("TransitionElement::element[KEY2StyleContext.cpp]: found unexpected element %d\n", name)); +@@ -214,16 +214,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::animationAutoPlay : +- case KEY2Token::NS_URI_KEY | KEY2Token::animationAutoPlay : ++ case +IWORKToken::NS_URI_SF | IWORKToken::animationAutoPlay : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::animationAutoPlay : + return std::make_shared<AnimationAutoPlayPropertyElement>(getState(), m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::animationDelay : +- case KEY2Token::NS_URI_KEY | KEY2Token::animationDelay : ++ case +IWORKToken::NS_URI_SF | IWORKToken::animationDelay : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::animationDelay : + return std::make_shared<AnimationDelayPropertyElement>(getState(), m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::animationDuration : +- case KEY2Token::NS_URI_KEY | KEY2Token::animationDuration : ++ case +IWORKToken::NS_URI_SF | IWORKToken::animationDuration : ++ case +KEY2Token::NS_URI_KEY | KEY2Token::animationDuration : + return std::make_shared<AnimationDurationPropertyElement>(getState(), m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::transition : ++ case +IWORKToken::NS_URI_SF | IWORKToken::transition : + return std::make_shared<TransitionElement>(getState(), m_transition); + default: + break; +@@ -252,10 +252,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::ident : ++ case +IWORKToken::NS_URI_SF | IWORKToken::ident : + m_ident = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::parent_ident : ++ case +IWORKToken::NS_URI_SF | IWORKToken::parent_ident : + m_parentIdent = value; + break; + default : +@@ -270,7 +270,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::property_map : ++ case +IWORKToken::NS_URI_SF | IWORKToken::property_map : + return std::make_shared<PropertyMapElement>(getState(), m_props); + default: + ETONYEK_DEBUG_MSG(("KEY2StyleContext::element: found unexpected element %d\n", name)); +--- src/lib/contexts/PAG1AnnotationContext.cpp ++++ src/lib/contexts/PAG1AnnotationContext.cpp +@@ -37,7 +37,7 @@ + + void PAG1AnnotationContext::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::target)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::target)) + m_target = value; + else + PAG1XMLElementContextBase::attribute(name, value); +@@ -45,7 +45,7 @@ + + IWORKXMLContextPtr_t PAG1AnnotationContext::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::text)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::text)) + return std::make_shared<IWORKTextElement>(getState()); + return IWORKXMLContextPtr_t(); + } +--- src/lib/contexts/PAG1AnnotationElement.cpp ++++ src/lib/contexts/PAG1AnnotationElement.cpp +@@ -29,7 +29,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : // annotation ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : // annotation + m_id = value; + break; + default: +--- src/lib/contexts/PAG1FootnotesElement.cpp ++++ src/lib/contexts/PAG1FootnotesElement.cpp +@@ -23,7 +23,7 @@ + + IWORKXMLContextPtr_t PAG1FootnotesElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::text_storage)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::text_storage)) + return std::make_shared<PAG1TextStorageElement>(getState(), PAG_TEXTSTORAGE_KIND_NOTE); + return IWORKXMLContextPtr_t(); + } +--- src/lib/contexts/PAG1ShapeContext.cpp ++++ src/lib/contexts/PAG1ShapeContext.cpp +@@ -51,7 +51,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::text_storage : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_storage : + return std::make_shared<PAG1TextStorageElement>(getState(), PAG1XMLContextBase<IWORKTextElement>::m_stylesheet, PAG_TEXTSTORAGE_KIND_TEXTBOX); + default: + break; +@@ -71,7 +71,7 @@ + { + switch (name) + { +- case PAG1Token::order | PAG1Token::NS_URI_SL : ++ case +PAG1Token::order | PAG1Token::NS_URI_SL : + m_order=try_int_cast(value); + break; + default: +@@ -83,7 +83,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::text : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text : + return std::make_shared<TextElement>(getState()); + default: + break; +--- src/lib/contexts/PAG1StyleContext.cpp ++++ src/lib/contexts/PAG1StyleContext.cpp +@@ -62,13 +62,13 @@ + { + switch (name) + { +- case PAG1Token::NS_URI_SL | PAG1Token::footer : ++ case +PAG1Token::NS_URI_SL | PAG1Token::footer : + m_footer = value; + break; +- case PAG1Token::NS_URI_SL | PAG1Token::header : ++ case +PAG1Token::NS_URI_SL | PAG1Token::header : + m_header = value; + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : // store me? ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : // store me? + IWORKXMLEmptyContextBase::attribute(name, value); + break; + default : +@@ -96,9 +96,9 @@ + namespace + { + +-typedef IWORKPropertyContext<property::EvenPageMaster, PagemasterElement, IWORKToken::NS_URI_SF | IWORKToken::pagemaster> EvenPageMasterElement; +-typedef IWORKPropertyContext<property::FirstPageMaster, PagemasterElement, IWORKToken::NS_URI_SF | IWORKToken::pagemaster> FirstPageMasterElement; +-typedef IWORKPropertyContext<property::OddPageMaster, PagemasterElement, IWORKToken::NS_URI_SF | IWORKToken::pagemaster> OddPageMasterElement; ++typedef IWORKPropertyContext<property::EvenPageMaster, PagemasterElement, +IWORKToken::NS_URI_SF | IWORKToken::pagemaster> EvenPageMasterElement; ++typedef IWORKPropertyContext<property::FirstPageMaster, PagemasterElement, +IWORKToken::NS_URI_SF | IWORKToken::pagemaster> FirstPageMasterElement; ++typedef IWORKPropertyContext<property::OddPageMaster, PagemasterElement, +IWORKToken::NS_URI_SF | IWORKToken::pagemaster> OddPageMasterElement; + + } + +@@ -129,11 +129,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::evenPageMaster : ++ case +IWORKToken::NS_URI_SF | IWORKToken::evenPageMaster : + return std::make_shared<EvenPageMasterElement>(getState(), m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::firstPageMaster : ++ case +IWORKToken::NS_URI_SF | IWORKToken::firstPageMaster : + return std::make_shared<FirstPageMasterElement>(getState(), m_propMap); +- case IWORKToken::NS_URI_SF | IWORKToken::oddPageMaster : ++ case +IWORKToken::NS_URI_SF | IWORKToken::oddPageMaster : + return std::make_shared<OddPageMasterElement>(getState(), m_propMap); + default: + break; +@@ -157,10 +157,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::ident : ++ case +IWORKToken::NS_URI_SF | IWORKToken::ident : + m_ident = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::parent_ident : ++ case +IWORKToken::NS_URI_SF | IWORKToken::parent_ident : + m_parentIdent = value; + break; + default : +@@ -175,7 +175,7 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::property_map : ++ case +IWORKToken::NS_URI_SF | IWORKToken::property_map : + return std::make_shared<PropertyMapElement>(getState(), m_props); + default: + ETONYEK_DEBUG_MSG(("PAG1StyleContext::element: found unexpected element %d\n", name)); +--- src/lib/contexts/PAG1TextStorageElement.cpp ++++ src/lib/contexts/PAG1TextStorageElement.cpp +@@ -103,10 +103,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::sfclass : +- case IWORKToken::NS_URI_SF | IWORKToken::kind : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::sfclass : ++ case +IWORKToken::NS_URI_SF | IWORKToken::kind : + break; +- case IWORKToken::NS_URI_SFA | IWORKToken::ID : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::ID : + return PAG1XMLElementContextBase::attribute(name, value); + default: + ETONYEK_DEBUG_MSG(("AttachmentElement::attribute[PAG1TextStorageElement]: find some unknown attribute\n")); +@@ -130,13 +130,13 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : ++ case +IWORKToken::NS_URI_SF | IWORKToken::drawable_shape : + { + m_block = false; + context = std::make_shared<IWORKShapeContext>(getState()); + break; + } +- case IWORKToken::NS_URI_SF | IWORKToken::group : ++ case +IWORKToken::NS_URI_SF | IWORKToken::group : + { + static bool first=true; + if (first) +@@ -148,15 +148,15 @@ + //context = std::make_shared<IWORKGroupElement>(getState()); + break; + } +- case IWORKToken::NS_URI_SF | IWORKToken::media : ++ case +IWORKToken::NS_URI_SF | IWORKToken::media : + m_block = false; + context = std::make_shared<IWORKMediaElement>(getState()); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::original_size : ++ case +IWORKToken::NS_URI_SF | IWORKToken::original_size : + return std::make_shared<IWORKSizeElement>(getState(), m_originalSize); +- case IWORKToken::NS_URI_SF | IWORKToken::position : ++ case +IWORKToken::NS_URI_SF | IWORKToken::position : + return std::make_shared<IWORKPositionElement>(getState(), m_position); +- case IWORKToken::NS_URI_SF | IWORKToken::tabular_info : ++ case +IWORKToken::NS_URI_SF | IWORKToken::tabular_info : + m_block = true; + context = std::make_shared<IWORKTabularInfoElement>(getState()); + break; +@@ -221,7 +221,7 @@ + + IWORKXMLContextPtr_t AttachmentsElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::attachment)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::attachment)) + return std::make_shared<AttachmentElement>(getState()); + return IWORKXMLContextPtr_t(); + } +@@ -261,10 +261,10 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SFA | IWORKToken::IDREF : ++ case +IWORKToken::NS_URI_SFA | IWORKToken::IDREF : + m_ref = value; + break; +- case IWORKToken::NS_URI_SF | IWORKToken::kind : ++ case +IWORKToken::NS_URI_SF | IWORKToken::kind : + m_kind = value; + break; + default: +@@ -383,7 +383,7 @@ + + void FootnoteMarkElement::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::mark)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::mark)) + m_state.m_footnoteState.m_mark = value; + else + { +@@ -422,11 +422,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::footnote : ++ case +IWORKToken::NS_URI_SF | IWORKToken::footnote : + return std::make_shared<FootnoteElement>(m_state); +- case IWORKToken::NS_URI_SF | IWORKToken::footnotebr : ++ case +IWORKToken::NS_URI_SF | IWORKToken::footnotebr : + return std::make_shared<FootnotebrElement>(m_state); +- case IWORKToken::NS_URI_SF | IWORKToken::footnote_mark : ++ case +IWORKToken::NS_URI_SF | IWORKToken::footnote_mark : + return std::make_shared<FootnoteMarkElement>(m_state); + default: + break; +@@ -474,7 +474,7 @@ + const IWORKXMLContextPtr_t context = m_footnoteHelper.element(name); + if (bool(context)) + return context; +- if (name==(IWORKToken::NS_URI_SF | IWORKToken::attachment_ref)) ++ if (name==(+IWORKToken::NS_URI_SF | IWORKToken::attachment_ref)) + return std::make_shared<AttachmentRef>(getState()); + return IWORKSpanElement::element(name); + } +@@ -510,7 +510,7 @@ + + IWORKXMLContextPtr_t LinkElement::element(const int name) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::span)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::span)) + return std::make_shared<SpanElement>(m_state); + const IWORKXMLContextPtr_t context = m_footnoteHelper.element(name); + if (bool(context)) +@@ -554,15 +554,15 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::attachment_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::attachment_ref : + return std::make_shared<AttachmentRef>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::link : ++ case +IWORKToken::NS_URI_SF | IWORKToken::link : + return std::make_shared<LinkElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::span : ++ case +IWORKToken::NS_URI_SF | IWORKToken::span : + return std::make_shared<SpanElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::annotation_field : ++ case +IWORKToken::NS_URI_SF | IWORKToken::annotation_field : + return std::make_shared<PAG1AnnotationElement>(getState(),*this); +- case IWORKToken::NS_URI_SF | IWORKToken::annotation_field_ref : ++ case +IWORKToken::NS_URI_SF | IWORKToken::annotation_field_ref : + return std::make_shared<PAG1AnnotationElement>(getState(),*this,true); + default: + break; +@@ -638,7 +638,7 @@ + if (!m_opened) + open(); + +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::p)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::p)) + return std::make_shared<PElement>(getState()); + + return IWORKLayoutElement::element(name); +@@ -700,7 +700,7 @@ + + void SectionElement::attribute(const int name, const char *const value) + { +- if (name == (IWORKToken::NS_URI_SF | IWORKToken::style)) ++ if (name == (+IWORKToken::NS_URI_SF | IWORKToken::style)) + m_style = value; + else + PAG1XMLElementContextBase::attribute(name, value); +@@ -711,7 +711,7 @@ + if (!m_opened) + open(); + +- if ((IWORKToken::NS_URI_SF | IWORKToken::layout) == name) ++ if ((+IWORKToken::NS_URI_SF | IWORKToken::layout) == name) + return std::make_shared<LayoutElement>(getState()); + + return IWORKXMLContextPtr_t(); +@@ -757,16 +757,16 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::frame_h : ++ case +IWORKToken::NS_URI_SF | IWORKToken::frame_h : + m_containerFrame.m_h = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::frame_w : ++ case +IWORKToken::NS_URI_SF | IWORKToken::frame_w : + m_containerFrame.m_w = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::frame_x : ++ case +IWORKToken::NS_URI_SF | IWORKToken::frame_x : + m_containerFrame.m_x = double_cast(value); + break; +- case IWORKToken::NS_URI_SF | IWORKToken::frame_y : ++ case +IWORKToken::NS_URI_SF | IWORKToken::frame_y : + m_containerFrame.m_y = double_cast(value); + break; + // also page-index, cindex, sindex, lindex, anchor-loc, nlabel=true/false +@@ -802,11 +802,11 @@ + { + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::container_hint : ++ case +IWORKToken::NS_URI_SF | IWORKToken::container_hint : + return std::make_shared<ContainerHintElement>(getState(), m_containerFrame); +- case IWORKToken::NS_URI_SF | IWORKToken::p : // for footnotes ++ case +IWORKToken::NS_URI_SF | IWORKToken::p : // for footnotes + return std::make_shared<PElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::section : ++ case +IWORKToken::NS_URI_SF | IWORKToken::section : + return std::make_shared<SectionElement>(getState()); + default: + break; +@@ -854,11 +854,11 @@ + + switch (name) + { +- case IWORKToken::NS_URI_SF | IWORKToken::attachments : ++ case +IWORKToken::NS_URI_SF | IWORKToken::attachments : + return std::make_shared<AttachmentsElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::footnotes : ++ case +IWORKToken::NS_URI_SF | IWORKToken::footnotes : + return std::make_shared<PAG1FootnotesElement>(getState()); +- case IWORKToken::NS_URI_SF | IWORKToken::text_body : ++ case +IWORKToken::NS_URI_SF | IWORKToken::text_body : + if (!m_textOpened) + { + assert(!getState().m_currentText); diff --git a/external/libetonyek/glm-force-dmat3-initialization-needed-from-v0.9.9.0.patch.1 b/external/libetonyek/glm-force-dmat3-initialization-needed-from-v0.9.9.0.patch.1 deleted file mode 100644 index 1add51828ce2..000000000000 --- a/external/libetonyek/glm-force-dmat3-initialization-needed-from-v0.9.9.0.patch.1 +++ /dev/null @@ -1,62 +0,0 @@ -From 548c2735c09570726f08d5ae9fee8efefb54d529 Mon Sep 17 00:00:00 2001 -From: osnola <alonso@loria.fr> -Date: Sun, 31 Mar 2019 09:34:11 +0200 -Subject: [PATCH] glm: force dmat3 initialization (needed from v0.9.9.0) - -Change-Id: I2cb285f2d9bc1e9818ed946b38caaf8a5de9e61a -Reviewed-on: https://gerrit.libreoffice.org/69993 -Reviewed-by: Laurent Alonso(fr) <alonso.laurent@gmail.com> -Tested-by: Laurent Alonso(fr) <alonso.laurent@gmail.com> ---- - src/lib/IWORKCollector.cpp | 6 +++--- - src/lib/KEYCollector.cpp | 3 +-- - 2 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/src/lib/IWORKCollector.cpp b/src/lib/IWORKCollector.cpp -index 41a9c79..794b462 100644 ---- a/src/lib/IWORKCollector.cpp -+++ b/src/lib/IWORKCollector.cpp -@@ -183,8 +183,8 @@ private: - IWORKCollector::Level::Level() - : m_geometry() - , m_graphicStyle() -- , m_trafo() -- , m_previousTrafo() -+ , m_trafo(1) -+ , m_previousTrafo(1) - { - } - -@@ -601,7 +601,7 @@ void IWORKCollector::startLevel() - return; - } - -- glm::dmat3 currentTrafo, prevTrafo; -+ glm::dmat3 currentTrafo(1), prevTrafo(1); - if (!m_levelStack.empty()) - { - currentTrafo = m_levelStack.top().m_trafo; -diff --git a/src/lib/KEYCollector.cpp b/src/lib/KEYCollector.cpp -index a9d8cc3..08e7e69 100644 ---- a/src/lib/KEYCollector.cpp -+++ b/src/lib/KEYCollector.cpp -@@ -167,7 +167,7 @@ void KEYCollector::insertTextPlaceholder(const KEYPlaceholderPtr_t &placeholder) - { - if (bool(placeholder)) - { -- glm::dmat3 trafo; -+ glm::dmat3 trafo(1); - if (bool(placeholder->m_geometry)) - trafo = makeTransformation(*placeholder->m_geometry); - trafo *= m_levelStack.top().m_trafo; -@@ -417,7 +417,6 @@ void KEYCollector::drawTextBox(const IWORKTextPtr_t &text, const glm::dmat3 &tra - double w = boundingBox->m_naturalSize.m_width; - double h = boundingBox->m_naturalSize.m_height; - vec = trafo * glm::dvec3(w, h, 0); -- - if (vec[0]>0) - props.insert("svg:width", pt2in(vec[0])); - if (vec[1]>0) --- -2.24.1 - diff --git a/external/libexttextcat/ExternalPackage_fingerprint.mk b/external/libexttextcat/ExternalPackage_fingerprint.mk index 016446a2afa8..fc53611e17c9 100644 --- a/external/libexttextcat/ExternalPackage_fingerprint.mk +++ b/external/libexttextcat/ExternalPackage_fingerprint.mk @@ -36,13 +36,16 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/bo.lm \ langclass/LM/br.lm \ langclass/LM/bs.lm \ + langclass/LM/buc.lm \ langclass/LM/ca.lm \ langclass/LM/ckb.lm \ langclass/LM/cs.lm \ + langclass/LM/cv.lm \ langclass/LM/cy.lm \ langclass/LM/da.lm \ langclass/LM/de.lm \ langclass/LM/dv.lm \ + langclass/LM/dz.lm \ langclass/LM/ee.lm \ langclass/LM/el.lm \ langclass/LM/emk-Latn.lm \ @@ -54,7 +57,9 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/fa.lm \ langclass/LM/fi.lm \ langclass/LM/fj.lm \ + langclass/LM/fkv.lm \ langclass/LM/fo.lm \ + langclass/LM/fon.lm \ langclass/LM/fr.lm \ langclass/LM/fur.lm \ langclass/LM/fy.lm \ @@ -77,27 +82,33 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/hy.lm \ langclass/LM/ia.lm \ langclass/LM/id.lm \ + langclass/LM/ilo.lm \ langclass/LM/is.lm \ langclass/LM/it.lm \ langclass/LM/ja.lm \ langclass/LM/ka.lm \ + langclass/LM/kbd.lm \ langclass/LM/kk.lm \ langclass/LM/kl.lm \ langclass/LM/km.lm \ langclass/LM/kn.lm \ langclass/LM/kng.lm \ + langclass/LM/koi.lm \ langclass/LM/ko.lm \ langclass/LM/ktu.lm \ langclass/LM/ky.lm \ langclass/LM/la.lm \ langclass/LM/lb.lm \ langclass/LM/lg.lm \ + langclass/LM/lij.lm \ + langclass/LM/lld.lm \ langclass/LM/ln.lm \ langclass/LM/lo.lm \ langclass/LM/lt.lm \ langclass/LM/lv.lm \ langclass/LM/mai.lm \ langclass/LM/mi.lm \ + langclass/LM/min.lm \ langclass/LM/mk.lm \ langclass/LM/ml.lm \ langclass/LM/mn.lm \ @@ -109,6 +120,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/nb.lm \ langclass/LM/nds.lm \ langclass/LM/ne.lm \ + langclass/LM/nio.lm \ langclass/LM/nl.lm \ langclass/LM/nn.lm \ langclass/LM/nr.lm \ @@ -117,11 +129,12 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/oc.lm \ langclass/LM/om.lm \ langclass/LM/pa.lm \ + langclass/LM/pap.lm \ langclass/LM/pl.lm \ langclass/LM/plt.lm \ langclass/LM/pt.lm \ + langclass/LM/quh.lm \ langclass/LM/quz.lm \ - langclass/LM/qxa.lm \ langclass/LM/rm.lm \ langclass/LM/ro.lm \ langclass/LM/ru.lm \ @@ -136,6 +149,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/shs.lm \ langclass/LM/si.lm \ langclass/LM/sk.lm \ + langclass/LM/skr.lm \ langclass/LM/sl.lm \ langclass/LM/so.lm \ langclass/LM/sq.lm \ @@ -143,7 +157,9 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/sr-Latn.lm \ langclass/LM/ss.lm \ langclass/LM/st.lm \ + langclass/LM/sun.lm \ langclass/LM/sv.lm \ + langclass/LM/swb.lm \ langclass/LM/sw.lm \ langclass/LM/ta.lm \ langclass/LM/tet.lm \ @@ -164,6 +180,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$( langclass/LM/ur.lm \ langclass/LM/uz-Cyrl.lm \ langclass/LM/uz.lm \ + langclass/LM/vec.lm \ langclass/LM/ve.lm \ langclass/LM/vep.lm \ langclass/LM/vi.lm \ diff --git a/external/libexttextcat/ExternalProject_libexttextcat.mk b/external/libexttextcat/ExternalProject_libexttextcat.mk index 1d729a103b33..479bc9bb3b60 100644 --- a/external/libexttextcat/ExternalProject_libexttextcat.mk +++ b/external/libexttextcat/ExternalProject_libexttextcat.mk @@ -16,13 +16,13 @@ $(eval $(call gb_ExternalProject_register_targets,libexttextcat,\ $(call gb_ExternalProject_get_state_target,libexttextcat,build): $(call gb_Trace_StartRange,libexttextcat,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --disable-shared --with-pic \ + $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(ENABLE_WERROR),--enable-werror,--disable-werror) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ - CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUGINFO_FLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ - $(if $(COM_IS_CLANG),-Qunused-arguments) \ - $(if $(filter AIX,$(OS)),-D_LINUX_SOURCE_COMPAT)" \ + $(gb_CONFIGURE_PLATFORMS) \ + CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUGINFO_FLAGS) $(call gb_ExternalProject_get_build_flags,libexttextcat) \ + $(if $(COM_IS_CLANG),-Qunused-arguments)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libexttextcat)" \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libexttextcat,EXTERNAL) diff --git a/external/libffi/ExternalPackage_libffi.mk b/external/libffi/ExternalPackage_libffi.mk index 61b0a1ca460c..c524ef90289f 100644 --- a/external/libffi/ExternalPackage_libffi.mk +++ b/external/libffi/ExternalPackage_libffi.mk @@ -13,7 +13,7 @@ $(eval $(call gb_ExternalPackage_use_external_project,libffi,libffi)) ifeq ($(COM),MSC) $(eval $(call gb_ExternalPackage_add_files,libffi,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib, \ - $(HOST_PLATFORM)/.libs/libffi-7.dll \ + $(HOST_PLATFORM)/.libs/libffi-8.dll \ )) endif diff --git a/external/libffi/ExternalProject_libffi.mk b/external/libffi/ExternalProject_libffi.mk index c9c89828768c..2e60dd480175 100644 --- a/external/libffi/ExternalProject_libffi.mk +++ b/external/libffi/ExternalProject_libffi.mk @@ -20,16 +20,16 @@ $(eval $(call gb_ExternalProject_register_targets,libffi,\ libffi_WIN_PLATFORM := $(strip \ $(if $(filter INTEL,$(CPUNAME)),32) \ $(if $(filter X86_64,$(CPUNAME)),64) \ - $(if $(filter ARM64,$(CPUNAME)),arm64) \ + $(if $(filter AARCH64,$(CPUNAME)),arm64) \ ) $(call gb_ExternalProject_get_state_target,libffi,build): $(call gb_Trace_StartRange,libffi,EXTERNAL) $(call gb_ExternalProject_run,build,\ export LIB="$(ILIB)" && \ - MAKE=$(MAKE) ./configure \ + MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --enable-option-checking=fatal \ - --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter LINUX,$(OS)), \ --disable-shared \ CC="$(CC) -fvisibility=hidden" \ diff --git a/external/libffi/UnpackedTarball_libffi.mk b/external/libffi/UnpackedTarball_libffi.mk index 5d0582329ac5..26436b33012e 100644 --- a/external/libffi/UnpackedTarball_libffi.mk +++ b/external/libffi/UnpackedTarball_libffi.mk @@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libffi)) $(eval $(call gb_UnpackedTarball_set_tarball,libffi,$(LIBFFI_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_patchlevel,libffi,0)) + +$(eval $(call gb_UnpackedTarball_add_patches,libffi, \ + external/libffi/implicit-function-declaration.patch \ +)) \ + # vim: set noet sw=4 ts=4: diff --git a/external/libffi/implicit-function-declaration.patch b/external/libffi/implicit-function-declaration.patch new file mode 100644 index 000000000000..294a5eff64a3 --- /dev/null +++ b/external/libffi/implicit-function-declaration.patch @@ -0,0 +1,11 @@ +--- src/tramp.c ++++ src/tramp.c +@@ -55,6 +55,8 @@ + #include <limits.h> + #endif + #endif ++ ++int open_temp_exec_file (void); + + /* + * Each architecture defines static code for a trampoline code table. The diff --git a/external/libfreehand/ExternalProject_libfreehand.mk b/external/libfreehand/ExternalProject_libfreehand.mk index be3a478485aa..a3b4859bb3af 100644 --- a/external/libfreehand/ExternalProject_libfreehand.mk +++ b/external/libfreehand/ExternalProject_libfreehand.mk @@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libfreehand,build) : $(call gb_Trace_StartRange,libfreehand,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -38,9 +38,10 @@ $(call gb_ExternalProject_get_state_target,libfreehand,build) : --disable-werror \ --disable-weffc \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libfreehand)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libfreehand)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libfreehand,EXTERNAL) diff --git a/external/libgpg-error/ExternalPackage_libgpg-error.mk b/external/libgpg-error/ExternalPackage_libgpg-error.mk index 1d9c016e09df..262675acf6e6 100644 --- a/external/libgpg-error/ExternalPackage_libgpg-error.mk +++ b/external/libgpg-error/ExternalPackage_libgpg-error.mk @@ -15,7 +15,7 @@ ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,libgpg-error,$(LIBO_LIB_FOLDER)/libgpg-error-lo.so.0,src/.libs/libgpg-error-lo.so.0.28.0)) +$(eval $(call gb_ExternalPackage_add_file,libgpg-error,$(LIBO_LIB_FOLDER)/libgpg-error-lo.so.0,src/.libs/libgpg-error-lo.so.0.36.0)) else ifeq ($(OS),MACOSX) diff --git a/external/libgpg-error/ExternalProject_libgpg-error.mk b/external/libgpg-error/ExternalProject_libgpg-error.mk index 736079c77aec..88b9b2be504a 100644 --- a/external/libgpg-error/ExternalProject_libgpg-error.mk +++ b/external/libgpg-error/ExternalProject_libgpg-error.mk @@ -20,7 +20,7 @@ $(call gb_ExternalProject_get_state_target,libgpg-error,build): $(call gb_Execut $(call gb_Trace_StartRange,libgpg-error,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(gb_WIN_GPG_cross_setup_exports) \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --enable-static \ --disable-shared \ --disable-rpath \ @@ -35,13 +35,13 @@ else $(call gb_ExternalProject_get_state_target,libgpg-error,build): $(call gb_Trace_StartRange,libgpg-error,EXTERNAL) $(call gb_ExternalProject_run,build,\ - MAKE=$(MAKE) ./configure \ + MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --disable-rpath \ --disable-languages \ --disable-doc \ - CPPFLAGS=" $(SOLARINC)" \ - $(if $(filter MSC,$(COM)),--force_use_syscfg=true) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,libgpg-error)" \ + CPPFLAGS="$(SOLARINC)" \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ && $(MAKE) \ diff --git a/external/libgpg-error/UnpackedTarball_libgpg-error.mk b/external/libgpg-error/UnpackedTarball_libgpg-error.mk index 72ff13069c76..698c41997326 100644 --- a/external/libgpg-error/UnpackedTarball_libgpg-error.mk +++ b/external/libgpg-error/UnpackedTarball_libgpg-error.mk @@ -16,7 +16,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgpg-error,0)) $(eval $(call gb_UnpackedTarball_add_patches,libgpg-error, \ $(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes.patch) \ $(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes-2.patch.1) \ - $(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes-3.patch.1) \ $(if $(filter MSC,$(COM)),external/libgpg-error/w32-disable-dllinit.patch.1) \ external/libgpg-error/w32-build-fixes-4.patch \ $(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes-5.patch) \ diff --git a/external/libgpg-error/w32-build-fixes-2.patch.1 b/external/libgpg-error/w32-build-fixes-2.patch.1 index 0f8a8b36ef1c..5f2a7b925842 100644 --- a/external/libgpg-error/w32-build-fixes-2.patch.1 +++ b/external/libgpg-error/w32-build-fixes-2.patch.1 @@ -1,17 +1,7 @@ diff -ru libgpg-error.orig/src/Makefile.in libgpg-error/src/Makefile.in ---- libgpg-error.orig/src/Makefile.in 2017-09-12 08:18:29.376536700 +0200 -+++ libgpg-error/src/Makefile.in 2017-09-12 08:57:11.648083800 +0200 -@@ -512,8 +512,7 @@ - @HAVE_W32_SYSTEM_TRUE@arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c \ - @HAVE_W32_SYSTEM_TRUE@ w32-iconv.c w32-estream.c w32-reg.c spawn-w32.c - --@HAVE_W32_SYSTEM_TRUE@RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ --@HAVE_W32_SYSTEM_TRUE@ -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS) -+@HAVE_W32_SYSTEM_TRUE@RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -DLOCALEDIR=$(localedir) $(AM_CPPFLAGS) - - @HAVE_W32_SYSTEM_TRUE@LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) - @HAVE_W32_SYSTEM_TRUE@SUFFIXES = .rc .lo -@@ -1242,7 +1241,7 @@ +--- libgpg-error.orig/src/Makefile.in 2023-04-06 17:30:13.000000000 +0900 ++++ libgpg-error/src/Makefile.in 2023-08-30 14:44:01.102310369 +0900 +@@ -1619,7 +1618,7 @@ @HAVE_W32_SYSTEM_TRUE@.rc.lo: @@ -20,12 +10,12 @@ diff -ru libgpg-error.orig/src/Makefile.in libgpg-error/src/Makefile.in @HAVE_W32_SYSTEM_TRUE@versioninfo.lo : gpg-error.w32-manifest -@@ -1283,7 +1282,7 @@ +@@ -1660,7 +1659,7 @@ # It is correct to use $(CPP). We want the host's idea of the error codes. - mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers) + mkerrcodes.h: Makefile mkerrcodes.awk $(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@ -- $(CPP) $(CPPFLAGS) $(extra_cppflags) -P _$@ | grep GPG_ERR_ | \ -+ $(CPP) $(CPPFLAGS) $(extra_cppflags) _$@ | grep GPG_ERR_ | \ +- $(CPP) $(CPPFLAGS) -P _$@ | grep GPG_ERR_ | \ ++ $(CPP) $(CPPFLAGS) _$@ | grep GPG_ERR_ | \ $(AWK) -f $(srcdir)/mkerrcodes.awk >$@ -rm _$@ diff --git a/external/libgpg-error/w32-build-fixes-3.patch.1 b/external/libgpg-error/w32-build-fixes-3.patch.1 deleted file mode 100644 index 5883211f9570..000000000000 --- a/external/libgpg-error/w32-build-fixes-3.patch.1 +++ /dev/null @@ -1,57 +0,0 @@ -diff -ru libgpg-error.orig/src/gpg-error.c libgpg-error/src/gpg-error.c ---- libgpg-error.orig/src/gpg-error.c 2016-12-02 22:55:32.000000000 +0100 -+++ libgpg-error/src/gpg-error.c 2017-09-13 22:25:10.040113800 +0200 -@@ -206,7 +206,7 @@ - static const char src_prefix[] = "GPG_ERR_SOURCE_"; - static const char code_prefix[] = "GPG_ERR_"; - -- if (!strncasecmp (src_prefix, str, sizeof (src_prefix) - 1)) -+ if (!_strnicmp (src_prefix, str, sizeof (src_prefix) - 1)) - { - gpg_err_source_t src; - -@@ -220,14 +220,14 @@ - const char *src_sym; - - src_sym = gpg_strsource_sym (src << GPG_ERR_SOURCE_SHIFT); -- if (src_sym && !strcasecmp (str, src_sym + sizeof (src_prefix) - 1)) -+ if (src_sym && !_stricmp (str, src_sym + sizeof (src_prefix) - 1)) - { - *err |= src << GPG_ERR_SOURCE_SHIFT; - return 1; - } - } - } -- else if (!strncasecmp (code_prefix, str, sizeof (code_prefix) - 1)) -+ else if (!_strnicmp (code_prefix, str, sizeof (code_prefix) - 1)) - { - gpg_err_code_t code; - -@@ -240,7 +240,7 @@ - { - const char *code_sym = gpg_strerror_sym (code); - if (code_sym -- && !strcasecmp (str, code_sym + sizeof (code_prefix) - 1)) -+ && !_stricmp (str, code_sym + sizeof (code_prefix) - 1)) - { - *err |= code; - return 1; -@@ -296,7 +296,7 @@ - for (src = 0; src < GPG_ERR_SOURCE_DIM; src++) - { - const char *src_str = gpg_strsource (src << GPG_ERR_SOURCE_SHIFT); -- if (src_str && !strcasecmp (str, src_str)) -+ if (src_str && !_stricmp (str, src_str)) - { - if (*have_source) - return 0; -@@ -310,7 +310,7 @@ - for (code = 0; code < GPG_ERR_CODE_DIM; code++) - { - const char *code_str = gpg_strerror (code); -- if (code_str && !strcasecmp (str, code_str)) -+ if (code_str && !_stricmp (str, code_str)) - { - if (*have_code) - return 0; -Nur in libgpg-error/src: gpg-error.c~. diff --git a/external/libgpg-error/w32-build-fixes-5.patch b/external/libgpg-error/w32-build-fixes-5.patch index 2633df9ee6c9..80d52f720e13 100644 --- a/external/libgpg-error/w32-build-fixes-5.patch +++ b/external/libgpg-error/w32-build-fixes-5.patch @@ -1,5 +1,21 @@ ---- src/gpg-error.c 2020-06-06 00:18:40.199791000 +0200 -+++ src/gpg-error.c~ 2020-06-05 18:44:14.223182300 +0200 +--- src/argparse.c 2021-11-03 13:44:56.000000000 +0100 ++++ src/argparse.c~ 2022-01-03 17:05:23.418077200 +0100 +@@ -33,8 +33,12 @@ + #include <stdarg.h> + #include <limits.h> + #include <errno.h> +-#include <unistd.h> + #include <time.h> ++#ifdef _WIN32 ++# define R_OK 04 ++# define strncasecmp _strnicmp ++# define strcasecmp _stricmp ++#endif + + #include "gpgrt-int.h" + +--- src/gpg-error.c 2022-03-04 20:25:28.000000000 +0900 ++++ src/gpg-error.c~ 2023-08-30 15:10:24.521856169 +0900 @@ -61,6 +61,11 @@ #define drop_locale_dir(dir) #endif @@ -12,22 +28,35 @@ static void i18n_init (void) { ---- src/logging.c 2020-06-05 18:58:59.254413200 +0200 -+++ src/logging.c~ 2019-12-12 15:23:37.000000000 +0100 -@@ -44,7 +44,11 @@ +--- src/spawn-w32.c 2023-08-30 15:24:46.861855840 +0900 ++++ src/spawn-w32.c~ 2023-08-30 15:26:04.581855810 +0900 +@@ -56,7 +56,7 @@ + * Previous versions interpreted X_OK as F_OK anyway, so we'll just + * use F_OK directly. */ + #undef X_OK +-#define X_OK F_OK ++#define X_OK 0 + + /* For HANDLE and the internal file descriptor (fd) of this module: + * HANDLE can be represented by an intptr_t which should be true for + +--- src/logging.c 2023-03-21 18:33:56.000000000 +0900 ++++ src/logging.c~ 2023-08-30 15:37:20.661855553 +0900 +@@ -44,7 +44,12 @@ # include <netinet/in.h> # include <arpa/inet.h> #endif /*!HAVE_W32_SYSTEM*/ +-#include <unistd.h> +#ifdef _WIN32 +# include <io.h> ++# include <process.h> +#else +# include <unistd.h> +#endif --#include <unistd.h> #include <fcntl.h> /* #include <execinfo.h> */ -@@ -57,6 +53,15 @@ +@@ -53,6 +58,15 @@ #ifdef HAVE_W32_SYSTEM @@ -43,72 +72,48 @@ # ifndef S_IRWXG # define S_IRGRP S_IRUSR # define S_IWGRP S_IWUSR ---- src/Makefile.am 2020-06-06 01:01:31.931459300 +0200 -+++ src/Makefile.am~ 2020-02-06 18:39:06.000000000 +0100 -@@ -213,7 +213,7 @@ - # without the extra_cppflags because they may include am -idirafter - # which is not supported by the RC compiler. - libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) -+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) -ladvapi32 $(LIBTHREAD) +--- src/Makefile.am 2022-08-19 17:39:54.000000000 +0900 ++++ src/Makefile.am~ 2023-08-30 15:41:10.371855465 +0900 +@@ -208,8 +208,8 @@ + # libgpg_error_la_DEPENDENCIES = \ + # $(srcdir)/gpg-error.vers + +-libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD) ++libgpg_error_la_CPPFLAGS = -DLOCALEDIR=$(localelidir) ++libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) -ladvapi32 $(LIBTHREAD) gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \ ---- src/Makefile.in 2020-06-06 01:01:31.931459300 +0200 -+++ src/Makefile.in~ 2020-02-06 18:39:06.000000000 +0100 -@@ -659,7 +659,7 @@ - # without the extra_cppflags because they may include am -idirafter - # which is not supported by the RC compiler. - libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) -+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) -ladvapi32 $(LIBTHREAD) +--- src/Makefile.in 2023-08-30 14:44:01.102310369 +0900 ++++ src/Makefile.in~ 2023-08-30 15:54:38.371855157 +0900 +@@ -662,8 +662,8 @@ + + # libgpg_error_la_DEPENDENCIES = \ + # $(srcdir)/gpg-error.vers +-libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD) ++libgpg_error_la_CPPFLAGS = -DLOCALEDIR=$(localedir) ++libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) -ladvapi32 $(LIBTHREAD) gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \ - -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) ---- src/spawn-w32.c 2020-06-05 18:47:05.807099200 +0200 -+++ src/spawn-w32.c~ 2020-06-05 18:44:14.114035900 +0200 -@@ -834,7 +834,11 @@ - /* We don't use ENVP. */ - (void)envp; - -+#ifdef _WIN32 -+ if (_access (pgmname, 04)) -+#else - if (access (pgmname, X_OK)) -+#endif - return _gpg_err_code_from_syserror (); - - /* Prepare security attributes. */ ---- src/sysutils.c 2020-06-06 00:23:52.457265500 +0200 -+++ src/sysutils.c~ 2019-12-12 15:23:37.000000000 +0100 -@@ -22,7 +22,11 @@ + -DLOCALEDIR=\"$(localedir)\" +--- src/sysutils.c 2023-03-21 18:33:56.000000000 +0900 ++++ src/sysutils.c~ 2023-08-30 15:57:34.401855090 +0900 +@@ -22,7 +22,12 @@ #include <stdlib.h> #include <stdint.h> #include <string.h> +-#include <unistd.h> +#ifdef _WIN32 +# include <io.h> ++# define W_OK 02 +#else +# include <unistd.h> +#endif --#include <unistd.h> #include <errno.h> #ifdef HAVE_W32_SYSTEM # include <windows.h> -@@ -274,11 +270,12 @@ - gpg_err_code_t - _gpgrt_mkdir (const char *name, const char *modestr) - { -+#ifdef _WIN32 --#ifdef HAVE_W32CE_SYSTEM - wchar_t *wname; - (void)modestr; - -+ size_t size; -+ wname = utf8_to_wchar (name, -1, &size); -- wname = utf8_to_wchar (name); - if (!wname) - return _gpg_err_code_from_syserror (); - if (!CreateDirectoryW (wname, NULL)) --- src/visibility.c 2020-06-05 18:54:56.410442900 +0200 +++ src/visibility.c~ 2019-01-04 12:56:54.000000000 +0100 @@ -1067,11 +1067,7 @@ @@ -131,12 +136,12 @@ const char *name); + +wchar_t *utf8_to_wchar (const char *string, size_t length, size_t *retlen); ---- src/w32-gettext.c 2020-06-06 00:33:24.680341900 +0200 -+++ src/w32-gettext.c~ 2020-06-05 18:44:14.254481700 +0200 -@@ -1355,7 +1355,7 @@ - string STRING. Caller must free this value. On failure returns - NULL. The result of calling this function with STRING set to NULL - is not defined. */ +--- src/w32-gettext.c 2022-03-04 21:44:26.000000000 +0900 ++++ src/w32-gettext.c~ 2023-08-30 16:01:12.861855006 +0900 +@@ -1325,7 +1325,7 @@ + is not defined. If LENGTH is zero and RETLEN NULL the function + assumes that STRING is a nul-terminated string and returns a + (wchar_t)0-terminated string. */ +wchar_t * -static wchar_t * utf8_to_wchar (const char *string, size_t length, size_t *retlen) diff --git a/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk b/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk deleted file mode 100644 index a5cd4c57ddc7..000000000000 --- a/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,libjpeg-turbo)) - -$(eval $(call gb_ExternalProject_use_autoconf,libjpeg-turbo,configure)) -$(eval $(call gb_ExternalProject_use_autoconf,libjpeg-turbo,build)) - -$(eval $(call gb_ExternalProject_register_targets,libjpeg-turbo,\ - configure \ - build \ -)) - -$(call gb_ExternalProject_get_state_target,libjpeg-turbo,build) : $(call gb_ExternalProject_get_state_target,libjpeg-turbo,configure) - $(call gb_Trace_StartRange,libjpeg-turbo,EXTERNAL) - +$(call gb_ExternalProject_run,build,\ - $(MAKE) \ - ) - $(call gb_Trace_EndRange,libjpeg-turbo,EXTERNAL) - -$(call gb_ExternalProject_get_state_target,libjpeg-turbo,configure) : - $(call gb_Trace_StartRange,libjpeg-turbo,EXTERNAL) - $(call gb_ExternalProject_run,configure,\ - MAKE=$(MAKE) ./configure \ - --build=$(BUILD_PLATFORM) \ - --host=$(HOST_PLATFORM) \ - --with-pic \ - --enable-static \ - --disable-shared \ - --without-java \ - --without-turbojpeg \ - $(if $(NASM),,--without-simd) \ - CFLAGS='$(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(CFLAGS) $(gb_VISIBILITY_FLAGS)' \ - ) - $(call gb_Trace_EndRange,libjpeg-turbo,EXTERNAL) - -# vim: set noet sw=4 ts=4: diff --git a/external/libjpeg-turbo/Module_libjpeg-turbo.mk b/external/libjpeg-turbo/Module_libjpeg-turbo.mk index 137e7557bacf..29be90155880 100644 --- a/external/libjpeg-turbo/Module_libjpeg-turbo.mk +++ b/external/libjpeg-turbo/Module_libjpeg-turbo.mk @@ -10,8 +10,8 @@ $(eval $(call gb_Module_Module,libjpeg-turbo)) $(eval $(call gb_Module_add_targets,libjpeg-turbo,\ - ExternalProject_libjpeg-turbo \ UnpackedTarball_libjpeg-turbo \ + StaticLibrary_libjpeg-turbo \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libjpeg-turbo/README b/external/libjpeg-turbo/README index 46eff7cb7487..7f0065b5f6d5 100644 --- a/external/libjpeg-turbo/README +++ b/external/libjpeg-turbo/README @@ -1,6 +1,6 @@ External library for reading/writing jpegs -This is only used by the jpeg import filter that is provided +This is used by the jpeg import and export filters that are provided for use by VCL see [[vcl/source/filter/jpeg]] -From [http://www.libjpeg-turbo.org/]. +From [https://www.libjpeg-turbo.org/]. diff --git a/external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk b/external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk new file mode 100644 index 000000000000..ace14fd8fc5d --- /dev/null +++ b/external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk @@ -0,0 +1,214 @@ +# -*- 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://mozillarg/MPL/2.0/. +# + +$(eval $(call gb_StaticLibrary_StaticLibrary,libjpeg-turbo)) + +$(eval $(call gb_StaticLibrary_use_unpacked,libjpeg-turbo,libjpeg-turbo)) + +$(eval $(call gb_StaticLibrary_set_warnings_disabled,libjpeg-turbo)) + +$(eval $(call gb_StaticLibrary_set_include,libjpeg-turbo,\ + -I$(call gb_UnpackedTarball_get_dir,libjpeg-turbo) \ + $$(INCLUDE) \ +)) + +ifeq ($(OS),WNT) +$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\ + -DHAVE_INTRIN_H=1 \ +)) +endif + +$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\ + -DSIZEOF_SIZE_T=$(SIZEOF_SIZE_T) \ +)) + +ifeq ($(COM),GCC) +ifneq ($(ENABLE_OPTIMIZED),) +$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\ + -O3 \ +)) +endif +endif + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/jaricom \ + UnpackedTarball/libjpeg-turbo/jcapimin \ + UnpackedTarball/libjpeg-turbo/jcapistd \ + UnpackedTarball/libjpeg-turbo/jcarith \ + UnpackedTarball/libjpeg-turbo/jccoefct \ + UnpackedTarball/libjpeg-turbo/jccolor \ + UnpackedTarball/libjpeg-turbo/jcdctmgr \ + UnpackedTarball/libjpeg-turbo/jchuff \ + UnpackedTarball/libjpeg-turbo/jcicc \ + UnpackedTarball/libjpeg-turbo/jcinit \ + UnpackedTarball/libjpeg-turbo/jcmainct \ + UnpackedTarball/libjpeg-turbo/jcmarker \ + UnpackedTarball/libjpeg-turbo/jcmaster \ + UnpackedTarball/libjpeg-turbo/jcomapi \ + UnpackedTarball/libjpeg-turbo/jcparam \ + UnpackedTarball/libjpeg-turbo/jcphuff \ + UnpackedTarball/libjpeg-turbo/jcprepct \ + UnpackedTarball/libjpeg-turbo/jcsample \ + UnpackedTarball/libjpeg-turbo/jctrans \ + UnpackedTarball/libjpeg-turbo/jdapimin \ + UnpackedTarball/libjpeg-turbo/jdapistd \ + UnpackedTarball/libjpeg-turbo/jdarith \ + UnpackedTarball/libjpeg-turbo/jdatadst \ + UnpackedTarball/libjpeg-turbo/jdatasrc \ + UnpackedTarball/libjpeg-turbo/jdcoefct \ + UnpackedTarball/libjpeg-turbo/jdcolor \ + UnpackedTarball/libjpeg-turbo/jddctmgr \ + UnpackedTarball/libjpeg-turbo/jdhuff \ + UnpackedTarball/libjpeg-turbo/jdicc \ + UnpackedTarball/libjpeg-turbo/jdinput \ + UnpackedTarball/libjpeg-turbo/jdmainct \ + UnpackedTarball/libjpeg-turbo/jdmarker \ + UnpackedTarball/libjpeg-turbo/jdmaster \ + UnpackedTarball/libjpeg-turbo/jdmerge \ + UnpackedTarball/libjpeg-turbo/jdphuff \ + UnpackedTarball/libjpeg-turbo/jdpostct \ + UnpackedTarball/libjpeg-turbo/jdsample \ + UnpackedTarball/libjpeg-turbo/jdtrans \ + UnpackedTarball/libjpeg-turbo/jerror \ + UnpackedTarball/libjpeg-turbo/jfdctflt \ + UnpackedTarball/libjpeg-turbo/jfdctfst \ + UnpackedTarball/libjpeg-turbo/jfdctint \ + UnpackedTarball/libjpeg-turbo/jidctflt \ + UnpackedTarball/libjpeg-turbo/jidctfst \ + UnpackedTarball/libjpeg-turbo/jidctint \ + UnpackedTarball/libjpeg-turbo/jidctred \ + UnpackedTarball/libjpeg-turbo/jmemmgr \ + UnpackedTarball/libjpeg-turbo/jmemnobs \ + UnpackedTarball/libjpeg-turbo/jquant1 \ + UnpackedTarball/libjpeg-turbo/jquant2 \ + UnpackedTarball/libjpeg-turbo/jutils \ +)) + +ifneq ($(NASM),) + +$(eval $(call gb_StaticLibrary_add_nasmflags,libjpeg-turbo,\ + -I$(call gb_UnpackedTarball_get_dir,libjpeg-turbo)/simd/nasm/ \ + -I$(dir $(call gb_UnpackedTarball_get_dir,libjpeg-turbo)/$(1)) \ +)) + +ifeq ($(CPUNAME),X86_64) + +$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\ + -DWITH_SIMD \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jsimd \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_nasmobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jsimdcpu.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctflt-sse.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jccolor-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jcgray-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jchuff-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jcphuff-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jcsample-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jdcolor-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jdmerge-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jdsample-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctfst-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctint-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctflt-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctfst-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctint-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctred-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jquantf-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jquanti-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jccolor-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jcgray-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jcsample-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jdcolor-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jdmerge-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jdsample-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctint-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctint-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/x86_64/jquanti-avx2.asm \ +)) + +else ifeq ($(CPUNAME),INTEL) + +$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\ + -DWITH_SIMD \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/simd/i386/jsimd \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_nasmobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/simd/i386/jsimdcpu.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctflt-3dn.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctflt-3dn.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jquant-3dn.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jccolor-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcgray-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcsample-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdcolor-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdmerge-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdsample-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctfst-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctint-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctfst-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctint-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctred-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jquant-mmx.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctflt-sse.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctflt-sse.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jquant-sse.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jccolor-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcgray-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jchuff-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcphuff-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcsample-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdcolor-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdmerge-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdsample-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctfst-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctint-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctflt-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctfst-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctint-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctred-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jquantf-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jquanti-sse2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jccolor-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcgray-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jcsample-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdcolor-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdmerge-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jdsample-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jfdctint-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jidctint-avx2.asm \ + UnpackedTarball/libjpeg-turbo/simd/i386/jquanti-avx2.asm \ +)) + +else + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/jsimd_none \ +)) + +endif + +else + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\ + UnpackedTarball/libjpeg-turbo/jsimd_none \ +)) + +endif + + +# vim: set noet sw=4 ts=4: diff --git a/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk b/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk index a99df67bb011..5c88c8756c28 100644 --- a/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk +++ b/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk @@ -11,14 +11,18 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libjpeg-turbo)) $(eval $(call gb_UnpackedTarball_set_tarball,libjpeg-turbo,$(LIBJPEG_TURBO_TARBALL))) -$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libjpeg-turbo)) - $(eval $(call gb_UnpackedTarball_set_patchlevel,libjpeg-turbo,0)) -$(eval $(call gb_UnpackedTarball_add_patches,libjpeg-turbo,\ - external/libjpeg-turbo/jpeg-turbo.build.patch.1 \ - $(if $(filter WNT,$(OS)),external/libjpeg-turbo/jpeg-turbo.win_build.patch.1) \ - external/libjpeg-turbo/ubsan.patch \ +$(eval $(call gb_UnpackedTarball_add_patches,libjpeg-turbo, \ + external/libjpeg-turbo/include.patch \ )) +# jconfigint.h and jconfig.h generated via +# cmake -DENABLE_STATIC:BOOL=ON -DENABLE_SHARED:BOOL=NO -DWITH_JAVA:BOOL=OFF -DWITH_TURBOJPEG:BOOL=OFF -DWITH_SIMD:BOOL=ON +# and then tweaking + +$(eval $(call gb_UnpackedTarball_add_file,libjpeg-turbo,jconfigint.h,external/libjpeg-turbo/jconfigint.h)) +$(eval $(call gb_UnpackedTarball_add_file,libjpeg-turbo,jconfig.h,external/libjpeg-turbo/jconfig.h)) +$(eval $(call gb_UnpackedTarball_add_file,libjpeg-turbo,jversion.h,external/libjpeg-turbo/jversion.h)) + # vim: set noet sw=4 ts=4: diff --git a/external/libjpeg-turbo/include.patch b/external/libjpeg-turbo/include.patch new file mode 100644 index 000000000000..0a36075ee7fc --- /dev/null +++ b/external/libjpeg-turbo/include.patch @@ -0,0 +1,12 @@ +--- jpeglib.h ++++ jpeglib.h +@@ -31,6 +31,9 @@ + #include "jmorecfg.h" /* seldom changed options */ + + ++#include <stdio.h> ++ ++ + #ifdef __cplusplus + #ifndef DONT_USE_EXTERN_C + extern "C" { diff --git a/external/libjpeg-turbo/jconfig.h b/external/libjpeg-turbo/jconfig.h new file mode 100644 index 000000000000..3855ccec9cfd --- /dev/null +++ b/external/libjpeg-turbo/jconfig.h @@ -0,0 +1,55 @@ +/* Version ID for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". + */ +#define JPEG_LIB_VERSION 62 + +/* libjpeg-turbo version */ +#define LIBJPEG_TURBO_VERSION 2.1.5.1 + +/* libjpeg-turbo version in integer form */ +#define LIBJPEG_TURBO_VERSION_NUMBER 2001005 + +/* Support arithmetic encoding */ +#define C_ARITH_CODING_SUPPORTED 1 + +/* Support arithmetic decoding */ +#define D_ARITH_CODING_SUPPORTED 1 + +/* Support in-memory source/destination managers */ +#define MEM_SRCDST_SUPPORTED 1 + +/* Use accelerated SIMD routines. */ +/* #undef WITH_SIMD */ + +/* + * Define BITS_IN_JSAMPLE as either + * 8 for 8-bit sample values (the usual setting) + * 12 for 12-bit sample values + * Only 8 and 12 are legal data precisions for lossy JPEG according to the + * JPEG standard, and the IJG code does not support anything else! + * We do not support run-time selection of data precision, sorry. + */ + +#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ + +/* Define if your (broken) compiler shifts signed values as if they were + unsigned. */ +/* #undef RIGHT_SHIFT_IS_UNSIGNED */ + +/* Extra Libreoffice config for windows */ +#ifdef _MSC_VER + +/* Define "boolean" as unsigned char, not int, per Windows custom */ +#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ +typedef unsigned char boolean; +#endif +#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ + +/* Define "INT32" as int, not long, per Windows custom */ +#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */ +typedef short INT16; +typedef signed int INT32; +#endif +#define XMD_H /* prevent jmorecfg.h from redefining it */ + +#endif /* _MSC_VER */ diff --git a/external/libjpeg-turbo/jconfigint.h b/external/libjpeg-turbo/jconfigint.h new file mode 100644 index 000000000000..b7644cbac90e --- /dev/null +++ b/external/libjpeg-turbo/jconfigint.h @@ -0,0 +1,54 @@ +#include <sal/types.h> + +/* libjpeg-turbo build number */ +#define BUILD "20230315" + +/* Compiler's inline keyword */ +#undef inline + +/* How to obtain function inlining. */ +#if defined _MSC_VER +#define INLINE __forceinline +#elif defined __GNUC__ +#define INLINE __attribute__((always_inline)) inline +#else +#define INLINE inline +#endif + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libjpeg-turbo" + +/* Version number of package */ +#define VERSION "2.1.5.1" + +/* The size of `size_t', as computed by sizeof. */ +/* #undef SIZEOF_SIZE_T */ + +/* How to obtain thread-local storage */ +#define THREAD_LOCAL + +#if defined(__GNUC__) && SAL_TYPES_SIZEOFLONG == SIZEOF_SIZE_T +/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */ +#define HAVE_BUILTIN_CTZL +#endif + +/* Define to 1 if you have the <intrin.h> header file. */ +/* #undef HAVE_INTRIN_H */ + +#if defined(_MSC_VER) && defined(HAVE_INTRIN_H) +#if (SIZEOF_SIZE_T == 8) +#define HAVE_BITSCANFORWARD64 +#elif (SIZEOF_SIZE_T == 4) +#define HAVE_BITSCANFORWARD +#endif +#endif + +#if defined(__has_attribute) +#if __has_attribute(fallthrough) +#define FALLTHROUGH __attribute__((fallthrough)); +#else +#define FALLTHROUGH +#endif +#else +#define FALLTHROUGH +#endif diff --git a/external/libjpeg-turbo/jpeg-turbo.build.patch.1 b/external/libjpeg-turbo/jpeg-turbo.build.patch.1 deleted file mode 100644 index 4d01ad4b9aed..000000000000 --- a/external/libjpeg-turbo/jpeg-turbo.build.patch.1 +++ /dev/null @@ -1,58 +0,0 @@ -diff -ur jpeg.org/Makefile.am jpeg/Makefile.am ---- jpeg.org/Makefile.am 2014-11-14 12:05:43.349386578 +0100 -+++ jpeg/Makefile.am 2014-11-14 12:06:21.005387021 +0100 -@@ -174,8 +174,6 @@ - rm -rf `find $(distdir) -name .svn` - - --SUBDIRS += md5 -- - if WITH_12BIT - - TESTORIG = testorig12.jpg -diff -ru jpeg-turbo.orig/Makefile.in jpeg-turbo/Makefile.in ---- jpeg-turbo.orig/Makefile.in 2015-09-21 20:48:45.000000000 +0200 -+++ jpeg-turbo/Makefile.in 2015-11-22 16:17:10.326527000 +0100 -@@ -405,7 +405,7 @@ - ETAGS = etags - CTAGS = ctags - CSCOPE = cscope --DIST_SUBDIRS = java simd md5 -+DIST_SUBDIRS = java simd - am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in $(srcdir)/jconfig.h.in \ - $(srcdir)/jconfigint.h.in $(srcdir)/libjpeg.map.in \ -@@ -622,7 +622,7 @@ - jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \ - jquant2.c jutils.c jmemmgr.c jmemnobs.c $(am__append_4) \ - $(am__append_5) $(am__append_6) $(am__append_11) --SUBDIRS = java $(am__append_10) md5 -+SUBDIRS = java $(am__append_10) - @WITH_TURBOJPEG_TRUE@libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) \ - @WITH_TURBOJPEG_TRUE@ turbojpeg.c turbojpeg.h transupp.c \ - @WITH_TURBOJPEG_TRUE@ transupp.h jdatadst-tj.c jdatasrc-tj.c \ -diff -ru jpeg-turbo.orig/configure jpeg-turbo/configure ---- jpeg-turbo.orig/configure 2015-09-21 20:48:41.000000000 +0200 -+++ jpeg-turbo/configure 2015-11-22 15:23:25.387071000 +0100 -@@ -14630,9 +14630,7 @@ - $as_echo "yes" >&6; } - else - rm -rf conftest* -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- as_fn_error $? "configuration problem: maybe object file format mismatch." "$LINENO" 5 -+ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - fi - - -@@ -14828,9 +14826,7 @@ - $as_echo "yes" >&6; } - else - rm -rf conftest* -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- as_fn_error $? "configuration problem: maybe object file format mismatch." "$LINENO" 5 -+ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - fi - - diff --git a/external/libjpeg-turbo/jpeg-turbo.win_build.patch.1 b/external/libjpeg-turbo/jpeg-turbo.win_build.patch.1 deleted file mode 100644 index 00b642703f3a..000000000000 --- a/external/libjpeg-turbo/jpeg-turbo.win_build.patch.1 +++ /dev/null @@ -1,54 +0,0 @@ -Copy definitions of "boolean", "INT16", "INT32" from win/jconfig.h.in - -... into jconfig.h.in, which is the one we use via configure. - -diff -ru jpeg-turbo.orig/simd/Makefile.in jpeg-turbo/simd/Makefile.in ---- jpeg-turbo.orig/simd/Makefile.in 2015-09-21 20:48:45.000000000 +0200 -+++ jpeg-turbo/simd/Makefile.in 2015-11-22 10:52:46.975285184 +0100 -@@ -769,8 +769,8 @@ - .asm.lo: - $(AM_V_GEN) $(LIBTOOL) $(AM_V_lt) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(AM_V_lt) $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@ - --jsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h -- $(AM_V_GEN) $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@ -+jsimdcfg.inc: $(top_srcdir)/win/jsimdcfg.inc -+ cp $< $@ - - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. -diff -ru jpeg-turbo.orig/configure jpeg-turbo/configure ---- jpeg-turbo.orig/configure 2015-11-22 15:57:23.702656000 +0100 -+++ jpeg-turbo/configure 2015-11-22 15:59:37.084285000 +0100 -@@ -13931,7 +13931,7 @@ - - else - --$as_echo "#define NEED_BSD_STRINGS 1" >>confdefs.h -+$as_echo "#undef NEED_BSD_STRINGS" >>confdefs.h - - fi - done ---- jpeg-turbo/jconfig.h.in.orig 2016-11-02 22:43:55.012600000 +0100 -+++ jpeg-turbo/jconfig.h.in 2016-11-02 22:45:01.905400000 +0100 -@@ -71,3 +71,21 @@ - - /* Define to `unsigned int' if <sys/types.h> does not define. */ - #undef size_t -+ -+#ifdef _MSC_VER -+ -+/* Define "boolean" as unsigned char, not int, per Windows custom */ -+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ -+typedef unsigned char boolean; -+#endif -+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ -+ -+/* Define "INT32" as int, not long, per Windows custom */ -+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */ -+typedef short INT16; -+typedef signed int INT32; -+#endif -+#define XMD_H /* prevent jmorecfg.h from redefining it */ -+ -+#endif /* _MSC_VER */ -+ diff --git a/external/libjpeg-turbo/jversion.h b/external/libjpeg-turbo/jversion.h new file mode 100644 index 000000000000..ea6de648d926 --- /dev/null +++ b/external/libjpeg-turbo/jversion.h @@ -0,0 +1,54 @@ +/* + * jversion.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding. + * libjpeg-turbo Modifications: + * Copyright (C) 2010, 2012-2023, D. R. Commander. + * For conditions of distribution and use, see the accompanying README.ijg + * file. + * + * This file contains software version identification. + */ + + +#if JPEG_LIB_VERSION >= 80 + +#define JVERSION "8d 15-Jan-2012" + +#elif JPEG_LIB_VERSION >= 70 + +#define JVERSION "7 27-Jun-2009" + +#else + +#define JVERSION "6b 27-Mar-1998" + +#endif + +/* + * NOTE: It is our convention to place the authors in the following order: + * - libjpeg-turbo authors (2009-) in descending order of the date of their + * most recent contribution to the project, then in ascending order of the + * date of their first contribution to the project, then in alphabetical + * order + * - Upstream authors in descending order of the date of the first inclusion of + * their code + */ + +#define JCOPYRIGHT \ + "Copyright (C) 2009-2023 D. R. Commander\n" \ + "Copyright (C) 2015, 2020 Google, Inc.\n" \ + "Copyright (C) 2019-2020 Arm Limited\n" \ + "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \ + "Copyright (C) 2011-2016 Siarhei Siamashka\n" \ + "Copyright (C) 2015 Intel Corporation\n" \ + "Copyright (C) 2013-2014 Linaro Limited\n" \ + "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ + "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \ + "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ + "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ + "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding" + +#define JCOPYRIGHT_SHORT \ + "Copyright (C) 1991-2023 The libjpeg-turbo Project and many others" diff --git a/external/libjpeg-turbo/ubsan.patch b/external/libjpeg-turbo/ubsan.patch deleted file mode 100644 index 33d3c15a8b3c..000000000000 --- a/external/libjpeg-turbo/ubsan.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- jcphuff.c -+++ jcphuff.c -@@ -14,6 +14,7 @@ - * suspension. - */ - -+#include <stdint.h> - #define JPEG_INTERNALS - #include "jinclude.h" - #include "jpeglib.h" -@@ -255,7 +256,7 @@ - if (c == 0xFF) { /* need to stuff a zero byte? */ - emit_byte(entropy, 0); - } -- put_buffer <<= 8; -+ put_buffer = (uint_least32_t) put_buffer << 8; - put_bits -= 8; - } - ---- jdarith.c -+++ jdarith.c -@@ -306,7 +306,7 @@ - while (m >>= 1) - if (arith_decode(cinfo, st)) v |= m; - v += 1; if (sign) v = -v; -- entropy->last_dc_val[ci] += v; -+ entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff; - } - - /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */ -@@ -564,7 +564,7 @@ - while (m >>= 1) - if (arith_decode(cinfo, st)) v |= m; - v += 1; if (sign) v = -v; -- entropy->last_dc_val[ci] += v; -+ entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff; - } - - if (block) diff --git a/external/liblangtag/ExternalProject_liblangtag.mk b/external/liblangtag/ExternalProject_liblangtag.mk index 51dc4f4b0c68..4e07b9fe4278 100644 --- a/external/liblangtag/ExternalProject_liblangtag.mk +++ b/external/liblangtag/ExternalProject_liblangtag.mk @@ -17,33 +17,26 @@ $(eval $(call gb_ExternalProject_register_targets,liblangtag,\ build \ )) -# disable ccache on windows, as it doesn't cope with the quoted defines -# liblangtag uses (-DBUILDDIR="\"$(abs_top_builddir)\"" and similar). -# Results in "cl : Command line error D8003 : missing source filename" $(call gb_ExternalProject_get_state_target,liblangtag,build): - $(call gb_Trace_StartRange,liblangtrag,EXTERNAL) + $(call gb_Trace_StartRange,liblangtag,EXTERNAL) $(call gb_ExternalProject_run,build,\ - MAKE=$(MAKE) ./configure --disable-modules --disable-test --disable-introspection --with-pic \ + unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure --disable-modules --disable-test --disable-introspection --with-pic \ $(if $(or $(DISABLE_DYNLOADING),$(filter MSC,$(COM))), \ --disable-shared --enable-static, \ --enable-shared --disable-static) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(filter TRUE,$(HAVE_GCC_BUILTIN_ATOMIC)),"lt_cv_has_atomic=yes","lt_cv_has_atomic=no") \ - CFLAGS='$(CFLAGS) \ - $(if $(ENABLE_OPTIMIZED), \ - $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ - $(if $(call gb_Module__symbols_enabled,liblangtag),$(gb_DEBUGINFO_FLAGS))' \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter WNT,$(OS)),"lt_cv_c99_vsnprintf=yes" "ac_cv_va_copy=yes","ac_cv_va_copy=no")) \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS='$(CFLAGS) -pthread \ + $(call gb_ExternalProject_get_build_flags,liblangtag)' \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter WNT,$(OS)),"lt_cv_c99_vsnprintf=yes" "ac_cv_va_copy=yes","ac_cv_va_copy=no")) \ LIBXML2_CFLAGS="$(LIBXML_CFLAGS)" \ LIBXML2_LIBS="$(if $(filter WNT,$(OS)),-L$(call gb_UnpackedTarball_get_dir,libxml2)/win32/bin.msvc -llibxml2,$(LIBXML_LIBS))" \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________URELIB) \ $(if $(filter-out LINUX FREEBSD,$(OS)),,LDFLAGS="-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath,\\"\$$\$$ORIGIN) \ $(if $(filter-out SOLARIS,$(OS)),,LDFLAGS="-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-R$(COMMA)\\"\$$\$$ORIGIN) \ - && $(if $(filter WNT,$(OS)),\ - REAL_CC="$(shell cygpath -w $(lastword $(filter-out -%,$(CC))))" \ - REAL_CC_FLAGS="$(filter -%,$(CC))") \ - $(if $(verbose),V=1) \ + && $(if $(verbose),V=1) \ $(MAKE) \ LIBO_TUNNEL_LIBRARY_PATH='$(subst ','\'',$(subst $$,$$$$,$(call gb_Helper_extend_ld_path,$(call gb_UnpackedTarball_get_dir,liblangtag)/liblangtag/.libs)))' \ $(if $(filter MACOSX,$(OS)),\ @@ -51,6 +44,6 @@ $(call gb_ExternalProject_get_state_target,liblangtag,build): $(EXTERNAL_WORKDIR)/liblangtag/.libs/liblangtag.1.dylib \ ) \ ) - $(call gb_Trace_EndRange,liblangtrag,EXTERNAL) + $(call gb_Trace_EndRange,liblangtag,EXTERNAL) # vim: set noet sw=4 ts=4: diff --git a/external/liblangtag/UnpackedTarball_liblangtag.mk b/external/liblangtag/UnpackedTarball_liblangtag.mk index aae5a56e3295..40102052a79c 100644 --- a/external/liblangtag/UnpackedTarball_liblangtag.mk +++ b/external/liblangtag/UnpackedTarball_liblangtag.mk @@ -12,7 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,liblangtag)) $(eval $(call gb_UnpackedTarball_set_tarball,liblangtag,$(LIBLANGTAG_TARBALL),,liblangtag)) $(eval $(call gb_UnpackedTarball_set_pre_action,liblangtag,\ - $(GNUTAR) -x -j -f $(gb_UnpackedTarget_TARFILE_LOCATION)/$(LANGTAGREG_TARBALL) \ + $(GNUTAR) -x -j -f $(call gb_Helper_cyg_path,$(gb_UnpackedTarget_TARFILE_LOCATION)/$(LANGTAGREG_TARBALL)) \ )) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,liblangtag)) @@ -27,14 +27,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,liblangtag,\ endif endif -# * external/liblangtag/Wformat-overflow.patch is effectively covered by upstream -# <https://bitbucket.org/tagoh/liblangtag/commits/49135ef561f309078f0bfd6e1f15052769cf75b4> "Fix -# possible null argument for %s directive": $(eval $(call gb_UnpackedTarball_add_patches,liblangtag, \ $(if $(SYSTEM_LIBXML),,external/liblangtag/langtag-libtool-rpath.patch.0) \ external/liblangtag/clang-cl.patch.0 \ - external/liblangtag/langtag-valencia.patch.0 \ - external/liblangtag/Wformat-overflow.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/liblangtag/Wformat-overflow.patch b/external/liblangtag/Wformat-overflow.patch deleted file mode 100644 index f2d017e4b395..000000000000 --- a/external/liblangtag/Wformat-overflow.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- liblangtag/lt-script-db.c -+++ liblangtag/lt-script-db.c -@@ -134,8 +134,12 @@ - cnode = cnode->next; - } - if (!subtag) { -- lt_warning("No subtag node: description = '%s'", -- desc); -+ if (!desc) { -+ lt_warning("No subtag nor description node"); -+ } else { -+ lt_warning("No subtag node: description = '%s'", -+ desc); -+ } - goto bail1; - } - if (!desc) { diff --git a/external/liblangtag/langtag-valencia.patch.0 b/external/liblangtag/langtag-valencia.patch.0 deleted file mode 100644 index dc28043042e4..000000000000 --- a/external/liblangtag/langtag-valencia.patch.0 +++ /dev/null @@ -1,29 +0,0 @@ ---- liblangtag/lt-tag.c -+++ liblangtag/lt-tag.c -@@ -2009,11 +2009,23 @@ - if (ctag->region) - lt_string_append_printf(string, "_%s", - lt_region_get_tag(ctag->region)); -- if (ctag->script) { -+ if (ctag->script) - mod = lt_script_convert_to_modifier(ctag->script); -- if (mod) -- lt_string_append_printf(string, "@%s", mod); -+ if (!mod && ctag->variants) -+ { -+ lt_list_t* l; -+ for (l = ctag->variants; l != NULL; l = lt_list_next(l)) { -+ lt_variant_t *variant = lt_list_value(l); -+ const char *s = lt_variant_get_tag(variant); -+ if (lt_strcmp0(s, "valencia") == 0) { -+ mod = "valencia"; -+ break; -+ } -+ } - } -+ if (mod) -+ lt_string_append_printf(string, "@%s", mod); -+ - lt_tag_unref(ctag); - - bail: diff --git a/external/libmspub/ExternalProject_libmspub.mk b/external/libmspub/ExternalProject_libmspub.mk index 21121f091279..b43fc8f1998c 100644 --- a/external/libmspub/ExternalProject_libmspub.mk +++ b/external/libmspub/ExternalProject_libmspub.mk @@ -22,11 +22,19 @@ $(eval $(call gb_ExternalProject_use_externals,libmspub,\ zlib \ )) +libmspub_CPPFLAGS := $(CPPFLAGS) $(BOOST_CPPFLAGS) +# Needed when workdir/UnpackedTarball/libmspub/src/lib/MSPUBCollector.cpp includes Boost 1.79.0 +# boost/multi_array.hpp, which indirectly includes +# workdir/UnpackedTarball/boost/boost/functional.hpp using std::unary_/binary_function: +ifeq ($(HAVE_LIBCPP),TRUE) +libmspub_CPPFLAGS += -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION +endif + $(call gb_ExternalProject_get_state_target,libmspub,build) : $(call gb_Trace_StartRange,libmspub,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -36,9 +44,10 @@ $(call gb_ExternalProject_get_state_target,libmspub,build) : --disable-werror \ --disable-weffc \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ - CPPFLAGS="$(CPPFLAGS) $(ICU_UCHAR_TYPE) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libmspub)" \ + CPPFLAGS="$(libmspub_CPPFLAGS)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libmspub)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libmspub,EXTERNAL) diff --git a/external/libmwaw/ExternalProject_libmwaw.mk b/external/libmwaw/ExternalProject_libmwaw.mk index 067de69002bd..7a67a067fa77 100644 --- a/external/libmwaw/ExternalProject_libmwaw.mk +++ b/external/libmwaw/ExternalProject_libmwaw.mk @@ -23,7 +23,7 @@ $(call gb_ExternalProject_get_state_target,libmwaw,build) : $(call gb_Trace_StartRange,libmwaw,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ @@ -36,11 +36,11 @@ $(call gb_ExternalProject_get_state_target,libmwaw,build) : $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ --disable-werror \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libmwaw)" \ $(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && (cd $(EXTERNAL_WORKDIR)/src/lib && \ $(MAKE)) \ diff --git a/external/libmwaw/Library_mwaw.mk b/external/libmwaw/Library_mwaw.mk index bb1a880fd9ce..58d433f9d093 100644 --- a/external/libmwaw/Library_mwaw.mk +++ b/external/libmwaw/Library_mwaw.mk @@ -41,6 +41,12 @@ $(eval $(call gb_Library_add_generated_exception_objects,mwaw,\ UnpackedTarball/libmwaw/src/lib/BeagleWksSSParser \ UnpackedTarball/libmwaw/src/lib/BeagleWksStructManager \ UnpackedTarball/libmwaw/src/lib/BeagleWksText \ + UnpackedTarball/libmwaw/src/lib/Canvas5BMParser \ + UnpackedTarball/libmwaw/src/lib/Canvas5Graph \ + UnpackedTarball/libmwaw/src/lib/Canvas5Image \ + UnpackedTarball/libmwaw/src/lib/Canvas5Parser \ + UnpackedTarball/libmwaw/src/lib/Canvas5Structure \ + UnpackedTarball/libmwaw/src/lib/Canvas5StyleManager \ UnpackedTarball/libmwaw/src/lib/CanvasGraph \ UnpackedTarball/libmwaw/src/lib/CanvasParser \ UnpackedTarball/libmwaw/src/lib/CanvasStyleManager \ @@ -195,11 +201,16 @@ $(eval $(call gb_Library_add_generated_exception_objects,mwaw,\ UnpackedTarball/libmwaw/src/lib/RagTimeSpreadsheet \ UnpackedTarball/libmwaw/src/lib/RagTimeStruct \ UnpackedTarball/libmwaw/src/lib/RagTimeText \ + UnpackedTarball/libmwaw/src/lib/ReadySetGoParser \ + UnpackedTarball/libmwaw/src/lib/ScoopParser \ + UnpackedTarball/libmwaw/src/lib/ScriptWriterParser \ + UnpackedTarball/libmwaw/src/lib/StudentWritingCParser \ UnpackedTarball/libmwaw/src/lib/StyleParser \ UnpackedTarball/libmwaw/src/lib/SuperPaintParser \ UnpackedTarball/libmwaw/src/lib/TeachTxtParser \ UnpackedTarball/libmwaw/src/lib/WingzGraph \ UnpackedTarball/libmwaw/src/lib/WingzParser \ + UnpackedTarball/libmwaw/src/lib/WordMakerParser \ UnpackedTarball/libmwaw/src/lib/WriteNowEntry \ UnpackedTarball/libmwaw/src/lib/WriteNowParser \ UnpackedTarball/libmwaw/src/lib/WriteNowText \ diff --git a/external/libnumbertext/ExternalPackage_numbertext.mk b/external/libnumbertext/ExternalPackage_numbertext.mk index 5379d08fc53a..0116627b87f3 100644 --- a/external/libnumbertext/ExternalPackage_numbertext.mk +++ b/external/libnumbertext/ExternalPackage_numbertext.mk @@ -21,9 +21,11 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libnumbertext_numbertext,$(L data/eo.sor \ data/es.sor \ data/et.sor \ + data/fa.sor \ data/fi.sor \ data/fr.sor \ data/fr.sor \ + data/ga.sor \ data/gl.sor \ data/he.sor \ data/hr.sor \ @@ -35,9 +37,12 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,libnumbertext_numbertext,$(L data/ja.sor \ data/ko.sor \ data/lb.sor \ + data/lg.sor \ data/lt.sor \ data/lv.sor \ + data/mr.sor \ data/ms.sor \ + data/mt.sor \ data/no.sor \ data/nl.sor \ data/pl.sor \ diff --git a/external/libnumbertext/ExternalProject_libnumbertext.mk b/external/libnumbertext/ExternalProject_libnumbertext.mk index f4dbe5f655c3..71376be45dbd 100644 --- a/external/libnumbertext/ExternalProject_libnumbertext.mk +++ b/external/libnumbertext/ExternalProject_libnumbertext.mk @@ -16,25 +16,23 @@ $(eval $(call gb_ExternalProject_register_targets,libnumbertext,\ build \ )) -libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11) +libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11) $(gb_EMSCRIPTEN_CXXFLAGS) -ifneq (,$(filter ANDROID DRAGONFLY FREEBSD iOS LINUX NETBSD OPENBSD,$(OS))) -ifneq (,$(gb_ENABLE_DBGUTIL)) -libnumbertext_CPPFLAGS+=-D_GLIBCXX_DEBUG -endif -endif +libnumbertext_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG) $(gb_EMSCRIPTEN_CPPFLAGS) $(call gb_ExternalProject_get_state_target,libnumbertext,build): $(call gb_Trace_StartRange,libnumbertext,EXTERNAL) $(call gb_ExternalProject_run,build,\ LIBS="$(gb_STDLIBS) $(LIBS)" \ - $(SHELL) ./configure --disable-shared --with-pic \ + $(SHELL) $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(ENABLE_WERROR),--enable-werror,--disable-werror) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\ - $(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(libnumbertext_CPPFLAGS),CPPFLAGS='$(libnumbertext_CPPFLAGS)') \ - CXXFLAGS="$(libnumbertext_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX)" \ + CXXFLAGS="$(libnumbertext_CXXFLAGS) \ + $(call gb_ExternalProject_get_build_flags,libnumbertext) \ + $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libnumbertext)" \ && cd src && $(MAKE) \ ) $(call gb_Trace_EndRange,libnumbertext,EXTERNAL) diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk b/external/libnumbertext/UnpackedTarball_libnumbertext.mk index 48cd2a9a273d..162fafdb6a20 100644 --- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk +++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk @@ -15,9 +15,13 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libnumbertext)) $(eval $(call gb_UnpackedTarball_set_patchlevel,libnumbertext,1)) +# EmptyString.patch1 submitted as +# https://github.com/Numbertext/libnumbertext/pull/95 + $(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \ external/libnumbertext/MSVCNonBMPBug.patch1 \ external/libnumbertext/WinUnicodePath.patch1 \ + external/libnumbertext/deprecated.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/deprecated.patch.0 b/external/libnumbertext/deprecated.patch.0 new file mode 100644 index 000000000000..8ee86ac135c5 --- /dev/null +++ b/external/libnumbertext/deprecated.patch.0 @@ -0,0 +1,43 @@ +--- src/Numbertext.cxx ++++ src/Numbertext.cxx +@@ -41,7 +41,14 @@ + std::wifstream wif(filename); + if (wif.fail()) + return false; ++#if defined __GNUC__ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" ++#endif + wif.imbue(std::locale(std::locale(), new std::codecvt_utf8<wchar_t>)); ++#if defined __GNUC__ ++#pragma GCC diagnostic pop ++#endif + std::wstringstream wss; + wss << wif.rdbuf(); + result = wss.str(); +@@ -122,8 +129,15 @@ + MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, wstr.get(), nSize); + return wstr.get(); + #elif !defined NUMBERTEXT_BOOST ++#if defined __GNUC__ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" ++#endif + typedef std::codecvt_utf8<wchar_t> convert_type; + std::wstring_convert<convert_type, wchar_t> converter; ++#if defined __GNUC__ ++#pragma GCC diagnostic pop ++#endif + return converter.from_bytes( s ); + #else + return ::locale::conv::utf_to_utf<wchar_t>(s.c_str(), s.c_str() + s.size()); +@@ -138,6 +152,9 @@ + WideCharToMultiByte(CP_UTF8, 0, s.c_str(), -1, str.get(), nSize, nullptr, nullptr); + return str.get(); + #elif !defined NUMBERTEXT_BOOST ++#if defined __GNUC__ ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" ++#endif + typedef std::codecvt_utf8<wchar_t> convert_type; + std::wstring_convert<convert_type, wchar_t> converter; + return converter.to_bytes( s ); diff --git a/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 b/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 deleted file mode 100644 index 1fc4e6b9d261..000000000000 --- a/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 +++ /dev/null @@ -1,58 +0,0 @@ -From 68e0c8e4c834df57bc9a0e8da72151f69ff5e7a6 Mon Sep 17 00:00:00 2001 -From: David Tardon <dtardon@redhat.com> -Date: Fri, 12 Aug 2016 12:50:39 +0200 -Subject: [PATCH] tdf#101077 make double->string conversion locale-agnostic - ---- - src/OdsGenerator.cxx | 19 +++++++++++++++++-- - 1 file changed, 17 insertions(+), 2 deletions(-) - -diff --git a/src/OdsGenerator.cxx b/src/OdsGenerator.cxx -index 52e135e..8cb7203 100644 ---- a/src/OdsGenerator.cxx -+++ b/src/OdsGenerator.cxx -@@ -26,6 +26,8 @@ - - #include <librevenge/librevenge.h> - -+#include <iomanip> -+#include <locale> - #include <map> - #include <stack> - #include <sstream> -@@ -46,6 +48,19 @@ - #include "OdcGenerator.hxx" - #include "OdfGenerator.hxx" - -+namespace -+{ -+ -+librevenge::RVNGString makePreciseStr(const double value) -+{ -+ std::ostringstream os; -+ os.imbue(std::locale::classic()); -+ os << std::fixed << std::setprecision(8) << value; -+ return os.str().c_str(); -+} -+ -+} -+ - class OdsGeneratorPrivate : public OdfGenerator - { - public: -@@ -968,10 +983,10 @@ void OdsGenerator::openSheetCell(const librevenge::RVNGPropertyList &propList) - // we need the maximum precision here, so we must avoid getStr() when possible - librevenge::RVNGString value; - if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_GENERIC) -- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()); -+ value = makePreciseStr(propList["librevenge:value"]->getDouble()); - else if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_PERCENT) - { -- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()*100.); -+ value = makePreciseStr(propList["librevenge:value"]->getDouble()*100.); - value.append('%'); - } - else --- -2.7.4 - diff --git a/external/libodfgen/ExternalProject_libodfgen.mk b/external/libodfgen/ExternalProject_libodfgen.mk index 679598542b30..c3df917c0177 100644 --- a/external/libodfgen/ExternalProject_libodfgen.mk +++ b/external/libodfgen/ExternalProject_libodfgen.mk @@ -16,6 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,libodfgen,\ )) $(eval $(call gb_ExternalProject_use_externals,libodfgen,\ + libxml2 \ revenge \ )) @@ -23,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libodfgen,build) : $(call gb_Trace_StartRange,libodfgen,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ @@ -34,14 +35,15 @@ $(call gb_ExternalProject_get_state_target,libodfgen,build) : --disable-werror \ --disable-weffc \ --without-docs \ - --with-sharedptr=c++11 \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libodfgen)" \ CPPFLAGS="$(CPPFLAGS) $(if $(SYSTEM_REVENGE),,$(if $(filter-out MSC,$(COM)),-DLIBREVENGE_VISIBILITY))" \ + XML_CFLAGS="$(LIBXML_CFLAGS)" \ + XML_LIBS="$(LIBXML_LIBS)" \ $(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ diff --git a/external/libodfgen/Library_odfgen.mk b/external/libodfgen/Library_odfgen.mk index 946fa9081452..b67f5ad89715 100644 --- a/external/libodfgen/Library_odfgen.mk +++ b/external/libodfgen/Library_odfgen.mk @@ -12,6 +12,7 @@ $(eval $(call gb_Library_Library,odfgen)) $(eval $(call gb_Library_use_unpacked,odfgen,libodfgen)) $(eval $(call gb_Library_use_externals,odfgen,\ + libxml2 \ revenge \ )) @@ -26,7 +27,6 @@ $(eval $(call gb_Library_add_defs,odfgen,\ -DDLL_EXPORT \ -DLIBODFGEN_BUILD \ -DNDEBUG \ - -DSHAREDPTR_STD \ -DPACKAGE=\"libodfgen\" \ -DVERSION=\"0.1.$(ODFGEN_VERSION_MICRO)\" \ )) @@ -40,6 +40,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,odfgen,\ UnpackedTarball/libodfgen/src/GraphicStyle \ UnpackedTarball/libodfgen/src/InternalHandler \ UnpackedTarball/libodfgen/src/ListStyle \ + UnpackedTarball/libodfgen/src/NumberingStyle \ UnpackedTarball/libodfgen/src/OdcGenerator \ UnpackedTarball/libodfgen/src/OdfGenerator \ UnpackedTarball/libodfgen/src/OdgGenerator \ diff --git a/external/libodfgen/UnpackedTarball_libodfgen.mk b/external/libodfgen/UnpackedTarball_libodfgen.mk index c4ea2939f4cb..c9790e1033de 100644 --- a/external/libodfgen/UnpackedTarball_libodfgen.mk +++ b/external/libodfgen/UnpackedTarball_libodfgen.mk @@ -15,6 +15,13 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libodfgen,0)) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libodfgen)) +# * external/libodfgen/ellipticalarc.patch reported upstream as +# <https://sourceforge.net/p/libwpd/mailman/message/37329517/> "[Libwpd-devel] [PATCH] Avoid +# division by zero for empty elliptical arc": +$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \ + external/libodfgen/ellipticalarc.patch \ +)) + ifeq ($(SYSTEM_REVENGE),) $(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \ external/libodfgen/rpath.patch \ @@ -29,12 +36,4 @@ $(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \ endif endif -# * external/libodfgen/c++11.patch: obsoleted upstream by -# <https://sourceforge.net/p/libwpd/libodfgen/ci/e11112e50562de4f3252227bfba175ededf82194/> -# "boost::shared_ptr -> std::shared_ptr" -$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \ - external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 \ - external/libodfgen/c++11.patch \ -)) - # vim: set noet sw=4 ts=4: diff --git a/external/libodfgen/c++11.patch b/external/libodfgen/c++11.patch deleted file mode 100644 index f41d1a166964..000000000000 --- a/external/libodfgen/c++11.patch +++ /dev/null @@ -1,44 +0,0 @@ -# Add -std=c++11 before existing CXXFLAGS, in case those already contain some -std= (which will thus -# override the preceding -std=c++11, which is likely what the caller passing in those CXXFLAGS -# intends): -# -#--- configure.ac -#+++ configure.ac -#@@ -217,7 +217,7 @@ -# AS_IF([test "x$with_sharedptr" = "xc++11"], [ -# AC_MSG_CHECKING([for c++11 shared ptr]) -# save_CXXFLAGS="$CXXFLAGS" -#- CXXFLAGS="$CXXFLAGS -std=c++11" -#+ CXXFLAGS="-std=c++11 $CXXFLAGS" -# AC_COMPILE_IFELSE([ -# AC_LANG_PROGRAM( -# [[#include <memory>]], -#@@ -241,7 +241,7 @@ -# AC_MSG_RESULT([no]) -# ], [ -# AC_MSG_RESULT([yes]) -#- CXXFLAGS="$CXXFLAGS -std=c++11" -#+ CXXFLAGS="-std=c++11 $CXXFLAGS" -# ]) -# ]) -# AS_IF([test "x$with_sharedptr" = "xtr1"], [ ---- configure -+++ configure -@@ -16723,7 +16723,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for c++11 shared ptr" >&5 - $as_echo_n "checking for c++11 shared ptr... " >&6; } - save_CXXFLAGS="$CXXFLAGS" -- CXXFLAGS="$CXXFLAGS -std=c++11" -+ CXXFLAGS="-std=c++11 $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -16780,7 +16780,7 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } -- CXXFLAGS="$CXXFLAGS -std=c++11" -+ CXXFLAGS="-std=c++11 $CXXFLAGS" - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext diff --git a/external/libodfgen/ellipticalarc.patch b/external/libodfgen/ellipticalarc.patch new file mode 100644 index 000000000000..27aaee77cb8a --- /dev/null +++ b/external/libodfgen/ellipticalarc.patch @@ -0,0 +1,13 @@ +--- src/GraphicFunctions.cxx ++++ src/GraphicFunctions.cxx +@@ -59,6 +59,10 @@ + double rx, double ry, double phi, bool largeArc, bool sweep, double x, double y, + double &xmin, double &ymin, double &xmax, double &ymax) + { ++ if (x0 == x && y0 == y) { ++ return; ++ } ++ + phi *= M_PI/180; + if (rx < 0.0) + rx *= -1.0; diff --git a/external/libodfgen/libodfgen-bundled-soname.patch.0 b/external/libodfgen/libodfgen-bundled-soname.patch.0 index 052ba795e40e..d012fe3a8f65 100644 --- a/external/libodfgen/libodfgen-bundled-soname.patch.0 +++ b/external/libodfgen/libodfgen-bundled-soname.patch.0 @@ -1,9 +1,10 @@ +-*- Mode: Diff -*- diff -urN src/Makefile.in.orig src/Makefile.in --- src/Makefile.in.orig 2016-03-02 17:17:02.812606210 +0100 +++ src/Makefile.in 2016-03-02 17:17:25.176670151 +0100 @@ -355,7 +355,7 @@ - AM_CXXFLAGS = -I$(top_srcdir)/inc/ $(REVENGE_CFLAGS) $(DEBUG_CXXFLAGS) -DLIBODFGEN_BUILD - libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LIBADD = @LIBODFGEN_WIN32_RESOURCE@ $(REVENGE_LIBS) + $(XML_CFLAGS) -DLIBODFGEN_BUILD $(am__append_1) + libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LIBADD = @LIBODFGEN_WIN32_RESOURCE@ $(REVENGE_LIBS) $(XML_LIBS) libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_DEPENDENCIES = @LIBODFGEN_WIN32_RESOURCE@ -libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined +libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined -release lo diff --git a/external/liborcus/ExternalPackage_liborcus.mk b/external/liborcus/ExternalPackage_liborcus.mk index 747691809d2e..4adfcb247bdc 100644 --- a/external/liborcus/ExternalPackage_liborcus.mk +++ b/external/liborcus/ExternalPackage_liborcus.mk @@ -12,11 +12,11 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,liborcus,liborcus)) $(eval $(call gb_ExternalPackage_use_external_project,liborcus,liborcus)) ifeq ($(OS),MACOSX) -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.16.0.dylib,src/liborcus/.libs/liborcus-0.16.0.dylib)) -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.16.0.dylib,src/parser/.libs/liborcus-parser-0.16.0.dylib)) +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.18.0.dylib,src/liborcus/.libs/liborcus-0.18.0.dylib)) +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.18.0.dylib,src/parser/.libs/liborcus-parser-0.18.0.dylib)) else ifeq ($(DISABLE_DYNLOADING),) -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.16.so.0,src/liborcus/.libs/liborcus-0.16.so.0.0.0)) -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.16.so.0,src/parser/.libs/liborcus-parser-0.16.so.0.0.0)) +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.18.so.0,src/liborcus/.libs/liborcus-0.18.so.0.0.0)) +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.18.so.0,src/parser/.libs/liborcus-parser-0.18.so.0.0.0)) endif # vim: set noet sw=4 ts=4: diff --git a/external/liborcus/ExternalProject_liborcus.mk b/external/liborcus/ExternalProject_liborcus.mk index c2a8cdcbe4a3..7f2e5f24083f 100644 --- a/external/liborcus/ExternalProject_liborcus.mk +++ b/external/liborcus/ExternalProject_liborcus.mk @@ -47,7 +47,7 @@ ifeq ($(OS),ANDROID) liborcus_LIBS+=$(gb_STDLIBS) endif -liborcus_CPPCLAGS=$(CPPFLAGS) +liborcus_CPPFLAGS=$(CPPFLAGS) ifeq ($(SYSTEM_ZLIB),) liborcus_CPPFLAGS+=$(ZLIB_CFLAGS) endif @@ -58,14 +58,12 @@ endif # library (glibc), the NDK does offer the GNU C++ library as one of # the C++ libraries available, and we use it. # -ifneq (,$(filter ANDROID DRAGONFLY FREEBSD iOS LINUX NETBSD OPENBSD,$(OS))) -ifneq (,$(gb_ENABLE_DBGUTIL)) -liborcus_CPPFLAGS+=-D_GLIBCXX_DEBUG -endif -endif +liborcus_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG) liborcus_CXXFLAGS=$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(CXXFLAGS_CXX11) -DBOOST_SYSTEM_NO_DEPRECATED liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS) +liborcus_CXXFLAGS+=$(call gb_ExternalProject_get_build_flags,liborcus) +liborcus_LDFLAGS+=$(call gb_ExternalProject_get_link_flags,liborcus) ifeq ($(COM),MSC) liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS) endif @@ -82,24 +80,16 @@ ifeq ($(OS),LINUX) liborcus_LDFLAGS+=-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN endif -ifeq ($(ENABLE_GDB_INDEX),TRUE) -liborcus_LDFLAGS+=-Wl,--gdb-index -liborcus_CXXFLAGS+=-ggnu-pubnames -ifneq ($(USE_LD),) -liborcus_LDFLAGS += $(USE_LD) -endif -endif - $(call gb_ExternalProject_get_state_target,liborcus,build) : $(call gb_Trace_StartRange,liborcus,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \ $(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \ - $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS)') \ + $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)') \ $(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \ MDDS_CFLAGS='$(MDDS_CFLAGS)' \ MDDS_LIBS=' ' \ - MAKE=$(MAKE) ./configure \ + MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ @@ -109,6 +99,8 @@ $(call gb_ExternalProject_get_state_target,liborcus,build) : $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \ --disable-spreadsheet-model \ --without-tools \ + --without-benchmark \ + --without-doc-example \ --disable-python \ --disable-werror \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ @@ -118,13 +110,13 @@ $(call gb_ExternalProject_get_state_target,liborcus,build) : boost_cv_lib_system=yes \ boost_cv_lib_filesystem=yes \ ) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ && $(if $(verbose),V=1) \ $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \ - $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.16.0.dylib \ - $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.16.0.dylib \ + $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.18.0.dylib \ + $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.18.0.dylib \ ) \ ) $(call gb_Trace_EndRange,liborcus,EXTERNAL) diff --git a/external/liborcus/Library_orcus-parser.mk b/external/liborcus/Library_orcus-parser.mk index 4e46591b98fe..b7b459f36b7f 100644 --- a/external/liborcus/Library_orcus-parser.mk +++ b/external/liborcus/Library_orcus-parser.mk @@ -54,7 +54,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus-parser,\ UnpackedTarball/liborcus/src/parser/json_parser_thread \ UnpackedTarball/liborcus/src/parser/parser_base \ UnpackedTarball/liborcus/src/parser/parser_global \ - UnpackedTarball/liborcus/src/parser/pstring \ UnpackedTarball/liborcus/src/parser/sax_parser_base \ UnpackedTarball/liborcus/src/parser/sax_token_parser \ UnpackedTarball/liborcus/src/parser/sax_token_parser_thread \ @@ -62,6 +61,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus-parser,\ UnpackedTarball/liborcus/src/parser/string_pool \ UnpackedTarball/liborcus/src/parser/tokens \ UnpackedTarball/liborcus/src/parser/types \ + UnpackedTarball/liborcus/src/parser/utf8 \ UnpackedTarball/liborcus/src/parser/xml_namespace \ UnpackedTarball/liborcus/src/parser/xml_writer \ UnpackedTarball/liborcus/src/parser/yaml_parser_base \ diff --git a/external/liborcus/Library_orcus.mk b/external/liborcus/Library_orcus.mk index 0a0ca582882a..28ef13612260 100644 --- a/external/liborcus/Library_orcus.mk +++ b/external/liborcus/Library_orcus.mk @@ -59,15 +59,18 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/dom_tree \ UnpackedTarball/liborcus/src/liborcus/format_detection \ UnpackedTarball/liborcus/src/liborcus/formula_result \ - UnpackedTarball/liborcus/src/liborcus/global \ UnpackedTarball/liborcus/src/liborcus/gnumeric_cell_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_detection_handler \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_filter_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_handler \ - UnpackedTarball/liborcus/src/liborcus/gnumeric_helper \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_names_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_namespace_types \ UnpackedTarball/liborcus/src/liborcus/gnumeric_sheet_context \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_styles_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_tokens \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_types \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_value_format_parser \ UnpackedTarball/liborcus/src/liborcus/info \ UnpackedTarball/liborcus/src/liborcus/interface \ UnpackedTarball/liborcus/src/liborcus/json_document_tree \ @@ -76,15 +79,17 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/json_structure_tree \ UnpackedTarball/liborcus/src/liborcus/json_util \ UnpackedTarball/liborcus/src/liborcus/measurement \ + UnpackedTarball/liborcus/src/liborcus/number_utils \ + UnpackedTarball/liborcus/src/liborcus/odf_document_styles_context \ UnpackedTarball/liborcus/src/liborcus/odf_helper \ UnpackedTarball/liborcus/src/liborcus/odf_namespace_types \ - UnpackedTarball/liborcus/src/liborcus/odf_number_formatting_context \ + UnpackedTarball/liborcus/src/liborcus/odf_number_format_context \ UnpackedTarball/liborcus/src/liborcus/odf_para_context \ - UnpackedTarball/liborcus/src/liborcus/odf_styles \ + UnpackedTarball/liborcus/src/liborcus/odf_style_context \ UnpackedTarball/liborcus/src/liborcus/odf_styles_context \ + UnpackedTarball/liborcus/src/liborcus/odf_styles \ UnpackedTarball/liborcus/src/liborcus/odf_tokens \ UnpackedTarball/liborcus/src/liborcus/ods_content_xml_context \ - UnpackedTarball/liborcus/src/liborcus/ods_content_xml_handler \ UnpackedTarball/liborcus/src/liborcus/ods_dde_links_context \ UnpackedTarball/liborcus/src/liborcus/ods_session_data \ UnpackedTarball/liborcus/src/liborcus/ooxml_content_types \ @@ -101,8 +106,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/orcus_import_xlsx \ UnpackedTarball/liborcus/src/liborcus/orcus_json \ UnpackedTarball/liborcus/src/liborcus/orcus_ods \ - UnpackedTarball/liborcus/src/liborcus/orcus_xls_xml \ UnpackedTarball/liborcus/src/liborcus/orcus_xlsx \ + UnpackedTarball/liborcus/src/liborcus/orcus_xls_xml \ UnpackedTarball/liborcus/src/liborcus/orcus_xml \ UnpackedTarball/liborcus/src/liborcus/orcus_xml_impl \ UnpackedTarball/liborcus/src/liborcus/orcus_xml_map_def \ @@ -112,32 +117,37 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/spreadsheet_interface \ UnpackedTarball/liborcus/src/liborcus/spreadsheet_types \ UnpackedTarball/liborcus/src/liborcus/string_helper \ - UnpackedTarball/liborcus/src/liborcus/xls_xml_context \ - UnpackedTarball/liborcus/src/liborcus/xls_xml_detection_handler \ - UnpackedTarball/liborcus/src/liborcus/xls_xml_handler \ - UnpackedTarball/liborcus/src/liborcus/xls_xml_namespace_types \ - UnpackedTarball/liborcus/src/liborcus/xls_xml_tokens \ UnpackedTarball/liborcus/src/liborcus/xlsx_autofilter_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_conditional_format_context \ - UnpackedTarball/liborcus/src/liborcus/xlsx_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_drawing_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_handler \ UnpackedTarball/liborcus/src/liborcus/xlsx_helper \ + UnpackedTarball/liborcus/src/liborcus/xls_xml_context \ + UnpackedTarball/liborcus/src/liborcus/xls_xml_detection_handler \ + UnpackedTarball/liborcus/src/liborcus/xls_xml_handler \ + UnpackedTarball/liborcus/src/liborcus/xls_xml_namespace_types \ + UnpackedTarball/liborcus/src/liborcus/xls_xml_tokens \ UnpackedTarball/liborcus/src/liborcus/xlsx_pivot_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_revision_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_session_data \ + UnpackedTarball/liborcus/src/liborcus/xlsx_shared_strings_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_sheet_context \ + UnpackedTarball/liborcus/src/liborcus/xlsx_styles_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_table_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_types \ UnpackedTarball/liborcus/src/liborcus/xlsx_workbook_context \ UnpackedTarball/liborcus/src/liborcus/xml_context_base \ UnpackedTarball/liborcus/src/liborcus/xml_context_global \ + UnpackedTarball/liborcus/src/liborcus/xml_element_types \ + UnpackedTarball/liborcus/src/liborcus/xml_element_validator \ + UnpackedTarball/liborcus/src/liborcus/xml_empty_context \ UnpackedTarball/liborcus/src/liborcus/xml_map_tree \ UnpackedTarball/liborcus/src/liborcus/xml_simple_stream_handler \ UnpackedTarball/liborcus/src/liborcus/xml_stream_handler \ UnpackedTarball/liborcus/src/liborcus/xml_stream_parser \ UnpackedTarball/liborcus/src/liborcus/xml_structure_mapper \ UnpackedTarball/liborcus/src/liborcus/xml_structure_tree \ + UnpackedTarball/liborcus/src/liborcus/xml_util \ UnpackedTarball/liborcus/src/liborcus/xpath_parser \ UnpackedTarball/liborcus/src/liborcus/yaml_document_tree \ )) diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index 113e8e25818d..3de24f0135d7 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -19,13 +19,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/rpath.patch.0 \ external/liborcus/gcc9.patch.0 \ external/liborcus/libtool.patch.0 \ - external/liborcus/fix-pch.patch.0 \ - external/liborcus/include.patch.0 \ )) ifeq ($(OS),WNT) $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/windows-constants-hack.patch \ + external/liborcus/win_path_utf16.patch \ )) endif diff --git a/external/liborcus/fix-pch.patch.0 b/external/liborcus/fix-pch.patch.0 deleted file mode 100644 index 42a9d52d99f6..000000000000 --- a/external/liborcus/fix-pch.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ ---- src/liborcus/gnumeric_cell_context.cpp.sav 2018-05-27 18:18:56.000000000 +0200 -+++ src/liborcus/gnumeric_cell_context.cpp 2019-10-13 10:43:24.587258400 +0200 -@@ -248,7 +248,7 @@ - range.last.column = col + mp_cell_data->array_cols - 1; - range.last.row = row + mp_cell_data->array_rows - 1; - -- iface::import_array_formula* af = mp_sheet->get_array_formula(); -+ spreadsheet::iface::import_array_formula* af = mp_sheet->get_array_formula(); - if (af) - { - af->set_range(range); diff --git a/external/liborcus/gcc9.patch.0 b/external/liborcus/gcc9.patch.0 index f89b1dddccb1..da404038e68e 100644 --- a/external/liborcus/gcc9.patch.0 +++ b/external/liborcus/gcc9.patch.0 @@ -1,10 +1,9 @@ --- include/orcus/types.hpp +++ include/orcus/types.hpp -@@ -7,6 +7,14 @@ - +@@ -8,6 +8,14 @@ #ifndef INCLUDED_ORCUS_TYPES_HPP #define INCLUDED_ORCUS_TYPES_HPP -+ + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" // for old GCC @@ -12,17 +11,17 @@ +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wshadow" +#endif - ++ + #include <cstdint> #include <cstdlib> #include <vector> -@@ -145,6 +152,10 @@ - typedef ::std::vector<xml_token_attr_t> xml_attrs_t; - +@@ -629,5 +637,9 @@ ORCUS_PSR_DLLPUBLIC extern const xml_token_t XML_UNKNOWN_TOKEN; + } -+ + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif - ++ #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/external/liborcus/inc/pch/precompiled_orcus-parser.hxx b/external/liborcus/inc/pch/precompiled_orcus-parser.hxx index 1427148445d1..9d800f45b254 100644 --- a/external/liborcus/inc/pch/precompiled_orcus-parser.hxx +++ b/external/liborcus/inc/pch/precompiled_orcus-parser.hxx @@ -13,13 +13,14 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-09-21 15:21:18 using: + Generated on 2023-01-24 17:21:40 using: ./bin/update_pch external/liborcus orcus-parser --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: ./bin/update_pch_bisect ./external/liborcus/inc/pch/precompiled_orcus-parser.hxx "make external/liborcus.build" --find-conflicts */ +#include <sal/config.h> #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> @@ -31,11 +32,15 @@ #include <cstring> #include <deque> #include <fstream> +#include <iomanip> #include <iostream> +#include <iterator> #include <limits> #include <locale> #include <memory> #include <sstream> +#include <stdexcept> +#include <string_view> #include <tuple> #include <unordered_map> #include <unordered_set> @@ -62,14 +67,12 @@ #include <orcus/csv_parser_base.hpp> #include <orcus/detail/parser_token_buffer.hpp> #include <orcus/exception.hpp> -#include <orcus/global.hpp> #include <orcus/json_global.hpp> #include <orcus/json_parser.hpp> #include <orcus/json_parser_base.hpp> #include <orcus/json_parser_thread.hpp> #include <orcus/parser_base.hpp> #include <orcus/parser_global.hpp> -#include <orcus/pstring.hpp> #include <orcus/sax_parser_base.hpp> #include <orcus/sax_token_parser.hpp> #include <orcus/sax_token_parser_thread.hpp> diff --git a/external/liborcus/inc/pch/precompiled_orcus.hxx b/external/liborcus/inc/pch/precompiled_orcus.hxx index 9edb13aec79b..0c2e3ffd1719 100644 --- a/external/liborcus/inc/pch/precompiled_orcus.hxx +++ b/external/liborcus/inc/pch/precompiled_orcus.hxx @@ -13,13 +13,14 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-09-21 15:21:19 using: + Generated on 2023-01-24 17:20:59 using: ./bin/update_pch external/liborcus orcus --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: ./bin/update_pch_bisect ./external/liborcus/inc/pch/precompiled_orcus.hxx "make external/liborcus.build" --find-conflicts */ +#include <sal/config.h> #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> @@ -36,9 +37,12 @@ #include <locale> #include <map> #include <memory> +#include <optional> #include <ostream> #include <sstream> +#include <stdexcept> #include <string> +#include <string_view> #include <unordered_map> #include <unordered_set> #include <vector> @@ -46,7 +50,6 @@ #include <boost/filesystem.hpp> #include <boost/iostreams/filter/gzip.hpp> #include <boost/iostreams/filtering_stream.hpp> -#include <boost/optional.hpp> #include <boost/pool/object_pool.hpp> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 @@ -62,7 +65,6 @@ #include <orcus/dom_tree.hpp> #include <orcus/exception.hpp> #include <orcus/format_detection.hpp> -#include <orcus/global.hpp> #include <orcus/info.hpp> #include <orcus/interface.hpp> #include <orcus/json_document_tree.hpp> @@ -81,7 +83,6 @@ #include <orcus/orcus_xml.hpp> #include <orcus/parser_base.hpp> #include <orcus/parser_global.hpp> -#include <orcus/pstring.hpp> #include <orcus/sax_ns_parser.hpp> #include <orcus/sax_parser.hpp> #include <orcus/sax_parser_base.hpp> @@ -89,6 +90,7 @@ #include <orcus/spreadsheet/export_interface.hpp> #include <orcus/spreadsheet/import_interface.hpp> #include <orcus/spreadsheet/import_interface_pivot.hpp> +#include <orcus/spreadsheet/import_interface_styles.hpp> #include <orcus/spreadsheet/import_interface_view.hpp> #include <orcus/spreadsheet/styles.hpp> #include <orcus/spreadsheet/types.hpp> diff --git a/external/liborcus/include.patch.0 b/external/liborcus/include.patch.0 deleted file mode 100644 index a3275b1b13fa..000000000000 --- a/external/liborcus/include.patch.0 +++ /dev/null @@ -1,30 +0,0 @@ ---- src/liborcus/orcus_xlsx.cpp -+++ src/liborcus/orcus_xlsx.cpp -@@ -32,6 +32,7 @@ - - #include <cstdlib> - #include <iostream> -+#include <limits> - #include <string> - #include <cstring> - #include <sstream> ---- src/liborcus/xls_xml_context.cpp -+++ src/liborcus/xls_xml_context.cpp -@@ -16,6 +16,7 @@ - #include <mdds/sorted_string_map.hpp> - - #include <iostream> -+#include <limits> - - using namespace std; - namespace ss = orcus::spreadsheet; ---- src/liborcus/xlsx_revision_context.cpp -+++ src/liborcus/xlsx_revision_context.cpp -@@ -16,6 +16,7 @@ - #include "orcus/global.hpp" - - #include <iostream> -+#include <limits> - - using namespace std; - diff --git a/external/liborcus/win_path_utf16.patch b/external/liborcus/win_path_utf16.patch new file mode 100644 index 000000000000..0a6781e728b3 --- /dev/null +++ b/external/liborcus/win_path_utf16.patch @@ -0,0 +1,33 @@ +diff --git a/src/parser/stream.cpp b/src/parser/stream.cpp +index 00395f59ff25..8f385fb8965a 100644 +--- a/src/parser/stream.cpp ++++ b/src/parser/stream.cpp +@@ -147,6 +147,14 @@ std::tuple<std::string_view, size_t, size_t> find_line_with_offset(std::string_v + return std::make_tuple(line, line_num, offset_on_line); + } + ++#ifdef _WIN32 ++std::wstring to_wstring(std::string_view s) ++{ ++ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> conversion; ++ return conversion.from_bytes(s.data(), s.data() + s.size()); ++} ++#endif ++ + } // anonymous namespace + + struct file_content::impl +@@ -162,8 +170,13 @@ struct file_content::impl + impl() : content_size(0), content(nullptr) {} + + impl(std::string_view filepath) : ++#ifdef _WIN32 ++ content_size(fs::file_size(to_wstring(filepath))), ++ mapped_file(to_wstring(filepath).c_str(), bip::read_only), ++#else + content_size(fs::file_size(std::string{filepath}.c_str())), + mapped_file(std::string{filepath}.c_str(), bip::read_only), ++#endif + mapped_region(mapped_file, bip::read_only, 0, content_size), + content(nullptr) + { diff --git a/external/liborcus/windows-constants-hack.patch b/external/liborcus/windows-constants-hack.patch index 51aabfa1fb47..28cf0997a168 100644 --- a/external/liborcus/windows-constants-hack.patch +++ b/external/liborcus/windows-constants-hack.patch @@ -3,13 +3,13 @@ index ae571f5..539ce18 100644 --- a/src/liborcus/info.cpp +++ b/src/liborcus/info.cpp @@ -7,7 +7,9 @@ - + #include "orcus/info.hpp" - + -#include "constants.inl" +#define ORCUS_MAJOR_VERSION 0 -+#define ORCUS_MINOR_VERSION 16 -+#define ORCUS_MICRO_VERSION 0 - ++#define ORCUS_MINOR_VERSION 19 ++#define ORCUS_MICRO_VERSION 2 + namespace orcus { - + diff --git a/external/libpagemaker/ExternalProject_libpagemaker.mk b/external/libpagemaker/ExternalProject_libpagemaker.mk index 34254b872713..d663ffaf9ea9 100644 --- a/external/libpagemaker/ExternalProject_libpagemaker.mk +++ b/external/libpagemaker/ExternalProject_libpagemaker.mk @@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libpagemaker,build) : $(call gb_Trace_StartRange,libpagemaker,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -34,9 +34,10 @@ $(call gb_ExternalProject_get_state_target,libpagemaker,build) : --disable-werror \ --disable-weffc \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libpagemaker)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libpagemaker)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libpagemaker,EXTERNAL) diff --git a/external/libpng/StaticLibrary_libpng.mk b/external/libpng/StaticLibrary_libpng.mk index 77f1b29dc00a..6f07750c55eb 100644 --- a/external/libpng/StaticLibrary_libpng.mk +++ b/external/libpng/StaticLibrary_libpng.mk @@ -33,7 +33,7 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,libpng,\ UnpackedTarball/libpng/pngwrite \ UnpackedTarball/libpng/pngwtran \ UnpackedTarball/libpng/pngwutil \ - $(if $(filter ARM AARCH64 ARM64,$(CPUNAME)),\ + $(if $(filter ARM AARCH64,$(CPUNAME)),\ UnpackedTarball/libpng/arm/arm_init \ UnpackedTarball/libpng/arm/filter_neon_intrinsics \ UnpackedTarball/libpng/arm/palette_neon_intrinsics \ @@ -42,6 +42,16 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,libpng,\ UnpackedTarball/libpng/powerpc/powerpc_init \ UnpackedTarball/libpng/powerpc/filter_vsx_intrinsics \ ) \ + $(if $(filter INTEL X86_64,$(CPUNAME)), \ + UnpackedTarball/libpng/intel/intel_init \ + UnpackedTarball/libpng/intel/filter_sse2_intrinsics \ + ) \ +)) + +$(eval $(call gb_StaticLibrary_add_defs,libpng,\ + $(if $(filter ARM AARCH64,$(CPUNAME)), -DPNG_ARM_NEON) \ + $(if $(filter POWERPC POWERPC64,$(CPUNAME)), -DPNG_POWERPC_VSX ) \ + $(if $(filter INTEL X86_64,$(CPUNAME)), -DPNG_INTEL_SSE_OPT) \ )) # At least on Linux, with --enable-lto, when building both this external/libpng and external/skia, diff --git a/external/libpng/UnpackedTarball_libpng.mk b/external/libpng/UnpackedTarball_libpng.mk index 2a8ad3f84406..dca4e4b5cfe9 100644 --- a/external/libpng/UnpackedTarball_libpng.mk +++ b/external/libpng/UnpackedTarball_libpng.mk @@ -15,8 +15,4 @@ $(eval $(call gb_UnpackedTarball_add_files,libpng,.,\ external/libpng/configs/pnglibconf.h \ )) -$(eval $(call gb_UnpackedTarball_add_patches,libpng,\ - external/libpng/libpng-osx.patch.1 \ -)) - # vim: set noet sw=4 ts=4: diff --git a/external/libpng/libpng-osx.patch.1 b/external/libpng/libpng-osx.patch.1 deleted file mode 100644 index 0e9d7336a762..000000000000 --- a/external/libpng/libpng-osx.patch.1 +++ /dev/null @@ -1,16 +0,0 @@ --*- Mode: Diff -*- - -Avoid warning: 'inflateValidate' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] - ---- a/pngrutil.c -+++ b/pngrutil.c -@@ -419,7 +419,8 @@ - } - - #if ZLIB_VERNUM >= 0x1290 && \ -- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) -+ defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) && \ -+ !(defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 101300) - if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON) - /* Turn off validation of the ADLER32 checksum in IDAT chunks */ - ret = inflateValidate(&png_ptr->zstream, 0); diff --git a/external/libqxp/ExternalProject_libqxp.mk b/external/libqxp/ExternalProject_libqxp.mk index f1b63f6bfa38..0cafe24e0634 100644 --- a/external/libqxp/ExternalProject_libqxp.mk +++ b/external/libqxp/ExternalProject_libqxp.mk @@ -25,7 +25,7 @@ $(call gb_ExternalProject_get_state_target,libqxp,build) : $(call gb_Trace_StartRange,libqxp,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -37,9 +37,10 @@ $(call gb_ExternalProject_get_state_target,libqxp,build) : --disable-weffc \ $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libqxp)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libqxp)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libqxp,EXTERNAL) diff --git a/external/librevenge/ExternalProject_librevenge.mk b/external/librevenge/ExternalProject_librevenge.mk index 7c3e36761e22..4e64d5534b6b 100644 --- a/external/librevenge/ExternalProject_librevenge.mk +++ b/external/librevenge/ExternalProject_librevenge.mk @@ -23,7 +23,7 @@ $(call gb_ExternalProject_get_state_target,librevenge,build) : $(call gb_Trace_StartRange,librevenge,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --disable-shared --enable-static, \ @@ -35,9 +35,9 @@ $(call gb_ExternalProject_get_state_target,librevenge,build) : --disable-generators \ --without-docs \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,librevenge)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ diff --git a/external/librevenge/UnpackedTarball_librevenge.mk b/external/librevenge/UnpackedTarball_librevenge.mk index 74f28751c609..5fcc2e33b060 100644 --- a/external/librevenge/UnpackedTarball_librevenge.mk +++ b/external/librevenge/UnpackedTarball_librevenge.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,librevenge,0)) $(eval $(call gb_UnpackedTarball_add_patches,librevenge, \ external/librevenge/rpath.patch \ + external/librevenge/tdf63130-improve-perf.patch.0 \ )) ifneq ($(OS),MACOSX) diff --git a/external/librevenge/tdf63130-improve-perf.patch.0 b/external/librevenge/tdf63130-improve-perf.patch.0 new file mode 100644 index 000000000000..02a8a6e1f94b --- /dev/null +++ b/external/librevenge/tdf63130-improve-perf.patch.0 @@ -0,0 +1,80 @@ +--- inc/librevenge/RVNGString.h 2023-05-17 15:48:15.373159469 +0200 ++++ inc/librevenge/RVNGString.h 2023-05-17 15:49:00.781411917 +0200 +@@ -22,6 +22,7 @@ + #define RVNGSTRING_H + + #include "librevenge-api.h" ++#include <string> + + namespace librevenge + { +@@ -36,6 +37,7 @@ + RVNGString(); + RVNGString(const RVNGString &other); + RVNGString(const char *str); ++ RVNGString(std::string&&); + ~RVNGString(); + + /** Create a new string from \a s as escaped XML. +--- src/lib/RVNGBinaryData.cpp 2023-05-17 15:48:15.373159469 +0200 ++++ src/lib/RVNGBinaryData.cpp 2023-05-17 15:49:00.773411873 +0200 +@@ -67,9 +67,9 @@ + boost::archive::iterators::transform_width<std::vector<unsigned char>::const_iterator, 6, 8 > > base64_encoder; + + // Encode the buffer and create a string +- std::copy( ++ result.insert(result.begin(), + base64_encoder(source.begin()), +- base64_encoder(source.end()), std::back_inserter(result)); ++ base64_encoder(source.end())); + + result.append(numPadding, '='); // add '=' for each padded character + } +@@ -150,10 +150,10 @@ + { + m_binaryDataImpl->makeUnique(); + +- unsigned long previousSize = m_binaryDataImpl->m_ptr->m_buf.size(); +- m_binaryDataImpl->m_ptr->m_buf.reserve(previousSize + data.m_binaryDataImpl->m_ptr->m_buf.size()); +- for (unsigned long i = 0; i < data.m_binaryDataImpl->m_ptr->m_buf.size(); i++) +- m_binaryDataImpl->m_ptr->m_buf.push_back(data.m_binaryDataImpl->m_ptr->m_buf[i]); ++ m_binaryDataImpl->m_ptr->m_buf.insert( ++ m_binaryDataImpl->m_ptr->m_buf.end(), ++ data.m_binaryDataImpl->m_ptr->m_buf.begin(), ++ data.m_binaryDataImpl->m_ptr->m_buf.end()); + } + + void RVNGBinaryData::appendBase64Data(const RVNGString &base64) +@@ -231,8 +231,9 @@ + const RVNGString RVNGBinaryData::getBase64Data() const + { + std::string base64; ++ base64.reserve(m_binaryDataImpl->m_ptr->m_buf.size() / 4 * 3); + convertToBase64(base64, m_binaryDataImpl->m_ptr->m_buf); +- return RVNGString(base64.c_str()); ++ return RVNGString(std::move(base64)); + } + + RVNGInputStream *RVNGBinaryData::getDataStream() const +--- src/lib/RVNGString.cpp 2023-05-17 15:48:15.373159469 +0200 ++++ src/lib/RVNGString.cpp 2023-05-17 15:49:00.773411873 +0200 +@@ -73,6 +73,7 @@ + { + public: + RVNGStringImpl() : m_buf() {} ++ RVNGStringImpl(std::string&& str) : m_buf(std::move(str)) {} + bool empty() const + { + return m_buf.empty(); +@@ -157,6 +158,11 @@ + m_stringImpl->m_buf = str; + } + ++RVNGString::RVNGString(std::string&& str) : ++ m_stringImpl(new RVNGStringImpl(std::move(str))) ++{ ++} ++ + RVNGString RVNGString::escapeXML(const RVNGString &s) + { + RVNGString escaped; diff --git a/external/libstaroffice/ExternalProject_libstaroffice.mk b/external/libstaroffice/ExternalProject_libstaroffice.mk index 8aad471e5d24..a81428e713e4 100644 --- a/external/libstaroffice/ExternalProject_libstaroffice.mk +++ b/external/libstaroffice/ExternalProject_libstaroffice.mk @@ -23,7 +23,7 @@ $(call gb_ExternalProject_get_state_target,libstaroffice,build) : $(call gb_Trace_StartRange,libstaroffice,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ @@ -37,11 +37,11 @@ $(call gb_ExternalProject_get_state_target,libstaroffice,build) : $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ --disable-werror \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libstaroffice)" \ $(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ diff --git a/external/libtiff/0001-ofz-54685-Timeout.patch b/external/libtiff/0001-ofz-54685-Timeout.patch new file mode 100644 index 000000000000..e09b9679f083 --- /dev/null +++ b/external/libtiff/0001-ofz-54685-Timeout.patch @@ -0,0 +1,59 @@ +From caab95ab518aafbc985974098ad806f769c462ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> +Date: Fri, 20 Jan 2023 10:41:34 +0000 +Subject: [PATCH] ofz#54685 Timeout + +--- + libtiff/tif_ojpeg.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c +index 0c915de2..27b84611 100644 +--- a/libtiff/tif_ojpeg.c ++++ b/libtiff/tif_ojpeg.c +@@ -1312,6 +1312,34 @@ static int OJPEGReadSecondarySos(TIFF *tif, uint16_t s) + return (1); + } + ++// see also vcl/source/filter/jpeg/jpegc.cxx ++static void emitMessage(j_common_ptr cinfo, int msg_level) ++{ ++ if (msg_level < 0) ++ { ++ // https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf ++ // try to retain some degree of recoverability up to some reasonable ++ // limit (initially using ImageMagick's current limit of 1000), then ++ // bail. ++ const int WarningLimit = 1000; ++#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) ++ // ofz#50452 due to Timeouts, just abandon fuzzing on any ++ // JWRN_NOT_SEQUENTIAL ++ if (cinfo->err->msg_code == JWRN_NOT_SEQUENTIAL) ++ { ++ cinfo->err->error_exit(cinfo); ++ return; ++ } ++#endif ++ if (++cinfo->err->num_warnings > WarningLimit) ++ cinfo->err->error_exit(cinfo); ++ else ++ cinfo->err->output_message(cinfo); ++ } ++ else if (cinfo->err->trace_level >= msg_level) ++ cinfo->err->output_message(cinfo); ++} ++ + static int OJPEGWriteHeaderInfo(TIFF *tif) + { + static const char module[] = "OJPEGWriteHeaderInfo"; +@@ -1327,6 +1355,7 @@ static int OJPEGWriteHeaderInfo(TIFF *tif) + sp->libjpeg_jpeg_error_mgr.output_message = + OJPEGLibjpegJpegErrorMgrOutputMessage; + sp->libjpeg_jpeg_error_mgr.error_exit = OJPEGLibjpegJpegErrorMgrErrorExit; ++ sp->libjpeg_jpeg_error_mgr.emit_message = emitMessage; + sp->libjpeg_jpeg_decompress_struct.err = &(sp->libjpeg_jpeg_error_mgr); + sp->libjpeg_jpeg_decompress_struct.client_data = (void *)tif; + if (jpeg_create_decompress_encap( +-- +2.39.0 + diff --git a/external/libtiff/ExternalProject_libtiff.mk b/external/libtiff/ExternalProject_libtiff.mk new file mode 100644 index 000000000000..f6bcba106669 --- /dev/null +++ b/external/libtiff/ExternalProject_libtiff.mk @@ -0,0 +1,74 @@ +# -*- 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_ExternalProject_ExternalProject,libtiff)) + +$(eval $(call gb_ExternalProject_register_targets,libtiff,\ + build \ +)) + +$(eval $(call gb_ExternalProject_use_externals,libtiff,\ + libjpeg \ + libwebp \ + zlib \ +)) + +$(eval $(call gb_ExternalProject_use_autoconf,libtiff,build)) + +# using ac_cv_lib_z_inflateEnd=yes to skip test for our +# static windows lib where the name is zlib not z +# using ac_cv_lib_jpeg_jpeg_read_scanlines and +# ac_cv_lib_jpeg_jpeg12_read_scanlines to skip tests +# for our static jpeg lib where the name is libjpeg-turbo.lib +# or liblibjpeg-turbo.a not libjpeg.lib/libjpeg.a +# we're building this statically anyway so the lib isn't +# used during the link done here + +$(call gb_ExternalProject_get_state_target,libtiff,build) : + $(call gb_Trace_StartRange,libtiff,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + export PKG_CONFIG="" \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ + --enable-static \ + --enable-jpeg \ + --enable-zlib \ + --enable-webp \ + --disable-shared \ + --disable-cxx \ + --disable-libdeflate \ + --disable-jbig \ + --disable-lerc \ + --disable-lzma \ + --disable-mdi \ + --disable-win32-io \ + --disable-zstd \ + --with-pic \ + --without-x \ + $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ + CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,libtiff) $(gb_EMSCRIPTEN_CFLAGS)" \ + $(if $(SYSTEM_ZLIB),,--with-zlib-include-dir="$(call gb_UnpackedTarball_get_dir,zlib)") \ + $(if $(SYSTEM_ZLIB),,--with-zlib-lib-dir="$(gb_StaticLibrary_WORKDIR)") \ + $(if $(SYSTEM_LIBJPEG),,--with-jpeg-include-dir="$(call gb_UnpackedTarball_get_dir,libjpeg-turbo)") \ + $(if $(SYSTEM_LIBJPEG),,--with-jpeg-lib-dir="$(gb_StaticLibrary_WORKDIR)") \ + $(if $(SYSTEM_LIBWEBP),,--with-webp-include-dir="$(call gb_UnpackedTarball_get_dir,libwebp/src)") \ + $(if $(SYSTEM_LIBWEBP),,$(if $(filter WNT,$(OS_FOR_BUILD)),\ + --with-webp-lib-dir="$(call gb_UnpackedTarball_get_dir,libwebp)/output/lib/libwebp$(if $(MSVC_USE_DEBUG_RUNTIME),_debug)$(gb_StaticLibrary_PLAINEXT)", \ + --with-webp-lib-dir="$(call gb_UnpackedTarball_get_dir,libwebp)/src/.libs")) \ + CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libtiff) $(gb_EMSCRIPTEN_LDFLAGS)" \ + ac_cv_lib_z_inflateEnd=yes \ + ac_cv_lib_jpeg_jpeg_read_scanlines=yes \ + ac_cv_lib_jpeg_jpeg12_read_scanlines=no \ + ac_cv_lib_webp_WebPDecode=yes \ + $(gb_CONFIGURE_PLATFORMS) \ + && cd libtiff && $(MAKE) libtiff.la \ + ) + $(call gb_Trace_EndRange,libtiff,EXTERNAL) + +# vim: set noet sw=4 ts=4: diff --git a/external/ct2n/Makefile b/external/libtiff/Makefile index e4968cf85fb6..e4968cf85fb6 100644 --- a/external/ct2n/Makefile +++ b/external/libtiff/Makefile diff --git a/external/neon/Module_neon.mk b/external/libtiff/Module_libtiff.mk index cc2e0cb5e2a6..adf8114e6e1e 100644 --- a/external/neon/Module_neon.mk +++ b/external/libtiff/Module_libtiff.mk @@ -7,11 +7,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,neon)) +$(eval $(call gb_Module_Module,libtiff)) -$(eval $(call gb_Module_add_targets,neon,\ - Library_neon \ - UnpackedTarball_neon \ +$(eval $(call gb_Module_add_targets,libtiff,\ + ExternalProject_libtiff \ + UnpackedTarball_libtiff \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libtiff/README b/external/libtiff/README new file mode 100644 index 000000000000..a650ea584a6a --- /dev/null +++ b/external/libtiff/README @@ -0,0 +1,3 @@ +libtiff is a library to encode and decode images in TIFF format, from [http://download.osgeo.org/libtiff/] + +For the moment we use it only for decoding part. diff --git a/external/libtiff/UnpackedTarball_libtiff.mk b/external/libtiff/UnpackedTarball_libtiff.mk new file mode 100644 index 000000000000..7f27c8d3fee7 --- /dev/null +++ b/external/libtiff/UnpackedTarball_libtiff.mk @@ -0,0 +1,22 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,libtiff)) + +$(eval $(call gb_UnpackedTarball_set_tarball,libtiff,$(LIBTIFF_TARBALL))) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,libtiff,1)) + +$(eval $(call gb_UnpackedTarball_add_patches,libtiff,\ + external/libtiff/libtiff.linknolibs.patch \ + external/libtiff/0001-ofz-54685-Timeout.patch \ + external/libtiff/ofz65182.patch \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libtiff/libtiff.linknolibs.patch b/external/libtiff/libtiff.linknolibs.patch new file mode 100644 index 000000000000..bd03af3a708d --- /dev/null +++ b/external/libtiff/libtiff.linknolibs.patch @@ -0,0 +1,11 @@ +--- a/libtiff/Makefile.in 2022-05-21 15:32:48.069999327 +0100 ++++ b/libtiff/Makefile.in 2022-05-21 15:32:59.051499293 +0100 +@@ -372,7 +372,7 @@ + LDFLAGS = @LDFLAGS@ + LIBDIR = @LIBDIR@ + LIBOBJS = @LIBOBJS@ +-LIBS = @LIBS@ ++#LIBS = @LIBS@ + LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ + LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ + LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ diff --git a/external/libtiff/ofz65182.patch b/external/libtiff/ofz65182.patch new file mode 100644 index 000000000000..d4b18e4ade3e --- /dev/null +++ b/external/libtiff/ofz65182.patch @@ -0,0 +1,23 @@ +diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c +index 820a2544..afd7cb6e 100644 +--- a/libtiff/tif_strip.c ++++ b/libtiff/tif_strip.c +@@ -287,7 +287,17 @@ uint64_t TIFFScanlineSize64(TIFF *tif) + else + { + uint64_t scanline_samples; +- scanline_samples = _TIFFMultiply64(tif, td->td_imagewidth, ++ uint32_t scanlinewidth = td->td_imagewidth; ++ ++ if (td->td_photometric == PHOTOMETRIC_YCBCR) ++ { ++ uint16_t SubsamplingHor, SubsamplingVer; ++ TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer); ++ if (SubsamplingHor > 1) // roundup width for YCbCr ++ scanlinewidth = TIFFroundup_32(scanlinewidth, SubsamplingHor); ++ } ++ ++ scanline_samples = _TIFFMultiply64(tif, scanlinewidth, + td->td_samplesperpixel, module); + scanline_size = + TIFFhowmany_64(_TIFFMultiply64(tif, scanline_samples, diff --git a/external/libtommath/README b/external/libtommath/README index 0da3128c5404..41f91970a71b 100644 --- a/external/libtommath/README +++ b/external/libtommath/README @@ -3,4 +3,4 @@ integer library written entirely in C. Used by embedded firebird (external/firebird). -http://www.libtom.org/LibTomMath/ +From [https://www.libtom.net/LibTomMath/]. diff --git a/external/libtommath/UnpackedTarball_libtommath.mk b/external/libtommath/UnpackedTarball_libtommath.mk index bb0b9e352930..6d8e1e9fdd57 100644 --- a/external/libtommath/UnpackedTarball_libtommath.mk +++ b/external/libtommath/UnpackedTarball_libtommath.mk @@ -13,9 +13,12 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libtommath,$(LIBTOMMATH_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,libtommath,0)) +ifneq ($(MSYSTEM),) +# use binary flag so patch from git-bash won't choke on mixed line-endings in patches +$(eval $(call gb_UnpackedTarball_set_patchflags,libtommath,--binary)) +endif + $(eval $(call gb_UnpackedTarball_add_patches,libtommath,\ - external/libtommath/libtommath-msvc.patch \ - external/libtommath/clang-cl.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libtommath/clang-cl.patch b/external/libtommath/clang-cl.patch deleted file mode 100644 index 1cc92d380c62..000000000000 --- a/external/libtommath/clang-cl.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- tommath.h -+++ tommath.h -@@ -15,6 +15,13 @@ - #ifndef BN_H_
- #define BN_H_
-
-+// Work around clang-cl issue when mp_word is a typedef for unsigned __int128, see -+// <https://bugs.llvm.org/show_bug.cgi?id=25305> "Clang-cl generates a call to an undefined symbol -+// _udivti3": -+#if defined _WIN32 && defined __clang__ -+#define MP_8BIT -+#endif -+ - #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
diff --git a/external/libtommath/libtommath-msvc.patch b/external/libtommath/libtommath-msvc.patch deleted file mode 100644 index 07884871aac9..000000000000 --- a/external/libtommath/libtommath-msvc.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- makefile.msvc 2016-02-05 23:25:32.000000000 +0100 -+++ makefile.msvc 2016-07-21 11:34:20.618390100 +0200 -@@ -38,3 +38,9 @@ -
- library: $(OBJECTS)
- lib /out:tommath.lib $(OBJECTS)
-+
-+.cc.obj:
-+ $(CC) /nologo $(CFLAGS) /c $<
-+
-+.c.obj:
-+ $(CC) /nologo $(CFLAGS) /c $<
diff --git a/external/libvisio/ExternalProject_libvisio.mk b/external/libvisio/ExternalProject_libvisio.mk index 0911fcd87c7c..abf7cbd728df 100644 --- a/external/libvisio/ExternalProject_libvisio.mk +++ b/external/libvisio/ExternalProject_libvisio.mk @@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libvisio,build) : $(call gb_Trace_StartRange,libvisio,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -37,9 +37,10 @@ $(call gb_ExternalProject_get_state_target,libvisio,build) : --disable-werror \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(CXXFLAGS) $(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libvisio)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libvisio)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libvisio,EXTERNAL) diff --git a/external/libvisio/UnpackedTarball_libvisio.mk b/external/libvisio/UnpackedTarball_libvisio.mk index e19878740289..b5f530fb2763 100644 --- a/external/libvisio/UnpackedTarball_libvisio.mk +++ b/external/libvisio/UnpackedTarball_libvisio.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libvisio)) $(eval $(call gb_UnpackedTarball_add_patches,libvisio, \ external/libvisio/ubsan.patch \ + external/libvisio/solid-fill-style.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libvisio/solid-fill-style.patch b/external/libvisio/solid-fill-style.patch new file mode 100644 index 000000000000..53dc6a405e71 --- /dev/null +++ b/external/libvisio/solid-fill-style.patch @@ -0,0 +1,198 @@ +--- src/lib/VSDStyles.h ++++ src/lib/VSDStyles.h +@@ -179,14 +177,13 @@ struct VSDFillStyle + ASSIGN_OPTIONAL(style.qsFillMatrix, qsFillMatrix); + if (theme) + { +- if (!!style.qsFillColour && style.qsFillColour.get() >= 0) +- ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.get()), fgColour); +- +- if (!!style.qsFillColour && style.qsFillColour.get() >= 0) +- ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.get()), bgColour); +- +- if (!!style.qsShadowColour && style.qsShadowColour.get() >= 0) +- ASSIGN_OPTIONAL(theme->getThemeColour(style.qsShadowColour.get()), shadowFgColour); ++ // Quick Style Colour 100 is special. It is the default, ++ // and it is not saved explicitely in the VSDX file. ++ ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.value_or(100)), fgColour); ++ ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.value_or(100)), bgColour); ++ ASSIGN_OPTIONAL(theme->getThemeColour(style.qsShadowColour.value_or(100)), shadowFgColour); ++ if (!!style.qsFillMatrix && style.qsFillMatrix.get() >= 0) ++ ASSIGN_OPTIONAL(theme->getFillStyleColour(style.qsFillMatrix.get()), fgColour); + } + ASSIGN_OPTIONAL(style.fgColour, fgColour); + ASSIGN_OPTIONAL(style.bgColour, bgColour); +--- src/lib/VSDXTheme.cpp ++++ src/lib/VSDXTheme.cpp +@@ -63,7 +63,8 @@ libvisio::VSDXFontScheme::VSDXFontScheme() + + libvisio::VSDXTheme::VSDXTheme() + : m_clrScheme(), +- m_fontScheme() ++ m_fontScheme(), ++ m_fillStyleLst(std::vector<boost::optional<libvisio::Colour>>(6)) + { + } + +@@ -102,6 +103,9 @@ bool libvisio::VSDXTheme::parse(librevenge::RVNGInputStream *input) + case XML_A_FONTSCHEME: + readFontScheme(reader.get()); + break; ++ case XML_A_FMTSCHEME: ++ readFmtScheme(reader.get()); ++ break; + default: + break; + } +@@ -320,7 +324,7 @@ void libvisio::VSDXTheme::readClrScheme(xmlTextReaderPtr reader) + while ((XML_A_CLRSCHEME != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); + } + +-void libvisio::VSDXTheme::readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr) ++bool libvisio::VSDXTheme::readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr) + { + int ret = 1; + int tokenId = XML_TOKEN_INVALID; +@@ -350,7 +354,11 @@ void libvisio::VSDXTheme::readThemeColour(xmlTextReaderPtr reader, int idToken, + while ((idToken != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); + + if (colour) ++ { + clr = *colour; ++ return true; ++ } ++ return false; + } + + void libvisio::VSDXTheme::readVariationClrSchemeLst(xmlTextReaderPtr reader) +@@ -491,4 +499,96 @@ boost::optional<libvisio::Colour> libvisio::VSDXTheme::getThemeColour(unsigned v + return boost::optional<libvisio::Colour>(); + } + ++void libvisio::VSDXTheme::readFmtScheme(xmlTextReaderPtr reader) ++{ ++ VSD_DEBUG_MSG(("VSDXTheme::readFmtScheme\n")); ++ int ret = 1; ++ int tokenId = XML_TOKEN_INVALID; ++ int tokenType = -1; ++ do ++ { ++ ret = xmlTextReaderRead(reader); ++ tokenId = getElementToken(reader); ++ if (XML_TOKEN_INVALID == tokenId) ++ { ++ VSD_DEBUG_MSG(("VSDXTheme::readFmtScheme: unknown token %s\n", xmlTextReaderConstName(reader))); ++ } ++ tokenType = xmlTextReaderNodeType(reader); ++ switch (tokenId) ++ { ++ case XML_A_FILLSTYLELST: ++ { ++ readFillStyleLst(reader); ++ break; ++ } ++ default: ++ // Other style lists not implemented ++ break; ++ } ++ } while ((XML_A_FMTSCHEME != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); ++} ++ ++void libvisio::VSDXTheme::skipUnimplemented(xmlTextReaderPtr reader, int idToken) ++{ ++ int ret = 1; ++ int tokenId = XML_TOKEN_INVALID; ++ int tokenType = -1; ++ do ++ { ++ ret = xmlTextReaderRead(reader); ++ tokenId = getElementToken(reader); ++ if (XML_TOKEN_INVALID == tokenId) ++ { ++ VSD_DEBUG_MSG(("VSDXTheme::skipUnimplemented: unknown token %s\n", xmlTextReaderConstName(reader))); ++ } ++ tokenType = xmlTextReaderNodeType(reader); ++ } while ((idToken != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); ++} ++ ++void libvisio::VSDXTheme::readFillStyleLst(xmlTextReaderPtr reader) ++{ ++ VSD_DEBUG_MSG(("VSDXTheme::readFillStyleLst\n")); ++ int ret = xmlTextReaderRead(reader); ++ int tokenId = getElementToken(reader); ++ if (XML_TOKEN_INVALID == tokenId) ++ { ++ VSD_DEBUG_MSG(("VSDXTheme::readFillStyleLst: unknown token %s\n", xmlTextReaderConstName(reader))); ++ } ++ int tokenType = xmlTextReaderNodeType(reader); ++ int i = 0; ++ while ((XML_A_FILLSTYLELST != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret) ++ { ++ switch (tokenId) ++ { ++ case XML_A_SOLIDFILL: ++ { ++ Colour colour; ++ if (readThemeColour(reader, tokenId, colour)) ++ { ++ m_fillStyleLst[i] = colour; ++ } ++ break; ++ } ++ default: ++ // Skip unimplemented fill type ++ skipUnimplemented(reader, tokenId); ++ break; ++ } ++ ret = xmlTextReaderRead(reader); ++ tokenId = getElementToken(reader); ++ if (XML_TOKEN_INVALID == tokenId) ++ { ++ VSD_DEBUG_MSG(("VSDXTheme::readFillStyleLst: unknown token %s\n", xmlTextReaderConstName(reader))); ++ } ++ tokenType = xmlTextReaderNodeType(reader); ++ } ++} ++ ++boost::optional<libvisio::Colour> libvisio::VSDXTheme::getFillStyleColour(unsigned value) const ++{ ++ if (value == 0 || value > m_fillStyleLst.size()) ++ return boost::optional<libvisio::Colour>(); ++ return m_fillStyleLst[value - 1]; ++} ++ + /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ +--- src/lib/VSDXTheme.h ++++ src/lib/VSDXTheme.h +@@ -80,6 +80,7 @@ public: + ~VSDXTheme(); + bool parse(librevenge::RVNGInputStream *input); + boost::optional<Colour> getThemeColour(unsigned value, unsigned variationIndex = 0) const; ++ boost::optional<Colour> getFillStyleColour(unsigned value) const; + + private: + VSDXTheme(const VSDXTheme &); +@@ -89,18 +90,22 @@ private: + boost::optional<Colour> readSysClr(xmlTextReaderPtr reader); + + void readClrScheme(xmlTextReaderPtr reader); +- void readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr); ++ bool readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr); + void readVariationClrSchemeLst(xmlTextReaderPtr reader); + void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch); + void readFontScheme(xmlTextReaderPtr reader); + void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font); + bool readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace); + bool readTypeFace(xmlTextReaderPtr reader, int &script, librevenge::RVNGString &typeFace); ++ void readFmtScheme(xmlTextReaderPtr reader); ++ void readFillStyleLst(xmlTextReaderPtr reader); + + int getElementToken(xmlTextReaderPtr reader); ++ void skipUnimplemented(xmlTextReaderPtr reader, int idToken); + + VSDXClrScheme m_clrScheme; + VSDXFontScheme m_fontScheme; ++ std::vector<boost::optional<Colour>> m_fillStyleLst; + }; + + } // namespace libvisio diff --git a/external/libwebp/ExternalProject_libwebp.mk b/external/libwebp/ExternalProject_libwebp.mk new file mode 100644 index 000000000000..0146bd72acfc --- /dev/null +++ b/external/libwebp/ExternalProject_libwebp.mk @@ -0,0 +1,58 @@ +# -*- 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_ExternalProject_ExternalProject,libwebp)) + +$(eval $(call gb_ExternalProject_register_targets,libwebp,\ + build \ +)) + +ifeq ($(COM),MSC) +$(eval $(call gb_ExternalProject_use_nmake,libwebp,build)) + +# Explicitly passing in ARCH (for the known architectures, at least) avoids +# workdir/UnpackedTarball/libwebp/Makefile.vc not being able to detect it when CC is clang-cl: +$(call gb_ExternalProject_get_state_target,libwebp,build): + $(call gb_Trace_StartRange,libwebp,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + nmake -nologo -f Makefile.vc CFG=$(if $(MSVC_USE_DEBUG_RUNTIME),debug,release)-static RTLIBCFG=dynamic OBJDIR=output \ + $(if $(filter INTEL,$(CPUNAME)),ARCH=x86, \ + $(if $(filter X86_64,$(CPUNAME)),ARCH=x64, \ + $(if $(filter AARCH64,$(CPUNAME)),ARCH=ARM))) \ + ) + $(call gb_Trace_EndRange,libwebp,EXTERNAL) +else +$(eval $(call gb_ExternalProject_use_autoconf,libwebp,build)) + +$(call gb_ExternalProject_get_state_target,libwebp,build) : + $(call gb_Trace_StartRange,libwebp,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + export PKG_CONFIG="" \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ + --enable-static \ + --with-pic \ + --disable-shared \ + --disable-gl \ + --disable-sdl \ + --disable-png \ + --disable-jpeg \ + --disable-tiff \ + --disable-gif \ + --disable-wic \ + $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ + CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,libwebp)" \ + CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libwebp)" \ + $(gb_CONFIGURE_PLATFORMS) \ + && $(MAKE) \ + ) + $(call gb_Trace_EndRange,libwebp,EXTERNAL) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/languagetool/Makefile b/external/libwebp/Makefile index e4968cf85fb6..e4968cf85fb6 100644 --- a/external/languagetool/Makefile +++ b/external/libwebp/Makefile diff --git a/external/libwebp/Makefile.vc.patch b/external/libwebp/Makefile.vc.patch new file mode 100644 index 000000000000..412ccf60b901 --- /dev/null +++ b/external/libwebp/Makefile.vc.patch @@ -0,0 +1,151 @@ +--- Makefile.vc.sav 2021-07-30 00:55:37.000000000 +0200 ++++ Makefile.vc 2022-01-25 17:35:30.206117700 +0100 +@@ -8,13 +8,13 @@ + LIBSHARPYUV_BASENAME = libsharpyuv + + !IFNDEF ARCH +-!IF ! [ cl 2>&1 | find "x86" > NUL ] ++!IF ! [ $(CC) 2>&1 | grep -q "x86" > NUL ] + ARCH = x86 +-!ELSE IF ! [ cl 2>&1 | find "x64" > NUL ] ++!ELSE IF ! [ $(CC) 2>&1 | grep -q "x64" > NUL ] + ARCH = x64 +-!ELSE IF ! [ cl 2>&1 | find "ARM64" > NUL ] ++!ELSE IF ! [ $(CC) 2>&1 | grep -q "ARM64" > NUL ] + ARCH = ARM64 +-!ELSE IF ! [ cl 2>&1 | find "ARM" > NUL ] ++!ELSE IF ! [ $(CC) 2>&1 | grep -q "ARM" > NUL ] + ARCH = ARM + !ELSE + !ERROR Unable to auto-detect toolchain architecture! \ +@@ -30,8 +30,8 @@ + ## Nothing more to do below this line! + + NOLOGO = /nologo +-CCNODBG = cl.exe $(NOLOGO) /O2 /DNDEBUG +-CCDEBUG = cl.exe $(NOLOGO) /Od /Zi /D_DEBUG /RTC1 ++CCNODBG = $(CC) $(NOLOGO) /O2 /DNDEBUG ++CCDEBUG = $(CC) $(NOLOGO) /Od /Zi /D_DEBUG /RTC1 + CFLAGS = /I. /Isrc $(NOLOGO) /W3 /EHsc /c + CFLAGS = $(CFLAGS) /DWIN32 /D_CRT_SECURE_NO_WARNINGS /DWIN32_LEAN_AND_MEAN + LDFLAGS = /LARGEADDRESSAWARE /MANIFEST:EMBED /NXCOMPAT /DYNAMICBASE +@@ -69,7 +69,7 @@ + RTLIB = /MD + RTLIBD = /MDd + !ENDIF +-DIRBASE = $(OUTDIR)\$(CFG)\$(ARCH) ++DIRBASE = $(OUTDIR) + DIROBJ = $(DIRBASE)\obj + DIRLIB = $(DIRBASE)\lib + DIRINC = $(DIRBASE)\include +@@ -89,10 +89,10 @@ + + # Target configuration + !IF "$(CFG)" == "release-static" +-CC = $(CCNODBG) ++CC_ = $(CCNODBG) + STATICLIBBUILD = TRUE + !ELSE IF "$(CFG)" == "debug-static" +-CC = $(CCDEBUG) ++CC_ = $(CCDEBUG) + RTLIB = $(RTLIBD) + STATICLIBBUILD = TRUE + LIBWEBPDECODER_BASENAME = $(LIBWEBPDECODER_BASENAME)_debug +@@ -101,11 +101,11 @@ + LIBWEBPDEMUX_BASENAME = $(LIBWEBPDEMUX_BASENAME)_debug + LIBSHARPYUV_BASENAME = $(LIBSHARPYUV_BASENAME)_debug + !ELSE IF "$(CFG)" == "release-dynamic" +-CC = $(CCNODBG) ++CC_ = $(CCNODBG) + RC = $(RCNODBG) + DLLBUILD = TRUE + !ELSE IF "$(CFG)" == "debug-dynamic" +-CC = $(CCDEBUG) ++CC_ = $(CCDEBUG) + RC = $(RCDEBUG) + RTLIB = $(RTLIBD) + DLLBUILD = TRUE +@@ -117,7 +117,7 @@ + !ENDIF + + !IF "$(STATICLIBBUILD)" == "TRUE" +-CC = $(CC) $(RTLIB) ++CC_ = $(CC_) $(RTLIB) + CFGSET = TRUE + LIBWEBPDECODER = $(DIRLIB)\$(LIBWEBPDECODER_BASENAME).lib + LIBWEBP = $(DIRLIB)\$(LIBWEBP_BASENAME).lib +@@ -125,7 +125,7 @@ + LIBWEBPDEMUX = $(DIRLIB)\$(LIBWEBPDEMUX_BASENAME).lib + LIBSHARPYUV = $(DIRLIB)\$(LIBSHARPYUV_BASENAME).lib + !ELSE IF "$(DLLBUILD)" == "TRUE" +-CC = $(CC) /I$(DIROBJ) $(RTLIB) /DWEBP_DLL ++CC_ = $(CC_) /I$(DIROBJ) $(RTLIB) /DWEBP_DLL + LIBWEBPDECODER = $(DIRLIB)\$(LIBWEBPDECODER_BASENAME)_dll.lib + LIBWEBP = $(DIRLIB)\$(LIBWEBP_BASENAME)_dll.lib + LIBWEBPMUX = $(DIRLIB)\$(LIBWEBPMUX_BASENAME)_dll.lib +@@ -438,7 +438,7 @@ + + !IF "$(DLLBUILD)" == "TRUE" + {$(DIROBJ)}.c{$(DIROBJ)}.obj: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$@ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$@ $< + + {src}.rc{$(DIROBJ)}.res: + $(RC) /fo$@ $< +@@ -471,41 +471,41 @@ + # File-specific flag builds. Note batch rules take precedence over wildcards, + # so for now name each file individually. + $(DIROBJ)\examples\anim_diff.obj: examples\anim_diff.c +- $(CC) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ ++ $(CC_) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ + /Fo$(DIROBJ)\examples\ examples\$(@B).c + $(DIROBJ)\examples\anim_dump.obj: examples\anim_dump.c +- $(CC) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ ++ $(CC_) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ + /Fo$(DIROBJ)\examples\ examples\$(@B).c + $(DIROBJ)\examples\anim_util.obj: examples\anim_util.c +- $(CC) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ ++ $(CC_) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ + /Fo$(DIROBJ)\examples\ examples\$(@B).c + $(DIROBJ)\examples\gif2webp.obj: examples\gif2webp.c +- $(CC) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ ++ $(CC_) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ + /Fo$(DIROBJ)\examples\ examples\$(@B).c + $(DIROBJ)\examples\gifdec.obj: examples\gifdec.c +- $(CC) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ ++ $(CC_) $(CFLAGS) /DWEBP_HAVE_GIF /Fd$(LIBWEBP_PDBNAME) \ + /Fo$(DIROBJ)\examples\ examples\$(@B).c + # Batch rules + {examples}.c{$(DIROBJ)\examples}.obj:: +- $(CC) $(CFLAGS) /Fd$(DIROBJ)\examples\ /Fo$(DIROBJ)\examples\ $< ++ $(CC_) $(CFLAGS) /Fd$(DIROBJ)\examples\ /Fo$(DIROBJ)\examples\ $< + {extras}.c{$(DIROBJ)\extras}.obj:: +- $(CC) $(CFLAGS) /Fd$(DIROBJ)\extras\ /Fo$(DIROBJ)\extras\ $< ++ $(CC_) $(CFLAGS) /Fd$(DIROBJ)\extras\ /Fo$(DIROBJ)\extras\ $< + {imageio}.c{$(DIROBJ)\imageio}.obj:: +- $(CC) $(CFLAGS) /Fd$(DIROBJ)\imageio\ /Fo$(DIROBJ)\imageio\ $< ++ $(CC_) $(CFLAGS) /Fd$(DIROBJ)\imageio\ /Fo$(DIROBJ)\imageio\ $< + {sharpyuv}.c{$(DIROBJ)\sharpyuv}.obj:: +- $(CC) $(CFLAGS) /Fd$(DIROBJ)\sharpyuv\ /Fo$(DIROBJ)\sharpyuv\ $< ++ $(CC_) $(CFLAGS) /Fd$(DIROBJ)\sharpyuv\ /Fo$(DIROBJ)\sharpyuv\ $< + {src\dec}.c{$(DIROBJ)\dec}.obj:: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\dec\ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\dec\ $< + {src\demux}.c{$(DIROBJ)\demux}.obj:: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\demux\ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\demux\ $< + {src\dsp}.c{$(DIROBJ)\dsp}.obj:: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\dsp\ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\dsp\ $< + {src\enc}.c{$(DIROBJ)\enc}.obj:: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\enc\ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\enc\ $< + {src\mux}.c{$(DIROBJ)\mux}.obj:: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\mux\ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\mux\ $< + {src\utils}.c{$(DIROBJ)\utils}.obj:: +- $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\utils\ $< ++ $(CC_) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\utils\ $< + + LNKLIBS = ole32.lib windowscodecs.lib shlwapi.lib + !IF "$(UNICODE)" == "1" diff --git a/external/serf/Module_serf.mk b/external/libwebp/Module_libwebp.mk index 10ec039359a2..b89056ac3d35 100644 --- a/external/serf/Module_serf.mk +++ b/external/libwebp/Module_libwebp.mk @@ -7,11 +7,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,serf)) +$(eval $(call gb_Module_Module,libwebp)) -$(eval $(call gb_Module_add_targets,serf,\ - UnpackedTarball_serf \ - ExternalProject_serf \ +$(eval $(call gb_Module_add_targets,libwebp,\ + ExternalProject_libwebp \ + UnpackedTarball_libwebp \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libwebp/README b/external/libwebp/README new file mode 100644 index 000000000000..1308c278baca --- /dev/null +++ b/external/libwebp/README @@ -0,0 +1 @@ +libwebp is a library to encode and decode images in WebP format, from [https://developers.google.com/speed/webp/] diff --git a/external/qrcodegen/Module_qrcodegen.mk b/external/libwebp/UnpackedTarball_libwebp.mk index 09c771d0d535..67f797157717 100644 --- a/external/qrcodegen/Module_qrcodegen.mk +++ b/external/libwebp/UnpackedTarball_libwebp.mk @@ -7,18 +7,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,qrcodegen)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,libwebp)) -$(eval $(call gb_Module_add_targets,qrcodegen,\ - UnpackedTarball_qrcodegen \ -)) +$(eval $(call gb_UnpackedTarball_set_tarball,libwebp,$(LIBWEBP_TARBALL))) -ifeq ($(ENABLE_QRCODEGEN),TRUE) +$(eval $(call gb_UnpackedTarball_set_patchlevel,libwebp,0)) -$(eval $(call gb_Module_add_targets,qrcodegen,\ - StaticLibrary_qrcodegen \ +$(eval $(call gb_UnpackedTarball_add_patches,libwebp,\ + external/libwebp/Makefile.vc.patch \ )) -endif - # vim: set noet sw=4 ts=4: diff --git a/external/libwpd/ExternalProject_libwpd.mk b/external/libwpd/ExternalProject_libwpd.mk index c3b810c6acd7..3317aecd76d2 100644 --- a/external/libwpd/ExternalProject_libwpd.mk +++ b/external/libwpd/ExternalProject_libwpd.mk @@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libwpd,build) : $(call gb_Trace_StartRange,libwpd,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --disable-shared --enable-static, \ @@ -36,12 +36,12 @@ $(call gb_ExternalProject_get_state_target,libwpd,build) : $(if $(filter MACOSX,$(OS)), \ --prefix=/@.__________________________________________________OOO) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libwpd)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ $(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \ diff --git a/external/libwpd/UnpackedTarball_libwpd.mk b/external/libwpd/UnpackedTarball_libwpd.mk index eefa9331c8d6..c72baa515d09 100644 --- a/external/libwpd/UnpackedTarball_libwpd.mk +++ b/external/libwpd/UnpackedTarball_libwpd.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwpd)) $(eval $(call gb_UnpackedTarball_add_patches,libwpd,\ external/libwpd/libwpd-vs2013.patch.1 \ + external/libwpd/tdf153034_3_WrongGreekCharactersWP5Import.patch \ $(if $(SYSTEM_REVENGE),,external/libwpd/rpath.patch) \ external/libwpd/include.patch \ )) diff --git a/external/libwpd/tdf153034_3_WrongGreekCharactersWP5Import.patch b/external/libwpd/tdf153034_3_WrongGreekCharactersWP5Import.patch new file mode 100644 index 000000000000..7227a70004ac --- /dev/null +++ b/external/libwpd/tdf153034_3_WrongGreekCharactersWP5Import.patch @@ -0,0 +1,18 @@ + + +--- src/lib/libwpd_internal.cpp.orig 2023-09-09 12:20:11.332107210 +0200 ++++ src/lib/libwpd_internal.cpp 2023-09-09 12:22:13.360092760 +0200 +@@ -803,11 +803,11 @@ + 0x0394, 0x03b4, 0x0395, 0x03b5, 0x0396, 0x03b6, 0x0397, 0x03b7, + 0x0398, 0x03b8, 0x0399, 0x03b9, 0x039a, 0x03ba, 0x039b, 0x03bb, + 0x039c, 0x03bc, 0x039d, 0x03bd, 0x039e, 0x03be, 0x039f, 0x03bf, +- 0x03a0, 0x03c0, 0x03a1, 0x03c1, 0x03a3, 0x03c3, 0x03f9, 0x03db, ++ 0x03a0, 0x03c0, 0x03a1, 0x03c1, 0x03a3, 0x03c3, 0x03a3, 0x03c2, + 0x03a4, 0x03c4, 0x03a5, 0x03c5, 0x03a6, 0x03d5, 0x03a7, 0x03c7, + 0x03a8, 0x03c8, 0x03a9, 0x03c9, 0x03ac, 0x03ad, 0x03ae, 0x03af, + 0x03ca, 0x03cc, 0x03cd, 0x03cb, 0x03ce, 0x03b5, 0x03d1, 0x03f0, +- 0x03d6, 0x1fe5, 0x03d2, 0x03c6, 0x03c9, 0x037e, 0x0387, 0x0384, ++ 0x03d6, 0x03f1, 0x03d2, 0x03c6, 0x03c9, 0x037e, 0x0387, 0x0384, + 0x00a8, 0x0385, 0x1fed, 0x1fef, 0x1fc0, 0x1fbd, 0x1fbf, 0x1fbe, + 0x1fce, 0x1fde, 0x1fcd, 0x1fdd, 0x1fcf, 0x1fdf, 0x0384, 0x1fef, + 0x1fc0, 0x1fbd, 0x1fbf, 0x1fce, 0x1fde, 0x1fcd, 0x1fdd, 0x1fcf, diff --git a/external/libwpg/ExternalProject_libwpg.mk b/external/libwpg/ExternalProject_libwpg.mk index 01f31c55d771..dc6bdf7d6899 100644 --- a/external/libwpg/ExternalProject_libwpg.mk +++ b/external/libwpg/ExternalProject_libwpg.mk @@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libwpg,build) : $(call gb_Trace_StartRange,libwpg,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --disable-shared --enable-static, \ @@ -35,8 +35,9 @@ $(call gb_ExternalProject_get_state_target,libwpg,build) : --disable-werror \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + $(gb_CONFIGURE_PLATFORMS) \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libwpg)" \ + CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ $(if $(filter LINUX,$(OS)), \ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \ diff --git a/external/libwpg/Library_wpg.mk b/external/libwpg/Library_wpg.mk index 09dc34915238..e59133ea588d 100644 --- a/external/libwpg/Library_wpg.mk +++ b/external/libwpg/Library_wpg.mk @@ -12,6 +12,7 @@ $(eval $(call gb_Library_Library,wpg)) $(eval $(call gb_Library_use_unpacked,wpg,libwpg)) $(eval $(call gb_Library_use_externals,wpg,\ + boost_headers \ revenge \ wpd \ )) diff --git a/external/libwps/ExternalProject_libwps.mk b/external/libwps/ExternalProject_libwps.mk index 0bcfc5ceb72d..5ff5997f6021 100644 --- a/external/libwps/ExternalProject_libwps.mk +++ b/external/libwps/ExternalProject_libwps.mk @@ -19,34 +19,22 @@ $(eval $(call gb_ExternalProject_use_externals,libwps,\ revenge \ )) -ifneq (,$(filter ANDROID DRAGONFLY FREEBSD iOS LINUX NETBSD OPENBSD,$(OS))) -ifneq (,$(gb_ENABLE_DBGUTIL)) -libwps_CPPFLAGS+=-D_GLIBCXX_DEBUG -endif -endif +libwps_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG) -libwps_CXXFLAGS=$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) +libwps_CXXFLAGS=$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libwps) -libwps_LDFLAGS= +libwps_LDFLAGS=$(call gb_ExternalProject_get_link_flags,libwps) ifeq ($(OS),LINUX) ifeq ($(SYSTEM_REVENGE),) libwps_LDFLAGS+=-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN endif endif -ifeq ($(ENABLE_GDB_INDEX),TRUE) -libwps_LDFLAGS+=-Wl,--gdb-index -libwps_CXXFLAGS+=-ggnu-pubnames -ifneq ($(USE_LD),) -libwps_LDFLAGS += $(USE_LD) -endif -endif - $(call gb_ExternalProject_get_state_target,libwps,build) : $(call gb_Trace_StartRange,libwps,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && ./configure \ + && $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ @@ -62,7 +50,7 @@ $(call gb_ExternalProject_get_state_target,libwps,build) : $(if $(libwps_CXXFLAGS),CXXFLAGS='$(libwps_CXXFLAGS)') \ $(if $(libwps_CPPFLAGS),CPPFLAGS='$(libwps_CPPFLAGS)') \ $(if $(libwps_LDFLAGS),LDFLAGS='$(libwps_LDFLAGS)') \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) \ $(if $(filter MACOSX,$(OS)),\ diff --git a/external/libwps/README b/external/libwps/README index 3ce52187d520..1354aaa24db2 100644 --- a/external/libwps/README +++ b/external/libwps/README @@ -1 +1 @@ -Microsoft Works file word processor format import library from [http://libwps.sourceforge.net/]. +Microsoft Works file word processor format import library from [https://sourceforge.net/projects/libwps/]. diff --git a/external/libwps/UnpackedTarball_libwps.mk b/external/libwps/UnpackedTarball_libwps.mk index f53a8fffc429..de2e2040abdd 100644 --- a/external/libwps/UnpackedTarball_libwps.mk +++ b/external/libwps/UnpackedTarball_libwps.mk @@ -11,13 +11,14 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libwps)) $(eval $(call gb_UnpackedTarball_set_tarball,libwps,$(WPS_TARBALL))) -$(eval $(call gb_UnpackedTarball_set_patchlevel,libwps,1)) +$(eval $(call gb_UnpackedTarball_set_patchlevel,libwps,0)) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwps)) $(eval $(call gb_UnpackedTarball_add_patches,libwps,\ $(if $(SYSTEM_REVENGE),,external/libwps/rpath.patch.0) \ external/libwps/libtool.patch.0 \ + external/libwps/enumarith.patch \ )) ifneq ($(OS),MACOSX) diff --git a/external/libwps/enumarith.patch b/external/libwps/enumarith.patch new file mode 100644 index 000000000000..9cee0cec6dae --- /dev/null +++ b/external/libwps/enumarith.patch @@ -0,0 +1,20 @@ +--- src/lib/MSWrite.cpp ++++ src/lib/MSWrite.cpp +@@ -1421,7 +1421,7 @@ + break; + } + +- unsigned offset = MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V2_STRUCT_SIZE + colors * unsigned(sizeof(MSWriteParserInternal::BitmapPalette)); ++ unsigned offset = +MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V2_STRUCT_SIZE + colors * unsigned(sizeof(MSWriteParserInternal::BitmapPalette)); + + // File header + bmpdata.append('B'); +@@ -1513,7 +1513,7 @@ + bmpdata.append('M'); + MSWriteParserInternal::appendU32(bmpdata, size + MSWriteParserInternal::BM_FILE_STRUCT_SIZE); + MSWriteParserInternal::appendU32(bmpdata, 0); +- MSWriteParserInternal::appendU32(bmpdata, MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V3_STRUCT_SIZE + 4 * colors); ++ MSWriteParserInternal::appendU32(bmpdata, +MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V3_STRUCT_SIZE + 4 * colors); + + bmpdata.append(data, size); + diff --git a/external/libwps/inc/pch/precompiled_wps.hxx b/external/libwps/inc/pch/precompiled_wps.hxx index 77d92f7615b6..e25d81e9c6ca 100644 --- a/external/libwps/inc/pch/precompiled_wps.hxx +++ b/external/libwps/inc/pch/precompiled_wps.hxx @@ -13,13 +13,14 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2019-10-13 10:00:18 using: + Generated on 2023-09-21 20:32:22 using: ./bin/update_pch external/libwps wps --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: ./bin/update_pch_bisect ./external/libwps/inc/pch/precompiled_wps.hxx "make external/libwps.build" --find-conflicts */ +#include <sal/config.h> #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> diff --git a/external/libwps/libtool.patch.0 b/external/libwps/libtool.patch.0 index cc4b08ba2147..bccd0ebdbc06 100644 --- a/external/libwps/libtool.patch.0 +++ b/external/libwps/libtool.patch.0 @@ -1,12 +1,11 @@ ---- ltmain.sh.sav 2018-08-02 14:21:34.000000000 +0200 -+++ ltmain.sh 2019-05-05 22:04:15.433588776 +0200 -@@ -7277,7 +7277,8 @@ func_mode_link () - # -stdlib=* select c++ std lib with clang +--- ltmain.sh.sav 2023-05-03 21:29:15.000000000 +0900 ++++ ltmain.sh 2023-09-21 20:13:31.766938069 +0900 +@@ -7277,7 +7277,7 @@ func_mode_link () -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) -+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -+ -fuse-ld=*|--ld-path=*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ +- -fsanitize=*) ++ -fsanitize=*|-fuse-ld=*|--ld-path=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" diff --git a/external/libxml2/ExternalPackage_libxml2.mk b/external/libxml2/ExternalPackage_libxml2.mk index d38eb68df0cb..799044575f9a 100644 --- a/external/libxml2/ExternalPackage_libxml2.mk +++ b/external/libxml2/ExternalPackage_libxml2.mk @@ -21,7 +21,7 @@ else # COM=MSC $(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll)) endif else # OS!=WNT -$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.9.$(LIBXML_VERSION_MICRO))) +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.12.$(LIBXML_VERSION_MICRO))) endif endif # DISABLE_DYNLOADING diff --git a/external/libxml2/ExternalProject_libxml2.mk b/external/libxml2/ExternalProject_libxml2.mk index 778befade47f..a97f69c7eabd 100644 --- a/external/libxml2/ExternalProject_libxml2.mk +++ b/external/libxml2/ExternalProject_libxml2.mk @@ -13,6 +13,10 @@ $(eval $(call gb_ExternalProject_register_targets,libxml2,\ build \ )) +ifeq ($(OS),EMSCRIPTEN) +$(call gb_ExternalProject_use_external_project,libxml2,icu) +endif + ifeq ($(OS),WNT) $(call gb_ExternalProject_use_external_project,libxml2,icu) @@ -22,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libxml2,build): $(call gb_Trace_StartRange,libxml2,EXTERNAL) $(call gb_ExternalProject_run,build,\ cscript /e:javascript configure.js \ - iconv=no icu=yes sax1=yes $(if $(MSVC_USE_DEBUG_RUNTIME),run_debug=yes cruntime=/MDd) \ + iconv=no icu=yes sax1=yes $(if $(MSVC_USE_DEBUG_RUNTIME),cruntime=/MDd) \ $(if $(filter TRUE,$(ENABLE_DBGUTIL)),debug=yes) \ && nmake \ ,win32) @@ -31,15 +35,18 @@ else # OS!=WNT $(call gb_ExternalProject_get_state_target,libxml2,build): $(call gb_Trace_StartRange,libxml2,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --disable-ipv6 --without-python --without-zlib --with-sax1 \ + $(gb_RUN_CONFIGURE) ./configure --disable-ipv6 --without-python --without-zlib --with-sax1 \ --without-lzma \ $(if $(debug),--with-run-debug) \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________URELIB) \ - LDFLAGS="$(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \ - CFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(if $(debug),-g)" \ + LDFLAGS="$(LDFLAGS) $(call gb_ExternalProject_get_link_flags,libxml2) $(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \ + CFLAGS="$(CFLAGS) \ + $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \ + $(call gb_ExternalProject_get_build_flags,libxml2)" \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ - && $(MAKE) \ + && $(MAKE) libxml2.la xmllint \ ) $(call gb_Trace_EndRange,libxml2,EXTERNAL) endif diff --git a/external/libxml2/UnpackedTarball_libxml2.mk b/external/libxml2/UnpackedTarball_libxml2.mk index 37b5bad97549..489fb007572b 100644 --- a/external/libxml2/UnpackedTarball_libxml2.mk +++ b/external/libxml2/UnpackedTarball_libxml2.mk @@ -14,14 +14,15 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2)) $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\ - external/libxml2/libxml2-config.patch.1 \ - external/libxml2/libxml2-global-symbols.patch \ + $(if $(filter SOLARIS,$(OS)),external/libxml2/libxml2-global-symbols.patch) \ external/libxml2/libxml2-vc10.patch \ + external/libxml2/libxml2-XMLCALL-redefine.patch.0 \ $(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \ $(if $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED), \ external/libxml2/libxml2-icu-sym.patch.0, \ external/libxml2/libxml2-icu.patch.0) \ - external/libxml2/ubsan.patch.0 \ )) +$(eval $(call gb_UnpackedTarball_add_file,libxml2,xml2-config.in,external/libxml2/xml2-config.in)) + # vim: set noet sw=4 ts=4: diff --git a/external/libxml2/libxml2-XMLCALL-redefine.patch.0 b/external/libxml2/libxml2-XMLCALL-redefine.patch.0 new file mode 100644 index 000000000000..d9ca23be7ce4 --- /dev/null +++ b/external/libxml2/libxml2-XMLCALL-redefine.patch.0 @@ -0,0 +1,11 @@ +--- include/libxml/xmlexports.h 2023-05-24 12:48:46.179570708 +0100 ++++ include/libxml/xmlexports.h 2023-05-24 12:48:56.563577488 +0100 +@@ -38,8 +38,6 @@ + + /** DOC_DISABLE */ + /* Compatibility */ +-#define XMLCALL +-#define XMLCDECL + #if !defined(LIBXML_DLL_IMPORT) + #define LIBXML_DLL_IMPORT XMLPUBVAR + #endif diff --git a/external/libxml2/libxml2-android.patch b/external/libxml2/libxml2-android.patch index 42af83274026..acf9b17e02db 100644 --- a/external/libxml2/libxml2-android.patch +++ b/external/libxml2/libxml2-android.patch @@ -2,9 +2,9 @@ +++ misc/build/libxml2-2.7.6/Makefile.in @@ -1635,7 +1635,7 @@ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive --all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \ + $(MAKE) $(AM_MAKEFLAGS) check-local + check: check-recursive +-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(DATA) \ +all-am: Makefile $(LTLIBRARIES) \ config.h install-binPROGRAMS: install-libLTLIBRARIES diff --git a/external/libxml2/libxml2-config.patch.1 b/external/libxml2/libxml2-config.patch.1 deleted file mode 100644 index 8c28fb6a7806..000000000000 --- a/external/libxml2/libxml2-config.patch.1 +++ /dev/null @@ -1,43 +0,0 @@ -Hack the xml2-config to return paths into WORKDIR. - ---- a/xml2-config.in 2009-12-17 11:45:20.000000000 +0000 -+++ b/xml2-config.in 2009-12-17 11:45:36.000000000 +0000 -@@ -1,9 +1,14 @@ - #! /bin/sh - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --includedir=@includedir@ --libdir=@libdir@ -+#prefix=@prefix@ -+#exec_prefix=@exec_prefix@ -+#includedir=@includedir@ -+#libdir=@libdir@ -+ -+prefix=${WORKDIR}/UnpackedTarball/libxml2 -+exec_prefix=${WORKDIR}/UnpackedTarball/libxml2 -+includedir=${WORKDIR}/UnpackedTarball/libxml2/include -+libdir=${WORKDIR}/UnpackedTarball/libxml2/.libs - - usage() - { -@@ -67,7 +72,8 @@ - ;; - - --cflags) -- cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@" -+ #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@" -+ cflags="-I${includedir}" - ;; - - --libtool-libs) -@@ -91,7 +96,8 @@ - libs="@XML_LIBDIR@ $libs" - fi - -- libs="$libs @WIN32_EXTRA_LIBADD@" -+ #libs="$libs @WIN32_EXTRA_LIBADD@" -+ libs="-L${libdir} -lxml2 -lm" - ;; - - *) diff --git a/external/libxml2/libxml2-global-symbols.patch b/external/libxml2/libxml2-global-symbols.patch index 49ee73731562..32146da4b3d7 100644 --- a/external/libxml2/libxml2-global-symbols.patch +++ b/external/libxml2/libxml2-global-symbols.patch @@ -13,10 +13,22 @@ } LIBXML2_2.6.28; LIBXML2_2.6.32 { -@@ -2231,3 +2231,43 @@ - xmlHashDefaultDeallocator; - } LIBXML2_2.9.1; +@@ -2231,3 +2231,55 @@ + xmlPopOutputCallbacks; + } LIBXML2_2.9.8; ++LIBXML2_2.11.4 { ++ global: ++ xmlMemSize; ++ xmlNewSAXParserCtxt; ++} LIBXML2_2.9.11; ++ ++LIBXML2_2.12.3 { ++ global: ++ xmlCtxtSetMaxAmplification; ++ xmlTextReaderSetMaxAmplification; ++} LIBXML2_2.11.4; ++ +# HACK: export global variable accessor functions (globals.h) +LIBXML2_GLOBAL_VARIABLES { + global: diff --git a/external/libxml2/libxml2-icu-sym.patch.0 b/external/libxml2/libxml2-icu-sym.patch.0 index aac9d09ef13e..07676228da19 100644 --- a/external/libxml2/libxml2-icu-sym.patch.0 +++ b/external/libxml2/libxml2-icu-sym.patch.0 @@ -25,7 +25,7 @@ diff -up win32/Makefile.msvc.dt win32/Makefile.msvc !if "$(STATIC)" == "1" LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib !else -+!if "$(WITH_RUN_DEBUG)" == "1" ++!if "$(DEBUG)" == "1" +LIBS = $(LIBS) icuind.lib icuucd.lib icudtd.lib +!else LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib diff --git a/external/libxml2/libxml2-icu.patch.0 b/external/libxml2/libxml2-icu.patch.0 index b390b03d8787..84197763f878 100644 --- a/external/libxml2/libxml2-icu.patch.0 +++ b/external/libxml2/libxml2-icu.patch.0 @@ -23,7 +23,7 @@ diff -up win32/Makefile.msvc.dt win32/Makefile.msvc !if "$(STATIC)" == "1" LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib !else -+!if "$(WITH_RUN_DEBUG)" == "1" ++!if "$(DEBUG)" == "1" +LIBS = $(LIBS) icuind.lib icuucd.lib icudtd.lib +!else LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib diff --git a/external/libxml2/ubsan.patch.0 b/external/libxml2/ubsan.patch.0 deleted file mode 100644 index b52259719673..000000000000 --- a/external/libxml2/ubsan.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ ---- xpath.c -+++ xpath.c -@@ -14529,7 +14529,7 @@ - } - - stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH, -- &namespaces[0]); -+ namespaces); // i.e., &namespaces[0] if namespaces != NULL - if (namespaces != NULL) { - xmlFree((xmlChar **)namespaces); - } diff --git a/external/libxml2/xml2-config.in b/external/libxml2/xml2-config.in new file mode 100644 index 000000000000..164508e47e67 --- /dev/null +++ b/external/libxml2/xml2-config.in @@ -0,0 +1,28 @@ +#! /bin/sh + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + --version) + echo @VERSION@ + exit 0 + ;; + --cflags) + cflags="$LIBXML_CFLAGS" + ;; + --libs) + libs="$LIBXML_LIBS" + ;; + esac + shift +done + +if test -n "$cflags$libs"; then + echo $cflags $libs +fi + +exit 0 diff --git a/external/libxslt/ExternalPackage_libxslt.mk b/external/libxslt/ExternalPackage_libxslt.mk index c22a2e1b5dad..c1a8ee1217f1 100644 --- a/external/libxslt/ExternalPackage_libxslt.mk +++ b/external/libxslt/ExternalPackage_libxslt.mk @@ -25,7 +25,7 @@ $(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.dl endif else # OS!=WNT $(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.$(LIBXSLT_VERSION_MICRO))) -$(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.20)) +$(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.21)) endif endif # DISABLE_DYNLOADING diff --git a/external/libxslt/ExternalProject_libxslt.mk b/external/libxslt/ExternalProject_libxslt.mk index 0602c320ea7d..842f60db2e89 100644 --- a/external/libxslt/ExternalProject_libxslt.mk +++ b/external/libxslt/ExternalProject_libxslt.mk @@ -32,8 +32,8 @@ else # OS!=WNT $(call gb_ExternalProject_get_state_target,libxslt,build): $(call gb_Trace_StartRange,libxslt,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure --without-crypto --without-python \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_RUN_CONFIGURE) ./configure --without-crypto --without-python \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ LDFLAGS="$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN" -Wl$(COMMA)-noinhibit-exec) \ $(if $(SYSBASE),$(if $(filter SOLARIS LINUX,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ diff --git a/external/libxslt/README b/external/libxslt/README index dd69a9d732c3..2eb71661b903 100644 --- a/external/libxslt/README +++ b/external/libxslt/README @@ -1 +1 @@ -Gnome xslt library written in C, from [http://xmlsoft.org/xslt/] +libxslt is an XSLT processor based on libxml2, from [https://gitlab.gnome.org/GNOME/libxslt/] diff --git a/external/libxslt/UnpackedTarball_libxslt.mk b/external/libxslt/UnpackedTarball_libxslt.mk index 5bde97637e25..7d39cb1e3478 100644 --- a/external/libxslt/UnpackedTarball_libxslt.mk +++ b/external/libxslt/UnpackedTarball_libxslt.mk @@ -21,7 +21,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxslt,\ external/libxslt/libxslt-msvc.patch.2) \ external/libxslt/libxslt-1.1.26-memdump.patch \ external/libxslt/rpath.patch.0 \ - external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 b/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 deleted file mode 100644 index f82c2e4f77ee..000000000000 --- a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 +++ /dev/null @@ -1,69 +0,0 @@ -From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001 -From: Chun-wei Fan <fanchunwei@src.gnome.org> -Date: Tue, 12 Nov 2019 17:37:05 +0800 -Subject: [PATCH] win32: Add configuration for profiler - -Without this the generated xsltconfig.h will not be complete as there -will be a configuration variable that is left in the header, breaking -builds. - -This will allow one to enable or disable profiler support in Windows -builds, and the default is to enable this. ---- - win32/configure.js | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/win32/configure.js b/win32/configure.js -index 56694cce..12c99f30 100644 ---- a/win32/configure.js -+++ b/win32/configure.js -@@ -47,6 +47,7 @@ var withIconv = true; - var withZlib = false; - var withCrypto = true; - var withModules = false; -+var withProfiler = true; - /* Win32 build options. */ - var dirSep = "\\"; - var compiler = "msvc"; -@@ -106,6 +107,7 @@ function usage() - txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; - txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; - txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n"; -+ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n"; - txt += "\nWin32 build options, default value given in parentheses:\n\n"; - txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; - txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; -@@ -192,6 +194,7 @@ function discoverVersion() - vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); - vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); - vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); -+ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0")); - vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); - vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); - vf.WriteLine("PREFIX=" + buildPrefix); -@@ -240,6 +243,8 @@ function configureXslt() - of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); - } else if (s.search(/\@WITH_MODULES\@/) != -1) { - of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0")); -+ } else if (s.search(/\@WITH_PROFILER\@/) != -1) { -+ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0")); - } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) { - of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL")); - } else -@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { - withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "modules") - withModules = strToBool(arg.substring(opt.length + 1, arg.length)); -+ else if (opt == "profiler") -+ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "compiler") - compiler = arg.substring(opt.length + 1, arg.length); - else if (opt == "cruntime") -@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; - txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; - txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; - txtOut += " Modules: " + boolToStr(withModules) + "\n"; -+txtOut += " Profiler: " + boolToStr(withProfiler) + "\n"; - txtOut += "\n"; - txtOut += "Win32 build configuration\n"; - txtOut += "-------------------------\n"; diff --git a/external/libxslt/rpath.patch.0 b/external/libxslt/rpath.patch.0 index 78c4859251df..798bccec750e 100644 --- a/external/libxslt/rpath.patch.0 +++ b/external/libxslt/rpath.patch.0 @@ -7,4 +7,4 @@ +hardcode_libdir_flag_spec= ;; - netbsd*) + netbsd* | netbsdelf*-gnu) diff --git a/external/libzmf/ExternalProject_libzmf.mk b/external/libzmf/ExternalProject_libzmf.mk index c6593899f2c0..2bba4d2e427a 100644 --- a/external/libzmf/ExternalProject_libzmf.mk +++ b/external/libzmf/ExternalProject_libzmf.mk @@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libzmf,build) : $(call gb_Trace_StartRange,libzmf,EXTERNAL) $(call gb_ExternalProject_run,build,\ export PKG_CONFIG="" \ - && MAKE=$(MAKE) ./configure \ + && unset MSYS_NO_PATHCONV && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \ --with-pic \ --enable-static \ --disable-shared \ @@ -38,9 +38,10 @@ $(call gb_ExternalProject_get_state_target,libzmf,build) : --disable-werror \ --disable-weffc \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libzmf)" \ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,libzmf)" \ + $(gb_CONFIGURE_PLATFORMS) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,libzmf,EXTERNAL) diff --git a/external/lpsolve/ExternalProject_lpsolve.mk b/external/lpsolve/ExternalProject_lpsolve.mk index b23dddf47a29..21843f713c58 100644 --- a/external/lpsolve/ExternalProject_lpsolve.mk +++ b/external/lpsolve/ExternalProject_lpsolve.mk @@ -25,12 +25,11 @@ else # $(OS)!=WNT $(call gb_ExternalProject_get_state_target,lpsolve,build): $(call gb_Trace_StartRange,lpsolve,EXTERNAL) $(call gb_ExternalProject_run,build,\ - CC="$(CC) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS))" \ + CC="$(CC) $(call gb_ExternalProject_get_build_flags,lpsolve)" \ $(if $(filter MACOSX,$(OS)),EXTRA_LINKFLAGS='-install_name @__________________________________________________OOO/liblpsolve55.dylib') \ sh -e $(if $(filter MACOSX,$(OS)),ccc.osx, \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),ccc.static, \ - $(if $(filter AIXGCC,$(OS)$(COM)),ccc.aix.gcc, \ - ccc))) \ + ccc)) \ ,lpsolve55) $(call gb_Trace_EndRange,lpsolve,EXTERNAL) endif # $(OS) diff --git a/external/lpsolve/UnpackedTarball_lpsolve.mk b/external/lpsolve/UnpackedTarball_lpsolve.mk index 3d17c0e9b928..62a182dc7517 100644 --- a/external/lpsolve/UnpackedTarball_lpsolve.mk +++ b/external/lpsolve/UnpackedTarball_lpsolve.mk @@ -23,7 +23,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\ else $(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\ - external/lpsolve/lp_solve-aix.patch \ external/lpsolve/lp_solve-fixed-warn.patch \ external/lpsolve/lp_solve_5.5.patch \ external/lpsolve/lpsolve-ubsan.patch.0 \ diff --git a/external/lpsolve/lp_solve-aix.patch b/external/lpsolve/lp_solve-aix.patch deleted file mode 100644 index 6ad5877ca499..000000000000 --- a/external/lpsolve/lp_solve-aix.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- /dev/null 2010-07-28 04:47:47.000000000 -0500 -+++ misc/build/lp_solve_5.5/lpsolve55/ccc.aix.gcc 2010-06-29 17:44:53.000000000 -0500 -@@ -0,0 +1,25 @@ -+src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' -+c=$CC -+ -+def= -+so= -+if [ "$PLATFORM" = "SCO_UNIX" ] -+then def='-dy -K PIC -DNOLONGLONG' -+ dl=-lc -+else dl=-ldl -+ so=y -+fi -+ -+opts='-O3' -+ -+$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -+ar rv liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -+ranlib liblpsolve55.a -+ -+if [ "$so" != "" ] -+then -+ $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -+ $c -shared $lpsolve_LDFLAGS -o liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl -+fi -+ -+rm *.o 2>/dev/null ---- misc/lp_solve_5.5/lp_lib.h 2010-07-28 05:15:10.000000000 -0500 -+++ misc/build/lp_solve_5.5/lp_lib.h 2010-07-28 05:15:55.000000000 -0500 -@@ -56,7 +56,7 @@ - /* Define user program feature option switches */ - /* ------------------------------------------------------------------------- */ - --#if !defined _WINDOWS && !defined _WIN32 && !defined WIN32 -+#if !defined _WINDOWS && !defined _WIN32 && !defined WIN32 && !defined(_AIX) - # define _isnan(x) FALSE - #endif - diff --git a/external/lxml/0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1 b/external/lxml/0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1 new file mode 100644 index 000000000000..ce1ec383cc63 --- /dev/null +++ b/external/lxml/0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1 @@ -0,0 +1,31 @@ +From 9686dd9c7670d18acff6360c8444520273d5f1b2 Mon Sep 17 00:00:00 2001 +From: Jakub Wilk <jwilk@jwilk.net> +Date: Fri, 16 Jun 2023 09:24:21 +0200 +Subject: [PATCH] Make regexp string raw to correct its escape sequence usage + (GH-371) + +Fixes: + + $ python3 -Wd setup.py + setup.py:117: DeprecationWarning: invalid escape sequence \. + ... +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 709cbc68..7a3f46e5 100644 +--- a/setup.py ++++ b/setup.py +@@ -114,7 +114,7 @@ extra_options['packages'] = [ + + def setup_extra_options(): + is_interesting_package = re.compile('^(libxml|libxslt|libexslt)$').match +- is_interesting_header = re.compile('^(zconf|zlib|.*charset)\.h$').match ++ is_interesting_header = re.compile(r'^(zconf|zlib|.*charset)\.h$').match + + def extract_files(directories, pattern='*'): + def get_files(root, dir_path, files): +-- +2.39.2 + diff --git a/external/lxml/README b/external/lxml/README index ad9f0952c6b3..be90f0a862ce 100644 --- a/external/lxml/README +++ b/external/lxml/README @@ -1,7 +1,7 @@ -LXML XML processing python Library from [http://lxml.de/]. +LXML XML processing python Library from [https://lxml.de/]. This library is used for the .ui accessibility checker bin/gla11y The archive was downloaded from: -[http://lxml.de/files/lxml-4.1.1.tgz] -on 2018-02-22. +[https://lxml.de/files/lxml-4.9.2.tgz] +on 2023-07-17. diff --git a/external/lxml/UnpackedTarball_lxml.mk b/external/lxml/UnpackedTarball_lxml.mk index bfb5dc2b046f..58905943c7ee 100644 --- a/external/lxml/UnpackedTarball_lxml.mk +++ b/external/lxml/UnpackedTarball_lxml.mk @@ -11,4 +11,13 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,lxml)) $(eval $(call gb_UnpackedTarball_set_tarball,lxml,$(LXML_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_patchlevel,lxml,0)) + +$(eval $(call gb_UnpackedTarball_add_patches,lxml, \ + external/lxml/0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1 \ + external/lxml/replace-setuptools-with-distutils.patch.1 \ + external/lxml/Wincompatible-function-pointer-types.patch \ + external/lxml/Wincompatible-pointer-types.patch \ +)) + # vim: set noet sw=4 ts=4: diff --git a/external/lxml/Wincompatible-function-pointer-types.patch b/external/lxml/Wincompatible-function-pointer-types.patch new file mode 100644 index 000000000000..644082fdc8bc --- /dev/null +++ b/external/lxml/Wincompatible-function-pointer-types.patch @@ -0,0 +1,83 @@ +--- src/lxml/etree.c ++++ src/lxml/etree.c +@@ -113118,7 +113118,7 @@ + * self._orig_loader = _register_document_loader() if set_document_loader else NULL + * if self._validator is not None: + */ +- __pyx_v_self->_c_ctxt->sax->serror = __pyx_f_4lxml_5etree__receiveParserError; ++ __pyx_v_self->_c_ctxt->sax->serror = (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveParserError; + + /* "src/lxml/parser.pxi":587 + * self._doc = None +@@ -117606,7 +117606,7 @@ + * sax.startElementNs = NULL + * sax.endElementNs = NULL + */ +- __pyx_v_sax->serror = __pyx_f_4lxml_5etree__receiveParserError; ++ __pyx_v_sax->serror = (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveParserError; + + /* "src/lxml/parser.pxi":923 + * sax.initialized = xmlparser.XML_SAX2_MAGIC +@@ -181690,7 +181690,7 @@ + * + * @cython.final + */ +- __pyx_v_xpathCtxt->error = __pyx_f_4lxml_5etree__receiveXPathError; ++ __pyx_v_xpathCtxt->error = (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveXPathError; + + /* "src/lxml/extensions.pxi":132 + * return utf +@@ -218964,7 +218964,7 @@ + * parser_ctxt, _receiveError, <void*>self._error_log) + * _connectGenericErrorLog(self._error_log, xmlerror.XML_FROM_RELAXNGP) + */ +- xmlRelaxNGSetParserStructuredErrors(__pyx_v_parser_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); ++ xmlRelaxNGSetParserStructuredErrors(__pyx_v_parser_ctxt, (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); + + /* "src/lxml/relaxng.pxi":92 + * relaxng.xmlRelaxNGSetParserStructuredErrors( +@@ -219382,7 +219382,7 @@ + * valid_ctxt, _receiveError, <void*>self._error_log) + * _connectGenericErrorLog(self._error_log, xmlerror.XML_FROM_RELAXNGV) + */ +- xmlRelaxNGSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); ++ xmlRelaxNGSetValidStructuredErrors(__pyx_v_valid_ctxt, (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); + + /* "src/lxml/relaxng.pxi":134 + * relaxng.xmlRelaxNGSetValidStructuredErrors( +@@ -220271,7 +220271,7 @@ + * parser_ctxt, _receiveError, <void*>self._error_log) + * if self._doc is not None: + */ +- xmlSchemaSetParserStructuredErrors(__pyx_v_parser_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); ++ xmlSchemaSetParserStructuredErrors(__pyx_v_parser_ctxt, (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); + + /* "src/lxml/xmlschema.pxi":74 + * xmlschema.xmlSchemaSetParserStructuredErrors( +@@ -220814,7 +220814,7 @@ + * valid_ctxt, _receiveError, <void*>self._error_log) + * + */ +- xmlSchemaSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); ++ xmlSchemaSetValidStructuredErrors(__pyx_v_valid_ctxt, (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); + + /* "src/lxml/xmlschema.pxi":131 + * valid_ctxt, _receiveError, <void*>self._error_log) +@@ -221579,7 +221579,7 @@ + * self._valid_ctxt, _receiveError, <void*>error_log) + * self._sax_plug = xmlschema.xmlSchemaSAXPlug( + */ +- xmlSchemaSetValidStructuredErrors(__pyx_v_self->_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_error_log)); ++ xmlSchemaSetValidStructuredErrors(__pyx_v_self->_valid_ctxt, (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_error_log)); + + /* "src/lxml/xmlschema.pxi":195 + * xmlschema.xmlSchemaSetValidOptions( +@@ -222756,7 +222756,7 @@ + * valid_ctxt, _receiveError, <void*>self._error_log) + * c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node) + */ +- xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); ++ xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, (xmlStructuredErrorFunc)__pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log)); + + /* "src/lxml/schematron.pxi":153 + * schematron.xmlSchematronSetValidStructuredErrors( diff --git a/external/lxml/Wincompatible-pointer-types.patch b/external/lxml/Wincompatible-pointer-types.patch new file mode 100644 index 000000000000..68d017c4e5fb --- /dev/null +++ b/external/lxml/Wincompatible-pointer-types.patch @@ -0,0 +1,65 @@ +--- src/lxml/etree.c ++++ src/lxml/etree.c +@@ -137695,7 +137695,7 @@ + * + * def start(self, tag, attrs, nsmap=None): + */ +- __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 832, __pyx_L1_error) ++ __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData((__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 832, __pyx_L1_error) + + /* "src/lxml/saxparser.pxi":826 + * return self._last +@@ -137856,7 +137856,7 @@ + * def end(self, tag): + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_3 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag, __pyx_v_attrs, __pyx_v_nsmap); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) ++ __pyx_t_3 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart((__pyx_v_self), __pyx_v_tag, __pyx_v_attrs, __pyx_v_nsmap); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; +@@ -137927,7 +137927,7 @@ + * assert self._last.tag == tag,\ + * f"end tag mismatch (expected {self._last.tag}, got {tag})" + */ +- __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 848, __pyx_L1_error) ++ __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd((__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_element = __pyx_t_1; + __pyx_t_1 = 0; +@@ -138128,7 +138128,7 @@ + * def comment(self, comment): + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_target, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 859, __pyx_L1_error) ++ __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi((__pyx_v_self), __pyx_v_target, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; +@@ -138191,7 +138191,7 @@ + * return self._handleSaxComment(comment) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 867, __pyx_L1_error) ++ __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment((__pyx_v_self), __pyx_v_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; +@@ -203205,7 +203205,7 @@ + * context.register_context(transform_ctxt, input_doc) + * + */ +- __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L9_error) ++ __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy((__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))))) __PYX_ERR(4, 550, __pyx_L9_error) + __Pyx_DECREF_SET(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_1)); +@@ -205038,7 +205030,7 @@ + * + * new_xslt._xslt_resolver_context = stylesheet._xslt_resolver_context._copy() + */ +- __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 691, __pyx_L1_error) ++ __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy((__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))))) __PYX_ERR(4, 691, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); diff --git a/external/lxml/replace-setuptools-with-distutils.patch.1 b/external/lxml/replace-setuptools-with-distutils.patch.1 new file mode 100644 index 000000000000..5275e40312c8 --- /dev/null +++ b/external/lxml/replace-setuptools-with-distutils.patch.1 @@ -0,0 +1,29 @@ +diff -ur lxml.org/setupinfo.py lxml/setupinfo.py +--- lxml.org/setupinfo.py 2023-10-20 10:32:17.921500435 +0200 ++++ lxml/setupinfo.py 2023-10-20 10:33:40.303323572 +0200 +@@ -4,7 +4,7 @@ + import os.path + import subprocess + +-from setuptools.command.build_ext import build_ext as _build_ext ++from distutils.command.build_ext import build_ext as _build_ext + from distutils.core import Extension + from distutils.errors import CompileError, DistutilsOptionError + from versioninfo import get_base_dir +diff -ur lxml.org/setup.py lxml/setup.py +--- lxml.org/setup.py 2023-10-20 10:32:17.949501053 +0200 ++++ lxml/setup.py 2023-10-20 10:33:09.082631759 +0200 +@@ -217,9 +217,10 @@ + # `Unknown distribution option: 'bugtrack_url'` + # which distract folks from real causes of problems when troubleshooting + # bugtrack_url="https://bugs.launchpad.net/lxml", +- project_urls={ +- "Source": "https://github.com/lxml/lxml", +- }, ++ # same as for bugtrack_urls also for project_urls when using distutils instead of setuptools ++ #project_urls={ ++ # "Source": "https://github.com/lxml/lxml", ++ #}, + description=( + "Powerful and Pythonic XML processing library" + " combining libxml2/libxslt with the ElementTree API." diff --git a/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk b/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk index 3458089ce99e..a5b485b74d13 100644 --- a/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk +++ b/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk @@ -21,12 +21,10 @@ $(eval $(call gb_StaticLibrary_set_include,mariadb-connector-c,\ # This is needed for MSVC 2008: it somehow finds a dlopen somewhere # but the static library then contains unreferenced symbols. # This macro enables a re-definition to native Win32 APIs in my_global.h. -## TODO missing enable: -D HAVE_COMPRESS -## (but then need to add "-lz" to mysqlcppconn linking) -$(eval $(call gb_StaticLibrary_add_cflags,mariadb-connector-c,-DHAVE_DLOPEN -D ENABLED_LOCAL_INFILE -D LIBMARIADB -D THREAD -DSQLITE_ENABLE_COLUMN_METADATA=1)) +$(eval $(call gb_StaticLibrary_add_cflags,mariadb-connector-c,-DHAVE_DLOPEN -DHAVE_COMPRESS -D ENABLED_LOCAL_INFILE -D LIBMARIADB -D THREAD -DSQLITE_ENABLE_COLUMN_METADATA=1)) ifeq ($(OS),WNT) -$(eval $(call gb_StaticLibrary_add_cflags,mariadb-connector-c,-D_TIMESPEC_DEFINED -DHAVE_STRTOULL)) +$(eval $(call gb_StaticLibrary_add_cflags,mariadb-connector-c,-D_TIMESPEC_DEFINED -DHAVE_STRTOULL -DHAVE_WINCRYPT)) $(eval $(call gb_StaticLibrary_set_include,mariadb-connector-c,\ $$(INCLUDE) \ -I$(call gb_UnpackedTarball_get_dir,mariadb-connector-c)/win-iconv \ @@ -46,7 +44,7 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,mariadb-connector-c,\ UnpackedTarball/mariadb-connector-c/libmariadb/ma_default \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_dtoa \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_errmsg \ - UnpackedTarball/mariadb-connector-c/libmariadb/ma_hash \ + UnpackedTarball/mariadb-connector-c/libmariadb/ma_hashtbl \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_init \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_io \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_list \ @@ -55,6 +53,11 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,mariadb-connector-c,\ UnpackedTarball/mariadb-connector-c/libmariadb/ma_net \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_password \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_pvio \ + $(ifneq $(filter $(OS),WNT), \ + UnpackedTarball/mariadb-connector-c/plugins/auth/auth_gssapi_client \ + UnpackedTarball/mariadb-connector-c/plugins/auth/gssapi_client \ + UnpackedTarball/mariadb-connector-c/plugins/auth/gssapi_errmsg \ + ) \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_sha1 \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_stmt_codec \ UnpackedTarball/mariadb-connector-c/libmariadb/ma_string \ @@ -67,6 +70,10 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,mariadb-connector-c,\ UnpackedTarball/mariadb-connector-c/libmariadb/ma_client_plugin \ UnpackedTarball/mariadb-connector-c/plugins/auth/my_auth \ UnpackedTarball/mariadb-connector-c/plugins/auth/caching_sha2_pw \ + $(ifneq $(filter $(OS),WNT), \ + UnpackedTarball/mariadb-connector-c/plugins/auth/gssapi_client \ + UnpackedTarball/mariadb-connector-c/plugins/auth/gssapi_errmsg \ + ) \ UnpackedTarball/mariadb-connector-c/plugins/pvio/pvio_socket \ $(if $(filter $(OS),WNT), \ UnpackedTarball/mariadb-connector-c/libmariadb/win32_errmsg \ diff --git a/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk b/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk index 241e12db6581..f874918de5ee 100644 --- a/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk +++ b/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk @@ -36,6 +36,9 @@ $(eval $(call gb_UnpackedTarball_set_post_action,mariadb-connector-c, \ extern struct st_mysql_client_plugin pvio_socket_client_plugin\; \ extern struct st_mysql_client_plugin caching_sha2_password_client_plugin\; \ extern struct st_mysql_client_plugin mysql_native_password_client_plugin\; \ + $(ifneq $(filter WNT,$(OS)), \ + extern struct st_mysql_client_plugin_AUTHENTICATION auth_gssapi_client_client_plugin\; \ + ) \ $(if $(filter WNT,$(OS)), \ extern struct st_mysql_client_plugin pvio_shmem_client_plugin\; \ extern struct st_mysql_client_plugin pvio_npipe_client_plugin\; \ @@ -45,6 +48,9 @@ $(eval $(call gb_UnpackedTarball_set_post_action,mariadb-connector-c, \ (struct st_mysql_client_plugin *)\&pvio_socket_client_plugin$(COMMA) \ (struct st_mysql_client_plugin *)\&caching_sha2_password_client_plugin$(COMMA) \ (struct st_mysql_client_plugin *)\&mysql_native_password_client_plugin$(COMMA) \ + $(ifneq $(filter WNT,$(OS)), \ + (struct st_mysql_client_plugin_AUTHENTICATION *)\&auth_gssapi_client_client_plugin$(COMMA) \ + ) \ $(if $(filter WNT,$(OS)), \ (struct st_mysql_client_plugin *)\&pvio_shmem_client_plugin$(COMMA) \ (struct st_mysql_client_plugin *)\&pvio_npipe_client_plugin$(COMMA) \ diff --git a/external/mariadb-connector-c/configs/wnt_ma_config.h b/external/mariadb-connector-c/configs/wnt_ma_config.h index d06393509881..acd08c125a95 100644 --- a/external/mariadb-connector-c/configs/wnt_ma_config.h +++ b/external/mariadb-connector-c/configs/wnt_ma_config.h @@ -72,11 +72,7 @@ # define HAVE_LONG 1 #endif -#ifdef _M_X64 #define SIZEOF_LONG_LONG 8 -#else -#define SIZEOF_LONG_LONG 4 -#endif #if defined(SIZEOF_LONG_LONG) # define HAVE_LONG_LONG 1 #endif diff --git a/external/mdds/0001-cid-1546160-COPY_INSTEAD_OF_MOVE.patch.1 b/external/mdds/0001-cid-1546160-COPY_INSTEAD_OF_MOVE.patch.1 new file mode 100644 index 000000000000..9c47e1d22767 --- /dev/null +++ b/external/mdds/0001-cid-1546160-COPY_INSTEAD_OF_MOVE.patch.1 @@ -0,0 +1,62 @@ +From f7d8d7eaf2b4160354887ac740a1efed9b6fc23b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com> +Date: Sun, 14 Jan 2024 21:03:12 +0000 +Subject: [PATCH] cid#1546160 COPY_INSTEAD_OF_MOVE + +and + +cid#1545547 COPY_INSTEAD_OF_MOVE +cid#1545642 COPY_INSTEAD_OF_MOVE +cid#1557206 COPY_INSTEAD_OF_MOVE +--- + include/mdds/flat_segment_tree.hpp | 2 +- + include/mdds/flat_segment_tree_def.inl | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/include/mdds/flat_segment_tree.hpp b/include/mdds/flat_segment_tree.hpp +index bf8e0956..317eb279 100644 +--- a/include/mdds/flat_segment_tree.hpp ++++ b/include/mdds/flat_segment_tree.hpp +@@ -767,7 +767,7 @@ private: + { + node_ptr next_node = cur_node->next; + disconnect_all_nodes(cur_node.get()); +- cur_node = next_node; ++ cur_node = std::move(next_node); + } + last_node->next = end_node; + end_node->prev = last_node; +diff --git a/include/mdds/flat_segment_tree_def.inl b/include/mdds/flat_segment_tree_def.inl +index 76350656..d07cae82 100644 +--- a/include/mdds/flat_segment_tree_def.inl ++++ b/include/mdds/flat_segment_tree_def.inl +@@ -114,7 +114,7 @@ + // Move on to the next destination node, and have the next node point + // back to the previous node. + node_ptr old_node = dest_node; +- dest_node->next->prev = old_node; ++ dest_node->next->prev = std::move(old_node); + dest_node = dest_node->next; + + if (src_node == r.m_right_leaf.get()) +@@ -380,7 +380,7 @@ + + p = get_insertion_pos_leaf(start_key, p); + node_ptr start_pos(const_cast<node*>(p)); +- return insert_to_pos(start_pos, start_key, end_key, val); ++ return insert_to_pos(std::move(start_pos), start_key, end_key, val); + } + + template<typename Key, typename Value> +@@ -456,7 +456,7 @@ + last_seg_value = node_pos->value_leaf.value; + node_ptr next = node_pos->next; + disconnect_all_nodes(node_pos.get()); +- node_pos = next; ++ node_pos = std::move(next); + } + + start_pos->value_leaf.value = last_seg_value; +-- +2.42.0 + diff --git a/external/mdds/UnpackedTarball_mdds.mk b/external/mdds/UnpackedTarball_mdds.mk index 65dd0109e972..ce1ba745be43 100644 --- a/external/mdds/UnpackedTarball_mdds.mk +++ b/external/mdds/UnpackedTarball_mdds.mk @@ -11,9 +11,12 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,mdds)) $(eval $(call gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL))) -$(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,1)) +$(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0)) $(eval $(call gb_UnpackedTarball_add_patches,mdds,\ + external/mdds/use-after-free.patch \ + external/mdds/gcc-12-silence-use-after-free.patch.1 \ + external/mdds/0001-cid-1546160-COPY_INSTEAD_OF_MOVE.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/mdds/gcc-12-silence-use-after-free.patch.1 b/external/mdds/gcc-12-silence-use-after-free.patch.1 new file mode 100644 index 000000000000..94f7ba979e61 --- /dev/null +++ b/external/mdds/gcc-12-silence-use-after-free.patch.1 @@ -0,0 +1,42 @@ +Workaround for gcc-toolset-12 on almalinux8 on a release/optimized build: +[build CXX] sc/source/core/data/column2.cxx +In file included from /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree.hpp:37, + from /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/sc/inc/columnspanset.hxx:16, + from /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/sc/inc/column.hxx:25, + from /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/sc/source/core/data/column2.cxx:20: +In function ‘void mdds::__st::intrusive_ptr_release(node<T>*) [with T = mdds::flat_segment_tree<int, bool>]’, + inlined from ‘boost::intrusive_ptr<T>::~intrusive_ptr() [with T = mdds::__st::node<mdds::flat_segment_tree<int, bool> >]’ at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:100:44, + inlined from ‘std::pair<mdds::flat_segment_tree<Key, Value>::const_iterator, bool> mdds::flat_segment_tree<Key, Value>::insert_segment_impl(key_type, key_type, value_type, bool) [with Key = int; Value = bool]’ at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree_def.inl:225:1: +/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/node.hpp:247:10: error: pointer used after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free] + 247 | --p->refcount; + | ~~~^~~~~~~~ +In function ‘void mdds::__st::intrusive_ptr_release(node<T>*) [with T = mdds::flat_segment_tree<int, bool>]’, + inlined from ‘void mdds::__st::intrusive_ptr_release(node<T>*) [with T = mdds::flat_segment_tree<int, bool>]’ at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/node.hpp:245:13, + inlined from ‘boost::intrusive_ptr<T>::~intrusive_ptr() [with T = mdds::__st::node<mdds::flat_segment_tree<int, bool> >]’ at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:100:44, + inlined from ‘std::pair<mdds::flat_segment_tree<Key, Value>::const_iterator, bool> mdds::flat_segment_tree<Key, Value>::insert_segment_impl(key_type, key_type, value_type, bool) [with Key = int; Value = bool]’ at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree_def.inl:224:93: +/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/node.hpp:249:9: note: call to ‘void operator delete(void*, std::size_t)’ here + 249 | delete p; + | ^~~~~~~~ +cc1plus: all warnings being treated as errors + +diff -ur mdds.org/include/mdds/node.hpp mdds/include/mdds/node.hpp +--- mdds.org/include/mdds/node.hpp 2023-07-24 18:27:14.427139325 +0000 ++++ mdds/include/mdds/node.hpp 2023-07-24 18:26:54.554461294 +0000 +@@ -244,9 +244,15 @@ + template<typename T> + inline void intrusive_ptr_release(node<T>* p) + { +- --p->refcount; +- if (!p->refcount) ++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ <= 3 && !defined __clang__ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wuse-after-free" ++#endif ++ if(--p->refcount == 0) + delete p; ++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ <= 3 && !defined __clang__ ++#pragma GCC diagnostic pop ++#endif + } + + template<typename T> diff --git a/external/mdds/use-after-free.patch b/external/mdds/use-after-free.patch new file mode 100644 index 000000000000..981c945821a7 --- /dev/null +++ b/external/mdds/use-after-free.patch @@ -0,0 +1,12 @@ +--- include/mdds/flat_segment_tree_def.inl ++++ include/mdds/flat_segment_tree_def.inl +@@ -84,8 +84,8 @@ + // Move on to the next destination node, and have the next node point + // back to the previous node. + node_ptr old_node = dest_node; ++ dest_node->next->prev = old_node; + dest_node = dest_node->next; +- dest_node->prev = old_node; + + if (src_node == r.m_right_leaf.get()) + { diff --git a/external/more_fonts/ExternalPackage_EmojiOne_Color.mk b/external/more_fonts/ExternalPackage_EmojiOne_Color.mk deleted file mode 100644 index 76cdb668487f..000000000000 --- a/external/more_fonts/ExternalPackage_EmojiOne_Color.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,fonts_emojione_color,font_emojione_color)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_emojione_color,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - EmojiOneColor-SVGinOT.ttf \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_amiri.mk b/external/more_fonts/ExternalPackage_amiri.mk index d938b8cf7542..96aa3a1b1a33 100644 --- a/external/more_fonts/ExternalPackage_amiri.mk +++ b/external/more_fonts/ExternalPackage_amiri.mk @@ -10,11 +10,11 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,fonts_amiri,font_amiri)) $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_amiri,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Amiri-Regular.ttf \ Amiri-Bold.ttf \ - Amiri-BoldSlanted.ttf \ + Amiri-Italic.ttf \ + Amiri-BoldItalic.ttf \ AmiriQuran.ttf \ - Amiri-Regular.ttf \ - Amiri-Slanted.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_culmus.mk b/external/more_fonts/ExternalPackage_culmus.mk index ecbd7f70ec07..f7a537e8055b 100644 --- a/external/more_fonts/ExternalPackage_culmus.mk +++ b/external/more_fonts/ExternalPackage_culmus.mk @@ -10,10 +10,10 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,fonts_culmus,font_culmus)) $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_culmus,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - DavidCLM-Bold.ttf \ - DavidCLM-BoldItalic.ttf \ - DavidCLM-Medium.ttf \ - DavidCLM-MediumItalic.ttf \ + DavidCLM-Bold.otf \ + DavidCLM-BoldItalic.otf \ + DavidCLM-Medium.otf \ + DavidCLM-MediumItalic.otf \ FrankRuehlCLM-Bold.ttf \ FrankRuehlCLM-BoldOblique.ttf \ FrankRuehlCLM-Medium.ttf \ diff --git a/external/more_fonts/ExternalPackage_kacst.mk b/external/more_fonts/ExternalPackage_kacst.mk deleted file mode 100644 index 909ed11110b3..000000000000 --- a/external/more_fonts/ExternalPackage_kacst.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,fonts_kacst,font_kacst)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_kacst,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - KacstBook.ttf \ - KacstOffice.ttf \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto.mk b/external/more_fonts/ExternalPackage_noto.mk deleted file mode 100644 index dd52ac956265..000000000000 --- a/external/more_fonts/ExternalPackage_noto.mk +++ /dev/null @@ -1,63 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,fonts_noto,font_noto)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - NotoKufiArabic-Bold.ttf \ - NotoKufiArabic-Regular.ttf \ - NotoMono-Regular.ttf \ - NotoNaskhArabic-Bold.ttf \ - NotoNaskhArabic-Regular.ttf \ - NotoNaskhArabicUI-Bold.ttf \ - NotoNaskhArabicUI-Regular.ttf \ - NotoSansArabic-Bold.ttf \ - NotoSansArabic-Regular.ttf \ - NotoSansArabicUI-Bold.ttf \ - NotoSansArabicUI-Regular.ttf \ - NotoSansArmenian-Bold.ttf \ - NotoSansArmenian-Regular.ttf \ - NotoSans-Bold.ttf \ - NotoSans-BoldItalic.ttf \ - NotoSans-Condensed.ttf \ - NotoSans-CondensedBold.ttf \ - NotoSans-CondensedBoldItalic.ttf \ - NotoSans-CondensedItalic.ttf \ - NotoSansGeorgian-Bold.ttf \ - NotoSansGeorgian-Regular.ttf \ - NotoSansHebrew-Bold.ttf \ - NotoSansHebrew-Regular.ttf \ - NotoSans-Italic.ttf \ - NotoSansLao-Bold.ttf \ - NotoSansLao-Regular.ttf \ - NotoSans-Light.ttf \ - NotoSans-LightItalic.ttf \ - NotoSansLisu-Regular.ttf \ - NotoSans-Regular.ttf \ - NotoSerifArmenian-Bold.ttf \ - NotoSerifArmenian-Regular.ttf \ - NotoSerif-Bold.ttf \ - NotoSerif-BoldItalic.ttf \ - NotoSerif-Condensed.ttf \ - NotoSerif-CondensedBold.ttf \ - NotoSerif-CondensedBoldItalic.ttf \ - NotoSerif-CondensedItalic.ttf \ - NotoSerifGeorgian-Bold.ttf \ - NotoSerifGeorgian-Regular.ttf \ - NotoSerifHebrew-Bold.ttf \ - NotoSerifHebrew-Regular.ttf \ - NotoSerif-Italic.ttf \ - NotoSerifLao-Bold.ttf \ - NotoSerifLao-Regular.ttf \ - NotoSerif-Light.ttf \ - NotoSerif-LightItalic.ttf \ - NotoSerif-Regular.ttf \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/apr/UnpackedTarball_apr_util.mk b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk index 06860f13967e..2a9a053b4874 100644 --- a/external/apr/UnpackedTarball_apr_util.mk +++ b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk @@ -7,16 +7,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,apr_util)) +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto_kufi_arabic,font_noto_kufi_arabic)) -$(eval $(call gb_UnpackedTarball_set_tarball,apr_util,$(APR_UTIL_TARBALL))) - -$(eval $(call gb_UnpackedTarball_fix_end_of_line,apr_util,\ - aprutil.mak \ -)) - -$(eval $(call gb_UnpackedTarball_add_patches,apr_util,\ - external/apr/windows.build.patch.1 \ +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_kufi_arabic,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoKufiArabic/full/ttf/NotoKufiArabic-Bold.ttf \ + NotoKufiArabic/full/ttf/NotoKufiArabic-Regular.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_naskh_arabic.mk b/external/more_fonts/ExternalPackage_noto_naskh_arabic.mk new file mode 100644 index 000000000000..a6647e7b769c --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_naskh_arabic.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_naskh_arabic,font_noto_naskh_arabic)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_naskh_arabic,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoNaskhArabic/full/ttf/NotoNaskhArabic-Bold.ttf \ + NotoNaskhArabic/full/ttf/NotoNaskhArabic-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_sans.mk b/external/more_fonts/ExternalPackage_noto_sans.mk new file mode 100644 index 000000000000..7c8e6a14abbe --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans.mk @@ -0,0 +1,19 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_sans,font_noto_sans)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSans/full/ttf/NotoSans-Bold.ttf \ + NotoSans/full/ttf/NotoSans-BoldItalic.ttf \ + NotoSans/full/ttf/NotoSans-Italic.ttf \ + NotoSans/full/ttf/NotoSans-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_sans_arabic.mk b/external/more_fonts/ExternalPackage_noto_sans_arabic.mk new file mode 100644 index 000000000000..88a5b2e6d444 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_arabic.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_sans_arabic,font_noto_sans_arabic)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans_arabic,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansArabic/full/ttf/NotoSansArabic-Bold.ttf \ + NotoSansArabic/full/ttf/NotoSansArabic-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_sans_armenian.mk b/external/more_fonts/ExternalPackage_noto_sans_armenian.mk new file mode 100644 index 000000000000..c02badc631ce --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_armenian.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_sans_armenian,font_noto_sans_armenian)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans_armenian,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansArmenian/full/ttf/NotoSansArmenian-Bold.ttf \ + NotoSansArmenian/full/ttf/NotoSansArmenian-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_sans_georgian.mk b/external/more_fonts/ExternalPackage_noto_sans_georgian.mk new file mode 100644 index 000000000000..500fb1f8c044 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_georgian.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_sans_georgian,font_noto_sans_georgian)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans_georgian,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansGeorgian/full/ttf/NotoSansGeorgian-Bold.ttf \ + NotoSansGeorgian/full/ttf/NotoSansGeorgian-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_sans_hebrew.mk b/external/more_fonts/ExternalPackage_noto_sans_hebrew.mk new file mode 100644 index 000000000000..9e44f4546c81 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_hebrew.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_sans_hebrew,font_noto_sans_hebrew)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans_hebrew,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansHebrew/full/ttf/NotoSansHebrew-Bold.ttf \ + NotoSansHebrew/full/ttf/NotoSansHebrew-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/apr/UnpackedTarball_apr.mk b/external/more_fonts/ExternalPackage_noto_sans_lao.mk index c3be6167024d..52454e20d0f5 100644 --- a/external/apr/UnpackedTarball_apr.mk +++ b/external/more_fonts/ExternalPackage_noto_sans_lao.mk @@ -7,15 +7,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,apr)) +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto_sans_lao,font_noto_sans_lao)) -$(eval $(call gb_UnpackedTarball_set_tarball,apr,$(APR_TARBALL))) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,apr,0)) - -$(eval $(call gb_UnpackedTarball_add_patches,apr, \ - external/apr/exit.patch \ - external/apr/uuid.patch \ +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans_lao,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansLao/full/ttf/NotoSansLao-Bold.ttf \ + NotoSansLao/full/ttf/NotoSansLao-Regular.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/languagetool/Module_languagetool.mk b/external/more_fonts/ExternalPackage_noto_sans_lisu.mk index 0574d55d6856..198351f1320b 100644 --- a/external/languagetool/Module_languagetool.mk +++ b/external/more_fonts/ExternalPackage_noto_sans_lisu.mk @@ -7,16 +7,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,languagetool)) +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto_sans_lisu,font_noto_sans_lisu)) -ifneq ($(ENABLE_JAVA),) -ifneq ($(filter LANGUAGETOOL,$(BUILD_TYPE)),) -$(eval $(call gb_Module_add_targets,languagetool,\ - ExternalProject_languagetool \ - ExtensionPackage_LanguageTool \ - UnpackedTarball_languagetool \ +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_sans_lisu,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansLisu/full/ttf/NotoSansLisu-Bold.ttf \ + NotoSansLisu/full/ttf/NotoSansLisu-Regular.ttf \ )) -endif -endif # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_serif.mk b/external/more_fonts/ExternalPackage_noto_serif.mk new file mode 100644 index 000000000000..a57db67a92ae --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_serif.mk @@ -0,0 +1,19 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_serif,font_noto_serif)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_serif,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSerif/hinted/ttf/NotoSerif-Bold.ttf \ + NotoSerif/hinted/ttf/NotoSerif-BoldItalic.ttf \ + NotoSerif/hinted/ttf/NotoSerif-Italic.ttf \ + NotoSerif/hinted/ttf/NotoSerif-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_serif_armenian.mk b/external/more_fonts/ExternalPackage_noto_serif_armenian.mk new file mode 100644 index 000000000000..77e92ddf10a4 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_serif_armenian.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_serif_armenian,font_noto_serif_armenian)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_serif_armenian,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSerifArmenian/full/ttf/NotoSerifArmenian-Bold.ttf \ + NotoSerifArmenian/full/ttf/NotoSerifArmenian-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_serif_georgian.mk b/external/more_fonts/ExternalPackage_noto_serif_georgian.mk new file mode 100644 index 000000000000..b9142bc86d4d --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_serif_georgian.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_serif_georgian,font_noto_serif_georgian)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_serif_georgian,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSerifGeorgian/full/ttf/NotoSerifGeorgian-Bold.ttf \ + NotoSerifGeorgian/full/ttf/NotoSerifGeorgian-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_serif_hebrew.mk b/external/more_fonts/ExternalPackage_noto_serif_hebrew.mk new file mode 100644 index 000000000000..709dfdd6b274 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_serif_hebrew.mk @@ -0,0 +1,17 @@ +# -*- 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_ExternalPackage_ExternalPackage,fonts_noto_serif_hebrew,font_noto_serif_hebrew)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_serif_hebrew,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSerifHebrew/full/ttf/NotoSerifHebrew-Bold.ttf \ + NotoSerifHebrew/full/ttf/NotoSerifHebrew-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/Module_apache-commons.mk b/external/more_fonts/ExternalPackage_noto_serif_lao.mk index 45aabe229b03..f7243ffd1d3f 100644 --- a/external/apache-commons/Module_apache-commons.mk +++ b/external/more_fonts/ExternalPackage_noto_serif_lao.mk @@ -7,12 +7,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,apache-commons)) +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto_serif_lao,font_noto_serif_lao)) -$(eval $(call gb_Module_add_targets,apache-commons,\ - ExternalPackage_apache_commons_logging \ - ExternalProject_apache_commons_logging \ - UnpackedTarball_apache_commons_logging \ +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_serif_lao,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSerifLao/full/ttf/NotoSerifLao-Bold.ttf \ + NotoSerifLao/full/ttf/NotoSerifLao-Regular.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_reem.mk b/external/more_fonts/ExternalPackage_reem.mk index 9a40652b55cc..bc26cecc7dfe 100644 --- a/external/more_fonts/ExternalPackage_reem.mk +++ b/external/more_fonts/ExternalPackage_reem.mk @@ -11,6 +11,7 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,fonts_reem,font_reem)) $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_reem,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ ttf/ReemKufi-Regular.ttf \ + ttf/ReemKufi-Bold.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_sourcecode.mk b/external/more_fonts/ExternalPackage_sourcecode.mk deleted file mode 100644 index 5f1d7f7c5b31..000000000000 --- a/external/more_fonts/ExternalPackage_sourcecode.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,fonts_sourcecode,font_sourcecode)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_sourcecode,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - SourceCodePro-BlackIt.ttf \ - SourceCodePro-Black.ttf \ - SourceCodePro-BoldIt.ttf \ - SourceCodePro-Bold.ttf \ - SourceCodePro-ExtraLightIt.ttf \ - SourceCodePro-ExtraLight.ttf \ - SourceCodePro-It.ttf \ - SourceCodePro-LightIt.ttf \ - SourceCodePro-Light.ttf \ - SourceCodePro-MediumIt.ttf \ - SourceCodePro-Medium.ttf \ - SourceCodePro-Regular.ttf \ - SourceCodePro-SemiboldIt.ttf \ - SourceCodePro-Semibold.ttf \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_sourcesans.mk b/external/more_fonts/ExternalPackage_sourcesans.mk deleted file mode 100644 index cd7ac29e92af..000000000000 --- a/external/more_fonts/ExternalPackage_sourcesans.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,fonts_sourcesans,font_sourcesans)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_sourcesans,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - SourceSansPro-BlackIt.ttf \ - SourceSansPro-Black.ttf \ - SourceSansPro-BoldIt.ttf \ - SourceSansPro-Bold.ttf \ - SourceSansPro-ExtraLightIt.ttf \ - SourceSansPro-ExtraLight.ttf \ - SourceSansPro-It.ttf \ - SourceSansPro-LightIt.ttf \ - SourceSansPro-Light.ttf \ - SourceSansPro-Regular.ttf \ - SourceSansPro-SemiboldIt.ttf \ - SourceSansPro-Semibold.ttf \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_sourceserif.mk b/external/more_fonts/ExternalPackage_sourceserif.mk deleted file mode 100644 index 6a5272bbaa7a..000000000000 --- a/external/more_fonts/ExternalPackage_sourceserif.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,fonts_sourceserif,font_sourceserif)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_sourceserif,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - SourceSerifPro-BoldIt.ttf \ - SourceSerifPro-ExtraLight.ttf \ - SourceSerifPro-Light.ttf \ - SourceSerifPro-Semibold.ttf \ - SourceSerifPro-BlackIt.ttf \ - SourceSerifPro-Bold.ttf \ - SourceSerifPro-It.ttf \ - SourceSerifPro-Regular.ttf \ - SourceSerifPro-Black.ttf \ - SourceSerifPro-ExtraLightIt.ttf \ - SourceSerifPro-LightIt.ttf \ - SourceSerifPro-SemiboldIt.ttf \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index c6e56c5b90b7..e17af9a15141 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -17,18 +17,26 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ $(if $(MPL_SUBSET),,ExternalPackage_culmus) \ ExternalPackage_dejavu \ ExternalPackage_gentium \ - $(if $(MPL_SUBSET),,ExternalPackage_kacst) \ ExternalPackage_liberation \ ExternalPackage_liberation_narrow \ ExternalPackage_libertineg \ ExternalPackage_libre_hebrew \ - ExternalPackage_sourcecode \ - ExternalPackage_sourcesans \ - ExternalPackage_sourceserif \ - ExternalPackage_noto \ + ExternalPackage_noto_kufi_arabic \ + ExternalPackage_noto_naskh_arabic \ + ExternalPackage_noto_sans \ + ExternalPackage_noto_sans_arabic \ + ExternalPackage_noto_sans_armenian \ + ExternalPackage_noto_sans_georgian \ + ExternalPackage_noto_sans_hebrew \ + ExternalPackage_noto_sans_lao \ + ExternalPackage_noto_sans_lisu \ + ExternalPackage_noto_serif \ + ExternalPackage_noto_serif_armenian \ + ExternalPackage_noto_serif_georgian \ + ExternalPackage_noto_serif_hebrew \ + ExternalPackage_noto_serif_lao \ ExternalPackage_reem \ ExternalPackage_scheherazade \ - ExternalPackage_EmojiOne_Color \ UnpackedTarball_alef \ UnpackedTarball_amiri \ UnpackedTarball_caladea \ @@ -36,18 +44,26 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ $(if $(MPL_SUBSET),,UnpackedTarball_culmus) \ UnpackedTarball_dejavu \ UnpackedTarball_gentium \ - $(if $(MPL_SUBSET),,UnpackedTarball_kacst) \ UnpackedTarball_liberation \ UnpackedTarball_liberation_narrow \ UnpackedTarball_libertineg \ UnpackedTarball_libre_hebrew \ - UnpackedTarball_sourcecode \ - UnpackedTarball_sourcesans \ - UnpackedTarball_sourceserif \ - UnpackedTarball_noto \ + UnpackedTarball_noto_kufi_arabic \ + UnpackedTarball_noto_naskh_arabic \ + UnpackedTarball_noto_sans \ + UnpackedTarball_noto_sans_arabic \ + UnpackedTarball_noto_sans_armenian \ + UnpackedTarball_noto_sans_georgian \ + UnpackedTarball_noto_sans_hebrew \ + UnpackedTarball_noto_sans_lao \ + UnpackedTarball_noto_sans_lisu \ + UnpackedTarball_noto_serif \ + UnpackedTarball_noto_serif_armenian \ + UnpackedTarball_noto_serif_georgian \ + UnpackedTarball_noto_serif_hebrew \ + UnpackedTarball_noto_serif_lao \ UnpackedTarball_reem \ UnpackedTarball_scheherazade \ - UnpackedTarball_EmojiOne_Color \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk new file mode 100644 index 000000000000..f5e70d0c5e7a --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_kufi_arabic)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_kufi_arabic,$(FONT_NOTO_KUFI_ARABIC_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_naskh_arabic.mk b/external/more_fonts/UnpackedTarball_noto_naskh_arabic.mk new file mode 100644 index 000000000000..f429d85f13be --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_naskh_arabic.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_naskh_arabic)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_naskh_arabic,$(FONT_NOTO_NASKH_ARABIC_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto.mk b/external/more_fonts/UnpackedTarball_noto_sans.mk index ee6f223f8cad..f09189dbe185 100644 --- a/external/more_fonts/UnpackedTarball_noto.mk +++ b/external/more_fonts/UnpackedTarball_noto_sans.mk @@ -7,8 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_sans)) -$(eval $(call gb_UnpackedTarball_set_tarball,font_noto,$(FONT_NOTO_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans,$(FONT_NOTO_SANS_TARBALL),0)) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_sans_arabic.mk b/external/more_fonts/UnpackedTarball_noto_sans_arabic.mk new file mode 100644 index 000000000000..b5c4e9f9ed4b --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_sans_arabic.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_sans_arabic)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans_arabic,$(FONT_NOTO_SANS_ARABIC_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_sans_armenian.mk b/external/more_fonts/UnpackedTarball_noto_sans_armenian.mk new file mode 100644 index 000000000000..90632c088797 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_sans_armenian.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_sans_armenian)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans_armenian,$(FONT_NOTO_SANS_ARMENIAN_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_sans_georgian.mk b/external/more_fonts/UnpackedTarball_noto_sans_georgian.mk new file mode 100644 index 000000000000..b5b59184bcf2 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_sans_georgian.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_sans_georgian)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans_georgian,$(FONT_NOTO_SANS_GEORGIAN_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_sans_hebrew.mk b/external/more_fonts/UnpackedTarball_noto_sans_hebrew.mk new file mode 100644 index 000000000000..e4272805698d --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_sans_hebrew.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_sans_hebrew)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans_hebrew,$(FONT_NOTO_SANS_HEBREW_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_kacst.mk b/external/more_fonts/UnpackedTarball_noto_sans_lao.mk index 7972da8d3e8f..0ab604afad67 100644 --- a/external/more_fonts/UnpackedTarball_kacst.mk +++ b/external/more_fonts/UnpackedTarball_noto_sans_lao.mk @@ -7,8 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_kacst)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_sans_lao)) -$(eval $(call gb_UnpackedTarball_set_tarball,font_kacst,$(FONT_KACST_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans_lao,$(FONT_NOTO_SANS_LAO_TARBALL),0)) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_EmojiOne_Color.mk b/external/more_fonts/UnpackedTarball_noto_sans_lisu.mk index d931c7705636..58729012aeef 100644 --- a/external/more_fonts/UnpackedTarball_EmojiOne_Color.mk +++ b/external/more_fonts/UnpackedTarball_noto_sans_lisu.mk @@ -7,8 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_emojione_color)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_sans_lisu)) -$(eval $(call gb_UnpackedTarball_set_tarball,font_emojione_color,$(FONT_EMOJIONE_COLOR_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_sans_lisu,$(FONT_NOTO_SANS_LISU_TARBALL),0)) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_sourcesans.mk b/external/more_fonts/UnpackedTarball_noto_serif.mk index 65ff325535a1..d60fb9b5f00d 100644 --- a/external/more_fonts/UnpackedTarball_sourcesans.mk +++ b/external/more_fonts/UnpackedTarball_noto_serif.mk @@ -7,8 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_sourcesans)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_serif)) -$(eval $(call gb_UnpackedTarball_set_tarball,font_sourcesans,$(FONT_SOURCESANS_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_serif,$(FONT_NOTO_SERIF_TARBALL),0)) # vim: set noet sw=4 ts=4: diff --git a/external/apr/Module_apr.mk b/external/more_fonts/UnpackedTarball_noto_serif_armenian.mk index 6bb85fb76204..fa9fc1a09801 100644 --- a/external/apr/Module_apr.mk +++ b/external/more_fonts/UnpackedTarball_noto_serif_armenian.mk @@ -7,13 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,apr)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_serif_armenian)) -$(eval $(call gb_Module_add_targets,apr,\ - UnpackedTarball_apr \ - UnpackedTarball_apr_util \ - ExternalProject_apr \ - ExternalProject_apr_util \ -)) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_serif_armenian,$(FONT_NOTO_SERIF_ARMENIAN_TARBALL),0)) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_serif_georgian.mk b/external/more_fonts/UnpackedTarball_noto_serif_georgian.mk new file mode 100644 index 000000000000..192e37ed68bf --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_serif_georgian.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_serif_georgian)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_serif_georgian,$(FONT_NOTO_SERIF_GEORGIAN_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_serif_hebrew.mk b/external/more_fonts/UnpackedTarball_noto_serif_hebrew.mk new file mode 100644 index 000000000000..0d3020047e3d --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_serif_hebrew.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_serif_hebrew)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_serif_hebrew,$(FONT_NOTO_SERIF_HEBREW_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_serif_lao.mk b/external/more_fonts/UnpackedTarball_noto_serif_lao.mk new file mode 100644 index 000000000000..f6de23ed7e3b --- /dev/null +++ b/external/more_fonts/UnpackedTarball_noto_serif_lao.mk @@ -0,0 +1,14 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,font_noto_serif_lao)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_serif_lao,$(FONT_NOTO_SERIF_LAO_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_sourceserif.mk b/external/more_fonts/UnpackedTarball_sourceserif.mk deleted file mode 100644 index 0e8407320733..000000000000 --- a/external/more_fonts/UnpackedTarball_sourceserif.mk +++ /dev/null @@ -1,14 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,font_sourceserif)) - -$(eval $(call gb_UnpackedTarball_set_tarball,font_sourceserif,$(FONT_SOURCESERIF_TARBALL))) - -# vim: set noet sw=4 ts=4: diff --git a/external/mythes/ExternalProject_mythes.mk b/external/mythes/ExternalProject_mythes.mk index b352e9b594d3..b0e0a6bbdb1d 100644 --- a/external/mythes/ExternalProject_mythes.mk +++ b/external/mythes/ExternalProject_mythes.mk @@ -9,7 +9,9 @@ $(eval $(call gb_ExternalProject_ExternalProject,mythes)) +ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE) $(eval $(call gb_ExternalProject_use_external,mythes,hunspell)) +endif $(eval $(call gb_ExternalProject_register_targets,mythes,\ build \ @@ -18,8 +20,11 @@ $(eval $(call gb_ExternalProject_register_targets,mythes,\ $(call gb_ExternalProject_get_state_target,mythes,build): $(call gb_Trace_StartRange,mythes,EXTERNAL) $(call gb_ExternalProject_run,build,\ - LIBS="$(gb_STDLIBS) $(LIBS)" ./configure --disable-shared --with-pic \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \ + CXXFLAGS=" $(CXXFLAGS) $(call gb_ExternalProject_get_build_flags,mythes)" \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,mythes)" \ + LIBS="$(gb_STDLIBS) $(LIBS)" $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),gio_can_sniff=no) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,mythes,EXTERNAL) diff --git a/external/neon/Library_neon.mk b/external/neon/Library_neon.mk deleted file mode 100644 index 4c034a3178fb..000000000000 --- a/external/neon/Library_neon.mk +++ /dev/null @@ -1,100 +0,0 @@ -# -*- 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_Library_Library,neon)) - -$(eval $(call gb_Library_use_unpacked,neon,neon)) - -$(eval $(call gb_Library_use_externals,neon,\ - gnutls \ - libxml2 \ - libgcrypt \ - openssl \ - openssl_headers \ - zlib \ -)) - -$(eval $(call gb_Library_set_visibility_default,neon)) - -$(eval $(call gb_Library_set_warnings_disabled,neon)) - -$(eval $(call gb_Library_add_generated_cobjects,neon,\ - UnpackedTarball/neon/src/ne_207 \ - UnpackedTarball/neon/src/ne_acl3744 \ - UnpackedTarball/neon/src/ne_alloc \ - UnpackedTarball/neon/src/ne_auth \ - UnpackedTarball/neon/src/ne_basic \ - UnpackedTarball/neon/src/ne_compress \ - UnpackedTarball/neon/src/ne_dates \ - UnpackedTarball/neon/src/ne_i18n \ - UnpackedTarball/neon/src/ne_locks \ - UnpackedTarball/neon/src/ne_md5 \ - UnpackedTarball/neon/src/ne_props \ - UnpackedTarball/neon/src/ne_redirect \ - UnpackedTarball/neon/src/ne_request \ - UnpackedTarball/neon/src/ne_session \ - UnpackedTarball/neon/src/ne_socket \ - UnpackedTarball/neon/src/ne_socks \ - UnpackedTarball/neon/src/ne_string \ - UnpackedTarball/neon/src/ne_uri \ - UnpackedTarball/neon/src/ne_utils \ - UnpackedTarball/neon/src/ne_xml \ - UnpackedTarball/neon/src/ne_xmlreq \ -)) - - -ifneq ($(DISABLE_OPENSSL),TRUE) -$(eval $(call gb_Library_add_generated_cobjects,neon,\ - UnpackedTarball/neon/src/ne_openssl \ -)) -else -$(eval $(call gb_Library_add_generated_cobjects,neon,\ - UnpackedTarball/neon/src/ne_gnutls \ -)) -endif - - -ifeq ($(OS),WNT) -$(eval $(call gb_Library_use_system_win32_libs,neon,\ - ws2_32 \ - crypt32 \ -)) - -ifeq ($(COM),MSC) -$(eval $(call gb_Library_add_ldflags,neon,\ - /DEF:$(SRCDIR)/external/neon/neon.def \ -)) -endif - -$(eval $(call gb_Library_add_generated_cobjects,neon,\ - UnpackedTarball/neon/src/ne_sspi \ -)) - -else -ifneq ($(DISABLE_OPENSSL),TRUE) -$(eval $(call gb_Library_add_generated_cobjects,neon,\ - UnpackedTarball/neon/src/ne_ntlm \ -)) -endif - -endif - -ifeq ($(OS),LINUX) -$(eval $(call gb_Library_add_libs,neon,\ - -ldl \ -)) -endif - -ifneq (,$(gb_ENABLE_DBGUTIL)) -$(eval $(call gb_Library_add_cflags,neon,\ - -DNE_DEBUGGING \ -)) -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/neon/README b/external/neon/README deleted file mode 100644 index e983ae8223b5..000000000000 --- a/external/neon/README +++ /dev/null @@ -1 +0,0 @@ -Web library to help deal with WebDAV or other protocols, from [https://notroj.github.io/neon/]. diff --git a/external/neon/UnpackedTarball_neon.mk b/external/neon/UnpackedTarball_neon.mk deleted file mode 100644 index 73cdd81f2e18..000000000000 --- a/external/neon/UnpackedTarball_neon.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,neon)) - -$(eval $(call gb_UnpackedTarball_set_tarball,neon,$(NEON_TARBALL))) - -$(eval $(call gb_UnpackedTarball_add_files,neon,src,\ - external/neon/configs/config.h \ -)) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,neon,0)) - -$(eval $(call gb_UnpackedTarball_add_patches,neon,\ - external/neon/neon.patch \ - external/neon/neon_with_gnutls.patch \ - external/neon/neon_fix_lock_token_on_if.patch \ - $(if $(filter WNT,$(OS)),external/neon/neon_fix_no_OPENSSL_Applink.patch) \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/neon/configs/config.h b/external/neon/configs/config.h deleted file mode 100644 index 3f93d1e68132..000000000000 --- a/external/neon/configs/config.h +++ /dev/null @@ -1,597 +0,0 @@ -/* Contents kept in sync with config.h.in from neon 0.31.1 */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* Define to specific EGD socket path */ -/* #undef EGD_PATH */ - -/* Define if EGD should be supported */ -/* #undef ENABLE_EGD */ - -/* Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise */ -/* #undef GSS_C_NT_HOSTBASED_SERVICE */ - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#ifdef UNX -#define HAVE_ARPA_INET_H 1 -#endif - -/* Define to 1 if you have the `bind_textdomain_codeset' function. */ -/* #undef HAVE_BIND_TEXTDOMAIN_CODESET */ - -/* Define to 1 if you have the `CRYPTO_set_idptr_callback' function. */ -/* #undef HAVE_CRYPTO_SET_IDPTR_CALLBACK */ - -/* Define to 1 if you have the declaration of `h_errno', and to 0 if you - don't. */ -#ifdef _WIN32 -#define HAVE_DECL_H_ERRNO 1 -#endif - -/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. - */ -#ifdef LINUX -#define HAVE_DECL_STPCPY 1 -#endif - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#ifdef LINUX -#define HAVE_DECL_STRERROR_R 1 -#endif - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#ifdef UNX -#define HAVE_DLFCN_H 1 -#endif - -/* Define to 1 if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H 1 - -/* Define if you have expat */ -/* #undef HAVE_EXPAT */ - -/* Define to 1 if you have the `fcntl' function. */ -#ifdef UNX -#define HAVE_FCNTL 1 -#endif - -/* Define to 1 if you have the <fcntl.h> header file. */ -#ifdef UNX -#define HAVE_FCNTL_H 1 -#endif - -/* Define to 1 if you have the `fstat64' function. */ -#define HAVE_FSTAT64 - -/* Define to 1 if you have the `gai_strerror' function. */ -#define HAVE_GAI_STRERROR 1 - -/* Define to 1 if you have the `gethostname' function. */ -/* #undef HAVE_GETHOSTNAME */ - -/* Define to 1 if you have the `getnameinfo' function. */ -/* #undef HAVE_GETNAMEINFO */ - -/* Define to 1 if you have the `getsockopt' function. */ -#ifdef UNX -#define HAVE_GETSOCKOPT 1 -#endif - -#ifdef DISABLE_OPENSSL -/* Define if GnuTLS support is enabled */ -#define HAVE_GNUTLS - -/* Define to 1 if you have the `gnutls_certificate_get_x509_cas' function. */ -/* #undef HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS */ - -/* Define to 1 if you have the `gnutls_certificate_verify_peers2' function. */ -#define HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS2 - -/* Define to 1 if you have the `gnutls_session_get_data2' function. */ -#define HAVE_GNUTLS_SESSION_GET_DATA2 - -/* Define to 1 if you have the `gnutls_sign_callback_set' function. */ -#define HAVE_GNUTLS_SIGN_CALLBACK_SET - -/* Define to 1 if you have the `gnutls_x509_dn_get_rdn_ava' function. */ -#define HAVE_GNUTLS_X509_DN_GET_RDN_AVA -#endif /* DISABLE_OPENSSL */ - -/* Define if GSSAPI support is enabled */ -/* #undef HAVE_GSSAPI */ - -/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the <gssapi/gssapi.h> header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_H */ - -/* Define to 1 if you have the <gssapi.h> header file. */ -/* #undef HAVE_GSSAPI_H */ - -/* Define to 1 if you have the `gss_init_sec_context' function. */ -/* #undef HAVE_GSS_INIT_SEC_CONTEXT */ - -/* Define to 1 if you have the `hstrerror' function. */ -/* #undef HAVE_HSTRERROR */ - -/* Define to 1 if you have the `iconv' function. */ -/* #undef HAVE_ICONV */ - -/* Define to 1 if you have the <iconv.h> header file. */ -/* #undef HAVE_ICONV_H */ - -/* Define to 1 if you have the `inet_ntop' function. */ -#ifdef UNX -#define HAVE_INET_NTOP 1 -#endif - -/* Define to 1 if you have the `inet_pton' function. */ -/* #undef HAVE_INET_PTON */ - -/* Define to 1 if you have the <inttypes.h> header file. */ -#ifdef UNX -#define HAVE_INTTYPES_H 1 -#endif - -/* Define to 1 if you have the `isatty' function. */ -#define HAVE_ISATTY 1 - -/* Define to 1 if you have the <libintl.h> header file. */ -/* #undef HAVE_LIBINTL_H */ - -/* Define if libproxy is supported */ -/* #undef HAVE_LIBPROXY */ - -/* Define if you have libxml */ -#define HAVE_LIBXML 1 - -/* Define to 1 if you have the <libxml/parser.h> header file. */ -#define HAVE_LIBXML_PARSER_H 1 - -/* Define to 1 if you have the <libxml/xmlversion.h> header file. */ -#define HAVE_LIBXML_XMLVERSION_H 1 - -/* Define to 1 if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the <locale.h> header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the `lseek64' function. */ -#define HAVE_LSEEK64 1 - -/* Define to 1 if you have the <memory.h> header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the <netdb.h> header file. */ -#ifdef UNX -#define HAVE_NETDB_H 1 -#endif - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#ifdef UNX -#define HAVE_NETINET_IN_H 1 -#endif - -/* Define to 1 if you have the <netinet/tcp.h> header file. */ -#ifdef UNX -#define HAVE_NETINET_TCP_H 1 -#endif - -#ifndef DISABLE_OPENSSL -/* Define if NTLM is supported */ -#ifndef _WIN32 -#define HAVE_NTLM 1 -#endif - -/* Define if OpenSSL support is enabled */ -#define HAVE_OPENSSL 1 - -/* Define to 1 if you have the <openssl/opensslv.h> header file. */ -#define HAVE_OPENSSL_OPENSSLV_H 1 - -/* Define to 1 if you have the <openssl/ssl.h> header file. */ -#define HAVE_OPENSSL_SSL_H 1 -#endif /* !DISABLE_OPENSSL */ - -/* Define if pakchois library supported */ -/* #undef HAVE_PAKCHOIS */ - -/* Define to 1 if you have the `pipe' function. */ -#define HAVE_PIPE 1 - -/* Define to 1 if you have the `poll' function. */ -#define HAVE_POLL 1 - -/* Define to 1 if you have the `pthread_mutex_init' function. */ -/* #undef HAVE_PTHREAD_MUTEX_INIT */ - -/* Define to 1 if you have the `pthread_mutex_lock' function. */ -/* #undef HAVE_PTHREAD_MUTEX_LOCK */ - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the `setsockopt' function. */ -#if defined(LINUX) || defined(_WIN32) -#define HAVE_SETSOCKOPT 1 -#endif - -/* Define to 1 if you have the `setvbuf' function. */ -#define HAVE_SETVBUF 1 - -/* Define to 1 if you have the `shutdown' function. */ -#ifdef LINUX -#define HAVE_SHUTDOWN 1 -#endif - -/* Define to 1 if you have the `signal' function. */ -#define HAVE_SIGNAL 1 - -/* Define to 1 if you have the <signal.h> header file. */ -#define HAVE_SIGNAL_H 1 - -/* Define to 1 if you have the `snprintf' function. */ -#if defined(UNX) || defined(_MSC_VER) -#define HAVE_SNPRINTF 1 -#endif - -/* Define to 1 if the system has the type `socklen_t'. */ -#ifdef UNX -#define HAVE_SOCKLEN_T 1 -#endif - -/* Define to 1 if you have the `SSL_SESSION_cmp' function. */ -/* #undef HAVE_SSL_SESSION_CMP */ - -/* Define to 1 if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H 1 - -/* Define to 1 if you have the <stdint.h> header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `stpcpy' function. */ -#ifdef LINUX -#define HAVE_STPCPY 1 -#endif - -/* Define to 1 if you have the `strcasecmp' function. */ -#ifdef UNX -#define HAVE_STRCASECMP 1 -#endif - -#ifdef _WIN32 -#define strcasecmp strcmpi -#endif - -/* Define to 1 if you have the `strerror_r' function. */ -#ifdef LINUX -#define HAVE_STRERROR_R 1 -#endif - -/* Define to 1 if you have the <strings.h> header file. */ -#ifdef UNX -#define HAVE_STRINGS_H 1 -#endif - -/* Define to 1 if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strtoll' function. */ -#define HAVE_STRTOLL 1 - -/* Define to 1 if you have the `strtoq' function. */ -/* #undef HAVE_STRTOQ */ - -/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */ -#ifdef LINUX -#define HAVE_STRUCT_TM_TM_GMTOFF 1 -#endif - -/* Define to 1 if `__tm_gmtoff' is member of `struct tm'. */ -/* #undef HAVE_STRUCT_TM___TM_GMTOFF */ - -/* Define to 1 if you have the <sys/limits.h> header file. */ -/* #undef HAVE_SYS_LIMITS_H */ - -/* Define to 1 if you have the <sys/poll.h> header file. */ -#ifdef UNX -#define HAVE_SYS_POLL_H 1 -#endif - -/* Define to 1 if you have the <sys/select.h> header file. */ -#ifdef UNX -#define HAVE_SYS_SELECT_H 1 -#endif - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#ifdef UNX -#define HAVE_SYS_SOCKET_H 1 -#endif - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/time.h> header file. */ -#ifdef UNX -#define HAVE_SYS_TIME_H 1 -#endif - -/* Define to 1 if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if the timezone global is available */ -#ifndef MACOSX -#define HAVE_TIMEZONE 1 -#if defined(_MSC_VER) -#define timezone _timezone -#endif -#endif - -/* Use trio printf replacement library */ -/* #undef HAVE_TRIO */ - -/* Define to 1 if you have the <trio.h> header file. */ -/* #undef HAVE_TRIO_H */ - -/* Define to 1 if you have the <unistd.h> header file. */ -#ifdef UNX -#define HAVE_UNISTD_H 1 -#endif - -/* Define to 1 if you have the `usleep' function. */ -#ifdef UNX -#define HAVE_USLEEP 1 -#endif - -/* Define to 1 if you have the `vsnprintf' function. */ -#if defined(UNX) || defined(_MSC_VER) -#define HAVE_VSNPRINTF 1 -#endif - -#ifdef __MINGW32__ -#define vsnprintf _vsnprintf -#endif - -/* Define to be location of localedir */ -/* #undef LOCALEDIR */ - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -/* #undef LT_OBJDIR */ - -/* Defined when neon is built as a library */ -#define NEON_IS_LIBRARY 1 - -/* Define to be the neon version string */ -#define NEON_VERSION "0.31.1" - -/* Define to enable debugging */ -/* #undef NE_DEBUGGING */ - -/* Define to be printf format string for ne_off_t */ -/* #undef NE_FMT_NE_OFF_T */ - -/* Define to be printf format string for off64_t */ -#define NE_FMT_OFF64_T "lld" - -/* Define to be printf format string for off_t */ -#define NE_FMT_OFF_T "ld" - -/* Define to be printf format string for size_t */ -#define NE_FMT_SIZE_T "u" - -/* Define to be printf format string for ssize_t */ -#define NE_FMT_SSIZE_T "d" - -/* Define to be printf format string for time_t */ -#define NE_FMT_TIME_T "ld" - -/* Define to be printf format string for XML_Size */ -/* #undef NE_FMT_XML_SIZE */ - -/* Defined if DAV is supported */ -#define NE_HAVE_DAV 1 - -/* Defined if I18N is supported */ -/* #undef NE_HAVE_I18N */ - -/* Defined if IPV6 is supported */ -#define NE_HAVE_IPV6 1 - -/* Defined if LFS is supported */ -#define NE_HAVE_LFS 1 - -/* Defined if LIBPXY is supported */ -/* #undef NE_HAVE_LIBPXY */ - -/* Defined if SSL is supported */ -#define NE_HAVE_SSL - -/* Defined if TS_SSL is supported */ -/* #undef NE_HAVE_TS_SSL */ - -/* Defined if ZLIB is supported */ -#define NE_HAVE_ZLIB 1 - -/* Define to be filename of an SSL CA root bundle */ -/* #undef NE_SSL_CA_BUNDLE */ - -/* Define if poll() should be used */ -#ifdef UNX -#define NE_USE_POLL 1 -#endif - -/* Define to be neon library major version */ -#define NE_VERSION_MAJOR (0) - -/* Define to be neon library minor version */ -#define NE_VERSION_MINOR (31) - -/* Define to be neon library patch version */ -#define NE_VERSION_PATCH (1) - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "neon@webdav.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "neon" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "neon 0.31.1" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "neon" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "0.31.1" - -/* The size of `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - -/* The size of `long long', as computed by sizeof. */ -#define SIZEOF_LONG_LONG 8 - -/* The size of `off64_t', as computed by sizeof. */ -#define SIZEOF_OFF64_T 8 - -/* The size of `off_t', as computed by sizeof. */ -#define SIZEOF_OFF_T 4 - -/* The size of `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 - -/* The size of `ssize_t', as computed by sizeof. */ -#define SIZEOF_SSIZE_T 4 - -/* The size of `time_t', as computed by sizeof. */ -#define SIZEOF_TIME_T 4 - -/* The size of `XML_Size', as computed by sizeof. */ -/* #undef SIZEOF_XML_SIZE */ - -/* Define to 1 if you have the ANSI C header files. */ -#ifdef __sun -#define STDC_HEADERS 1 -#endif - -/* Define to 1 if strerror_r returns char *. */ -#ifdef LINUX -#define STRERROR_R_CHAR_P 1 -#endif - -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -#define TIME_WITH_SYS_TIME 1 - -/* Define if getaddrinfo supports AI_ADDRCONFIG */ -/* #undef USE_GAI_ADDRCONFIG */ - -/* Define if getaddrinfo() should be used */ -#define USE_GETADDRINFO 1 - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -#undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -#undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -#undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -#undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -#undef __EXTENSIONS__ -#endif - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined(__sun) && defined(SPARC) -#define WORDS_BIGENDIAN 1 -#endif - -/* Always defined to enable GNU extensions */ -#define _GNU_SOURCE 1 - -/* Define to 1 if on MINIX. */ -/* #undef _MINIX */ - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -/* #undef _POSIX_SOURCE */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define if in_addr_t is not available */ -/* #undef in_addr_t */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#if defined(__sun) && defined(__SUNPRO_C) -#define inline -#endif -#endif - -/* Define to `long int' if <sys/types.h> does not define. */ -/* #undef off_t */ - -/* Define to `int' if <sys/types.h> does not define. */ -/* #undef pid_t */ - -/* Define to `unsigned int' if <sys/types.h> does not define. */ -/* #undef size_t */ - -/* Define if socklen_t is not available */ -/* #undef socklen_t */ - -/* MS IIS does not send Lock-Token response header after creation of a */ -/* new lock. This violates RFC, but... if we want to talk with this */ -/* beast we need a workaround */ -#define IIS_LOCK_BUG_WORKAROUND 1 - -/* Enable leak-tracking versions of ne_*alloc when NEON_MEMLEAK is enabled */ -#ifdef NEON_MEMLEAK -#include "memleak.h" -#endif - -#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy) -char* stpcpy(char*, const char*); -#endif - -#ifdef _WIN32 - -#include <io.h> - -#define HAVE_MEMCPY 1 - -#define strncasecmp strnicmp -#define inline __inline -#define WIN32_LEAN_AND_MEAN -#define NOUSER -#define NOGDI -#define NONLS -#define NOCRYPT - -#define HAVE_SSPI 1 - -#endif diff --git a/external/neon/neon.def b/external/neon/neon.def deleted file mode 100644 index 3a14d66fbdfe..000000000000 --- a/external/neon/neon.def +++ /dev/null @@ -1,292 +0,0 @@ -LIBRARY "neon.dll" -HEAPSIZE 0 -EXPORTS - ne_sspi_authenticate; - ne_sspi_clear_context; - ne_sspi_create_context; - ne_sspi_deinit; - ne_sspi_destroy_context; - ne_sspi_init; - ne__negotiate_ssl; - ne__ssl_exit; - ne__ssl_init; - ne_ssl_cert_cmp; - ne_ssl_cert_digest; - ne_ssl_cert_export; - ne_ssl_cert_free; - ne_ssl_cert_identity; - ne_ssl_cert_import; - ne_ssl_cert_issuer; - ne_ssl_cert_read; - ne_ssl_cert_signedby; - ne_ssl_cert_subject; - ne_ssl_cert_validity_time; - ne_ssl_cert_write; - ne_ssl_clicert_decrypt; - ne_ssl_clicert_encrypted; - ne_ssl_clicert_free; - ne_ssl_clicert_name; - ne_ssl_clicert_owner; - ne_ssl_clicert_read; - ne_ssl_context_create; - ne_ssl_context_destroy; - ne_ssl_context_keypair; - ne_ssl_context_set_flag; - ne_ssl_context_set_verify; - ne_ssl_context_trustcert; - ne_ssl_dname_cmp; - ne_ssl_readable_dname; - ne_ssl_set_clicert; - ne_ssl_trust_default_ca; - ne_xml_dispatch_request; - ne_xml_parse_response; - ne_xml_create; - ne_xml_currentline; - ne_xml_destroy; - ne_xml_doc_encoding; - ne_xml_failed; - ne_xml_get_attr; - ne_xml_get_error; - ne_xml_mapid; - ne_xml_parse; - ne_xml_parse_v; - ne_xml_push_handler; - ne_xml_resolve_nspace; - ne_xml_set_error; - ne_debug; - ne_debug_init; - ne_debug_mask; - ne_debug_stream; - ne_has_support; - ne_parse_statusline; - ne_version_match; - ne_version_string; - ne_path_childof; - ne_path_compare; - ne_path_escape; - ne_path_has_trailing_slash; - ne_path_parent; - ne_path_unescape; - ne_uri_cmp; - ne_uri_copy; - ne_uri_defaultport; - ne_uri_free; - ne_uri_parse; - ne_uri_resolve; - ne_uri_unparse; - ne_base64; - ne_buffer_altered; - ne_buffer_append; - ne_buffer_clear; - ne_buffer_concat; - ne_buffer_create; - ne_buffer_destroy; - ne_buffer_finish; - ne_buffer_grow; - ne_buffer_ncreate; - ne_buffer_snprintf; - ne_buffer_zappend; - ne_concat; - ne_qtoken; - ne_shave; - ne_snprintf; - ne_strcasecmp; - ne_strclean; - ne_strerror; - ne_strncasecmp; - ne_token; - ne_tolower_array; - ne_unbase64; - ne_vsnprintf; - ne__sock_sslsock; - ne_addr_destroy; - ne_addr_error; - ne_addr_first; - ne_addr_next; - ne_addr_resolve; - ne_addr_result; - ne_iaddr_cmp; - ne_iaddr_free; - ne_iaddr_make; - ne_iaddr_print; - ne_iaddr_reverse; - ne_iaddr_typeof; - ne_sock_accept; - ne_sock_accept_ssl; - ne_sock_block; - ne_sock_cipher; - ne_sock_close; - ne_sock_connect; - ne_sock_connect_ssl; - ne_sock_connect_timeout; - ne_sock_create; - ne_sock_error; - ne_sock_exit; - ne_sock_fd; - ne_sock_fullread; - ne_sock_fullwrite; - ne_sock_init; - ne_sock_peek; - ne_sock_peer; - ne_sock_prebind; - ne_sock_proxy; - ne_sock_read; - ne_sock_read_timeout; - ne_sock_readline; - ne_sock_sessid; - ne__ssl_set_verify_err; - ne_close_connection; - ne_fill_proxy_uri; - ne_fill_server_uri; - ne_get_error; - ne_get_scheme; - ne_get_server_hostport; - ne_get_session_flag; - ne_hook_close_conn; - ne_hook_create_request; - ne_hook_destroy_request; - ne_hook_destroy_session; - ne_hook_post_headers; - ne_hook_post_send; - ne_hook_pre_send; - ne_session_create; - ne_session_destroy; - ne_session_proxy; - ne_set_addrlist; - ne_set_connect_timeout; - ne_set_error; - ne_set_localaddr; - ne_set_notifier; - ne_set_progress; - ne_set_read_timeout; - ne_set_session_flag; - ne_set_session_private; - ne_set_useragent; - ne_ssl_cert_validity; - ne_ssl_provide_clicert; - ne_ssl_set_verify; - ne_ssl_trust_cert; - ne_unhook_close_conn; - ne_unhook_create_request; - ne_unhook_destroy_request; - ne_unhook_destroy_session; - ne_unhook_post_headers; - ne_unhook_post_send; - ne_unhook_pre_send; - ne_version_pre_http11; - ne_accept_2xx; - ne_accept_always; - ne_add_request_header; - ne_add_response_body_reader; - ne_begin_request; - ne_discard_response; - ne_end_request; - ne_get_request_flag; - ne_get_request_private; - ne_get_response_header; - ne_get_session; - ne_get_session_private; - ne_get_status; - ne_print_request_header; - ne_read_response_block; - ne_read_response_to_fd; - ne_request_create; - ne_request_destroy; - ne_request_dispatch; - ne_response_header_iterate; - ne_set_request_body_buffer; - ne_set_request_body_fd; - ne_set_request_body_provider; - ne_set_request_flag; - ne_set_request_private; - ne_redirect_location; - ne_redirect_register; - ne_propfind_allprop; - ne_propfind_create; - ne_propfind_current_private; - ne_propfind_destroy; - ne_propfind_get_parser; - ne_propfind_get_request; - ne_propfind_named; - ne_propfind_set_private; - ne_propnames; - ne_proppatch; - ne_propset_iterate; - ne_propset_lang; - ne_propset_private; - ne_propset_status; - ne_propset_value; - ne_simple_propfind; - ne_ascii_to_md5; - ne_md5_create_ctx; - ne_md5_destroy_ctx; - ne_md5_dup_ctx; - ne_md5_finish_ascii; - ne_md5_finish_ctx; - ne_md5_process_block; - ne_md5_process_bytes; - ne_md5_read_ctx; - ne_md5_reset_ctx; - ne_md5_stream; - ne_md5_to_ascii; - ne_lock; - ne_lock_copy; - ne_lock_create; - ne_lock_destroy; - ne_lock_discover; - ne_lock_free; - ne_lock_refresh; - ne_lock_using_parent; - ne_lock_using_resource; - ne_lockstore_add; - ne_lockstore_create; - ne_lockstore_destroy; - ne_lockstore_findbyuri; - ne_lockstore_first; - ne_lockstore_next; - ne_lockstore_register; - ne_lockstore_remove; - ne_unlock; - ne_i18n_init; - ne_asctime_parse; - ne_httpdate_parse; - ne_iso8601_parse; - ne_rfc1036_parse; - ne_rfc1123_date; - ne_rfc1123_parse; - ne_decompress_destroy; - ne_decompress_reader; - ne_add_depth_header; - ne_copy; - ne_delete; - ne_get; - ne_get_content_type; - ne_get_range; - ne_getmodtime; - ne_mkcol; - ne_move; - ne_options; - ne_options2; - ne_post; - ne_put; - ne_add_proxy_auth; - ne_add_server_auth; - ne_forget_auth; - ne_set_proxy_auth; - ne_set_server_auth; - ne_calloc; - ne_malloc; - ne_oom_callback; - ne_realloc; - ne_strdup; - ne_strndup; - ne_free; - ne_acl3744_set; - ne_207_create; - ne_207_destroy; - ne_207_get_current_propstat; - ne_207_get_current_response; - ne_207_set_propstat_handlers; - ne_207_set_response_handlers; - ne_accept_207; - ne_simple_request; diff --git a/external/neon/neon.patch b/external/neon/neon.patch deleted file mode 100644 index 23aef0d0fe85..000000000000 --- a/external/neon/neon.patch +++ /dev/null @@ -1,311 +0,0 @@ ---- src/ne_auth.c 2010-10-14 17:00:53.000000000 +0200 -+++ src/ne_auth.c 2011-02-03 10:31:22.000000000 +0100 -@@ -367,7 +367,7 @@ - static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt, - struct auth_challenge *chall, char *pwbuf) - { -- if (chall->handler->creds(chall->handler->userdata, sess->realm, -+ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm, - chall->handler->attempt++, sess->username, pwbuf) == 0) { - return 0; - } else { -@@ -385,15 +385,19 @@ - { - char *tmp, password[NE_ABUFSIZ]; - -+#if 0 /* Workaround - IIS sends challenge without realm. */ -+ - /* Verify challenge... must have a realm */ - if (parms->realm == NULL) { - challenge_error(errmsg, _("missing realm in Basic challenge")); - return -1; - } -+#endif - - clean_session(sess); - -- sess->realm = ne_strdup(parms->realm); -+ if (parms->realm != NULL) -+ sess->realm = ne_strdup(parms->realm); - - if (get_credentials(sess, errmsg, attempt, parms, password)) { - /* Failed to get credentials */ -@@ -610,10 +614,12 @@ - return NULL; - } - --static int continue_sspi(auth_session *sess, int ntlm, const char *hdr) -+static int continue_sspi(auth_session *sess, int ntlm, const char *hdr, -+ int attempt, struct auth_challenge *parms, ne_buffer **errmsg) - { - int status; - char *response = NULL; -+ char password[NE_ABUFSIZ]; - - NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n"); - -@@ -630,8 +636,17 @@ - return status; - } - } -- -- status = ne_sspi_authenticate(sess->sspi_context, hdr, &response); -+ -+ /* Authentification needs more than one http request. -+ * As long as authentification in progress use the existing credentials. -+ * Otherwise get new credentials.*/ -+ if (!hdr) -+ if (get_credentials(sess, errmsg, attempt, parms, password)) { -+ /* Failed to get credentials */ -+ return -1; -+ } -+ -+ status = ne_sspi_authenticate(sess->sspi_context, hdr, &response, sess->username, password); - if (status) { - return status; - } -@@ -651,7 +666,7 @@ - { - int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0; - -- return continue_sspi(sess, ntlm, parms->opaque); -+ return continue_sspi(sess, ntlm, parms->opaque, attempt, parms, errmsg); - } - - static int verify_sspi(struct auth_request *req, auth_session *sess, -@@ -674,7 +689,7 @@ - return NE_OK; - } - -- return continue_sspi(sess, ntlm, ptr); -+ return continue_sspi(sess, ntlm, ptr, 0, NULL, NULL); - } - - #endif ---- src/ne_auth.h 2009-09-01 22:13:12.000000000 +0200 -+++ src/ne_auth.h 2011-02-03 10:26:20.000000000 +0100 -@@ -47,8 +47,8 @@ - * Hint: if you just wish to attempt authentication just once (even if - * the user gets the username/password wrong), have the callback - * function use 'attempt' value as the function return value. */ --typedef int (*ne_auth_creds)(void *userdata, const char *realm, int attempt, -- char *username, char *password); -+typedef int (*ne_auth_creds)(void *userdata, const char * auth_protocol, -+ const char *realm, int attempt, char *username, char *password); - - /* Set callbacks to provide credentials for server and proxy - * authentication, using the default set of authentication protocols. ---- src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 -+++ src/ne_locks.c 2011-02-03 10:26:21.000000000 +0100 -@@ -579,6 +579,23 @@ - const char *token = ne_get_response_header(ctx->req, "Lock-Token"); - /* at the root element; retrieve the Lock-Token header, - * and bail if it wasn't given. */ -+#ifdef IIS_LOCK_BUG_WORKAROUND -+ /* MS IIS violates RFC 2518/4918. It does not send a Lock-Token response -+ header upon successful creation of a new lock. As a workaround, we -+ will try to pick the lock token from the response body (although -+ this is not 100% safe in case of multiple activelocks). */ -+ if (token == NULL) -+ NE_DEBUG(NE_DBG_LOCKS, -+ "Ignoring missing LOCK response Lock-Token header\n"); -+ -+ if (token != NULL) { -+ if (token[0] == '<') token++; -+ ctx->token = ne_strdup(token); -+ ne_shave(ctx->token, ">"); -+ NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n", -+ ctx->token); -+ } -+#else - if (token == NULL) { - ne_xml_set_error(ctx->parser, - _("LOCK response missing Lock-Token header")); -@@ -590,12 +607,28 @@ - ne_shave(ctx->token, ">"); - NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n", - ctx->token); -+#endif - } - - /* TODO: only accept 'prop' as root for LOCK response */ - if (!can_accept(parent, id)) - return NE_XML_DECLINE; - -+#ifdef IIS_LOCK_BUG_WORKAROUND -+ if (id == ELM_activelock && ctx->found) { -+ /* Found another activelock... */ -+ const char *token = ne_get_response_header(ctx->req, "Lock-Token"); -+ if (token == NULL) { -+ /* Response contains more than one activelock and no Lock-Token -+ * response header. We are doomed. No safe workaround for IIS -+ * lock bug possible. */ -+ ne_xml_set_error(ctx->parser, -+ _("LOCK response missing Lock-Token header and more than one activelock")); -+ return NE_XML_ABORT; -+ } -+ } -+#endif -+ - if (id == ELM_activelock && !ctx->found) { - /* a new activelock */ - ne_lock_free(&ctx->active); -@@ -621,7 +654,12 @@ - return -1; - - if (state == ELM_activelock) { -+#ifdef IIS_LOCK_BUG_WORKAROUND -+ if (ctx->active.token) { -+ ctx->token = ne_strdup(ctx->active.token); -+#else - if (ctx->active.token && strcmp(ctx->active.token, ctx->token) == 0) { -+#endif - ctx->found = 1; - } - } ---- src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200 -+++ src/ne_sspi.c 2011-02-03 10:26:21.000000000 +0100 -@@ -206,6 +206,45 @@ - } - - /* -+ * Simplification wrapper arround AcquireCredentialsHandle as most of -+ * the parameters do not change. -+ */ -+static int acquireCredentialsHandleForUsername(CredHandle * credentials, char *package, const char *username, const char *password) -+{ -+ SECURITY_STATUS status; -+ TimeStamp timestamp; -+ -+ const char *domain = ""; -+ -+ int rc, rcISC; -+ SecPkgInfo *secPackInfo; -+ SEC_WINNT_AUTH_IDENTITY *nameAndPwd = NULL; -+ int bytesReceived = 0, bytesSent = 0; -+ -+ nameAndPwd = (SEC_WINNT_AUTH_IDENTITY *) malloc( sizeof(SEC_WINNT_AUTH_IDENTITY) ); -+ memset( nameAndPwd, '\0', sizeof (*nameAndPwd) ); -+ nameAndPwd->Domain = (unsigned char *) _strdup( domain? domain: "" ); -+ nameAndPwd->DomainLength = domain? strlen( domain ): 0; -+ nameAndPwd->User = (unsigned char *) _strdup( username? username: "" ); -+ nameAndPwd->UserLength = username? strlen( username ): 0; -+ nameAndPwd->Password = (unsigned char *) _strdup( password? password: "" ); -+ nameAndPwd->PasswordLength = password? strlen( password ): 0; -+ nameAndPwd->Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; -+ -+ status = pSFT->AcquireCredentialsHandle( NULL, package, SECPKG_CRED_OUTBOUND, -+ NULL, nameAndPwd, NULL, NULL, credentials, ×tamp ); -+ -+ if (status != SEC_E_OK) { -+ NE_DEBUG(NE_DBG_HTTPAUTH, -+ "sspi: AcquireCredentialsHandle [fail] [%x].\n", status); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ -+/* - * Wrapper around initializeSecurityContext. Supplies several - * default parameters as well as logging in case of errors. - */ -@@ -483,7 +522,7 @@ - * Processes received authentication tokens as well as supplies the - * response token. - */ --int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken) -+int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken, const char* username, const char* password) - { - SecBufferDesc outBufferDesc; - SecBuffer outBuffer; -@@ -561,13 +600,22 @@ - /* Reset any existing context since we are starting over */ - resetContext(sspiContext); - -- if (acquireCredentialsHandle -- (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) { -- freeBuffer(&outBufferDesc); -- NE_DEBUG(NE_DBG_HTTPAUTH, -- "sspi: acquireCredentialsHandle failed.\n"); -- return -1; -- } -+ if (strlen(username) != 0) { -+ if (acquireCredentialsHandleForUsername -+ (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) { -+ freeBuffer(&outBufferDesc); -+ NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandleForUsername failed.\n"); -+ return -1; -+ } -+ } else { -+ if (acquireCredentialsHandle -+ (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) { -+ freeBuffer(&outBufferDesc); -+ NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandle failed.\n"); -+ return -1; -+ } -+ } -+ - - securityStatus = - initializeSecurityContext(&sspiContext->credentials, NULL, ---- src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100 -+++ src/ne_sspi.h 2011-02-03 10:26:21.000000000 +0100 -@@ -41,7 +41,7 @@ - int ne_sspi_clear_context(void *context); - - int ne_sspi_authenticate(void *context, const char *base64Token, -- char **responseToken); -+ char **responseToken, const char* username, const char* password); - - #endif /* HAVE_SSPI */ - ---- src/ne_openssl.c -+++ src/ne_openssl.c -@@ -43,6 +43,13 @@ - #endif - #endif - -+#ifdef _WIN32 -+#define X509_NAME WIN32_X509_NAME -+#include <windows.h> -+#include <wincrypt.h> -+#undef X509_NAME -+#endif -+ - #include "ne_ssl.h" - #include "ne_string.h" - #include "ne_session.h" -@@ -798,6 +805,31 @@ - X509_STORE_load_locations(store, NE_SSL_CA_BUNDLE, NULL); - #else - X509_STORE_set_default_paths(store); -+#ifdef _WIN32 -+ { -+ HCERTSTORE hStore; -+ PCCERT_CONTEXT pContext = NULL; -+ X509 *x509; -+ -+ hStore = CertOpenSystemStore(0, "ROOT"); -+ if (hStore) -+ { -+ while (pContext = CertEnumCertificatesInStore(hStore, pContext)) -+ { -+ x509 = d2i_X509(NULL, &pContext->pbCertEncoded, pContext->cbCertEncoded); -+ if (x509) -+ { -+ X509_STORE_add_cert(store, x509); -+ X509_free(x509); -+ } -+ } -+ } -+ -+ CertFreeCertificateContext(pContext); -+ CertCloseStore(hStore, 0); -+ } -+#endif -+ - #endif - } - diff --git a/external/neon/neon_fix_lock_token_on_if.patch b/external/neon/neon_fix_lock_token_on_if.patch deleted file mode 100644 index a60303789f53..000000000000 --- a/external/neon/neon_fix_lock_token_on_if.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -aru src.origin/ne_locks.c src/ne_locks.c ---- src.origin/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 -+++ src/ne_locks.c 2015-07-29 10:33:55.724753920 +0200 -@@ -137,7 +137,7 @@ - } - else { - char *uri = ne_uri_unparse(&item->lock->uri); -- ne_buffer_concat(req, " <", uri, "> (<", -+ ne_buffer_concat(req, " (<", - item->lock->token, ">)", NULL); - ne_free(uri); - } diff --git a/external/neon/neon_fix_no_OPENSSL_Applink.patch b/external/neon/neon_fix_no_OPENSSL_Applink.patch deleted file mode 100644 index 40291ff412bf..000000000000 --- a/external/neon/neon_fix_no_OPENSSL_Applink.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/ne_openssl.c -+++ src/ne_openssl.c -@@ -440,7 +440,7 @@ - #ifdef NE_DEBUGGING - if (ne_debug_mask & NE_DBG_SSL) { - fprintf(ne_debug_stream, "Cert #%d:\n", n); -- X509_print_fp(ne_debug_stream, cert->subject); -+ // X509_print_fp(ne_debug_stream, cert->subject); - } - #endif - if (top == NULL) { diff --git a/external/neon/neon_with_gnutls.patch b/external/neon/neon_with_gnutls.patch deleted file mode 100644 index ed8b7faadebf..000000000000 --- a/external/neon/neon_with_gnutls.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- src/ne_gnutls.c 2009-12-02 23:40:41.000000000 +0200 -+++ src/ne_gnutls.c 2013-03-29 13:41:00.429857276 +0200 -@@ -48,6 +48,26 @@ - #include <iconv.h> - #endif - -+ -+/* GnuTLS removed these symbols from 2.99.0. -+ * -+ * This is a dodgy solution to avoid further patching of neon -+ * sources */ -+#if LIBGNUTLS_VERSION_NUMBER >= 0x026300 -+# define gnutls_pkcs12 gnutls_pkcs12_t -+# define gnutls_pkcs12_bag gnutls_pkcs12_bag_t -+# define gnutls_pkcs12_bag_type gnutls_pkcs12_bag_type_t -+# define gnutls_certificate_verify_peers(_ssl) ({ \ -+ int __status_ ## __LINE__ = 0; \ -+ gnutls_certificate_verify_peers2((_ssl), &__status_ ## __LINE__) == 0 \ -+ ? __status_ ## __LINE__ : -1; \ -+ }) -+#elif LIBGNUTLS_VERSION_NUMBER >= 0x020303 -+/* GnuTLS had these symbols since 2.3.3. */ -+# define HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS -+#endif /* LIBGNUTLS_VERSION_NUMBER */ -+ -+ - #include "ne_ssl.h" - #include "ne_string.h" - #include "ne_session.h" diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk index 759ef461e3f8..79e7f8eb2b2e 100644 --- a/external/nss/ExternalProject_nss.mk +++ b/external/nss/ExternalProject_nss.mk @@ -15,6 +15,10 @@ $(eval $(call gb_ExternalProject_register_targets,nss,\ build \ )) +$(eval $(call gb_ExternalProject_use_externals,nss,\ + zlib \ +)) + ifeq ($(OS),WNT) $(call gb_ExternalProject_get_state_target,nss,build): \ $(call gb_ExternalExecutable_get_dependencies,python) \ @@ -27,14 +31,15 @@ $(call gb_ExternalProject_get_state_target,nss,build): \ MOZ_DEBUG_FLAGS=" " \ OPT_CODE_SIZE=0) \ OS_TARGET=WIN95 \ + USE_SYSTEM_ZLIB=1 \ $(if $(filter X86_64,$(CPUNAME)),USE_64=1) \ - $(if $(filter ARM64,$(CPUNAME)),USE_64=1) \ + $(if $(filter AARCH64,$(CPUNAME)),USE_64=1 CPU_ARCH=aarch64) \ LIB="$(ILIB)" \ - XCFLAGS="$(SOLARINC)" \ + XCFLAGS="$(SOLARINC) $(ZLIB_CFLAGS)" \ + NSPR_CONFIGURE_OPTS="$(gb_CONFIGURE_PLATFORMS)" \ $(if $(CROSS_COMPILING),\ CROSS_COMPILE=1 \ - $(if $(filter ARM64,$(CPUNAME)),CPU_ARCH=aarch64) \ - NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \ + $(if $(filter AARCH64,$(CPUNAME)),CPU_ARCH=aarch64)) \ $(MAKE) nss_build_all RC="rc.exe $(SOLARINC)" \ NSINSTALL='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \ NSS_DISABLE_GTESTS=1 \ @@ -51,29 +56,31 @@ $(call gb_ExternalProject_get_state_target,nss,build): \ $(call gb_Trace_StartRange,nss,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(if $(filter ANDROID FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \ - $(if $(filter ANDROID,$(OS)),$(if $(filter AARCH64,$(CPUNAME)),USE_64=1)) \ $(if $(filter AARCH64,$(CPUNAME)),USE_64=1 CPU_ARCH=aarch64) \ + $(if $(filter POWERPC64,$(CPUNAME)),USE_64=1 CPU_ARCH=ppc64le) \ $(if $(filter MACOSX,$(OS)),\ MACOS_SDK_DIR=$(MACOSX_SDK_PATH) \ NSS_USE_SYSTEM_SQLITE=1) \ $(if $(filter LINUX,$(OS)),$(if $(ENABLE_DBGUTIL),,BUILD_OPT=1)) \ $(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \ $(if $(filter ARM,$(CPUNAME)),NSS_DISABLE_ARM32_NEON=1) \ - $(if $(CROSS_COMPILING),\ - CROSS_COMPILE=1 \ - NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \ + NSPR_CONFIGURE_OPTS="$(gb_CONFIGURE_PLATFORMS)" \ + $(if $(CROSS_COMPILING),CROSS_COMPILE=1) \ $(if $(filter MACOSX-X86_64-arm64,$(OS)-$(CPUNAME)-$(shell uname -m)), \ - CPU_ARCH=x86_64 \ - NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \ + CPU_ARCH=x86_64) \ NSDISTMODE=copy \ $(MAKE) \ AR="$(AR)" \ RANLIB="$(RANLIB)" \ NMEDIT="$(NM)edit" \ COMMA=$(COMMA) \ - CC="$(CC)$(if $(filter iOS,$(OS)), -DNSS_STATIC_SOFTOKEN=1 -DNSS_STATIC_FREEBL=1 -DNSS_STATIC_PKCS11=1)$(if $(filter ANDROID,$(OS)), -D_PR_NO_LARGE_FILES=1 -DSQLITE_DISABLE_LFS=1)" CCC="$(CXX)" \ + CC="$(CC) $(gb_DEBUGINFO_FLAGS) \ + $(if $(filter -fsanitize=undefined,$(CC)),-fno-sanitize=function) \ + $(if $(filter iOS,$(OS)), -DNSS_STATIC_SOFTOKEN=1 -DNSS_STATIC_FREEBL=1 -DNSS_STATIC_PKCS11=1) \ + $(if $(filter ANDROID,$(OS)), -D_PR_NO_LARGE_FILES=1 -DSQLITE_DISABLE_LFS=1)" \ + CCC="$(CXX) $(gb_DEBUGINFO_FLAGS)" \ $(if $(CROSS_COMPILING),NSINSTALL="$(if $(filter MACOSX,$(OS_FOR_BUILD)),xcrun python3,$(call gb_ExternalExecutable_get_command,python)) $(SRCDIR)/external/nss/nsinstall.py") \ - $(if $(filter ANDROID,$(OS)),OS_TARGET=Android OS_TARGET_RELEASE=16 ARCHFLAG="" DEFAULT_COMPILER=clang ANDROID_NDK=$(ANDROID_NDK_HOME) ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(ANDROID_NDK_HOME)/sysroot ANDROID_TOOLCHAIN=$(ANDROID_BINUTILS_PREBUILT_ROOT)) \ + $(if $(filter ANDROID,$(OS)),OS_TARGET=Android OS_TARGET_RELEASE=$(ANDROID_API_LEVEL) ARCHFLAG="" DEFAULT_COMPILER=clang ANDROID_NDK=$(ANDROID_NDK_DIR) ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(ANDROID_NDK_DIR)/sysroot) \ NSS_DISABLE_GTESTS=1 \ nss_build_all \ && rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \ diff --git a/external/nss/README b/external/nss/README index 6997cea6ca06..09931f64ea20 100644 --- a/external/nss/README +++ b/external/nss/README @@ -1,5 +1,16 @@ Contains the Network Security Services (NSS) libraries from Mozilla +== ESR versions == + +Upstream releases both regular and "ESR" versions, the latter go into Firefox +ESR and Thunderbird. + +There is a new ESR version about once a year, and a ESR version gets micro +updates only when there are security issues to fix, and it's not always obvious +from the release notes of a regular release if there are security issues that +are relevant to LibreOffice, hence it's probably best to bundle only the ESR +versions and upgrade for every micro release (as recommended by upstream). + == Fips 140 and signed libraries == Fips 140 mode is not supported. That is, the *.chk files containing the @@ -20,18 +31,3 @@ With all supported macOS SDK we use NSS_USE_SYSTEM_SQLITE=1 to build using the system sqlite. -== system NSS on Linux == - -Note that different Linux distributions use different SONAMEs for the -NSS libraries, so it is not possible to use --with-system-nss and build -a portable generic LO installation set, despite NSS upstream apparently -maintaining ABI compatibility. - -Debian Squeeze: -0x000000000000000e (SONAME) Library soname: [libnss3.so.1d] -Fedora 20: -0x000000000000000e (SONAME) Library soname: [libnss3.so] - -For the record, the LSB specified SONAME is libnss3.so -http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libnss3.html - diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk index fb8b8b061265..bf2a93233e60 100644 --- a/external/nss/UnpackedTarball_nss.mk +++ b/external/nss/UnpackedTarball_nss.mk @@ -15,8 +15,6 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,nss,nspr/build/autoconf $(eval $(call gb_UnpackedTarball_add_patches,nss,\ external/nss/nss.patch \ - external/nss/nss.aix.patch \ - external/nss/nss-3.13.5-zlib-werror.patch \ external/nss/nss_macosx.patch \ external/nss/nss-win32-make.patch.1 \ external/nss/ubsan.patch.0 \ @@ -24,11 +22,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\ external/nss/nss.vs2015.patch \ external/nss/nss.vs2015.pdb.patch \ external/nss/nss.bzmozilla1238154.patch \ - external/nss/nss-bz1646594.patch.1 \ + external/nss/nss-bz1646594.patch.1 \ external/nss/macos-dlopen.patch.0 \ - external/nss/nss.getopt.patch.0 \ - external/nss/nss-win-arm64.patch \ external/nss/nss-restore-manual-pre-dependencies.patch.1 \ + external/nss/Wincompatible-function-pointer-types.patch.0 \ $(if $(filter iOS,$(OS)), \ external/nss/nss-ios.patch) \ $(if $(filter ANDROID,$(OS)), \ diff --git a/external/nss/Wincompatible-function-pointer-types.patch.0 b/external/nss/Wincompatible-function-pointer-types.patch.0 new file mode 100644 index 000000000000..1e9b7550e1da --- /dev/null +++ b/external/nss/Wincompatible-function-pointer-types.patch.0 @@ -0,0 +1,234 @@ +--- nspr/pr/tests/testfile.c ++++ nspr/pr/tests/testfile.c +@@ -86,7 +86,7 @@ + #endif + #define TMPDIR_LEN 64 + char testdir[TMPDIR_LEN]; +-static PRInt32 PR_CALLBACK DirTest(void *argunused); ++static void PR_CALLBACK DirTest(void *argunused); + PRInt32 dirtest_failed = 0; + + PRThread* create_new_thread(PRThreadType type, +@@ -123,7 +123,7 @@ + if (native_thread) { + #if defined(_PR_PTHREADS) + pthread_t tid; +- if (!pthread_create(&tid, NULL, start, arg)) { ++ if (!pthread_create(&tid, NULL, (void *(*)(void *))start, arg)) { + return((PRThread *) tid); + } + else { +@@ -594,7 +594,7 @@ + return 0; + } + +-static PRInt32 PR_CALLBACK DirTest(void *arg) ++static void PR_CALLBACK DirTest(void *arg) + { + struct dirtest_arg *tinfo = (struct dirtest_arg *) arg; + PRFileDesc *fd_file; +@@ -618,14 +618,14 @@ + printf( + "testfile failed to create dir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + fd_dir = PR_OpenDir(TEST_DIR); + if (fd_dir == NULL) { + printf( + "testfile failed to open dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + strcpy(pathname, TEST_DIR); +@@ -645,7 +645,7 @@ + printf( + "testfile failed to create/open file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + PR_Close(fd_file); + } +@@ -664,7 +664,7 @@ + printf( + "testfile failed to create/open hidden file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + PR_Close(fd_file); +@@ -681,7 +681,7 @@ + if (hfile == INVALID_HANDLE_VALUE) { + printf("testfile failed to create/open hidden file %s [0, %d]\n", + pathname, GetLastError()); +- return -1; ++ return; + } + CloseHandle(hfile); + +@@ -696,7 +696,7 @@ + if (hfile == INVALID_HANDLE_VALUE) { + printf("testfile failed to create/open hidden file %s [0, %d]\n", + pathname, GetLastError()); +- return -1; ++ return; + } + CloseHandle(hfile); + +@@ -707,7 +707,7 @@ + if (fd_file == NULL) { + printf("testfile failed to create/open hidden file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + PR_Close(fd_file); + #endif /* XP_UNIX */ +@@ -720,14 +720,14 @@ + printf( + "testfile failed to close dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + fd_dir = PR_OpenDir(TEST_DIR); + if (fd_dir == NULL) { + printf( + "testfile failed to reopen dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + /* +@@ -750,14 +750,14 @@ + printf( + "testfile failed to GetFileInfo file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + if (info.type != PR_FILE_FILE) { + printf( + "testfile incorrect fileinfo for file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + } + if (num_files != 0) +@@ -765,7 +765,7 @@ + printf( + "testfile failed to find all files in directory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + PR_CloseDir(fd_dir); +@@ -781,7 +781,7 @@ + printf( + "testfile failed to reopen dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + DPRINTF(("Listing non-hidden files in directory %s\n",TEST_DIR)); +@@ -789,7 +789,7 @@ + DPRINTF(("\t%s\n",dirEntry->name)); + if (!strcmp(HIDDEN_FILE_NAME, dirEntry->name)) { + printf("testfile found hidden file %s\n", pathname); +- return -1; ++ return; + } + + } +@@ -803,7 +803,7 @@ + printf( + "testfile failed to delete hidden file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + PR_CloseDir(fd_dir); +@@ -815,41 +815,41 @@ + printf( + "testfile failed to rename directory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + if (PR_FAILURE == PR_MkDir(TEST_DIR, 0777)) { + printf( + "testfile failed to recreate dir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + if (PR_SUCCESS == PR_Rename(renamename, TEST_DIR)) { + printf( + "testfile renamed directory to existing name %s\n", + renamename); +- return -1; ++ return; + } + + if (PR_FAILURE == PR_RmDir(TEST_DIR)) { + printf( + "testfile failed to rmdir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + if (PR_FAILURE == PR_Rename(renamename, TEST_DIR)) { + printf( + "testfile failed to rename directory %s [%d, %d]\n", + renamename, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + fd_dir = PR_OpenDir(TEST_DIR); + if (fd_dir == NULL) { + printf( + "testfile failed to reopen directory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + strcpy(pathname, TEST_DIR); +@@ -865,7 +865,7 @@ + printf( + "testfile failed to delete file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + } + +@@ -875,14 +875,13 @@ + printf( + "testfile failed to rmdir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + PR_EnterMonitor(tinfo->mon); + tinfo->done = 1; + PR_Notify(tinfo->mon); + PR_ExitMonitor(tinfo->mon); + +- return 0; + } + /************************************************************************/ + diff --git a/external/nss/asan.patch.1 b/external/nss/asan.patch.1 index 7dfd6ed4e782..ccabd446ebac 100644 --- a/external/nss/asan.patch.1 +++ b/external/nss/asan.patch.1 @@ -1,12 +1,12 @@ diff -ur nss.org/nss/coreconf/Linux.mk nss/nss/coreconf/Linux.mk --- nss.org/nss/coreconf/Linux.mk 2014-05-06 04:36:01.817838877 +0200 +++ nss/nss/coreconf/Linux.mk 2014-05-06 04:37:25.387835456 +0200 -@@ -146,7 +146,7 @@ +@@ -157,7 +157,7 @@ # we don't use -z defs there. # Also, -z defs conflicts with Address Sanitizer, which emits relocations # against the libsanitizer runtime built into the main executable. -ZDEFS_FLAG = -Wl,-z,defs +ZDEFS_FLAG = - DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN') - LDFLAGS += $(ARCHFLAG) -z noexecstack + DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell $(LD) -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN') + LDFLAGS += $(ARCHFLAG) -z noexecstack diff --git a/external/nss/clang-cl.patch.0 b/external/nss/clang-cl.patch.0 index 1d615c2397d8..e20aab3b9ff1 100644 --- a/external/nss/clang-cl.patch.0 +++ b/external/nss/clang-cl.patch.0 @@ -14,7 +14,7 @@ #pragma intrinsic(_InterlockedExchange) --- nspr/pr/include/prbit.h +++ nspr/pr/include/prbit.h -@@ -14,7 +14,7 @@ +@@ -15,7 +15,7 @@ */ #if defined(_WIN32) && (_MSC_VER >= 1300) && \ (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \ @@ -23,7 +23,7 @@ # include <intrin.h> # pragma intrinsic(_BitScanForward,_BitScanReverse) __forceinline static int __prBitScanForward32(unsigned int val) -@@ -32,7 +32,7 @@ +@@ -33,7 +33,7 @@ # define pr_bitscan_ctz32(val) __prBitScanForward32(val) # define pr_bitscan_clz32(val) __prBitScanReverse32(val) # define PR_HAVE_BUILTIN_BITSCAN32 @@ -32,7 +32,7 @@ (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ defined(__aarch64__)) # define pr_bitscan_ctz32(val) __builtin_ctz(val) -@@ -136,7 +136,7 @@ +@@ -138,7 +138,7 @@ */ #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \ @@ -61,9 +61,20 @@ #pragma deprecated(CERTDB_VALID_PEER) #endif #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD +--- nss/lib/freebl/blapit.h ++++ nss/lib/freebl/blapit.h +@@ -53,7 +53,7 @@ + * Mark the old defines as deprecated. This will warn code that expected + * DSA1 only that they need to change if the are to support DSA2. + */ +-#if defined(__GNUC__) && (__GNUC__ > 3) ++#if defined(__GNUC__) && (__GNUC__ > 3) || defined __clang__ + /* make GCC warn when we use these #defines */ + typedef int __BLAPI_DEPRECATED __attribute__((deprecated)); + #define DSA_SUBPRIME_LEN ((__BLAPI_DEPRECATED)DSA1_SUBPRIME_LEN) --- nss/lib/util/pkcs11n.h +++ nss/lib/util/pkcs11n.h -@@ -426,7 +426,7 @@ +@@ -563,7 +563,7 @@ /* keep the old value for compatibility reasons*/ #define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS + 4)) #else @@ -80,7 +91,7 @@ # in the outer pkcs11t.h: --- nss/lib/util/pkcs11t.h +++ nss/lib/util/pkcs11t.h -@@ -72,7 +72,14 @@ +@@ -78,7 +78,14 @@ #define CK_INVALID_HANDLE 0 /* pack */ @@ -95,7 +106,7 @@ typedef struct CK_VERSION { CK_BYTE major; /* integer portion of version number */ -@@ -1795,6 +1802,13 @@ +@@ -2586,6 +2593,13 @@ #include "pkcs11n.h" /* undo packing */ diff --git a/external/nss/macos-dlopen.patch.0 b/external/nss/macos-dlopen.patch.0 index 1889b8df7cd3..e8abc8f59c69 100644 --- a/external/nss/macos-dlopen.patch.0 +++ b/external/nss/macos-dlopen.patch.0 @@ -1,6 +1,6 @@ --- nspr/pr/src/linking/prlink.c +++ nspr/pr/src/linking/prlink.c -@@ -799,7 +799,7 @@ +@@ -555,7 +555,7 @@ * The reason is that DARWIN's dlopen ignores the provided path * and checks for the plain filename in DYLD_LIBRARY_PATH, * which could load an unexpected version of a library. */ diff --git a/external/nss/nss-3.13.5-zlib-werror.patch b/external/nss/nss-3.13.5-zlib-werror.patch deleted file mode 100644 index 0cdbf7808f81..000000000000 --- a/external/nss/nss-3.13.5-zlib-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/a/nss/lib/zlib/gzguts.h 2010-08-22 03:07:03.000000000 +0200 -+++ b/b/nss/lib/zlib/gzguts.h 2012-07-17 08:52:14.821552788 +0200 -@@ -26,6 +26,10 @@ - # define write _write - # define close _close - #endif -+ -+#ifndef _WIN32 -+#include <unistd.h> -+#endif - - #ifdef NO_DEFLATE /* for compatibility with old definition */ - # define NO_GZCOMPRESS diff --git a/external/nss/nss-android.patch.1 b/external/nss/nss-android.patch.1 index 0f75715e8b86..707fcf99afe0 100644 --- a/external/nss/nss-android.patch.1 +++ b/external/nss/nss-android.patch.1 @@ -1,7 +1,7 @@ diff -ur nss.org/nspr/build/autoconf/config.sub nss/nspr/build/autoconf/config.sub --- nss.org/nspr/build/autoconf/config.sub 2017-09-07 15:29:45.031246453 +0200 +++ nss/nspr/build/autoconf/config.sub 2017-09-07 15:32:13.087235423 +0200 -@@ -111,6 +111,11 @@ +@@ -110,6 +110,11 @@ exit 1;; esac @@ -10,13 +10,13 @@ diff -ur nss.org/nspr/build/autoconf/config.sub nss/nspr/build/autoconf/config.s +if test $1 = "i686-pc-linux-android"; then echo $1; exit; fi +if test $1 = "x86_64-pc-linux-android"; then echo $1; exit; fi + - # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + # Split fields of configuration type + # shellcheck disable=SC2162 + IFS="-" read field1 field2 field3 field4 <<EOF diff -ur nss.org/nspr/configure nss/nspr/configure --- nss.org/nspr/configure 2017-09-07 15:29:45.018246359 +0200 +++ nss/nspr/configure 2017-09-07 15:31:47.604075663 +0200 -@@ -2737,18 +2739,15 @@ +@@ -2728,18 +2728,15 @@ esac AS="$android_toolchain"/bin/"$android_tool_prefix"-as @@ -41,7 +41,7 @@ diff -ur nss.org/nspr/configure nss/nspr/configure diff -ur nss.org/nss/Makefile nss/nss/Makefile --- nss.org/nss/Makefile 2017-09-07 15:29:44.933245745 +0200 +++ nss/nss/Makefile 2017-09-07 15:32:04.347181076 +0200 -@@ -62,7 +62,7 @@ +@@ -65,7 +65,7 @@ ifeq ($(OS_TARGET),Android) NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) \ @@ -74,7 +74,7 @@ diff -ur nss.org/nss/Makefile nss/nss/Makefile diff -ur nss/nss/coreconf/arch.mk nss/nss/coreconf/arch.mk --- nss/nss/coreconf/arch.mk 2019-11-01 10:29:44.933245745 +0100 +++ nss/nss/coreconf/arch.mk 2019-11-01 10:32:04.347181076 +0100 -@@ -234,7 +234,15 @@ +@@ -213,7 +213,15 @@ # # this should be configurable from the user # diff --git a/external/nss/nss-bz1646594.patch.1 b/external/nss/nss-bz1646594.patch.1 index e6c75922a7dc..cffb9f5fe61d 100644 --- a/external/nss/nss-bz1646594.patch.1 +++ b/external/nss/nss-bz1646594.patch.1 @@ -2,7 +2,7 @@ regression from https://bugzilla.mozilla.org/show_bug.cgi?id=1646594 --- nss/nss/coreconf/arch.mk.orig2 2020-08-18 14:33:21.295252404 +0200 +++ nss/nss/coreconf/arch.mk 2020-08-18 14:33:46.360320806 +0200 -@@ -116,8 +116,10 @@ +@@ -94,8 +94,10 @@ OS_RELEASE := $(word 1,$(OS_RELEASE)).$(word 2,$(OS_RELEASE)) endif KERNEL = Linux diff --git a/external/nss/nss-ios.patch b/external/nss/nss-ios.patch index 4293cc5243ad..58239f718978 100644 --- a/external/nss/nss-ios.patch +++ b/external/nss/nss-ios.patch @@ -1,6 +1,6 @@ --- a/a/nss/Makefile +++ a/a/nss/Makefile -@@ -96,13 +96,11 @@ +@@ -91,13 +91,11 @@ ifdef NS_USE_GCC NSPR_CONFIGURE_ENV = CC=gcc CXX=g++ endif @@ -16,7 +16,7 @@ endif # -@@ -140,7 +140,6 @@ +@@ -140,7 +138,6 @@ build_nspr: $(NSPR_CONFIG_STATUS) $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) @@ -37,7 +37,7 @@ --- a/a/nss/lib/nss/nssinit.c +++ a/a/nss/lib/nss/nssinit.c -@@ -278,6 +278,7 @@ +@@ -275,6 +275,7 @@ const char *secmodprefix, char **retoldpath, char **retnewpath) { @@ -45,7 +45,7 @@ char *path, *oldpath = NULL, *lastsep; int len, path_len, secmod_len, dll_len; -@@ -309,6 +309,10 @@ +@@ -309,6 +310,10 @@ } *retoldpath = oldpath; *retnewpath = path; @@ -58,7 +58,7 @@ --- a/a/nss/lib/pk11wrap/pk11load.c +++ a/a/nss/lib/pk11wrap/pk11load.c -@@ -389,6 +389,8 @@ +@@ -390,6 +390,8 @@ /* * load a new module into our address space and initialize it. */ @@ -67,15 +67,15 @@ SECStatus secmod_LoadPKCS11Module(SECMODModule *mod, SECMODModule **oldModule) { -@@ -465,6 +465,7 @@ - /* load the library. If this succeeds, then we have to remember to +@@ -468,6 +470,7 @@ + /* load the library. If this succeeds, then we have to remember to * unload the library if anything goes wrong from here on out... */ +#ifndef NSS_STATIC_PKCS11 // With NSS_STATIC_PKCS11, the only module wodule we load here is nssckbi - library = PR_LoadLibrary(mod->dllName); - mod->library = (void *)library; - -@@ -487,6 +487,11 @@ + #if defined(_WIN32) + if (nssUTF8_Length(mod->dllName, NULL)) { + wchar_t *dllNameWide = _NSSUTIL_UTF8ToWide(mod->dllName); +@@ -507,6 +510,11 @@ mod->moduleDBFunc = (void *) PR_FindSymbol(library, "NSS_ReturnModuleSpecData"); } @@ -87,7 +87,7 @@ if (mod->moduleDBFunc == NULL) mod->isModuleDB = PR_FALSE; if ((ientry == NULL) && (fentry == NULL)) { -@@ -624,10 +624,12 @@ +@@ -643,10 +651,12 @@ } fail: mod->functionList = NULL; @@ -124,7 +124,7 @@ PRLibrary *handle; const char *name = getLibName(); -@@ -47,32 +47,42 @@ +@@ -47,32 +48,42 @@ if (handle) { PRFuncPtr address = PR_FindFunctionSymbol(handle, "FREEBL_GetVector"); if (address) { @@ -168,7 +168,7 @@ } static const PRCallOnceType pristineCallOnce; -@@ -837,6 +837,7 @@ +@@ -860,6 +871,7 @@ void BL_Unload(void) { @@ -176,7 +176,7 @@ /* This function is not thread-safe, but doesn't need to be, because it is * only called from functions that are also defined as not thread-safe, * namely C_Finalize in softoken, and the SSL bypass shutdown callback called -@@ -852,6 +852,7 @@ +@@ -872,6 +884,7 @@ PR_UnloadLibrary(blLib); #endif } @@ -186,19 +186,19 @@ } --- a/a/nspr/build/autoconf/config.sub 2017-09-07 15:29:45.031246453 +0200 +++ a/a/nspr/build/autoconf/config.sub 2017-09-07 15:32:13.087235423 +0200 -@@ -111,6 +111,9 @@ +@@ -110,6 +110,9 @@ exit 1;; esac +if test $1 = "arm64-apple-darwin"; then echo $1; exit; fi +if test $1 = "aarch64-apple-darwin"; then echo $1; exit; fi + - # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + # Split fields of configuration type + # shellcheck disable=SC2162 + IFS="-" read field1 field2 field3 field4 <<EOF --- a/a/nspr/config/autoconf.mk.in +++ a/a/nspr/config/autoconf.mk.in -@@ -67,7 +67,7 @@ +@@ -69,7 +69,7 @@ MSC_VER = @MSC_VER@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ @@ -209,7 +209,7 @@ RC = @RC@ --- a/a/nspr/configure +++ a/a/nspr/configure -@@ -755,7 +755,7 @@ +@@ -2507,7 +2507,7 @@ OBJDIR='$(OBJDIR_NAME)' OBJDIR_NAME=. OBJDIR_SUFFIX=OBJ @@ -218,7 +218,7 @@ NOSUCHFILE=/no-such-file LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)' LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)' -@@ -3060,7 +3060,7 @@ +@@ -5571,7 +5571,7 @@ LIB_SUFFIX=a DLL_SUFFIX=so ASM_SUFFIX=s @@ -227,7 +227,7 @@ PR_MD_ASFILES= PR_MD_CSRCS= PR_MD_ARCH_DIR=unix -@@ -3904,7 +3904,7 @@ +@@ -6485,7 +6485,7 @@ DSO_CFLAGS=-fPIC DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @__________________________________________________OOO/$@ -headerpad_max_install_names' _OPTIMIZE_FLAGS=-O2 @@ -238,7 +238,7 @@ USE_PTHREADS=1 --- a/a/nss/coreconf/ruleset.mk +++ a/a/nss/coreconf/ruleset.mk -@@ -68,7 +68,7 @@ +@@ -45,7 +45,7 @@ endif ifeq ($(MKPROG),) @@ -249,7 +249,7 @@ # --- a/a/nss/coreconf/Darwin.mk +++ a/a/nss/coreconf/Darwin.mk -@@ -124,7 +124,7 @@ +@@ -116,7 +116,7 @@ DSO_LDOPTS += --coverage endif diff --git a/external/nss/nss-restore-manual-pre-dependencies.patch.1 b/external/nss/nss-restore-manual-pre-dependencies.patch.1 index ebcc5b48c540..ea034f0dc80f 100644 --- a/external/nss/nss-restore-manual-pre-dependencies.patch.1 +++ b/external/nss/nss-restore-manual-pre-dependencies.patch.1 @@ -68,7 +68,7 @@ summary: Bug 1637083 Replace pre-dependency with shell hack r=rrelyea ck.h \ --- b/nss/manifest.mn Wed May 13 19:00:40 2020 +0000 +++ a/nss/manifest.mn Tue May 12 21:33:43 2020 +0000 -@@ -23,6 +23,12 @@ +@@ -24,6 +24,12 @@ # no real way to encode these in any sensible way $(MAKE) -C coreconf/nsinstall program $(MAKE) export @@ -79,5 +79,5 @@ summary: Bug 1637083 Replace pre-dependency with shell hack r=rrelyea + $(MAKE) -C lib/base libs + IGNORE_DIRS=1 $(MAKE) -C lib/ckfw/builtins libs - all: prepare_build - $(MAKE) libs + lib: coreconf + cmd: lib diff --git a/external/nss/nss-win-arm64.patch b/external/nss/nss-win-arm64.patch deleted file mode 100644 index eda198f85afc..000000000000 --- a/external/nss/nss-win-arm64.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- a/a/nspr/configure -+++ a/a/nspr/configure -@@ -821,6 +821,7 @@ - linux*) OS_ARCH=Linux ;; - solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;; - mingw*) OS_ARCH=WINNT CPU_ARCH=x86 ;; -+ cygwin*) OS_ARCH=WINNT ;; - darwin*) OS_ARCH=Darwin ;; - riscos*) OS_ARCH=RISCOS ;; - esac ---- a/a/nss/lib/freebl/Makefile.orig -+++ a/a/nss/lib/freebl/Makefile -@@ -119,8 +119,23 @@ - endif - endif - ifeq ($(CPU_ARCH),aarch64) -- DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2 -- EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c -+ ifdef CC_IS_CLANG -+ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2 -+ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c -+ else ifeq (1,$(CC_IS_GCC)) -+ # GCC versions older than 4.9 don't support ARM AES. The check -+ # is done in two parts, first allows "major.minor" == "4.9", -+ # and then rejects any major versions prior to 5. Note that -+ # there has been no GCC 4.10, as it is renamed to GCC 5. -+ ifneq (,$(filter 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION)))) -+ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2 -+ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c -+ endif -+ ifeq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION)))) -+ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2 -+ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c -+ endif -+ endif - endif - ifeq ($(CPU_ARCH),arm) - ifndef NSS_DISABLE_ARM32_NEON -@@ -133,7 +146,10 @@ - DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2 - EXTRA_SRCS += aes-armv8.c sha256-armv8.c - else ifeq (1,$(CC_IS_GCC)) -- # Old compiler doesn't support ARM AES. -+ # GCC versions older than 4.9 don't support ARM AES. The check -+ # is done in two parts, first allows "major.minor" == "4.9", -+ # and then rejects any major versions prior to 5. Note that -+ # there has been no GCC 4.10, as it is renamed to GCC 5. - ifneq (,$(filter 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION)))) - DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2 - EXTRA_SRCS += aes-armv8.c sha256-armv8.c -@@ -198,6 +200,7 @@ - ifdef BUILD_OPT - OPTIMIZER += -Ox # maximum optimization for freebl - endif -+ifeq ($(CPU_ARCH),x86_64) - ASFILES = arcfour-amd64-masm.asm mpi_amd64_masm.asm mp_comba_amd64_masm.asm - DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY - DEFINES += -DNSS_USE_COMBA -@@ -215,6 +218,7 @@ - endif - endif - endif -+endif - - ifeq ($(OS_TARGET),IRIX) - ifeq ($(USE_N32),1) diff --git a/external/nss/nss-win32-make.patch.1 b/external/nss/nss-win32-make.patch.1 index 7ba3df451ee6..6a3201a082a1 100644 --- a/external/nss/nss-win32-make.patch.1 +++ b/external/nss/nss-win32-make.patch.1 @@ -1,6 +1,6 @@ --- nss/nss/coreconf/rules.mk.orig2 2014-06-03 15:30:01.667200000 +0200 +++ nss/nss/coreconf/rules.mk 2014-06-03 15:30:14.537200000 +0200 -@@ -259,7 +259,7 @@ +@@ -174,7 +174,7 @@ $(LIBRARY): $(OBJS) | $$(@D)/d rm -f $@ ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) @@ -9,7 +9,7 @@ else $(AR) cr $@ $(OBJS) endif -@@ -297,7 +297,7 @@ +@@ -214,7 +214,7 @@ ifdef NS_USE_GCC $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES) else diff --git a/external/nss/nss.aix.patch b/external/nss/nss.aix.patch deleted file mode 100644 index 4b0c6bfb3261..000000000000 --- a/external/nss/nss.aix.patch +++ /dev/null @@ -1,140 +0,0 @@ -diff -ru a/nspr/configure b/nspr/configure ---- a/a/nspr/configure 2014-09-29 16:47:42.984012225 +0100 -+++ b/b/nspr/configure 2014-09-29 16:50:33.907375937 +0100 -@@ -6369,7 +6369,6 @@ - AIX_LINK_OPTS='-brtl -bnso -berok' - ;; - esac -- CFLAGS="$CFLAGS -qro -qroconst" - AIX_WRAP='$(DIST)/lib/aixwrap.o' - AIX_TMP='./_aix_tmp.o' - if test -n "$USE_64"; then -diff -ru a/nspr/configure.in b/nspr/configure.in ---- a/a/nspr/configure.in 2014-09-29 16:46:35.257394860 +0100 -+++ b/b/nspr/configure.in 2014-09-29 16:50:33.908375942 +0100 -@@ -1229,7 +1229,8 @@ - AC_DEFINE(XP_UNIX) - AC_DEFINE(AIX) - AC_DEFINE(SYSV) -- DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib' -+ DSO_LDOPTS='-Wl,-brtl -Wl,-bnortllib -Wl,-blibpath:/usr/lib:/lib' -+ MKSHLIB='$(CCC) -shared $(DSO_LDOPTS) -o $@' - AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)) - case "${target_os}" in - aix3.2*) -@@ -1269,10 +1270,9 @@ - AC_DEFINE(HAVE_SOCKLEN_T) - AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) - USE_IPV6=1 -- AIX_LINK_OPTS='-brtl -bnso -berok' -+ AIX_LINK_OPTS='-Wl,-brtl -Wl,-bnso -Wl,-berok' - ;; - esac -- CFLAGS="$CFLAGS -qro -qroconst" - AIX_WRAP='$(DIST)/lib/aixwrap.o' - AIX_TMP='./_aix_tmp.o' - if test -n "$USE_64"; then -diff -ru a/nspr/pr/src/Makefile.in b/nspr/pr/src/Makefile.in ---- a/a/nspr/pr/src/Makefile.in 2014-09-29 16:46:35.281395079 +0100 -+++ b/b/nspr/pr/src/Makefile.in 2014-09-29 16:50:33.909375948 +0100 -@@ -74,7 +74,6 @@ - endif # SunOS - - ifeq ($(OS_ARCH),AIX) --DSO_LDOPTS += -binitfini::_PR_Fini - OS_LIBS = -lodm -lcfg - ifeq ($(CLASSIC_NSPR),1) - ifeq ($(OS_RELEASE),4.1) -diff -ru a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk ---- a/a/nss/cmd/platlibs.mk 2014-09-29 16:47:42.987012253 +0100 -+++ b/b/nss/cmd/platlibs.mk 2014-09-29 16:50:33.910375955 +0100 -@@ -134,7 +134,7 @@ - $(NULL) - - ifeq ($(OS_ARCH), AIX) --EXTRA_SHARED_LIBS += -brtl -+EXTRA_SHARED_LIBS += -Wl,-brtl - endif - - # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS) -@@ -180,7 +180,7 @@ - $(NULL) - - ifeq ($(OS_ARCH), AIX) --EXTRA_SHARED_LIBS += -brtl -+EXTRA_SHARED_LIBS += -Wl,-brtl - endif - - # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS) -diff -ru a/nss/cmd/shlibsign/Makefile b/nss/cmd/shlibsign/Makefile ---- a/a/nss/cmd/shlibsign/Makefile 2014-09-29 16:46:35.139393785 +0100 -+++ b/b/nss/cmd/shlibsign/Makefile 2014-09-29 16:50:33.910375955 +0100 -@@ -43,6 +43,9 @@ - - endif - -+ifeq ($(OS), AIX) -+EXTRA_SHARED_LIBS += -lpthreads -+endif - - # sign any and all shared libraries that contain the word freebl - ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1) -diff -ru a/nss/cmd/shlibsign/mangle/Makefile b/nss/cmd/shlibsign/mangle/Makefile ---- a/a/nss/cmd/shlibsign/mangle/Makefile 2014-09-29 16:46:35.139393785 +0100 -+++ b/b/nss/cmd/shlibsign/mangle/Makefile 2014-09-29 16:50:33.910375955 +0100 -@@ -43,7 +43,9 @@ - - endif - -- -+ifeq ($(OS), AIX) -+EXTRA_SHARED_LIBS += -lpthreads -+endif - - ####################################################################### - # (5) Execute "global" rules. (OPTIONAL) # -diff -ru a/nss/coreconf/AIX.mk b/nss/coreconf/AIX.mk ---- a/a/nss/coreconf/AIX.mk 2014-09-29 16:46:35.040392883 +0100 -+++ b/b/nss/coreconf/AIX.mk 2014-09-29 16:50:33.909375948 +0100 -@@ -30,35 +30,30 @@ - - DEFAULT_COMPILER = xlc_r - --CC = xlc_r --CCC = xlC_r -+CCC = $(CXX) - - CPU_ARCH = rs6000 - - RANLIB = ranlib - - OS_CFLAGS = -DAIX -DSYSV --OS_LIBS += -blibpath:/usr/lib:/lib -lc -lm -+OS_LIBS += -Wl,-blibpath:/usr/lib:/lib -lc -lm - --DSO_LDOPTS = -brtl -bnortllib -bM:SRE -bnoentry --MKSHLIB = $(LD) $(DSO_LDOPTS) -blibpath:/usr/lib:/lib -lc -lm -+DSO_LDOPTS = -Wl,-brtl -Wl,-bnortllib -+MKSHLIB = $(CC) --shared $(DSO_LDOPTS) -Wl,-blibpath:/usr/lib:/lib -lc -lm - - AIX_WRAP = $(DIST)/lib/aixwrap.o - AIX_TMP = $(OBJDIR)/_aix_tmp.o - - ifdef MAPFILE --DSO_LDOPTS += -bexport:$(MAPFILE) -+DSO_LDOPTS += -Wl,-bexport:$(MAPFILE) - else --DSO_LDOPTS += -bexpall -+DSO_LDOPTS += -Wl,-bexpall - endif - - PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \ - sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' > $@ - --ifdef BUILD_OPT -- OPTIMIZER += -qmaxmem=-1 --endif -- - ifeq ($(USE_64), 1) - OS_CFLAGS += -DAIX_64BIT - OBJECT_MODE=64 diff --git a/external/nss/nss.bzmozilla1238154.patch b/external/nss/nss.bzmozilla1238154.patch index 468ff810b9ca..425f38257892 100644 --- a/external/nss/nss.bzmozilla1238154.patch +++ b/external/nss/nss.bzmozilla1238154.patch @@ -1,7 +1,7 @@ diff -ru a/nspr/configure b/nspr/configure --- a/a/nspr/configure 2019-01-26 12:23:06.589389910 +0100 +++ b/b/nspr/configure 2019-01-26 12:26:56.566222293 +0100 -@@ -7127,7 +7127,7 @@ +@@ -6883,7 +6883,7 @@ # Determine compiler version diff --git a/external/nss/nss.cygwin64.in32bit.patch b/external/nss/nss.cygwin64.in32bit.patch index b00761a0e85b..bce0f1d09403 100644 --- a/external/nss/nss.cygwin64.in32bit.patch +++ b/external/nss/nss.cygwin64.in32bit.patch @@ -3,7 +3,7 @@ on Cygwin 64bit and in 32bit mode diff -ru nss.orig/nss/Makefile nss/nss/Makefile --- a/nss.orig/nss/Makefile 2016-02-26 01:00:52.146713100 +0100 +++ b/nss/nss/Makefile 2016-02-26 01:02:05.303560100 +0100 -@@ -59,6 +59,8 @@ +@@ -63,6 +63,8 @@ # Translate coreconf build options to NSPR configure options. # diff --git a/external/nss/nss.getopt.patch.0 b/external/nss/nss.getopt.patch.0 deleted file mode 100644 index aeabb33f9b97..000000000000 --- a/external/nss/nss.getopt.patch.0 +++ /dev/null @@ -1,25 +0,0 @@ -# pr/tests/sel_spd.c:427:20: error: implicit declaration of function 'getopt' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ---- nspr/pr/tests/sel_spd.c -+++ nspr/pr/tests/sel_spd.c -@@ -15,6 +15,9 @@ - #include <stdio.h> - #include <errno.h> - #include <string.h> -+ -+extern char *optarg; -+int getopt(int argc, char *const argv[], const char *optstring); - - #ifdef DEBUG - #define PORT_INC_DO +100 ---- nspr/pr/tests/testfile.c -+++ nspr/pr/tests/testfile.c -@@ -23,6 +23,9 @@ - #include <getopt.h> - #include <errno.h> - #endif /* XP_OS2 */ -+ -+extern char *optarg; -+int getopt(int argc, char *const argv[], const char *optstring); - - static int _debug_on = 0; - diff --git a/external/nss/nss.nowerror.patch b/external/nss/nss.nowerror.patch index ff81a9b33539..bdf7a33a874c 100644 --- a/external/nss/nss.nowerror.patch +++ b/external/nss/nss.nowerror.patch @@ -1,7 +1,7 @@ diff -ur nss.org/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk --- a/nss.org/nss/coreconf/WIN32.mk 2016-04-13 11:33:09.322294523 +0200 +++ b/nss/nss/coreconf/WIN32.mk 2016-04-13 11:33:27.744323969 +0200 -@@ -127,7 +127,7 @@ +@@ -121,7 +121,7 @@ -D_CRT_NONSTDC_NO_WARNINGS OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS ifndef NSS_ENABLE_WERROR diff --git a/external/nss/nss.patch b/external/nss/nss.patch index d9aaee5199bb..cc9eeed1b009 100644 --- a/external/nss/nss.patch +++ b/external/nss/nss.patch @@ -1,6 +1,6 @@ --- a/a/nspr/configure 2017-08-29 23:44:13.686045013 +0530 +++ b/b/nspr/configure 2017-08-29 23:46:53.774768655 +0530 -@@ -7034,7 +7034,7 @@ +@@ -6794,7 +6794,7 @@ PR_MD_CSRCS=linux.c MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' DSO_CFLAGS=-fPIC @@ -11,7 +11,7 @@ # combo is not yet good at debugging inlined --- a/nss.orig/nspr/pr/src/misc/prnetdb.c 2017-08-29 23:44:13.690045031 +0530 +++ b/nss/nspr/pr/src/misc/prnetdb.c 2017-08-29 23:47:03.810814019 +0530 -@@ -438,7 +438,7 @@ +@@ -441,7 +441,7 @@ char *buf = *bufp; PRIntn buflen = *buflenp; @@ -51,7 +51,7 @@ --- a/nss.org/nss/coreconf/arch.mk 2017-08-29 23:44:13.646044832 +0530 +++ b/nss/nss/coreconf/arch.mk 2017-08-29 23:45:51.494487134 +0530 -@@ -305,11 +305,17 @@ +@@ -284,11 +284,17 @@ OBJDIR_NAME_COMPILER = $(COMPILER_TAG) endif OBJDIR_NAME_BASE = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(OBJDIR_NAME_COMPILER)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG) @@ -83,16 +83,16 @@ # The default implementation strategy for FreeBSD is pthreads. --- a/nss.org/nss/coreconf/Linux.mk 2017-08-29 23:44:13.642044814 +0530 +++ b/nss/nss/coreconf/Linux.mk 2017-08-29 23:47:26.318915759 +0530 -@@ -147,7 +147,7 @@ +@@ -158,7 +158,7 @@ # Also, -z defs conflicts with Address Sanitizer, which emits relocations # against the libsanitizer runtime built into the main executable. ZDEFS_FLAG = -Wl,-z,defs --DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) -+DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN') - LDFLAGS += $(ARCHFLAG) -z noexecstack +-DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell $(LD) -v)),,$(ZDEFS_FLAG)) ++DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell $(LD) -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN') + LDFLAGS += $(ARCHFLAG) -z noexecstack # On Maemo, we need to use the -rpath-link flag for even the standard system -@@ -177,8 +177,13 @@ +@@ -188,8 +188,13 @@ endif endif @@ -108,7 +108,7 @@ # dependencies in the same directory where it resides. --- a/nss.org/nss/coreconf/rules.mk 2017-08-29 23:44:13.646044832 +0530 +++ b/nss/nss/coreconf/rules.mk 2017-08-29 23:47:37.442966042 +0530 -@@ -261,7 +261,7 @@ +@@ -176,7 +176,7 @@ ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) $(AR) $(subst /,\\,$(OBJS)) else @@ -119,7 +119,7 @@ --- a/nss.org/nss/coreconf/SunOS5.mk 2017-08-29 23:44:13.646044832 +0530 +++ b/nss/nss/coreconf/SunOS5.mk 2017-08-29 23:45:00.902258445 +0530 -@@ -48,8 +48,11 @@ +@@ -46,8 +46,11 @@ # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer endif else @@ -135,7 +135,7 @@ ifndef BUILD_OPT --- a/nss.org/nss/coreconf/Werror.mk 2017-08-29 23:44:13.646044832 +0530 +++ b/nss/nss/coreconf/Werror.mk 2017-08-29 23:44:23.994091608 +0530 -@@ -94,7 +94,8 @@ +@@ -96,7 +96,8 @@ endif #ndef NSS_ENABLE_WERROR ifeq ($(NSS_ENABLE_WERROR),1) diff --git a/external/nss/nss.utf8bom.patch.1 b/external/nss/nss.utf8bom.patch.1 index e8c56abefcde..f474adf6f932 100644 --- a/external/nss/nss.utf8bom.patch.1 +++ b/external/nss/nss.utf8bom.patch.1 @@ -1,7 +1,7 @@ diff -ur nss.org/nss/lib/ckfw/builtins/certdata.perl nss/nss/lib/ckfw/builtins/certdata.perl --- nss.org/nss/lib/ckfw/builtins/certdata.perl 2016-03-31 18:26:07.890190900 +0800 +++ nss/nss/lib/ckfw/builtins/certdata.perl 2016-03-31 19:16:16.727269600 +0800 -@@ -110,6 +110,9 @@ +@@ -122,6 +122,9 @@ sub doprint { my $i; @@ -11,7 +11,7 @@ diff -ur nss.org/nss/lib/ckfw/builtins/certdata.perl nss/nss/lib/ckfw/builtins/c print <<EOD /* THIS IS A GENERATED FILE */ /* This Source Code Form is subject to the terms of the Mozilla Public -@@ -119,6 +122,7 @@ +@@ -131,6 +134,7 @@ #ifndef BUILTINS_H #include "builtins.h" #endif /* BUILTINS_H */ diff --git a/external/nss/nss.vs2015.patch b/external/nss/nss.vs2015.patch index de4f8762fd5b..73cff7c833fb 100644 --- a/external/nss/nss.vs2015.patch +++ b/external/nss/nss.vs2015.patch @@ -1,7 +1,7 @@ diff -ru nss.org/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk --- a/nss.org/nss/coreconf/WIN32.mk 2016-02-12 15:36:18.000000000 +0100 +++ b/nss/nss/coreconf/WIN32.mk 2016-02-26 00:42:43.170809600 +0100 -@@ -199,7 +199,7 @@ +@@ -192,7 +192,7 @@ # Disable C4244: conversion from 'type1' to 'type2', possible loss of data # Disable C4018: 'expression' : signed/unsigned mismatch # Disable C4312: 'type cast': conversion from 'type1' to 'type2' of greater size diff --git a/external/nss/nss.vs2015.pdb.patch b/external/nss/nss.vs2015.pdb.patch index c66940132cdd..3b498f976ac6 100644 --- a/external/nss/nss.vs2015.pdb.patch +++ b/external/nss/nss.vs2015.pdb.patch @@ -1,7 +1,7 @@ diff -ru nss.orig/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk --- a/nss.orig/nss/coreconf/WIN32.mk 2016-03-04 08:30:16.306639400 +0100 +++ b/nss/nss/coreconf/WIN32.mk 2016-03-04 08:31:17.987233200 +0100 -@@ -169,15 +169,15 @@ +@@ -163,15 +163,15 @@ DLLFLAGS += -OUT:$@ ifdef MOZ_DEBUG_SYMBOLS ifdef MOZ_DEBUG_FLAGS diff --git a/external/nss/nss.windows.patch b/external/nss/nss.windows.patch index 901846e7bc1f..27a44045802e 100644 --- a/external/nss/nss.windows.patch +++ b/external/nss/nss.windows.patch @@ -1,6 +1,6 @@ --- a/a/nspr/config/rules.mk 2008-12-03 00:24:39.000000000 +0100 +++ b/b/nspr/config/rules.mk 2009-11-27 13:36:22.662753328 +0100 -@@ -415,7 +415,7 @@ +@@ -423,7 +423,7 @@ ifdef NEED_ABSOLUTE_PATH # The quotes allow absolute paths to contain spaces. @@ -11,7 +11,7 @@ $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp --- a/a/nss/coreconf/rules.mk 2008-12-03 00:24:39.000000000 +0100 +++ b/b/nss/coreconf/rules.mk 2009-11-27 13:36:22.662753328 +0100 -@@ -386,7 +386,7 @@ +@@ -280,7 +280,7 @@ endif # The quotes allow absolute paths to contain spaces. @@ -22,7 +22,7 @@ ifdef USE_NT_C_SYNTAX --- a/a/nspr/pr/include/md/_win95.h +++ b/b/nspr/pr/include/md/_win95.h -@@ -312,7 +312,7 @@ +@@ -317,7 +317,7 @@ #define _MD_ATOMIC_ADD(ptr,val) (InterlockedExchangeAdd((PLONG)ptr, (LONG)val) + val) #define _MD_ATOMIC_DECREMENT(x) InterlockedDecrement((PLONG)x) #endif /* x86 */ diff --git a/external/nss/nss_macosx.patch b/external/nss/nss_macosx.patch index 07b60a5ed00d..456bd62d509b 100644 --- a/external/nss/nss_macosx.patch +++ b/external/nss/nss_macosx.patch @@ -1,7 +1,7 @@ diff -ru a/nspr/configure b/nspr/configure --- a/a/nspr/configure 2014-09-29 16:50:33.907375937 +0100 +++ b/b/nspr/configure 2014-09-29 16:51:59.213931947 +0100 -@@ -6453,6 +6453,9 @@ +@@ -6448,6 +6448,9 @@ AS='$(CC) -x assembler-with-cpp' CFLAGS="$CFLAGS -Wall -fno-common" case "${target_cpu}" in @@ -11,7 +11,7 @@ diff -ru a/nspr/configure b/nspr/configure arm*) CPU_ARCH=arm ;; -@@ -6578,7 +6579,7 @@ +@@ -6483,7 +6486,7 @@ DSO_CFLAGS=-fPIC @@ -23,7 +23,7 @@ diff -ru a/nspr/configure b/nspr/configure diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk --- a/a/nss/coreconf/Darwin.mk 2014-09-29 16:50:22.992304799 +0100 +++ b/b/nss/coreconf/Darwin.mk 2014-09-29 16:51:59.214931953 +0100 -@@ -20,13 +24,17 @@ +@@ -20,13 +20,17 @@ ifeq (,$(filter-out i%86,$(CPU_ARCH))) ifdef USE_64 @@ -41,7 +41,7 @@ diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk override CPU_ARCH = x86 endif else -@@ -40,19 +48,20 @@ +@@ -33,19 +37,20 @@ ifeq (arm,$(CPU_ARCH)) # Nothing set for arm currently. else @@ -66,7 +66,7 @@ diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk # GCC <= 3 DARWIN_SDK_FRAMEWORKS = -F$(MACOS_SDK_DIR)/System/Library/Frameworks ifneq (,$(shell find $(MACOS_SDK_DIR)/Library/Frameworks -maxdepth 0)) -@@ -108,7 +120,7 @@ +@@ -108,7 +113,7 @@ # May override this with different compatibility and current version numbers. DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1 # May override this with -bundle to create a loadable module. @@ -78,7 +78,7 @@ diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk diff -ru a/nss/Makefile b/nss/Makefile --- a/a/nss/Makefile 2014-09-29 16:50:22.990304789 +0100 +++ b/b/nss/Makefile 2014-09-29 16:51:59.207931908 +0100 -@@ -72,6 +72,9 @@ +@@ -82,6 +82,9 @@ ifeq ($(OS_TARGET),WIN95) NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95 endif @@ -88,17 +88,3 @@ diff -ru a/nss/Makefile b/nss/Makefile ifdef USE_DEBUG_RTL NSPR_CONFIGURE_OPTS += --enable-debug-rtl endif ---- a/a/nspr/pr/include/md/_darwin.h -+++ b/b/nspr/pr/include/md/_darwin.h -@@ -40,11 +40,7 @@ - - #undef HAVE_STACK_GROWING_UP - #define HAVE_DLL --#if defined(__x86_64__) || TARGET_OS_IPHONE - #define USE_DLFCN --#else --#define USE_MACH_DYLD --#endif - #define _PR_HAVE_SOCKADDR_LEN - #define _PR_STAT_HAS_ST_ATIMESPEC - #define _PR_HAVE_LARGE_OFF_T diff --git a/external/nss/ubsan.patch.0 b/external/nss/ubsan.patch.0 index 059a9f3b2c0a..5f97d3e9d24e 100644 --- a/external/nss/ubsan.patch.0 +++ b/external/nss/ubsan.patch.0 @@ -1,3 +1,12 @@ +--- nss/lib/base/item.c ++++ nss/lib/base/item.c +@@ -182,5 +182,5 @@ + return PR_FALSE; + } + +- return nsslibc_memequal(one->data, two->data, one->size, statusOpt); ++ return one->size == 0 || nsslibc_memequal(one->data, two->data, one->size, statusOpt); + } --- nss/lib/softoken/legacydb/pk11db.c +++ nss/lib/softoken/legacydb/pk11db.c @@ -65,7 +65,7 @@ @@ -18,7 +27,7 @@ count * sizeof(lgdbSlotData); data->data = (unsigned char *)PORT_ZAlloc(dataLen); -@@ -327,7 +327,7 @@ +@@ -329,7 +329,7 @@ } if ((encoded->major == LGDB_DB_EXT1_VERSION_MAJOR) && (encoded->minor >= LGDB_DB_EXT1_VERSION_MINOR)) { diff --git a/external/onlineupdate/CustomTarget_generated.mk b/external/onlineupdate/CustomTarget_generated.mk new file mode 100644 index 000000000000..ffdfffd4312a --- /dev/null +++ b/external/onlineupdate/CustomTarget_generated.mk @@ -0,0 +1,25 @@ +# -*- 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_INC)/primaryCert.h $(onlineupdate_INC)/secondaryCert.h : \ + $(call gb_ExternalExecutable_get_dependencies,python) \ + | $(call gb_UnpackedTarball_get_target,onlineupdate) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1) + mkdir -p $(dir $@) + PYPATH=$${PYPATH:+$$PYPATH$(gb_CLASSPATHSEP)}'$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater' $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/onlineupdate/generate.py $@ '$(ONLINEUPDATE_MAR_CERTIFICATEDER)' + +$(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/external/onlineupdate/Executable_mbsdiff.mk b/external/onlineupdate/Executable_mbsdiff.mk new file mode 100644 index 000000000000..a41729909586 --- /dev/null +++ b/external/onlineupdate/Executable_mbsdiff.mk @@ -0,0 +1,43 @@ +# -*- 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,mbsdiff)) + +$(eval $(call gb_Executable_use_unpacked,mbsdiff,onlineupdate)) + +$(eval $(call gb_Executable_set_include,mbsdiff,\ + -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/inc \ + -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/toolkit/mozapps/update/updater \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_Executable_use_externals,mbsdiff,\ + bzip2 \ +)) + + +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_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/external/onlineupdate/Executable_test_updater_dialog.mk b/external/onlineupdate/Executable_test_updater_dialog.mk new file mode 100644 index 000000000000..4d31c7f24f30 --- /dev/null +++ b/external/onlineupdate/Executable_test_updater_dialog.mk @@ -0,0 +1,80 @@ +# -*- 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,test_updater_dialog)) + +$(eval $(call gb_Executable_use_unpacked,test_updater_dialog,onlineupdate)) + +$(eval $(call gb_Executable_set_include,test_updater_dialog,\ + -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) ) \ +)) + +$(eval $(call gb_Executable_use_static_libraries,test_updater_dialog,\ + updatehelper \ +)) + +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 \ + Comctl32.lib \ + Shell32.lib \ + Shlwapi.lib \ + Crypt32.lib \ +)) + +$(eval $(call gb_Executable_set_targettype_gui,test_updater_dialog,YES)) + +$(eval $(call gb_Executable_add_nativeres,test_updater_dialog,updaterres)) + +$(eval $(call gb_Executable_add_ldflags,test_updater_dialog,\ + /ENTRY:wmainCRTStartup \ +)) + +else + +$(eval $(call gb_Executable_add_defs,test_updater_dialog,\ + -DMOZ_VERIFY_MAR_SIGNATURE \ + -DNSS3 \ +)) + +$(eval $(call gb_Executable_use_externals,test_updater_dialog,\ + nss3 \ +)) + +$(eval $(call gb_Executable_add_libs,test_updater_dialog,\ + $(GTK3_LIBS) \ +)) +endif + +$(eval $(call gb_Executable_add_exception_objects,test_updater_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 + +# vim:set shiftwidth=4 tabstop=4 noexpandtab: */ diff --git a/external/onlineupdate/Executable_update_service.mk b/external/onlineupdate/Executable_update_service.mk new file mode 100644 index 000000000000..2d301c5acead --- /dev/null +++ b/external/onlineupdate/Executable_update_service.mk @@ -0,0 +1,83 @@ +# -*- 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)) + +$(eval $(call gb_Executable_add_default_nativeres,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..2196ff5df579 --- /dev/null +++ b/external/onlineupdate/Executable_updater.mk @@ -0,0 +1,142 @@ +# -*- 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,\ + -DMOZ_APP_VERSION=\"$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\" \ + -DMOZ_VERIFY_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,\ + -DMOZ_APP_VERSION=\"$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\" \ + -DMOZ_VERIFY_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/external/onlineupdate/Library_install_updateservice.mk b/external/onlineupdate/Library_install_updateservice.mk new file mode 100644 index 000000000000..216b81a95a07 --- /dev/null +++ b/external/onlineupdate/Library_install_updateservice.mk @@ -0,0 +1,54 @@ +# -*- 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_Library_Library,install_updateservice)) + +$(eval $(call gb_Library_use_unpacked,install_updateservice,onlineupdate)) + +$(eval $(call gb_Library_set_include,install_updateservice, \ + -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/common \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_Library_add_defs,install_updateservice, \ + -U_DLL \ +)) + +$(eval $(call gb_Library_add_cxxflags,install_updateservice, \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ + $(if $(filter -fsanitize=%,$(CC)),,/fno-sanitize-address-vcasan-lib) \ +)) + +$(eval $(call gb_Library_add_ldflags,install_updateservice, \ + /DEF:$(SRCDIR)/external/onlineupdate/install_updateservice.def \ + /NODEFAULTLIB \ +)) + +$(eval $(call gb_Library_add_exception_objects,install_updateservice, \ + external/onlineupdate/install_updateservice \ +)) + +$(eval $(call gb_Library_use_static_libraries,install_updateservice, \ + updatehelper \ +)) + +$(eval $(call gb_Library_use_system_win32_libs,install_updateservice, \ + libcmt \ + libcpmt \ + libucrt \ + libvcruntime \ + msi \ + kernel32 \ + user32 \ + advapi32 \ + shell32 \ + shlwapi \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/Makefile b/external/onlineupdate/Makefile index 569ad8a0ba7a..569ad8a0ba7a 100644 --- a/external/ucpp/Makefile +++ b/external/onlineupdate/Makefile diff --git a/external/onlineupdate/Module_onlineupdate.mk b/external/onlineupdate/Module_onlineupdate.mk new file mode 100644 index 000000000000..6b037bd9713c --- /dev/null +++ b/external/onlineupdate/Module_onlineupdate.mk @@ -0,0 +1,33 @@ +# -*- 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_Module_Module,onlineupdate)) + +ifneq ($(ENABLE_ONLINE_UPDATE_MAR),) +$(eval $(call gb_Module_add_targets,onlineupdate,\ + UnpackedTarball_onlineupdate \ + StaticLibrary_libmar \ + StaticLibrary_libmarverify \ + StaticLibrary_updatehelper \ + $(if $(filter WNT,$(OS)),\ + Executable_update_service \ + Library_install_updateservice \ + WinResTarget_updater )\ + Executable_test_updater_dialog \ + Executable_mar \ + Executable_updater \ + Executable_mbsdiff \ + CustomTarget_generated \ + Package_update-settings_ini \ + Package_updater_ini \ +)) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/onlineupdate/Package_update-settings_ini.mk b/external/onlineupdate/Package_update-settings_ini.mk new file mode 100644 index 000000000000..bbb438e40d29 --- /dev/null +++ b/external/onlineupdate/Package_update-settings_ini.mk @@ -0,0 +1,16 @@ +# -*- 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_Package_Package,update-settings_ini,$(SRCDIR)/external/onlineupdate)) + +$(eval $(call gb_Package_add_files,update-settings_ini,$(if $(filter MACOSX,$(OS)),Contents/Resources,.), \ + update-settings.ini \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/onlineupdate/Package_updater_ini.mk b/external/onlineupdate/Package_updater_ini.mk new file mode 100644 index 000000000000..5ae65db8b4bd --- /dev/null +++ b/external/onlineupdate/Package_updater_ini.mk @@ -0,0 +1,16 @@ +# -*- 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_Package_Package,updater_ini,$(SRCDIR)/external/onlineupdate)) + +$(eval $(call gb_Package_add_files,updater_ini,$(LIBO_BIN_FOLDER), \ + updater.ini \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/onlineupdate/README.md b/external/onlineupdate/README.md new file mode 100644 index 000000000000..5b0d08146efb --- /dev/null +++ b/external/onlineupdate/README.md @@ -0,0 +1,44 @@ +# Online Update + +Online update implementation based on Mozilla's MAR format + update mechanism + +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. + +## Note + +The updater executable should not depend on any other dynamic library in the LibreOffice +installation as we would need to copy that one also to a temporary directory during update. We can't +update any library or executable that is currently in use. For the updater executable we solve this +problem by copying the updater before using it to a temporary directory. + +On Windows we use the system to provide us with a crypto library whereas on Linux we use NSS. + +## Update Procedure + +The updater executable is run two times. In a first run, the current installation is copied to an +`update` directory and the update is applied in this `update` directory. During the next run, a +replacement request is executed. The replacement request removes the old installation directory and +replaces it with the content of the `update` directory. + +### User Profile in the Installation Directory + +The archive based installations have the user profile by default inside of the installation +directory. During the update process this causes some problems that need special handling in the +updater. + +* The `update` directory is inside of the user profile resulting in recursive copying. +* During the replacement request the updater log is in the user profile, which changes location from +the actual location to a backup location. + +## Executable_test_updater_dialog + +To run that manual test, do +``` +$ cp instdir/program/updater.ini workdir/LinkTarget/Executable/test_updater_dialog.ini +$ workdir/LinkTarget/Executable/test_updater_dialog +$ rm workdir/LinkTarget/Executable/test_updater_dialog.ini +``` 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/external/onlineupdate/StaticLibrary_libmarverify.mk b/external/onlineupdate/StaticLibrary_libmarverify.mk new file mode 100644 index 000000000000..9915fcb66256 --- /dev/null +++ b/external/onlineupdate/StaticLibrary_libmarverify.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,libmarverify)) + +$(eval $(call gb_StaticLibrary_use_unpacked,libmarverify,onlineupdate)) + +$(eval $(call gb_StaticLibrary_set_include,libmarverify,\ + -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/libmar/src/ \ + -I$(call gb_UnpackedTarball_get_dir,onlineupdate)/include/onlineupdate \ + $$(INCLUDE) \ +)) + +ifeq ($(OS),WNT) + +$(eval $(call gb_StaticLibrary_add_defs,libmarverify, \ + -DXP_WIN \ +)) + +else + +$(eval $(call gb_StaticLibrary_add_defs,libmarverify,\ + -DMAR_NSS \ +)) + +$(eval $(call gb_StaticLibrary_use_externals,libmarverify,\ + nss3 \ +)) + +endif + +$(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_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..79da4f809ca7 --- /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 \ + -DMOZ_VERIFY_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..166ede0a6b9b --- /dev/null +++ b/external/onlineupdate/UnpackedTarball_onlineupdate.mk @@ -0,0 +1,36 @@ +# -*- 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 \ +)) + +ifeq ($(OS),WNT) +$(eval $(call gb_UnpackedTarball_add_patches,onlineupdate, \ + external/onlineupdate/cygpath.patch \ +)) +endif + +# The update maintenance service that is used on Windows has a couple of checks that files in the +# to-be-updated installation set are signed, which would fail for --disable-windows-build-signing; +# so, as a HACK for debugging purposes, silence those problematic checks for --enable-dbgutil: +ifeq ($(OS)-$(WINDOWS_BUILD_SIGNING)-$(ENABLE_DBGUTIL),WNT-FALSE-TRUE) +$(eval $(call gb_UnpackedTarball_add_patches,onlineupdate, \ + external/onlineupdate/unsigned-hack.patch \ +)) +endif + +# 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/cygpath.patch b/external/onlineupdate/cygpath.patch new file mode 100644 index 000000000000..81003a2e7dae --- /dev/null +++ b/external/onlineupdate/cygpath.patch @@ -0,0 +1,11 @@ +--- tools/update-packaging/make_incremental_update.sh ++++ tools/update-packaging/make_incremental_update.sh +@@ -110,7 +110,7 @@ + # Remove the / + newdir=$(echo "$newdir" | sed -e 's:\/$::') + fi +-workdir="$(mktemp -d)" ++workdir=$(cygpath -m "$(mktemp -d)") + updatemanifestv3="$workdir/updatev3.manifest" + + mkdir -p "$workdir" diff --git a/external/onlineupdate/generate-sources.sh b/external/onlineupdate/generate-sources.sh new file mode 100755 index 000000000000..8b6ebeb6c3c7 --- /dev/null +++ b/external/onlineupdate/generate-sources.sh @@ -0,0 +1,209 @@ +#!/bin/sh +# +# 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/. +# + +# Generate an external tarball from upstream git repo $1 (optionally using $2 in the tarball name): + +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 tools/update-packaging/common.sh tools/update-packaging/common.sh +copyto tools/update-packaging/make_full_update.sh tools/update-packaging/make_full_update.sh +copyto tools/update-packaging/make_incremental_update.sh tools/update-packaging/make_incremental_update.sh +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/generate.py b/external/onlineupdate/generate.py new file mode 100644 index 000000000000..8454d7efd91a --- /dev/null +++ b/external/onlineupdate/generate.py @@ -0,0 +1,21 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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/. +# + +import sys + +from gen_cert_header import create_header + +with open(sys.argv[1], mode='w') as f: + # For debug purposes, ONLINEUPDATE_MAR_CERTIFICATEDER (passed in as sys.argv[2]) can be empty, + # but create_header always expects an existing file argument, so as a hack fall back to this + # script itself (i.e., sys.argv[0]) as the pathname of the certificate DER file (though that + # will cause create_header to generate nonsense data, of course): + create_header(f, sys.argv[2] or sys.argv[0]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: 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/install_updateservice.cxx b/external/onlineupdate/install_updateservice.cxx new file mode 100644 index 000000000000..c1d547156098 --- /dev/null +++ b/external/onlineupdate/install_updateservice.cxx @@ -0,0 +1,225 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 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/. + */ + +#include <sal/config.h> + +#include <algorithm> +#include <cstddef> +#include <limits> +#include <memory> +#include <string> + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <msiquery.h> + +#include <pathhash.h> + +// Replacements for functions used in +// workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/common/pathhash.cpp but not +// available here: + +extern "C" wchar_t* _wcslwr(wchar_t* str) +{ + for (auto p = str; *p != L'\0'; ++p) + { + if (*p >= L'A' && *p <= L'Z') + { + *p += L'a' - L'A'; + } + } + return str; +}; + +extern "C" wchar_t* wcsncpy(wchar_t* strDest, wchar_t const* strSource, std::size_t count) +{ + for (std::size_t i = 0; i != count; ++i) + { + strDest[i] = *strSource; + if (*strSource != L'\0') + { + ++strSource; + } + } + return strDest; +} + +namespace +{ +bool getProperty(MSIHANDLE handle, wchar_t const* name, std::wstring* value) +{ + DWORD n = 0; + if (MsiGetPropertyW(handle, name, const_cast<wchar_t*>(L""), &n) != ERROR_MORE_DATA + || n == std::numeric_limits<DWORD>::max()) + { + return false; + } + ++n; + auto buf = std::make_unique<wchar_t[]>(n); + if (MsiGetPropertyW(handle, name, buf.get(), &n) != ERROR_SUCCESS) + { + return false; + } + if (n != 0 && buf[n - 1] == L'\\') + { + --n; + } + value->assign(buf.get(), n); + return true; +} + +typedef std::unique_ptr<void, decltype(&CloseHandle)> CloseHandleGuard; + +CloseHandleGuard guard(HANDLE handle) { return CloseHandleGuard(handle, CloseHandle); } + +bool runExecutable(std::wstring const& installLocation, wchar_t const* argument) +{ + std::wstring cmdline(L"\""); + cmdline += installLocation; + cmdline += L"\\program\\update_service.exe\" "; + cmdline += argument; + auto const n = cmdline.size() + 1; + auto const buf = std::make_unique<wchar_t[]>(n); + std::copy_n(cmdline.data(), n, buf.get()); + STARTUPINFOW si{}; + si.cb = sizeof(si); + PROCESS_INFORMATION pi{}; + if (!CreateProcessW(nullptr, buf.get(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW, nullptr, + nullptr, &si, &pi)) + { + return false; + } + auto const g(guard(pi.hProcess)); + DWORD res = WaitForSingleObject(pi.hProcess, INFINITE); + if (res != WAIT_OBJECT_0) + { + return false; + } + DWORD ec = 0; + if (!GetExitCodeProcess(pi.hProcess, &ec)) + { + return false; + } + if (ec != 0) + { + return false; + } + return true; +} + +bool writeRegistry(std::wstring const& installLocation) +{ + WCHAR path[MAX_PATH + 1]; + if (!CalculateRegistryPathFromFilePath(installLocation.c_str(), path)) + { + return false; + } + HKEY key; + if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, (std::wstring(path) + L"\\0").c_str(), 0, nullptr, + REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_WOW64_64KEY, nullptr, &key, + nullptr) + != ERROR_SUCCESS) + { + return false; + } + auto ok = true; + if (RegSetValueExW(key, L"issuer", 0, REG_SZ, + reinterpret_cast<BYTE const*>(L"Certum Code Signing 2021 CA"), + sizeof L"Certum Code Signing 2021 CA") + != ERROR_SUCCESS) + { + ok = false; + } + if (RegSetValueExW(key, L"name", 0, REG_SZ, + reinterpret_cast<BYTE const*>(L"The Document Foundation"), + sizeof L"The Document Foundation") + != ERROR_SUCCESS) + { + ok = false; + } + if (RegCloseKey(key) != ERROR_SUCCESS) + { + ok = false; + } + return ok; +} + +bool deleteRegistry(std::wstring const& installLocation) +{ + WCHAR path[MAX_PATH + 1]; + if (!CalculateRegistryPathFromFilePath(installLocation.c_str(), path)) + { + return false; + } + if (RegDeleteTreeW(HKEY_LOCAL_MACHINE, path) != ERROR_SUCCESS) + { + return false; + } + return true; +} +} + +extern "C" __declspec(dllexport) UINT __stdcall PrepareUpdateservice(MSIHANDLE handle) +{ + std::wstring loc; + if (!getProperty(handle, L"INSTALLLOCATION", &loc)) + { + return ERROR_INSTALL_FAILURE; + } + auto ok = true; + if (MsiSetPropertyW(handle, L"install_updateservice", loc.c_str()) != ERROR_SUCCESS) + { + ok = false; + } + if (MsiSetPropertyW(handle, L"uninstall_updateservice", loc.c_str()) != ERROR_SUCCESS) + { + ok = false; + } + return ok ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; +} + +extern "C" __declspec(dllexport) UINT __stdcall InstallUpdateservice(MSIHANDLE handle) +{ + std::wstring loc; + if (!getProperty(handle, L"CustomActionData", &loc)) + { + return ERROR_INSTALL_FAILURE; + } + auto ok = true; + if (!runExecutable(loc, L"install")) + { + ok = false; + } + if (!writeRegistry(loc)) + { + ok = false; + } + return ok ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; +} + +extern "C" __declspec(dllexport) UINT __stdcall UninstallUpdateservice(MSIHANDLE handle) +{ + std::wstring loc; + if (!getProperty(handle, L"CustomActionData", &loc)) + { + return ERROR_INSTALL_FAILURE; + } + auto ok = true; + if (!runExecutable(loc, L"uninstall")) + { + ok = false; + } + if (!deleteRegistry(loc)) + { + ok = false; + } + return ok ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/external/onlineupdate/install_updateservice.def b/external/onlineupdate/install_updateservice.def new file mode 100644 index 000000000000..d1c319a43ff0 --- /dev/null +++ b/external/onlineupdate/install_updateservice.def @@ -0,0 +1,5 @@ +LIBRARY "install_updateservice.dll" +EXPORTS + InstallUpdateservice + PrepareUpdateservice + UninstallUpdateservice diff --git a/external/onlineupdate/lo.patch b/external/onlineupdate/lo.patch new file mode 100644 index 000000000000..35dfb2f80fb8 --- /dev/null +++ b/external/onlineupdate/lo.patch @@ -0,0 +1,392 @@ +--- onlineupdate/source/libmar/tool/mar.c ++++ onlineupdate/source/libmar/tool/mar.c +@@ -14,7 +14,9 @@ + # include <windows.h> + # include <direct.h> + # define chdir _chdir ++# define PATH_MAX MAX_PATH + #else ++# include <limits.h> + # include <unistd.h> + #endif + +@@ -39,7 +41,7 @@ + printf("Create a MAR file:\n"); + printf( + " mar -H MARChannelID -V ProductVersion [-C workingDir] " +- "-c archive.mar [files...]\n"); ++ "-c archive.mar [files...|-f files]\n"); + + printf("Extract a MAR file:\n"); + printf(" mar [-C workingDir] -x archive.mar\n"); +@@ -244,6 +246,8 @@ + + switch (argv[1][1]) { + case 'c': { ++ int numfiles; ++ char** files; + struct ProductInformationBlock infoBlock; + if (!productVersion) { + fprintf(stderr, +@@ -256,9 +260,61 @@ + "<mar-channel-id>`).\n"); + return -1; + } ++ if (argc == 5 && !strcmp(argv[3], "-f")) { ++ FILE* in; ++ in = fopen(argv[4], "r"); ++ if (!in) { ++ fprintf(stderr, ++ "ERROR: Cannot open file `%s` for reading.\n", argv[4]); ++ return -1; ++ } ++ numfiles = 0; ++ files = malloc(sizeof(char*) * 10000); /*TODO*/ ++ if (!files) { ++ fprintf(stderr, ++ "ERROR: Cannot allocate memory"); ++ return -1; ++ } ++ for (;;) { ++ char buf[PATH_MAX + 1]; ++ size_t len; ++ if (!fgets(buf, PATH_MAX + 1, in)) { ++ if (feof(in)) { ++ break; ++ } ++ fprintf(stderr, ++ "ERROR: Cannot read from file `%s`.\n", argv[4]); ++ return -1; ++ } ++ len = strlen(buf); ++ if (len != 0 && buf[len - 1] == '\n') { ++ buf[len - 1] = '\0'; ++ } else if (!feof(in)) { ++ fprintf(stderr, ++ "ERROR: Too long line in file `%s`.\n", argv[4]); ++ return -1; ++ } ++ if (numfiles == 10000) { /*TODO*/ ++ fprintf(stderr, ++ "ERROR: Too many lines in file `%s`.\n", argv[4]); ++ return -1; ++ } ++ files[numfiles] = strdup(buf); ++ if (!files[numfiles]) { ++ fprintf(stderr, ++ "ERROR: Cannot allocate memory"); ++ return -1; ++ } ++ ++numfiles; ++ } ++ fclose(in); ++ } else { ++ numfiles = argc - 3; ++ files = argv + 3; ++ } + infoBlock.MARChannelID = MARChannelID; + infoBlock.productVersion = productVersion; +- return mar_create(argv[2], argc - 3, argv + 3, &infoBlock); ++ return mar_create(argv[2], numfiles, files, &infoBlock); + } + case 'i': { + if (!productVersion) { +--- onlineupdate/source/service/serviceinstall.cpp ++++ onlineupdate/source/service/serviceinstall.cpp +@@ -25,7 +25,7 @@ + + // This uninstall key is defined originally in maintenanceservice_installer.nsi + #define MAINT_UNINSTALL_KEY \ +- L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MozillaMaintenan" \ ++ L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\LibreOfficeMaintenan" \ + L"ceService" + + static BOOL UpdateUninstallerVersionString(LPWSTR versionString) { +@@ -201,7 +201,7 @@ + size_t currentServicePathLen = wcslen(currentServicePath); + bool doesServiceHaveCorrectPath = + currentServicePathLen > 2 && +- !wcsstr(currentServicePath, L"maintenanceservice_tmp.exe") && ++ !wcsstr(currentServicePath, L"update_service_tmp.exe") && + currentServicePath[0] == L'\"' && + currentServicePath[currentServicePathLen - 1] == L'\"'; + +@@ -222,7 +222,7 @@ + LOG_WARN(("Couldn't remove file spec. (%lu)", GetLastError())); + return FALSE; + } +- if (!PathAppendSafe(fixedPath, L"maintenanceservice.exe")) { ++ if (!PathAppendSafe(fixedPath, L"update_service.exe")) { + LOG_WARN(("Couldn't append file spec. (%lu)", GetLastError())); + return FALSE; + } +@@ -561,7 +561,7 @@ + + // The service can be in a stopped state but the exe still in use + // so make sure the process is really gone before proceeding +- WaitForProcessExit(L"maintenanceservice.exe", 30); ++ WaitForProcessExit(L"update_service.exe", 30); + LOG(("Done waiting for service stop, last service state: %lu", lastState)); + + return lastState == SERVICE_STOPPED; +--- onlineupdate/source/service/serviceinstall.h ++++ onlineupdate/source/service/serviceinstall.h +@@ -4,7 +4,7 @@ + + #include "readstrings.h" + +-#define SVC_DISPLAY_NAME L"Mozilla Maintenance Service" ++#define SVC_DISPLAY_NAME L"LibreOffice Maintenance Service" + + enum SvcInstallAction { UpgradeSvc, InstallSvc, ForceInstallSvc }; + BOOL SvcInstall(SvcInstallAction action); +--- onlineupdate/source/update/common/pathhash.cpp ++++ onlineupdate/source/update/common/pathhash.cpp +@@ -119,7 +119,7 @@ + delete[] lowercasePath; + + LPCWSTR baseRegPath = +- L"SOFTWARE\\Mozilla\\" ++ L"SOFTWARE\\LibreOffice\\" + L"MaintenanceService\\"; + wcsncpy(registryPath, baseRegPath, MAX_PATH); + BinaryDataToHexString(hash, hashSize, registryPath + wcslen(baseRegPath)); +--- onlineupdate/source/update/common/updatehelper.cpp ++++ onlineupdate/source/update/common/updatehelper.cpp +@@ -78,7 +78,7 @@ + wcsncpy(outBuf, progFilesX86, MAX_PATH + 1); + CoTaskMemFree(progFilesX86); + +- if (!PathAppendSafe(outBuf, L"Mozilla Maintenance Service")) { ++ if (!PathAppendSafe(outBuf, L"LibreOffice Maintenance Service")) { + return FALSE; + } + +@@ -311,7 +311,7 @@ + // Obtain the temp path of the maintenance service binary + WCHAR tmpService[MAX_PATH + 1] = {L'\0'}; + if (!PathGetSiblingFilePath(tmpService, serviceConfig.lpBinaryPathName, +- L"maintenanceservice_tmp.exe")) { ++ L"update_service_tmp.exe")) { + return FALSE; + } + +@@ -322,7 +322,7 @@ + // Get the new maintenance service path from the install dir + WCHAR newMaintServicePath[MAX_PATH + 1] = {L'\0'}; + wcsncpy(newMaintServicePath, installDir, MAX_PATH); +- PathAppendSafe(newMaintServicePath, L"maintenanceservice.exe"); ++ PathAppendSafe(newMaintServicePath, L"update_service.exe"); + + // Copy the temp file in alongside the maintenace service. + // This is a requirement for maintenance service upgrades. +@@ -429,7 +429,7 @@ + // 2) The command being executed, which is "software-update" + // 3) The path to updater.exe (from argv[0]) + LPCWSTR* updaterServiceArgv = new LPCWSTR[argc + 2]; +- updaterServiceArgv[0] = L"MozillaMaintenance"; ++ updaterServiceArgv[0] = L"LibreOfficeMaintenance"; + updaterServiceArgv[1] = L"software-update"; + + for (int i = 0; i < argc; ++i) { +--- onlineupdate/source/update/common/updatehelper.h ++++ onlineupdate/source/update/common/updatehelper.h +@@ -24,9 +24,9 @@ + #define PATCH_DIR_PATH L"\\updates\\0" + + #ifdef MOZ_MAINTENANCE_SERVICE +-# define SVC_NAME L"MozillaMaintenance" ++# define SVC_NAME L"LibreOfficeMaintenance" + +-# define BASE_SERVICE_REG_KEY L"SOFTWARE\\Mozilla\\MaintenanceService" ++# define BASE_SERVICE_REG_KEY L"SOFTWARE\\LibreOffice\\MaintenanceService" + + // The test only fallback key, as its name implies, is only present on machines + // that will use automated tests. Since automated tests always run from a +--- onlineupdate/source/service/workmonitor.cpp ++++ onlineupdate/source/service/workmonitor.cpp +@@ -328,7 +328,7 @@ + // The installation dir that we are installing to is installDir. + WCHAR installDirUpdater[MAX_PATH + 1] = {L'\0'}; + wcsncpy(installDirUpdater, installDir, MAX_PATH); +- if (!PathAppendSafe(installDirUpdater, L"updater.exe")) { ++ if (!PathAppendSafe(installDirUpdater, L"program\\updater.exe")) { + LOG_WARN(("Install directory updater could not be determined.")); + return false; + } +@@ -746,7 +746,7 @@ + + WCHAR installDirUpdater[MAX_PATH + 1] = {L'\0'}; + wcsncpy(installDirUpdater, installDir, MAX_PATH); +- if (!PathAppendSafe(installDirUpdater, L"updater.exe")) { ++ if (!PathAppendSafe(installDirUpdater, L"program\\updater.exe")) { + LOG_WARN(("Install directory updater could not be determined.")); + result = FALSE; + } +--- onlineupdate/source/update/updater/updater.cpp ++++ onlineupdate/source/update/updater/updater.cpp +@@ -4174,6 +4174,10 @@ + NS_tmkdir(gDeleteDirPath, 0755); + } + } ++ ++ if (_setmaxstdio(8192) == -1) { ++ LOG(("_setmaxstdio failed")); ++ } + #endif /* XP_WIN */ + + // Run update process on a background thread. ShowProgressUI may return +--- tools/update-packaging/common.sh ++++ tools/update-packaging/common.sh +@@ -76,17 +76,8 @@ + forced= + fi + +- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/') +- if [ $is_extension = "1" ]; then +- # Use the subdirectory of the extensions folder as the file to test +- # before performing this add instruction. +- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/') +- verbose_notice " add-if \"$testdir\" \"$f\"" +- echo "add-if \"$testdir\" \"$f\"" >> "$filev3" +- else +- verbose_notice " add \"$f\"$forced" +- echo "add \"$f\"" >> "$filev3" +- fi ++ verbose_notice " add-if \"$f\" \"$f\"$forced" ++ echo "add-if \"$f\" \"$f\"" >> "$filev3" + } + + check_for_add_if_not_update() { +@@ -113,17 +104,8 @@ + f="$1" + filev3="$2" + +- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/') +- if [ $is_extension = "1" ]; then +- # Use the subdirectory of the extensions folder as the file to test +- # before performing this add instruction. +- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/') +- verbose_notice " patch-if \"$testdir\" \"$f.patch\" \"$f\"" +- echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> "$filev3" +- else +- verbose_notice " patch \"$f.patch\" \"$f\"" +- echo "patch \"$f.patch\" \"$f\"" >> "$filev3" +- fi ++ verbose_notice " patch-if \"$f\" \"$f.patch\" \"$f\"" ++ echo "patch-if \"$f\" \"$f.patch\" \"$f\"" >> "$filev3" + } + + append_remove_instructions() { +--- tools/update-packaging/make_full_update.sh ++++ tools/update-packaging/make_full_update.sh +@@ -53,9 +53,10 @@ + fi + workdir="$targetdir.work" + updatemanifestv3="$workdir/updatev3.manifest" +-targetfiles="updatev3.manifest" + + mkdir -p "$workdir" ++ ++printf 'updatev3.manifest\n' >"$workdir/files.txt" + + # Generate a list of all files in the target directory. + pushd "$targetdir" +@@ -66,7 +67,6 @@ + if [ ! -f "precomplete" ]; then + if [ ! -f "Contents/Resources/precomplete" ]; then + notice "precomplete file is missing!" +- exit 1 + fi + fi + +@@ -99,7 +99,7 @@ + $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f" + copy_perm "$targetdir/$f" "$workdir/$f" + +- targetfiles="$targetfiles \"$f\"" ++ printf '%s\n' "$f" >>"$workdir/files.txt" + done + + # Append remove instructions for any dead files. +@@ -110,7 +110,7 @@ + $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3" + + mar_command="$mar_command -C \"$workdir\" -c output.mar" +-eval "$mar_command $targetfiles" ++eval "$mar_command -f $workdir/files.txt" + mv -f "$workdir/output.mar" "$archive" + + # cleanup +--- tools/update-packaging/make_incremental_update.sh ++++ tools/update-packaging/make_incremental_update.sh +@@ -112,9 +112,10 @@ + fi + workdir="$(mktemp -d)" + updatemanifestv3="$workdir/updatev3.manifest" +-archivefiles="updatev3.manifest" + + mkdir -p "$workdir" ++ ++printf 'updatev3.manifest\n' >"$workdir/files.txt" + + # Generate a list of all files in the target directory. + pushd "$olddir" +@@ -135,7 +136,6 @@ + if [ ! -f "precomplete" ]; then + if [ ! -f "Contents/Resources/precomplete" ]; then + notice "precomplete file is missing!" +- exit 1 + fi + fi + +@@ -170,7 +170,7 @@ + $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f" + copy_perm "$newdir/$f" "$workdir/$f" + make_add_if_not_instruction "$f" "$updatemanifestv3" +- archivefiles="$archivefiles \"$f\"" ++ printf '%s\n' "$f" >>"$workdir/files.txt" + continue 1 + fi + +@@ -180,7 +180,7 @@ + $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f" + copy_perm "$newdir/$f" "$workdir/$f" + make_add_instruction "$f" "$updatemanifestv3" 1 +- archivefiles="$archivefiles \"$f\"" ++ printf '%s\n' "$f" >>"$workdir/files.txt" + continue 1 + fi + +@@ -227,11 +227,11 @@ + make_patch_instruction "$f" "$updatemanifestv3" + mv -f "$patchfile" "$workdir/$f.patch" + rm -f "$workdir/$f" +- archivefiles="$archivefiles \"$f.patch\"" ++ printf '%s\n' "$f.patch" >>"$workdir/files.txt" + else + make_add_instruction "$f" "$updatemanifestv3" + rm -f "$patchfile" +- archivefiles="$archivefiles \"$f\"" ++ printf '%s\n' "$f" >>"$workdir/files.txt" + fi + fi + else +@@ -270,7 +270,7 @@ + fi + + +- archivefiles="$archivefiles \"$f\"" ++ printf '%s\n' "$f" >>"$workdir/files.txt" + done + + notice "" +@@ -302,7 +302,7 @@ + $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3" + + mar_command="$mar_command -C \"$workdir\" -c output.mar" +-eval "$mar_command $archivefiles" ++eval "$mar_command -f $workdir/files.txt" + mv -f "$workdir/output.mar" "$archive" + + # cleanup diff --git a/external/onlineupdate/monitor-sources.sh b/external/onlineupdate/monitor-sources.sh new file mode 100755 index 000000000000..9e0a252a0645 --- /dev/null +++ b/external/onlineupdate/monitor-sources.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# 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/. +# + +# Monitor any changes in upstream git repo $1 between revisions $2 and $3 that affect files that we +# copy with our external/onlineupdate/generate-sources.sh: + +set -ex -o pipefail + +source=${1?} +old=${2?} +new=${3?} + +files=$(grep -E '^copyto [^ ]+ [^ ]+$' external/onlineupdate/generate-sources.sh | cut -f 3 -d ' ') +git -C "${source?}" log --patch "${old?}".."${new?}" -- $files diff --git a/external/onlineupdate/qa/lang_packs/Makefile b/external/onlineupdate/qa/lang_packs/Makefile new file mode 100644 index 000000000000..d328472f53bf --- /dev/null +++ b/external/onlineupdate/qa/lang_packs/Makefile @@ -0,0 +1,21 @@ +gb_Side := host +include ../../../config_host.mk + +UPDATER_DIR := $(WORKDIR)/updater/lang_pack + +all : call + +unpack: + @echo "Unpacking the updater test project" + @rm -r $(UPDATER_DIR) || true + @mkdir -p $(WORKDIR)/updater/ + @unzip updater_lang.zip -d $(WORKDIR)/updater > /dev/null + @cp update_signed.mar $(UPDATER_DIR)/user/patch/update.mar + @cp update_en_signed.mar $(UPDATER_DIR)/user/patch/update_en_signed.mar + +call: unpack + @echo "Update the test project" + @$(INSTDIR)/program/updater $(UPDATER_DIR)/user/patch $(UPDATER_DIR) $(UPDATER_DIR)/user/update -1 + +call-gdb: unpack + gdb --args $(INSTDIR)/program/updater $(UPDATER_DIR)/user/patch $(UPDATER_DIR) $(UPDATER_DIR)/user/update -1 diff --git a/external/onlineupdate/qa/lang_packs/update_en_signed.mar b/external/onlineupdate/qa/lang_packs/update_en_signed.mar Binary files differnew file mode 100644 index 000000000000..b72d1c5df637 --- /dev/null +++ b/external/onlineupdate/qa/lang_packs/update_en_signed.mar diff --git a/external/onlineupdate/qa/lang_packs/update_signed.mar b/external/onlineupdate/qa/lang_packs/update_signed.mar Binary files differnew file mode 100644 index 000000000000..a145d6325c65 --- /dev/null +++ b/external/onlineupdate/qa/lang_packs/update_signed.mar diff --git a/external/onlineupdate/qa/lang_packs/updater_lang.zip b/external/onlineupdate/qa/lang_packs/updater_lang.zip Binary files differnew file mode 100644 index 000000000000..05b206bc8905 --- /dev/null +++ b/external/onlineupdate/qa/lang_packs/updater_lang.zip diff --git a/external/onlineupdate/qa/replace_request/Makefile b/external/onlineupdate/qa/replace_request/Makefile new file mode 100644 index 000000000000..476e93213cca --- /dev/null +++ b/external/onlineupdate/qa/replace_request/Makefile @@ -0,0 +1,17 @@ +gb_Side := host +include ../../../config_host.mk + +UPDATER_DIR := $(WORKDIR)/updater/replace_request + +unpack: + @echo "Unpacking the updater test project" + @rm -r $(UPDATER_DIR) || true + @mkdir -p $(WORKDIR)/updater + @unzip updater.zip -d $(WORKDIR)/updater > /dev/null + +call: unpack + @echo "Update the test project" + @$(INSTDIR)/program/updater $(UPDATER_DIR)/user/patch $(UPDATER_DIR) $(UPDATER_DIR)/user/update /replace + +call-gdb: unpack + gdb --args $(INSTDIR)/program/updater $(UPDATER_DIR)/user/patch $(UPDATER_DIR) $(UPDATER_DIR)/user/update /replace diff --git a/external/onlineupdate/qa/replace_request/README b/external/onlineupdate/qa/replace_request/README new file mode 100644 index 000000000000..f50c692fd692 --- /dev/null +++ b/external/onlineupdate/qa/replace_request/README @@ -0,0 +1,3 @@ +Tests the replacement request done by the automatic updater + +After calling 'make call' the content in workdir/updater/program/datei.txt should say "new". diff --git a/external/onlineupdate/qa/replace_request/updater.zip b/external/onlineupdate/qa/replace_request/updater.zip Binary files differnew file mode 100644 index 000000000000..dc5e26b0f258 --- /dev/null +++ b/external/onlineupdate/qa/replace_request/updater.zip diff --git a/external/onlineupdate/qa/single_step/Makefile b/external/onlineupdate/qa/single_step/Makefile new file mode 100644 index 000000000000..f303992baa0f --- /dev/null +++ b/external/onlineupdate/qa/single_step/Makefile @@ -0,0 +1,27 @@ +gb_Side := host +include ../../../config_host.mk + +UPDATER_DIR := $(WORKDIR)/updater/single_step + +all : call + +unpack: + @echo "Unpacking the updater test project" + @rm -r $(UPDATER_DIR) || true + @mkdir -p $(UPDATER_DIR) + @unzip single_step.zip -d $(WORKDIR)/updater > /dev/null + @mkdir -p $(UPDATER_DIR)/patch + +call-complete: unpack + @echo "Update the test project" + @cp complete_signed.mar $(UPDATER_DIR)/patch/update.mar + @$(INSTDIR)/program/updater $(UPDATER_DIR)/patch $(UPDATER_DIR) $(UPDATER_DIR) 0 + +call-incremental: unpack + @echo "Update the test project" + @cp incremental_signed.mar $(UPDATER_DIR)/patch/update.mar + @$(INSTDIR)/program/updater $(UPDATER_DIR)/patch $(UPDATER_DIR) $(UPDATER_DIR) 0 + +call-gdb: unpack + @cp incremental_signed.mar $(UPDATER_DIR)/patch/update.mar + gdb --args $(INSTDIR)/program/updater $(UPDATER_DIR)/patch $(UPDATER_DIR) $(UPDATER_DIR) 0 diff --git a/external/onlineupdate/qa/single_step/complete_signed.mar b/external/onlineupdate/qa/single_step/complete_signed.mar Binary files differnew file mode 100644 index 000000000000..7b0631dd338a --- /dev/null +++ b/external/onlineupdate/qa/single_step/complete_signed.mar diff --git a/external/onlineupdate/qa/single_step/incremental_signed.mar b/external/onlineupdate/qa/single_step/incremental_signed.mar Binary files differnew file mode 100644 index 000000000000..6ec6e7a1a919 --- /dev/null +++ b/external/onlineupdate/qa/single_step/incremental_signed.mar diff --git a/external/onlineupdate/qa/single_step/single_step.zip b/external/onlineupdate/qa/single_step/single_step.zip Binary files differnew file mode 100644 index 000000000000..823a590e08b4 --- /dev/null +++ b/external/onlineupdate/qa/single_step/single_step.zip diff --git a/external/onlineupdate/unsigned-hack.patch b/external/onlineupdate/unsigned-hack.patch new file mode 100644 index 000000000000..7ef3b76d73e6 --- /dev/null +++ b/external/onlineupdate/unsigned-hack.patch @@ -0,0 +1,20 @@ +--- onlineupdate/source/service/workmonitor.cpp ++++ onlineupdate/source/service/workmonitor.cpp +@@ -395,7 +395,7 @@ + } + + #ifndef DISABLE_UPDATER_AUTHENTICODE_CHECK +- return DoesBinaryMatchAllowedCertificates(installDir, updater); ++ return DoesBinaryMatchAllowedCertificates(installDir, updater)||true; + #else + return true; + #endif +@@ -732,7 +732,7 @@ + if (!WriteStatusFailure(argv[4], SERVICE_INSTALL_DIR_REG_ERROR)) { + LOG_WARN(("Could not write update.status for previous failure.")); + } +- return FALSE; ++ //return FALSE; + } + RegCloseKey(baseKey); + } else { diff --git a/external/onlineupdate/update-settings.ini b/external/onlineupdate/update-settings.ini new file mode 100644 index 000000000000..60a657f90423 --- /dev/null +++ b/external/onlineupdate/update-settings.ini @@ -0,0 +1,10 @@ +; +; 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/. +; + +[Settings] +ACCEPTED_MAR_CHANNEL_IDS=LOOnlineUpdater diff --git a/external/onlineupdate/updater.ini b/external/onlineupdate/updater.ini new file mode 100644 index 000000000000..8ee6ad9cc298 --- /dev/null +++ b/external/onlineupdate/updater.ini @@ -0,0 +1,12 @@ +; +; 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/. +; + +[Strings] +Title=LibreOffice Update +Info=Please wait while we update your installation. +MozillaMaintenanceDescription=The LibreOffice Maintenace Service helps ensure that you have the latest and most secure version of LibreOffice on your computer. diff --git a/external/onlineupdate/workben/test_dialog.cxx b/external/onlineupdate/workben/test_dialog.cxx new file mode 100644 index 000000000000..4c956410d8c0 --- /dev/null +++ b/external/onlineupdate/workben/test_dialog.cxx @@ -0,0 +1,39 @@ +#include "progressui.h" + +#if defined(_WIN32) +#include "progressui_win.cpp" +#else +#include "progressui_gtk.cpp" +#endif + +#include <thread> +#include <chrono> +#include <iostream> + +void func() +{ + for (int i = 0; i <= 100; ++i) + { + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + UpdateProgressUI(i); + } + QuitProgressUI(); +} + +int NS_main(int argc, NS_tchar** argv) +{ + InitProgressUI(&argc, &argv); + std::thread a(func); + /* + volatile bool b = false; + do + { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + while (!b); + */ + int result = ShowProgressUI(); + std::cout << result << std::endl; + a.join(); + return 0; +} diff --git a/external/openldap/ExternalProject_openldap.mk b/external/openldap/ExternalProject_openldap.mk index 46e9168f5a91..e02a35d9943f 100644 --- a/external/openldap/ExternalProject_openldap.mk +++ b/external/openldap/ExternalProject_openldap.mk @@ -9,43 +9,49 @@ $(eval $(call gb_ExternalProject_ExternalProject,openldap)) -$(eval $(call gb_ExternalProject_use_externals,openldap,nss3)) +$(eval $(call gb_ExternalProject_use_externals,openldap,openssl)) $(eval $(call gb_ExternalProject_register_targets,openldap,\ build \ )) -openldap_LDFLAGS = -ifeq ($(SYSTEM_NSS),) -openldap_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib \ - $(if $(filter AIX,$(OS)),-Wl$(COMMA)-brtl) +openldap_CFLAGS = +ifeq ($(OS),LINUX) # i.e., assuming glibc +# glibc needs at least _XOPEN_SOURCE=500 to declare pthread_getconcurrency and +# pthread_setconcurrency in <pthread.h> (and once that is defined, it also needs either +# _DEFUALT_SOURCE (glibc >= 2.19) or the deprecated _BSD_SOURCE (glibc <= 2.18) to be defined +# explicitly, so that e.g. u_char is declared in <sys/types.h>): +openldap_CFLAGS = -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -D_BSD_SOURCE endif -# Help openldap's configure determine that it needs -lpthread even if libasan.so -# contains a pthread_create override: -ifneq ($(filter -fsanitize=address,$(CC)),) + +openldap_LDFLAGS = $(call gb_ExternalProject_get_link_flags,openldap) +ifeq ($(SYSTEM_OPENSSL),) +openldap_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl) +endif +ifeq ($(OS),LINUX) openldap_LDFLAGS += -pthread endif $(call gb_ExternalProject_get_state_target,openldap,build) : $(call gb_Trace_StartRange,openldap,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ --disable-slapd \ --with-pic \ - --with-tls=moznss \ + --with-tls=openssl \ --without-cyrus-sasl \ --disable-shared \ --enable-static \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(CROSS_COMPILING), \ - --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ --with-yielding_select=yes \ ac_cv_func_memcmp_working=yes \ ) \ - $(if $(SYSTEM_NSS), \ - CPPFLAGS="$(CPPFLAGS) $(NSS_CFLAGS)" CFLAGS="$(CFLAGS) $(NSS_CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" LDFLAGS="$(LDFLAGS) $(NSS_LIBS)" \ + $(if $(SYSTEM_OPENSSL), \ + CPPFLAGS="$(CPPFLAGS) $(OPENSSL_CFLAGS)" CFLAGS="$(CFLAGS) $(openldap_CFLAGS) $(OPENSSL_CFLAGS) $(call gb_ExternalProject_get_build_flags,openldap)" LDFLAGS="$(LDFLAGS) $(openldap_LDFLAGS) $(OPENSSL_LIBS)" \ , \ - CPPFLAGS="$(CPPFLAGS) -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \ - CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \ + CPPFLAGS="$(CPPFLAGS) -I$(call gb_UnpackedTarball_get_dir,openssl)/include" \ + CFLAGS="$(CFLAGS) $(openldap_CFLAGS) $(call gb_ExternalProject_get_build_flags,openldap) -I$(call gb_UnpackedTarball_get_dir,openssl)/include" \ ) \ $(if $(openldap_LDFLAGS),LDFLAGS="$(LDFLAGS) $(openldap_LDFLAGS)") \ && MAKEFLAGS= && $(MAKE) \ diff --git a/external/openldap/README b/external/openldap/README index 0c1828c12b93..48da788f5447 100644 --- a/external/openldap/README +++ b/external/openldap/README @@ -1,3 +1,3 @@ OpenLDAP provides an LDAP client library -http://www.openldap.org/ +https://www.openldap.org/ diff --git a/external/openldap/openldap-2.4.44.patch.1 b/external/openldap/openldap-2.4.44.patch.1 index 0d3cf5b70c3f..2dfaf355afb0 100644 --- a/external/openldap/openldap-2.4.44.patch.1 +++ b/external/openldap/openldap-2.4.44.patch.1 @@ -1,57 +1,4 @@ ---- openldap.org/configure -+++ openldap/configure -@@ -15735,7 +15735,7 @@ - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lnss3 $LIBS" -+LIBS="-lnss3 -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - ---- openldap.org/configure.in -+++ openldap/configure.in -@@ -1239,7 +1239,8 @@ - AC_CHECK_HEADERS([nssutil.h]) - if test "$ac_cv_header_nssutil_h" = yes ; then - AC_CHECK_LIB([nss3], [NSS_Initialize], -- [ have_moznss=yes ], [ have_moznss=no ]) -+ [ have_moznss=yes ], [ have_moznss=no ], -+ [ -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 ]) - fi - - if test "$have_moznss" = yes ; then ---- openldap.org/libraries/libldap/tls_m.c -+++ openldap/libraries/libldap/tls_m.c -@@ -49,17 +49,17 @@ - #include <termios.h> /* for echo on/off */ - #endif - --#include <nspr/nspr.h> --#include <nspr/private/pprio.h> --#include <nss/nss.h> --#include <nss/ssl.h> --#include <nss/sslerr.h> --#include <nss/sslproto.h> --#include <nss/pk11pub.h> --#include <nss/secerr.h> --#include <nss/keyhi.h> --#include <nss/secmod.h> --#include <nss/cert.h> -+#include <nspr.h> -+#include <private/pprio.h> -+#include <nss.h> -+#include <ssl.h> -+#include <sslerr.h> -+#include <sslproto.h> -+#include <pk11pub.h> -+#include <secerr.h> -+#include <keyhi.h> -+#include <secmod.h> -+#include <cert.h> - - #undef NSS_VERSION_INT - #define NSS_VERSION_INT ((NSS_VMAJOR << 24) | (NSS_VMINOR << 16) | \ +-*- Mode: diff -*- --- openldap.org/Makefile.in +++ openldap/Makefile.in @@ -13,7 +13,7 @@ @@ -64,10 +11,10 @@ INSTALLDIRS= @@ -32,7 +32,3 @@ - $(RM) config.status libtool stamp-h stamp-h.in + $(RM) config.status libtool stamp-h stamp-h.in libraries/libldap/ldap.pc libraries/liblber/lber.pc distclean: veryclean FORCE - -check: test -test: FORCE -- cd tests; $(MAKE) test +- cd tests && $(MAKE) test diff --git a/external/openssl/ExternalPackage_openssl.mk b/external/openssl/ExternalPackage_openssl.mk index d0c0dbaab975..7d02dfc6ed1c 100644 --- a/external/openssl/ExternalPackage_openssl.mk +++ b/external/openssl/ExternalPackage_openssl.mk @@ -13,14 +13,14 @@ $(eval $(call gb_ExternalPackage_use_external_project,openssl,openssl)) ifeq ($(COM),MSC) $(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER),\ - libcrypto-1_1.dll \ - libssl-1_1.dll \ + libcrypto-3.dll \ + libssl-3.dll \ )) ifneq ($(DISABLE_PYTHON),TRUE) ifneq ($(SYSTEM_PYTHON),TRUE) $(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib, \ - libcrypto-1_1.dll \ - libssl-1_1.dll \ + libcrypto-3.dll \ + libssl-3.dll \ )) endif endif diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk index d0790e5e5b7b..910c957484c4 100644 --- a/external/openssl/ExternalProject_openssl.mk +++ b/external/openssl/ExternalProject_openssl.mk @@ -26,7 +26,9 @@ OPENSSL_PLATFORM := \ $(if $(filter GNU/kFreeBSD,$(shell uname)),\ debian-kfreebsd-amd64\ ,\ - $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic64, linux-generic64) no-asm\ + $(if $(filter FreeBSD,$(shell uname)), BSD-x86_64,\ + $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic64, linux-generic64) no-asm\ + )\ )\ ,\ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic32, linux-generic32)\ @@ -44,11 +46,13 @@ OPENSSL_PLATFORM := \ $(if $(filter WNT,$(OS)),\ $(if $(filter INTEL,$(CPUNAME)),VC-WIN32)\ $(if $(filter X86_64,$(CPUNAME)),VC-WIN64A)\ - $(if $(filter ARM64,$(CPUNAME)),VC-WIN64-ARM)\ + $(if $(filter AARCH64,$(CPUNAME)),VC-WIN64-ARM)\ ,\ $(if $(filter MACOSX,$(OS)),\ $(if $(filter X86_64,$(CPUNAME)),darwin64-x86_64-cc)\ $(if $(filter AARCH64,$(CPUNAME)),darwin64-arm64-cc)\ + ,\ + $(if $(filter EMSCRIPTEN,$(OS)),no-engine no-dso no-dgram no-srtp no-err no-ocsp no-psk no-ts no-asm) \ )\ )\ )\ @@ -58,12 +62,14 @@ OPENSSL_PLATFORM := \ ifeq ($(COM),MSC) $(eval $(call gb_ExternalProject_use_nmake,openssl,build)) +$(call gb_ExternalProject_get_state_target,openssl,build): export PERL:=$(if $(MSYSTEM),$(STRAWBERRY_PERL),$(shell cygpath -m $(PERL))) + $(call gb_ExternalProject_get_state_target,openssl,build): $(call gb_Trace_StartRange,openssl,EXTERNAL) $(call gb_ExternalProject_run,build,\ CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) no-tests no-multilib \ - && export PERL="$(shell cygpath -w $(PERL))" \ && nmake -f makefile \ + $(if $(call gb_Module__symbols_enabled,openssl),DEBUG_FLAGS_VALUE="$(gb_DEBUGINFO_FLAGS)") \ ) $(call gb_Trace_EndRange,openssl,EXTERNAL) @@ -83,6 +89,7 @@ $(call gb_ExternalProject_get_state_target,openssl,build): $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) build_libs \ CC="$(CC) -fPIC \ + $(if $(filter -fsanitize=undefined,$(CC)),-fno-sanitize=function) \ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), -DPURIFY,) \ $(if $(filter-out WNT MACOSX,$(OS)),-fvisibility=hidden)" \ && ln -s . lib \ diff --git a/external/openssl/README b/external/openssl/README index 399bdd56fded..eda5e7eb17ec 100644 --- a/external/openssl/README +++ b/external/openssl/README @@ -1,6 +1,6 @@ Open Source toolkit implementing SSL and TLS. -From [http://www.openssl.org/]. +From [https://www.openssl.org/]. SSL = Secure Sockets Layer (SSL v2/v3) protocol. TLS = Transport Layer Security (TLS v1) protocol. diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk index 6f00cf7f7e44..2a8f3bb3f905 100644 --- a/external/openssl/UnpackedTarball_openssl.mk +++ b/external/openssl/UnpackedTarball_openssl.mk @@ -13,6 +13,9 @@ $(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl $(eval $(call gb_UnpackedTarball_add_patches,openssl,\ external/openssl/openssl-no-multilib.patch.0 \ + external/openssl/configurable-z-option.patch.0 \ + external/openssl/openssl-no-ipc-cmd.patch.0 \ + external/openssl/system-cannot-find-path-for-move.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/openssl/configurable-z-option.patch.0 b/external/openssl/configurable-z-option.patch.0 new file mode 100644 index 000000000000..d9478b6a9701 --- /dev/null +++ b/external/openssl/configurable-z-option.patch.0 @@ -0,0 +1,34 @@ +--- Configurations/10-main.conf.sav 2023-09-19 22:02:31.000000000 +0900 ++++ Configurations/10-main.conf 2023-09-30 23:47:49.734377000 +0900 +@@ -14,7 +14,7 @@ + } elsif ($disabled{asm}) { + # assembler is still used to compile uplink shim + $vc_win64a_info = { AS => "ml64", +- ASFLAGS => "/nologo /Zi", ++ ASFLAGS => "/nologo $$(DEBUG_FLAGS_VALUE)", + asflags => "/c /Cp /Cx", + asoutflag => "/Fo", + perlasm_scheme => "masm" }; +@@ -44,7 +44,7 @@ + } elsif ($disabled{asm}) { + # not actually used, uplink shim is inlined into C code + $vc_win32_info = { AS => "ml", +- ASFLAGS => "/nologo /Zi", ++ ASFLAGS => "/nologo $$(DEBUG_FLAGS_VALUE)", + asflags => "/Cp /coff /c /Cx", + asoutflag => "/Fo", + perlasm_scheme => "win32" }; +@@ -1333,10 +1333,10 @@ + "UNICODE", "_UNICODE", + "_CRT_SECURE_NO_DEPRECATE", + "_WINSOCK_DEPRECATED_NO_WARNINGS"), +- lib_cflags => add("/Zi /Fdossl_static.pdb"), ++ lib_cflags => add("\$(DEBUG_FLAGS_VALUE)"), + lib_defines => add("L_ENDIAN"), +- dso_cflags => "/Zi /Fddso.pdb", +- bin_cflags => "/Zi /Fdapp.pdb", ++ dso_cflags => "\$(DEBUG_FLAGS_VALUE)", ++ bin_cflags => "\$(DEBUG_FLAGS_VALUE)", + # def_flag made to empty string so a .def file gets generated + shared_defflag => '', + shared_ldflag => "/dll", diff --git a/external/openssl/openssl-no-ipc-cmd.patch.0 b/external/openssl/openssl-no-ipc-cmd.patch.0 new file mode 100644 index 000000000000..8c6b2c58d63a --- /dev/null +++ b/external/openssl/openssl-no-ipc-cmd.patch.0 @@ -0,0 +1,60 @@ +--- util/perl/OpenSSL/config.pm 2022-09-08 11:45:57.408532119 +0100 ++++ util/perl/OpenSSL/config.pm 2022-09-08 11:47:46.877590711 +0100 +@@ -16,7 +16,7 @@ + use Getopt::Std; + use File::Basename; + use File::Spec; +-use IPC::Cmd; ++# use IPC::Cmd; + use POSIX; + use Config; + use Carp; +@@ -205,7 +205,8 @@ + + # Look for ISC/SCO with its unique uname program + sub is_sco_uname { +- return undef unless IPC::Cmd::can_run('uname'); ++ return undef; ++# return undef unless IPC::Cmd::can_run('uname'); + + open UNAME, "uname -X 2>/dev/null|" or return ''; + my $line = ""; +@@ -303,13 +304,13 @@ + $CCVENDOR = ''; # Dunno, don't care (unless found later) + + # Find a compiler if we don't already have one +- if ( ! $cc ) { +- foreach (@c_compilers) { +- next unless IPC::Cmd::can_run("$CROSS_COMPILE$_"); +- $CC = $_; +- last; +- } +- } ++# if ( ! $cc ) { ++# foreach (@c_compilers) { ++# next unless IPC::Cmd::can_run("$CROSS_COMPILE$_"); ++# $CC = $_; ++# last; ++# } ++# } + + if ( $CC ) { + # Find the compiler vendor and version number for certain compilers +--- util/perl/OpenSSL/config.pm.orig 2022-11-08 12:54:59.751298823 +0100 ++++ util/perl/OpenSSL/config.pm 2022-11-08 12:55:16.436287053 +0100 +@@ -52,13 +52,13 @@ + my @cc_version = + ( + clang => sub { +- return undef unless IPC::Cmd::can_run("$CROSS_COMPILE$CC"); ++ return undef; # unless IPC::Cmd::can_run("$CROSS_COMPILE$CC"); + my $v = `$CROSS_COMPILE$CC -v 2>&1`; + $v =~ m/(?:(?:clang|LLVM) version|.*based on LLVM)\s+([0-9]+\.[0-9]+)/; + return $1; + }, + gnu => sub { +- return undef unless IPC::Cmd::can_run("$CROSS_COMPILE$CC"); ++ return undef; # unless IPC::Cmd::can_run("$CROSS_COMPILE$CC"); + my $nul = File::Spec->devnull(); + my $v = `$CROSS_COMPILE$CC -dumpversion 2> $nul`; + # Strip off whatever prefix egcs prepends the number with. diff --git a/external/openssl/openssl-no-multilib.patch.0 b/external/openssl/openssl-no-multilib.patch.0 index 07c45318ac25..da9adf35785a 100644 --- a/external/openssl/openssl-no-multilib.patch.0 +++ b/external/openssl/openssl-no-multilib.patch.0 @@ -1,15 +1,15 @@ --- Configure.orig 2020-04-21 14:22:39.000000000 +0200 +++ Configure 2020-07-07 17:25:19.256297500 +0200 -@@ -24,7 +24,7 @@ +@@ -27,7 +27,7 @@ my $orig_death_handler = $SIG{__DIE__}; $SIG{__DIE__} = \&death_handler; -my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; +my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [no-multilib] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; - # Options: - # -@@ -59,6 +59,7 @@ + my $banner = <<"EOF"; + +@@ -86,6 +86,7 @@ # If disabled, it also disables shared and dynamic-engine. # no-asm do not use assembler # no-egd do not compile support for the entropy-gathering daemon APIs @@ -17,22 +17,22 @@ # [no-]zlib [don't] compile support for zlib compression. # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared # library and will be loaded in run-time by the OpenSSL library. -@@ -383,6 +384,7 @@ - "mdc2", +@@ -458,6 +459,7 @@ + "module", "msan", "multiblock", + "multilib", "nextprotoneg", - "pinshared", "ocb", -@@ -1754,6 +1756,10 @@ - if (-f catfile($srcdir, "test", $_, "build.info")); - } + "ocsp", +@@ -1907,6 +1909,10 @@ + + my @build_dirs = ( [ ] ); # current directory + if ($disabled{"multilib"}) { + $target{"multilib"} = ""; + } -+ ++ $config{build_infos} = [ ]; - my %ordinals = (); + # We want to detect configdata.pm in the source tree, so we diff --git a/external/openssl/opensslios.patch b/external/openssl/opensslios.patch deleted file mode 100644 index 28af92dd473b..000000000000 --- a/external/openssl/opensslios.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- misc/openssl-0.9.8v/Configure -+++ build/openssl-0.9.8v/Configure -@@ -530,6 +530,9 @@ - # iPhoneOS/iOS - "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - -+##### iOS in the LibreOffice case -+"ios-aarch64","clang:-O3 -fomit-frame-pointer -DL_ENDIAN:::IOS::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${aarch64_asm}:::::", -+ - ##### A/UX - "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", - diff --git a/external/openssl/system-cannot-find-path-for-move.patch.0 b/external/openssl/system-cannot-find-path-for-move.patch.0 new file mode 100644 index 000000000000..421d6b8df2be --- /dev/null +++ b/external/openssl/system-cannot-find-path-for-move.patch.0 @@ -0,0 +1,11 @@ +--- Configurations/windows-makefile.tmpl 2022-09-09 15:18:35.849924899 +0100 ++++ Configurations/windows-makefile.tmpl 2022-09-09 15:20:28.895825331 +0100 +@@ -790,7 +790,7 @@ + return <<"EOF"; + $target: "$gen0" $deps + \$(CPP) $incs $cppflags $defs "$gen0" > \$@.i +- move /Y \$@.i \$@ ++ mv -f \$@.i \$@ + EOF + } elsif ($gen0 =~ m|^.*\.in$|) { + # diff --git a/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk b/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk deleted file mode 100644 index 149becee9209..000000000000 --- a/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk +++ /dev/null @@ -1,23 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,owncloud_android_lib)) - -$(eval $(call gb_ExternalProject_register_targets,owncloud_android_lib,\ - build \ -)) - -$(call gb_ExternalProject_get_state_target,owncloud_android_lib,build) : - $(call gb_Trace_StartRange,owncloud_android_lib,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - ANDROID_HOME=$(ANDROID_SDK_HOME) $(SRCDIR)/android/source/gradlew assemble \ - ) - $(call gb_Trace_EndRange,owncloud_android_lib,EXTERNAL) - -# vim: set noet sw=4 ts=4: diff --git a/external/owncloud-android-lib/Makefile b/external/owncloud-android-lib/Makefile deleted file mode 100644 index e4968cf85fb6..000000000000 --- a/external/owncloud-android-lib/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- - -module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -include $(module_directory)/../../solenv/gbuild/partial_build.mk - -# vim: set noet sw=4 ts=4: diff --git a/external/owncloud-android-lib/Module_owncloud-android-lib.mk b/external/owncloud-android-lib/Module_owncloud-android-lib.mk deleted file mode 100644 index a57e70a79b84..000000000000 --- a/external/owncloud-android-lib/Module_owncloud-android-lib.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -*- 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_Module_Module,owncloud_android_lib)) - -ifneq ($(ENABLE_JAVA),) -$(eval $(call gb_Module_add_targets,owncloud_android_lib, \ - ExternalProject_owncloud_android_lib \ - UnpackedTarball_owncloud_android_lib \ -)) -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/owncloud-android-lib/README b/external/owncloud-android-lib/README deleted file mode 100644 index 921619d630cc..000000000000 --- a/external/owncloud-android-lib/README +++ /dev/null @@ -1,7 +0,0 @@ -Library required to access ownCloud servers from Android. - -Code from https://github.com/jaragunde/owncloud-android-library, release 0.9.4. -Notice it is a fork from the official repository at -https://github.com/owncloud/android-library, the test and example projects have -been removed and the binary jars have been replaced with the sources of the -required libraries. diff --git a/external/owncloud-android-lib/build.gradle b/external/owncloud-android-lib/build.gradle deleted file mode 100644 index 9203dc45a549..000000000000 --- a/external/owncloud-android-lib/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -apply plugin: 'com.android.library' -buildscript { - repositories { - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' - } -} - -allprojects { - repositories { - jcenter() - google() - } -} - -android { - useLibrary 'org.apache.http.legacy' - - compileOptions { - encoding 'ISO8859-1' - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - } - - compileSdkVersion 26 - buildToolsVersion "27.0.3" - - defaultConfig { - minSdkVersion 16 - targetSdkVersion 26 - } - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java { - srcDirs = [ - 'libs/commons-codec-1.9/src/main/java', - 'libs/commons-httpclient-3.1/src/java', - 'libs/jackrabbit-webdav-2.7.2/src/main/java', - 'libs/slf4j-1.7.12/src/java', - 'libs/tomcat-7.0.40/java', - 'src' - ] - } - resources { - srcDirs = [ - 'libs/tomcat-7.0.40/java', - 'libs/jackrabbit-webdav-2.7.2/src/main/java' - ] - } - } - } -} diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index f08ff51a31a3..898cdd12cce1 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_set_include,pdfium,\ -I$(call gb_UnpackedTarball_get_dir,pdfium) \ -I$(call gb_UnpackedTarball_get_dir,pdfium)/third_party \ -I$(call gb_UnpackedTarball_get_dir,pdfium)/third_party/agg23 \ + $(if $(filter TRUE,$(SYSTEM_ABSEIL)),$(ABSEIL_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,pdfium)/third_party/abseil-cpp) \ + $(if $(filter TRUE,$(SYSTEM_OPENJPEG2)),$(OPENJPEG2_CFLAGS)) \ $$(INCLUDE) \ )) @@ -33,20 +35,28 @@ $(eval $(call gb_Library_add_defs,pdfium,\ -DWIN32_LEAN_AND_MEAN \ -DCOMPONENT_BUILD \ )) +ifeq ($(SYSTEM_OPENJPEG2),TRUE) +$(eval $(call gb_Library_add_defs,pdfium,\ + -DUSE_SYSTEM_LIBOPENJPEG2 \ +)) +endif +ifeq ($(SYSTEM_ABSEIL),TRUE) +$(eval $(call gb_Library_add_defs,pdfium,\ + -DUSE_SYSTEM_ABSEIL \ +)) +endif + $(eval $(call gb_Library_set_generated_cxx_suffix,pdfium,cpp)) # pdfium $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annot \ - UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annothandlermgr \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annotiteration \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_baannot \ - UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_baannothandler \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_formfillenvironment \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pageview \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widget \ - UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widgethandler \ UnpackedTarball/pdfium/fpdfsdk/fpdf_dataavail \ UnpackedTarball/pdfium/fpdfsdk/fpdf_ext \ UnpackedTarball/pdfium/fpdfsdk/fpdf_flatten \ @@ -55,10 +65,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/fpdf_structtree \ UnpackedTarball/pdfium/fpdfsdk/fpdf_sysfontinfo \ UnpackedTarball/pdfium/fpdfsdk/fpdf_transformpage \ - UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_actionhandler \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annotiterator \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_customaccess \ - UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_fieldaction \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_filewriteadapter \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_helpers \ UnpackedTarball/pdfium/fpdfsdk/fpdf_annot \ @@ -77,6 +85,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interactiveform \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_renderpage \ UnpackedTarball/pdfium/fpdfsdk/fpdf_signature \ + UnpackedTarball/pdfium/constants/annotation_common \ + UnpackedTarball/pdfium/constants/appearance \ + UnpackedTarball/pdfium/constants/form_fields \ + UnpackedTarball/pdfium/constants/page_object \ + UnpackedTarball/pdfium/constants/stream_dict_common \ + UnpackedTarball/pdfium/constants/transparency \ + UnpackedTarball/pdfium/constants/font_encodings \ )) # fdrm @@ -90,7 +105,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_checkbox \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_combobox \ - UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_formfiller \ + UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_formfield \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_interactiveformfiller \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_listbox \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_pushbutton \ @@ -98,7 +113,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_textfield \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_button \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_textobject \ - UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_privatedata \ + UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_fieldaction \ + UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_perwindowdata \ )) # fpdfapi @@ -233,10 +249,9 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfapi/render/charposlist \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_devicebuffer \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_docrenderdata \ - UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagecacheentry \ - UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imageloader \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_imageloader \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagerenderer \ - UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercache \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageimagecache \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_progressiverenderer \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_rendercontext \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_renderoptions \ @@ -254,7 +269,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfapi/font/cfx_stockfontarray \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cid2unicodemap \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cmap \ - UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cmapmanager \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cmapparser \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_fontglobals \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_tounicodemap \ @@ -282,11 +296,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercontext \ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfuncdib \ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfunc \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_basedcs \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_indexedcs \ + UnpackedTarball/pdfium/core/fpdfapi/parser/object_tree_traversal_util \ )) # fpdfdoc $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/core/fpdfdoc/cline \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_aaction \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_action \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_annot \ @@ -307,18 +323,17 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_nametree \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_numbertree \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_pagelabel \ - UnpackedTarball/pdfium/core/fpdfdoc/cpdf_variabletext \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_viewerpreferences \ UnpackedTarball/pdfium/core/fpdfdoc/cpvt_fontmap \ - UnpackedTarball/pdfium/core/fpdfdoc/cpvt_generateap \ UnpackedTarball/pdfium/core/fpdfdoc/cpvt_wordinfo \ - UnpackedTarball/pdfium/core/fpdfdoc/csection \ - UnpackedTarball/pdfium/core/fpdfdoc/ctypeset \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structelement \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structtree \ - UnpackedTarball/pdfium/core/fpdfdoc/cba_fontmap \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_color_utils \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_icon \ + UnpackedTarball/pdfium/core/fpdfdoc/cpdf_bafontmap \ + UnpackedTarball/pdfium/core/fpdfdoc/cpdf_generateap \ + UnpackedTarball/pdfium/core/fpdfdoc/cpvt_section \ + UnpackedTarball/pdfium/core/fpdfdoc/cpvt_variabletext \ )) # fpdftext @@ -349,7 +364,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_SymbolDict \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_TrdProc \ UnpackedTarball/pdfium/core/fxcodec/gif/cfx_gif \ - UnpackedTarball/pdfium/core/fxcodec/gif/cfx_lzwdecompressor \ + UnpackedTarball/pdfium/core/fxcodec/gif/lzw_decompressor \ UnpackedTarball/pdfium/core/fxcodec/cfx_codec_memory \ UnpackedTarball/pdfium/core/fxcodec/fax/faxmodule \ UnpackedTarball/pdfium/core/fxcodec/scanlinedecoder \ @@ -359,7 +374,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_DocumentContext \ UnpackedTarball/pdfium/core/fxcodec/basic/basicmodule \ UnpackedTarball/pdfium/core/fxcodec/flate/flatemodule \ - UnpackedTarball/pdfium/core/fxcodec/icc/iccmodule \ + UnpackedTarball/pdfium/core/fxcodec/icc/icc_transform \ UnpackedTarball/pdfium/core/fxcodec/jbig2/jbig2_decoder \ UnpackedTarball/pdfium/core/fxcodec/jpeg/jpeg_common \ )) @@ -387,7 +402,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcrt/css/cfx_csscustomproperty \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssdeclaration \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssenumvalue \ - UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssexttextbuf \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssnumbervalue \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_csspropertyholder \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssrulecollection \ @@ -397,33 +411,36 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssstyleselector \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssstylesheet \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_csssyntaxparser \ - UnpackedTarball/pdfium/core/fxcrt/css/cfx_csstextbuf \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssvalue \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssvaluelist \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssvaluelistparser \ + UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssinputtextbuf \ + UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssoutputtextbuf \ UnpackedTarball/pdfium/core/fxcrt/cfx_datetime \ UnpackedTarball/pdfium/core/fxcrt/bytestring \ - UnpackedTarball/pdfium/core/fxcrt/cfx_binarybuf \ UnpackedTarball/pdfium/core/fxcrt/cfx_bitstream \ - UnpackedTarball/pdfium/core/fxcrt/cfx_utf8decoder \ - UnpackedTarball/pdfium/core/fxcrt/cfx_widetextbuf \ UnpackedTarball/pdfium/core/fxcrt/fx_random \ UnpackedTarball/pdfium/core/fxcrt/fx_string \ UnpackedTarball/pdfium/core/fxcrt/widestring \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssdata \ UnpackedTarball/pdfium/core/fxcrt/fx_codepage \ UnpackedTarball/pdfium/core/fxcrt/fx_number \ - UnpackedTarball/pdfium/core/fxcrt/cfx_utf8encoder \ - UnpackedTarball/pdfium/core/fxcrt/cfx_readonlymemorystream \ UnpackedTarball/pdfium/core/fxcrt/observed_ptr \ UnpackedTarball/pdfium/core/fxcrt/string_data_template \ + UnpackedTarball/pdfium/core/fxcrt/binary_buffer \ + UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_span_stream \ + UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_string_stream \ + UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_vector_stream \ + UnpackedTarball/pdfium/core/fxcrt/fx_memory_malloc \ + UnpackedTarball/pdfium/core/fxcrt/widetext_buffer \ + UnpackedTarball/pdfium/core/fxcrt/debug/alias \ + UnpackedTarball/pdfium/core/fxcrt/string_template \ )) # fxge $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/dib/cfx_bitmapcomposer \ UnpackedTarball/pdfium/core/fxge/dib/cfx_bitmapstorer \ - UnpackedTarball/pdfium/core/fxge/dib/cfx_dibextractor \ UnpackedTarball/pdfium/core/fxge/dib/cfx_dibitmap \ UnpackedTarball/pdfium/core/fxge/cfx_drawutils \ UnpackedTarball/pdfium/core/fxge/dib/cfx_imagerenderer \ @@ -432,6 +449,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/dib/cfx_scanlinecompositor \ UnpackedTarball/pdfium/core/fxge/dib/cstretchengine \ UnpackedTarball/pdfium/core/fxge/dib/fx_dib \ + UnpackedTarball/pdfium/core/fxge/dib/blend \ UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitDingbats \ UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixed \ UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBold \ @@ -462,7 +480,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/cfx_gemodule \ UnpackedTarball/pdfium/core/fxge/cfx_graphstate \ UnpackedTarball/pdfium/core/fxge/cfx_graphstatedata \ - UnpackedTarball/pdfium/core/fxge/cfx_pathdata \ + UnpackedTarball/pdfium/core/fxge/cfx_path \ UnpackedTarball/pdfium/core/fxge/cfx_renderdevice \ UnpackedTarball/pdfium/core/fxge/cfx_substfont \ UnpackedTarball/pdfium/core/fxge/cfx_unicodeencoding \ @@ -474,6 +492,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/dib/cfx_cmyk_to_srgb \ UnpackedTarball/pdfium/core/fxge/text_char_pos \ UnpackedTarball/pdfium/core/fxge/cfx_face \ + UnpackedTarball/pdfium/core/fxge/cfx_defaultrenderdevice \ + UnpackedTarball/pdfium/core/fxge/calculate_pitch \ )) # javascript, build with pdf_enable_v8 disabled. @@ -490,9 +510,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_caret \ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_combo_box \ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit \ - UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit_ctrl \ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit_impl \ - UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_icon \ + UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_sbbutton \ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_box \ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_cbbutton \ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_cblistbox \ @@ -503,14 +522,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_wnd \ )) -# third_party/bigint -$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/third_party/bigint/BigInteger \ - UnpackedTarball/pdfium/third_party/bigint/BigIntegerUtils \ - UnpackedTarball/pdfium/third_party/bigint/BigUnsigned \ - UnpackedTarball/pdfium/third_party/bigint/BigUnsignedInABase \ -)) - # third_party/fx_agg $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/third_party/agg23/agg_curves \ @@ -520,54 +531,44 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/third_party/agg23/agg_vcgen_stroke \ )) -# third_party/fx_libopenjpeg -$(eval $(call gb_Library_add_generated_cobjects,pdfium,\ - UnpackedTarball/pdfium/third_party/libopenjpeg20/bio \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/cio \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/dwt \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/event \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/function_list \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/image \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/invert \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/j2k \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/jp2 \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/mct \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/mqc \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/openjpeg \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/opj_clock \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/pi \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/thread \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/t1 \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/t2 \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/tcd \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/tgt \ - UnpackedTarball/pdfium/third_party/libopenjpeg20/sparse_array \ +ifneq ($(SYSTEM_ABSEIL),TRUE) +# third_party/abseil-cpp +$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ + UnpackedTarball/pdfium/third_party/abseil-cpp/absl/types/bad_optional_access \ + UnpackedTarball/pdfium/third_party/abseil-cpp/absl/types/bad_variant_access \ )) +endif -$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/third_party/libopenjpeg20/opj_malloc \ +ifneq ($(SYSTEM_OPENJPEG2),TRUE) +# third_party/fx_libopenjpeg +$(eval $(call gb_Library_add_generated_cobjects,pdfium,\ + UnpackedTarball/pdfium/third_party/libopenjpeg/bio \ + UnpackedTarball/pdfium/third_party/libopenjpeg/cio \ + UnpackedTarball/pdfium/third_party/libopenjpeg/dwt \ + UnpackedTarball/pdfium/third_party/libopenjpeg/event \ + UnpackedTarball/pdfium/third_party/libopenjpeg/function_list \ + UnpackedTarball/pdfium/third_party/libopenjpeg/image \ + UnpackedTarball/pdfium/third_party/libopenjpeg/invert \ + UnpackedTarball/pdfium/third_party/libopenjpeg/j2k \ + UnpackedTarball/pdfium/third_party/libopenjpeg/jp2 \ + UnpackedTarball/pdfium/third_party/libopenjpeg/mct \ + UnpackedTarball/pdfium/third_party/libopenjpeg/mqc \ + UnpackedTarball/pdfium/third_party/libopenjpeg/openjpeg \ + UnpackedTarball/pdfium/third_party/libopenjpeg/opj_clock \ + UnpackedTarball/pdfium/third_party/libopenjpeg/pi \ + UnpackedTarball/pdfium/third_party/libopenjpeg/thread \ + UnpackedTarball/pdfium/third_party/libopenjpeg/t1 \ + UnpackedTarball/pdfium/third_party/libopenjpeg/t2 \ + UnpackedTarball/pdfium/third_party/libopenjpeg/tcd \ + UnpackedTarball/pdfium/third_party/libopenjpeg/tgt \ + UnpackedTarball/pdfium/third_party/libopenjpeg/sparse_array \ + UnpackedTarball/pdfium/third_party/libopenjpeg/ht_dec \ )) -# pdfium_base $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/page_allocator \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/spin_lock \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_alloc \ - UnpackedTarball/pdfium/third_party/base/debug/alias \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/oom_callback \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_bucket \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_oom \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_page \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_root_base \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/random \ - UnpackedTarball/pdfium/third_party/base/memory/aligned_memory \ -)) - -# skia_shared -$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/third_party/skia_shared/SkFloatToDecimal \ + UnpackedTarball/pdfium/third_party/libopenjpeg/opj_malloc \ )) +endif $(eval $(call gb_Library_use_externals,pdfium,\ libjpeg \ @@ -583,6 +584,18 @@ $(eval $(call gb_Library_add_libs,pdfium,\ -lrt \ )) +ifeq ($(SYSTEM_OPENJPEG2),TRUE) +$(eval $(call gb_Library_add_libs,pdfium,\ + $(OPENJPEG2_LIBS) \ +)) +endif + +ifeq ($(SYSTEM_ABSEIL),TRUE) +$(eval $(call gb_Library_add_libs,pdfium,\ + $(ABSEIL_LIBS) \ +)) +endif + $(eval $(call gb_Library_use_external,pdfium,freetype)) $(eval $(call gb_Library_add_defs,pdfium,\ -DDEFINE_PS_TABLES_DATA \ @@ -620,12 +633,14 @@ $(eval $(call gb_Library_add_generated_cobjects,pdfium,\ UnpackedTarball/pdfium/third_party/freetype/src/src/truetype/truetype \ UnpackedTarball/pdfium/third_party/freetype/src/src/type1/type1 \ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftdebug \ + UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftfstype \ )) endif ifneq ($(OS),WNT) $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcrt/cfx_fileaccess_posix \ + UnpackedTarball/pdfium/core/fxcrt/fx_folder_posix \ )) endif @@ -641,9 +656,12 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/win32/cps_printer_driver \ UnpackedTarball/pdfium/core/fxge/win32/ctext_only_printer_driver \ UnpackedTarball/pdfium/core/fxge/win32/cwin32_platform \ + UnpackedTarball/pdfium/core/fxge/win32/cfx_psfonttracker \ UnpackedTarball/pdfium/core/fxge/cfx_windowsrenderdevice \ UnpackedTarball/pdfium/core/fxcrt/cfx_fileaccess_windows \ - UnpackedTarball/pdfium/third_party/base/win/win_util \ + UnpackedTarball/pdfium/core/fxcrt/fx_folder_windows \ + UnpackedTarball/pdfium/core/fxcrt/win/win_util \ + UnpackedTarball/pdfium/core/fxcrt/code_point_view \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_windowsrenderdevice \ )) @@ -660,7 +678,7 @@ ifeq ($(OS),MACOSX) # fxge $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \ - UnpackedTarball/pdfium/core/fxge/apple/fx_mac_impl \ + UnpackedTarball/pdfium/core/fxge/apple/fx_apple_impl \ UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \ )) @@ -670,6 +688,20 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\ )) endif +ifeq ($(OS),iOS) +# fxge +$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ + UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \ + UnpackedTarball/pdfium/core/fxge/apple/fx_apple_impl \ + UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \ +)) + +$(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\ + CoreGraphics \ + CoreFoundation \ +)) +endif + ifeq ($(OS),ANDROID) # fxge $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ @@ -685,7 +717,7 @@ endif ifeq ($(OS),LINUX) # fxge $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/core/fxge/fx_ge_linux \ + UnpackedTarball/pdfium/core/fxge/linux/fx_linux_impl \ )) endif diff --git a/external/pdfium/README b/external/pdfium/README index c1719cf0a152..2be9e8f11b26 100644 --- a/external/pdfium/README +++ b/external/pdfium/README @@ -8,6 +8,10 @@ https://pdfium.googlesource.com/pdfium/ How to update the tarball: version=$(git for-each-ref|grep chromium/|tail -n 1|sed 's|.*/||') +git checkout --track origin/chromium/$version +gclient sync git archive --prefix=pdfium/ --format=tar origin/chromium/${version} > pdfium-${version}.tar (cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/freetype/src/include/ pdfium/third_party/freetype/src/src/) +(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/abseil-cpp/absl/) +(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/build/build_config.h pdfium/build/buildflag.h) bzip2 pdfium-${version}.tar diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 11cd2193bb47..6c5bce9b2e29 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -8,17 +8,15 @@ # pdfium_patches := -pdfium_patches += ubsan.patch # Fixes build on our baseline. pdfium_patches += build.patch.1 # Avoids Windows 8 build dependency. pdfium_patches += windows7.patch.1 pdfium_patches += c++20-comparison.patch -# Work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94141> "c++20 rewritten operator== -# recursive call mixing friend and external operators for template class" in GCC with -# --with-latest-c++: -pdfium_patches += gcc-c++20-comparison.patch +pdfium_patches += constexpr-template.patch + +pdfium_patches += system-abseil.diff $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium)) @@ -30,29 +28,16 @@ $(eval $(call gb_UnpackedTarball_add_patches,pdfium,\ $(foreach patch,$(pdfium_patches),external/pdfium/$(patch)) \ )) -# Upstream build system generates this, but it's not really a generated file. -# Stripped down version from <https://dxr.mozilla.org/mozilla-central/source/ipc/chromium/src/build/build_config.h>. -$(eval $(call gb_UnpackedTarball_add_file,pdfium,build/build_config.h,external/pdfium/configs/build_config.h)) - $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\ mv third_party/bigint/BigInteger.cc third_party/bigint/BigInteger.cpp && \ mv third_party/bigint/BigIntegerUtils.cc third_party/bigint/BigIntegerUtils.cpp && \ mv third_party/bigint/BigUnsigned.cc third_party/bigint/BigUnsigned.cpp && \ mv third_party/bigint/BigUnsignedInABase.cc third_party/bigint/BigUnsignedInABase.cpp && \ - mv third_party/base/allocator/partition_allocator/address_space_randomization.cc third_party/base/allocator/partition_allocator/address_space_randomization.cpp && \ - mv third_party/base/allocator/partition_allocator/page_allocator.cc third_party/base/allocator/partition_allocator/page_allocator.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_alloc.cc third_party/base/allocator/partition_allocator/partition_alloc.cpp && \ - mv third_party/base/allocator/partition_allocator/spin_lock.cc third_party/base/allocator/partition_allocator/spin_lock.cpp && \ - mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp && \ - mv third_party/base/allocator/partition_allocator/oom_callback.cc third_party/base/allocator/partition_allocator/oom_callback.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_bucket.cc third_party/base/allocator/partition_allocator/partition_bucket.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_oom.cc third_party/base/allocator/partition_allocator/partition_oom.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_page.cc third_party/base/allocator/partition_allocator/partition_page.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_root_base.cc third_party/base/allocator/partition_allocator/partition_root_base.cpp && \ - mv third_party/base/allocator/partition_allocator/random.cc third_party/base/allocator/partition_allocator/random.cpp && \ - mv third_party/base/memory/aligned_memory.cc third_party/base/memory/aligned_memory.cpp && \ - mv third_party/base/win/win_util.cc third_party/base/win/win_util.cpp && \ - mv third_party/libopenjpeg20/opj_malloc.cc third_party/libopenjpeg20/opj_malloc.cpp \ + mv core/fxcrt/debug/alias.cc core/fxcrt/debug/alias.cpp && \ + mv core/fxcrt/win/win_util.cc core/fxcrt/win/win_util.cpp && \ + mv third_party/libopenjpeg/opj_malloc.cc third_party/libopenjpeg/opj_malloc.cpp && \ + mv third_party/abseil-cpp/absl/types/bad_optional_access.cc third_party/abseil-cpp/absl/types/bad_optional_access.cpp && \ + mv third_party/abseil-cpp/absl/types/bad_variant_access.cc third_party/abseil-cpp/absl/types/bad_variant_access.cpp \ )) # vim: set noet sw=4 ts=4: diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1 index 9d48b022fae2..1a5a35f1cdc7 100644 --- a/external/pdfium/build.patch.1 +++ b/external/pdfium/build.patch.1 @@ -1,8 +1,9 @@ +-*- Mode: diff -*- diff --git a/core/fpdfdoc/cpdf_metadata.cpp b/core/fpdfdoc/cpdf_metadata.cpp -index 323de4ffc..f11a0b0ad 100644 +index 31564f45f..5858549ef 100644 --- a/core/fpdfdoc/cpdf_metadata.cpp +++ b/core/fpdfdoc/cpdf_metadata.cpp -@@ -74,7 +74,7 @@ std::vector<UnsupportedFeature> CPDF_Metadata::CheckForSharedForm() const { +@@ -87,7 +87,7 @@ std::vector<UnsupportedFeature> CPDF_Metadata::CheckForSharedForm() const { CFX_XMLParser parser(stream); std::unique_ptr<CFX_XMLDocument> doc = parser.Parse(); if (!doc) @@ -10,43 +11,30 @@ index 323de4ffc..f11a0b0ad 100644 + return std::vector<UnsupportedFeature>(); std::vector<UnsupportedFeature> unsupported; - CheckForSharedFormInternal(doc->GetRoot(), &unsupported); -diff --git a/third_party/base/span.h b/third_party/base/span.h -index 0fb627ba8..f71c362e2 100644 ---- a/third_party/base/span.h -+++ b/third_party/base/span.h -@@ -214,7 +214,7 @@ class span { - // Conversions from spans of compatible types: this allows a span<T> to be - // seamlessly used as a span<const T>, but not the other way around. - template <typename U, typename = internal::EnableIfLegalSpanConversion<U, T>> -- constexpr span(const span<U>& other) : span(other.data(), other.size()) {} -+ span(const span<U>& other) : span(other.data(), other.size()) {} - span& operator=(const span& other) noexcept = default; - ~span() noexcept { - if (!size_) { -diff --git a/third_party/base/span.h b/third_party/base/span.h -index 0fb627ba8..dda1fc8bc 100644 ---- a/third_party/base/span.h -+++ b/third_party/base/span.h -@@ -204,7 +204,7 @@ class span { - // size()|. - template <typename Container, - typename = internal::EnableIfSpanCompatibleContainer<Container, T>> -- constexpr span(Container& container) -+ span(Container& container) - : span(container.data(), container.size()) {} - template < - typename Container, -diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp b/core/fxcodec/jpx/cjpx_decoder.cpp -index dbc1b1045..36b72461d 100644 ---- a/core/fxcodec/jpx/cjpx_decoder.cpp -+++ b/core/fxcodec/jpx/cjpx_decoder.cpp -@@ -70,7 +70,7 @@ Optional<OpjImageRgbData> alloc_rgb(size_t size) { - if (!data.b) - return {}; + CheckForSharedFormInternal(/*depth=*/0, doc->GetRoot(), &unsupported); +diff --git a/third_party/libopenjpeg/openjpeg.c b/third_party/libopenjpeg/openjpeg.c +index 9dd4256d7..949d65830 100644 +--- a/third_party/libopenjpeg/openjpeg.c ++++ b/third_party/libopenjpeg/openjpeg.c +@@ -358,7 +358,7 @@ OPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec, + return OPJ_FALSE; + } + +-OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decoder_set_strict_mode(opj_codec_t *p_codec, ++OPJ_BOOL OPJ_CALLCONV opj_decoder_set_strict_mode(opj_codec_t *p_codec, + OPJ_BOOL strict) + { + if (p_codec) { +diff --git a/core/fxge/cfx_face.cpp b/core/fxge/cfx_face.cpp +index 7d9cd0f44..0d0a311aa 100644 +--- a/core/fxge/cfx_face.cpp ++++ b/core/fxge/cfx_face.cpp +@@ -654,7 +654,7 @@ int CFX_Face::GetCharIndex(uint32_t code) { + } -- return data; -+ return std::move(data); + int CFX_Face::GetNameIndex(const char* name) { +- return FT_Get_Name_Index(GetRec(), name); ++ return FT_Get_Name_Index(GetRec(), const_cast<char*>(name)); } - void sycc_to_rgb(int offset, + FX_RECT CFX_Face::GetCharBBox(uint32_t code, int glyph_index) { diff --git a/external/pdfium/c++20-comparison.patch b/external/pdfium/c++20-comparison.patch index 025f9ba010db..d26fe66ad8b7 100644 --- a/external/pdfium/c++20-comparison.patch +++ b/external/pdfium/c++20-comparison.patch @@ -1,13 +1,13 @@ --- core/fxcrt/fx_memory_wrappers.h +++ core/fxcrt/fx_memory_wrappers.h -@@ -70,8 +70,8 @@ +@@ -70,8 +70,8 @@ struct FxPartitionAllocAllocator { } // There's no state, so they are all the same, -- bool operator==(const FxAllocAllocator& that) { return true; } -- bool operator!=(const FxAllocAllocator& that) { return false; } -+ bool operator==(const FxAllocAllocator& that) const { return true; } -+ bool operator!=(const FxAllocAllocator& that) const { return false; } +- bool operator==(const FxPartitionAllocAllocator& that) { return true; } +- bool operator!=(const FxPartitionAllocAllocator& that) { return false; } ++ bool operator==(const FxPartitionAllocAllocator& that) const { return true; } ++ bool operator!=(const FxPartitionAllocAllocator& that) const { return false; } }; - #endif // CORE_FXCRT_FX_MEMORY_WRAPPERS_H_ + // Used to put backing store for std::vector<> and such into the diff --git a/external/pdfium/configs/build_config.h b/external/pdfium/configs/build_config.h deleted file mode 100644 index 22084c0a0836..000000000000 --- a/external/pdfium/configs/build_config.h +++ /dev/null @@ -1,132 +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: */ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file adds defines about the platform we're currently building on. -// Operating System: -// OS_WIN / OS_APPLE / OS_LINUX / OS_POSIX (MACOSX or LINUX) -// Compiler: -// COMPILER_MSVC / COMPILER_GCC -// Processor: -// ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64) -// ARCH_CPU_32_BITS / ARCH_CPU_64_BITS - -#ifndef BUILD_BUILD_CONFIG_H_ -#define BUILD_BUILD_CONFIG_H_ - -// A set of macros to use for platform detection. -#if defined(ANDROID) -#define OS_ANDROID 1 -#define OS_LINUX 1 -#elif defined(__APPLE__) -#define OS_APPLE 1 -#elif defined(__linux__) -#define OS_LINUX 1 -#elif defined(__DragonFly__) -#define OS_DRAGONFLY 1 -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -#define OS_FREEBSD 1 -#elif defined(__NetBSD__) -#define OS_NETBSD 1 -#elif defined(__OpenBSD__) -#define OS_OPENBSD 1 -#elif defined(__sun__) -#define OS_SOLARIS 1 -#elif defined(_WIN32) -#define OS_WIN 1 -#else -#error Please add support for your platform in build/build_config.h -#endif - -// For access to standard BSD features, use OS_BSD instead of a -// more specific macro. -#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD) -#define OS_BSD 1 -#endif - -// For access to standard POSIX features, use OS_POSIX instead of a more -// specific macro. -#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) -#define OS_POSIX 1 -#endif - -// Compiler detection. -#if defined(__GNUC__) -#define COMPILER_GCC 1 -#elif defined(_MSC_VER) -#define COMPILER_MSVC 1 -#else -#error Please add support for your compiler in build/build_config.h -#endif - -// Processor architecture detection. For more info on what's defined, see: -// http://msdn.microsoft.com/en-us/library/b0084kay.aspx -// http://www.agner.org/optimize/calling_conventions.pdf -// or with gcc, run: "echo | gcc -E -dM -" -#if defined(_M_X64) || defined(__x86_64__) -#define ARCH_CPU_X86_FAMILY 1 -#define ARCH_CPU_X86_64 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(_M_IX86) || defined(__i386__) -#define ARCH_CPU_X86_FAMILY 1 -#define ARCH_CPU_X86 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__ARMEL__) -#define ARCH_CPU_ARM_FAMILY 1 -#define ARCH_CPU_ARMEL 1 -#define ARCH_CPU_32_BITS 1 -#define WCHAR_T_IS_UNSIGNED 1 -#elif defined(__powerpc64__) -#define ARCH_CPU_PPC64 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(__ppc__) || defined(__powerpc__) -#define ARCH_CPU_PPC 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__sparc__) && defined(__arch64__) -#define ARCH_CPU_SPARC 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(__sparc__) -#define ARCH_CPU_SPARC 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__mips64) && defined(__LP64__) -#define ARCH_CPU_MIPS 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(__mips__) -#define ARCH_CPU_MIPS 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__hppa__) -#define ARCH_CPU_HPPA 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__ia64__) -#define ARCH_CPU_IA64 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(__s390x__) -#define ARCH_CPU_S390X 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(__s390__) -#define ARCH_CPU_S390 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__sh__) -#define ARCH_CPU_SH 1 -#define ARCH_CPU_32_BITS 1 -#elif defined(__alpha__) -#define ARCH_CPU_ALPHA 1 -#define ARCH_CPU_64_BITS 1 -#elif defined(__aarch64__) || defined(_M_ARM64) -#define ARCH_CPU_ARM_FAMILY 1 -#define ARCH_CPU_ARM64 1 -#define ARCH_CPU_64_BITS 1 -#else -#error Please add support for your architecture in build/build_config.h -#endif - -// Type detection for wchar_t. -#if defined(OS_WIN) -#define WCHAR_T_IS_UTF16 -#else -#define WCHAR_T_IS_UTF32 -#endif - -#endif // BUILD_BUILD_CONFIG_H_ diff --git a/external/pdfium/constexpr-template.patch b/external/pdfium/constexpr-template.patch new file mode 100644 index 000000000000..b83b9f106a32 --- /dev/null +++ b/external/pdfium/constexpr-template.patch @@ -0,0 +1,12 @@ +--- core/fxcodec/jbig2/JBig2_SymbolDict.h ++++ core/fxcodec/jbig2/JBig2_SymbolDict.h +@@ -12,8 +12,7 @@ + #include <vector> + + #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" +- +-class CJBig2_Image; ++#include "core/fxcodec/jbig2/JBig2_Image.h" + + class CJBig2_SymbolDict { + public: diff --git a/external/pdfium/gcc-c++20-comparison.patch b/external/pdfium/gcc-c++20-comparison.patch deleted file mode 100644 index e81cb4fe2aa7..000000000000 --- a/external/pdfium/gcc-c++20-comparison.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- core/fxcrt/retain_ptr.h -+++ core/fxcrt/retain_ptr.h -@@ -135,6 +135,7 @@ - mutable intptr_t m_nRefCount = 0; - }; - -+#if !(defined __GNUC__ && !defined __clang__ && __cplusplus > 201703L) - template <typename T, typename U> - inline bool operator==(const U* lhs, const RetainPtr<T>& rhs) { - return rhs == lhs; -@@ -144,6 +144,7 @@ - inline bool operator!=(const U* lhs, const RetainPtr<T>& rhs) { - return rhs != lhs; - } -+#endif - - } // namespace fxcrt - diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx b/external/pdfium/inc/pch/precompiled_pdfium.hxx index cc82c4555e3a..f3e3330c65f4 100644 --- a/external/pdfium/inc/pch/precompiled_pdfium.hxx +++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx @@ -13,13 +13,14 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-09-21 15:21:21 using: + Generated on 2023-08-15 08:05:49 using: ./bin/update_pch external/pdfium pdfium --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: ./bin/update_pch_bisect ./external/pdfium/inc/pch/precompiled_pdfium.hxx "make external/pdfium.build" --find-conflicts */ +#include <sal/config.h> #if PCH_LEVEL >= 1 #include <agg_curves.h> #include <agg_math.h> @@ -30,28 +31,31 @@ #include <agg_vcgen_stroke.h> #include <algorithm> #include <array> -#include <atomic> #include <cassert> -#include <cctype> #include <cfloat> #include <climits> #include <cmath> -#include <cstring> -#include <cwchar> -#include <cwctype> +#include <ctype.h> #include <functional> #include <iterator> #include <limits.h> #include <limits> #include <list> #include <map> +#include <math.h> #include <memory> +#include <new> #include <numeric> +#include <optional> +#include <ostream> +#include <queue> #include <set> #include <setjmp.h> #include <sstream> #include <stack> +#include <stdarg.h> #include <stddef.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <string> @@ -60,6 +64,7 @@ #include <type_traits> #include <utility> #include <vector> +#include <wchar.h> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 #endif // PCH_LEVEL >= 2 @@ -68,6 +73,9 @@ #include <constants/access_permissions.h> #include <constants/annotation_common.h> #include <constants/annotation_flags.h> +#include <constants/appearance.h> +#include <constants/ascii.h> +#include <constants/font_encodings.h> #include <constants/form_fields.h> #include <constants/form_flags.h> #include <constants/page_object.h> @@ -89,7 +97,6 @@ #include <core/fpdfapi/font/cpdf_cid2unicodemap.h> #include <core/fpdfapi/font/cpdf_cidfont.h> #include <core/fpdfapi/font/cpdf_cmap.h> -#include <core/fpdfapi/font/cpdf_cmapmanager.h> #include <core/fpdfapi/font/cpdf_cmapparser.h> #include <core/fpdfapi/font/cpdf_font.h> #include <core/fpdfapi/font/cpdf_fontencoding.h> @@ -102,6 +109,7 @@ #include <core/fpdfapi/font/cpdf_type3font.h> #include <core/fpdfapi/page/cpdf_allstates.h> #include <core/fpdfapi/page/cpdf_annotcontext.h> +#include <core/fpdfapi/page/cpdf_basedcs.h> #include <core/fpdfapi/page/cpdf_clippath.h> #include <core/fpdfapi/page/cpdf_color.h> #include <core/fpdfapi/page/cpdf_colorspace.h> @@ -120,10 +128,13 @@ #include <core/fpdfapi/page/cpdf_graphicstates.h> #include <core/fpdfapi/page/cpdf_iccprofile.h> #include <core/fpdfapi/page/cpdf_image.h> +#include <core/fpdfapi/page/cpdf_imageloader.h> #include <core/fpdfapi/page/cpdf_imageobject.h> +#include <core/fpdfapi/page/cpdf_indexedcs.h> #include <core/fpdfapi/page/cpdf_meshstream.h> #include <core/fpdfapi/page/cpdf_occontext.h> #include <core/fpdfapi/page/cpdf_page.h> +#include <core/fpdfapi/page/cpdf_pageimagecache.h> #include <core/fpdfapi/page/cpdf_pagemodule.h> #include <core/fpdfapi/page/cpdf_pageobject.h> #include <core/fpdfapi/page/cpdf_pageobjectholder.h> @@ -178,13 +189,11 @@ #include <core/fpdfapi/parser/cpdf_syntax_parser.h> #include <core/fpdfapi/parser/fpdf_parser_decode.h> #include <core/fpdfapi/parser/fpdf_parser_utility.h> +#include <core/fpdfapi/parser/object_tree_traversal_util.h> #include <core/fpdfapi/render/charposlist.h> #include <core/fpdfapi/render/cpdf_devicebuffer.h> #include <core/fpdfapi/render/cpdf_docrenderdata.h> -#include <core/fpdfapi/render/cpdf_imagecacheentry.h> -#include <core/fpdfapi/render/cpdf_imageloader.h> #include <core/fpdfapi/render/cpdf_imagerenderer.h> -#include <core/fpdfapi/render/cpdf_pagerendercache.h> #include <core/fpdfapi/render/cpdf_pagerendercontext.h> #include <core/fpdfapi/render/cpdf_progressiverenderer.h> #include <core/fpdfapi/render/cpdf_rendercontext.h> @@ -196,13 +205,12 @@ #include <core/fpdfapi/render/cpdf_textrenderer.h> #include <core/fpdfapi/render/cpdf_type3cache.h> #include <core/fpdfapi/render/cpdf_type3glyphmap.h> -#include <core/fpdfdoc/cba_fontmap.h> -#include <core/fpdfdoc/cline.h> #include <core/fpdfdoc/cpdf_aaction.h> #include <core/fpdfdoc/cpdf_action.h> #include <core/fpdfdoc/cpdf_annot.h> #include <core/fpdfdoc/cpdf_annotlist.h> #include <core/fpdfdoc/cpdf_apsettings.h> +#include <core/fpdfdoc/cpdf_bafontmap.h> #include <core/fpdfdoc/cpdf_bookmark.h> #include <core/fpdfdoc/cpdf_bookmarktree.h> #include <core/fpdfdoc/cpdf_color_utils.h> @@ -211,6 +219,7 @@ #include <core/fpdfdoc/cpdf_filespec.h> #include <core/fpdfdoc/cpdf_formcontrol.h> #include <core/fpdfdoc/cpdf_formfield.h> +#include <core/fpdfdoc/cpdf_generateap.h> #include <core/fpdfdoc/cpdf_icon.h> #include <core/fpdfdoc/cpdf_iconfit.h> #include <core/fpdfdoc/cpdf_interactiveform.h> @@ -222,14 +231,12 @@ #include <core/fpdfdoc/cpdf_pagelabel.h> #include <core/fpdfdoc/cpdf_structelement.h> #include <core/fpdfdoc/cpdf_structtree.h> -#include <core/fpdfdoc/cpdf_variabletext.h> #include <core/fpdfdoc/cpdf_viewerpreferences.h> #include <core/fpdfdoc/cpvt_fontmap.h> -#include <core/fpdfdoc/cpvt_generateap.h> +#include <core/fpdfdoc/cpvt_section.h> +#include <core/fpdfdoc/cpvt_variabletext.h> #include <core/fpdfdoc/cpvt_word.h> #include <core/fpdfdoc/cpvt_wordinfo.h> -#include <core/fpdfdoc/csection.h> -#include <core/fpdfdoc/ctypeset.h> #include <core/fpdfdoc/ipvt_fontmap.h> #include <core/fpdftext/cpdf_linkextract.h> #include <core/fpdftext/cpdf_textpage.h> @@ -241,8 +248,8 @@ #include <core/fxcodec/flate/flatemodule.h> #include <core/fxcodec/fx_codec.h> #include <core/fxcodec/gif/cfx_gif.h> -#include <core/fxcodec/gif/cfx_lzwdecompressor.h> -#include <core/fxcodec/icc/iccmodule.h> +#include <core/fxcodec/gif/lzw_decompressor.h> +#include <core/fxcodec/icc/icc_transform.h> #include <core/fxcodec/jbig2/JBig2_ArithDecoder.h> #include <core/fxcodec/jbig2/JBig2_ArithIntDecoder.h> #include <core/fxcodec/jbig2/JBig2_BitStream.h> @@ -269,18 +276,23 @@ #include <core/fxcodec/scanlinedecoder.h> #include <core/fxcrt/autonuller.h> #include <core/fxcrt/autorestorer.h> +#include <core/fxcrt/binary_buffer.h> +#include <core/fxcrt/byteorder.h> #include <core/fxcrt/bytestring.h> -#include <core/fxcrt/cfx_binarybuf.h> #include <core/fxcrt/cfx_bitstream.h> #include <core/fxcrt/cfx_datetime.h> -#include <core/fxcrt/cfx_fixedbufgrow.h> #include <core/fxcrt/cfx_memorystream.h> -#include <core/fxcrt/cfx_readonlymemorystream.h> +#include <core/fxcrt/cfx_read_only_span_stream.h> +#include <core/fxcrt/cfx_read_only_string_stream.h> +#include <core/fxcrt/cfx_read_only_vector_stream.h> #include <core/fxcrt/cfx_seekablestreamproxy.h> #include <core/fxcrt/cfx_timer.h> -#include <core/fxcrt/cfx_utf8decoder.h> -#include <core/fxcrt/cfx_utf8encoder.h> -#include <core/fxcrt/cfx_widetextbuf.h> +#include <core/fxcrt/check.h> +#include <core/fxcrt/check_op.h> +#include <core/fxcrt/code_point_view.h> +#include <core/fxcrt/compiler_specific.h> +#include <core/fxcrt/containers/adapters.h> +#include <core/fxcrt/containers/contains.h> #include <core/fxcrt/css/cfx_css.h> #include <core/fxcrt/css/cfx_csscolorvalue.h> #include <core/fxcrt/css/cfx_csscomputedstyle.h> @@ -288,8 +300,9 @@ #include <core/fxcrt/css/cfx_cssdata.h> #include <core/fxcrt/css/cfx_cssdeclaration.h> #include <core/fxcrt/css/cfx_cssenumvalue.h> -#include <core/fxcrt/css/cfx_cssexttextbuf.h> +#include <core/fxcrt/css/cfx_cssinputtextbuf.h> #include <core/fxcrt/css/cfx_cssnumbervalue.h> +#include <core/fxcrt/css/cfx_cssoutputtextbuf.h> #include <core/fxcrt/css/cfx_csspropertyholder.h> #include <core/fxcrt/css/cfx_cssrulecollection.h> #include <core/fxcrt/css/cfx_cssselector.h> @@ -298,15 +311,20 @@ #include <core/fxcrt/css/cfx_cssstyleselector.h> #include <core/fxcrt/css/cfx_cssstylesheet.h> #include <core/fxcrt/css/cfx_csssyntaxparser.h> -#include <core/fxcrt/css/cfx_csstextbuf.h> #include <core/fxcrt/css/cfx_cssvalue.h> #include <core/fxcrt/css/cfx_cssvaluelist.h> #include <core/fxcrt/css/cfx_cssvaluelistparser.h> +#include <core/fxcrt/data_vector.h> +#include <core/fxcrt/debug/alias.h> #include <core/fxcrt/fileaccess_iface.h> +#include <core/fxcrt/fixed_size_data_vector.h> +#include <core/fxcrt/fx_2d_size.h> #include <core/fxcrt/fx_bidi.h> #include <core/fxcrt/fx_codepage.h> #include <core/fxcrt/fx_coordinates.h> #include <core/fxcrt/fx_extension.h> +#include <core/fxcrt/fx_folder.h> +#include <core/fxcrt/fx_memcpy_wrappers.h> #include <core/fxcrt/fx_memory.h> #include <core/fxcrt/fx_memory_wrappers.h> #include <core/fxcrt/fx_number.h> @@ -314,16 +332,32 @@ #include <core/fxcrt/fx_safe_types.h> #include <core/fxcrt/fx_stream.h> #include <core/fxcrt/fx_string.h> +#include <core/fxcrt/fx_string_wrappers.h> #include <core/fxcrt/fx_system.h> #include <core/fxcrt/fx_unicode.h> #include <core/fxcrt/maybe_owned.h> +#include <core/fxcrt/notreached.h> +#include <core/fxcrt/numerics/clamped_math.h> +#include <core/fxcrt/numerics/safe_conversions.h> +#include <core/fxcrt/numerics/safe_math.h> #include <core/fxcrt/observed_ptr.h> #include <core/fxcrt/pauseindicator_iface.h> +#include <core/fxcrt/ptr_util.h> +#include <core/fxcrt/raw_span.h> #include <core/fxcrt/retain_ptr.h> +#include <core/fxcrt/scoped_set_insertion.h> +#include <core/fxcrt/span.h> +#include <core/fxcrt/span_util.h> +#include <core/fxcrt/stl_util.h> #include <core/fxcrt/string_data_template.h> #include <core/fxcrt/string_pool_template.h> +#include <core/fxcrt/string_template.h> +#include <core/fxcrt/string_view_template.h> #include <core/fxcrt/unowned_ptr.h> +#include <core/fxcrt/unowned_ptr_exclusion.h> +#include <core/fxcrt/utf16.h> #include <core/fxcrt/widestring.h> +#include <core/fxcrt/widetext_buffer.h> #include <core/fxcrt/xml/cfx_xmlchardata.h> #include <core/fxcrt/xml/cfx_xmldocument.h> #include <core/fxcrt/xml/cfx_xmlelement.h> @@ -332,6 +366,7 @@ #include <core/fxcrt/xml/cfx_xmlparser.h> #include <core/fxcrt/xml/cfx_xmltext.h> #include <core/fxge/agg/fx_agg_driver.h> +#include <core/fxge/calculate_pitch.h> #include <core/fxge/cfx_cliprgn.h> #include <core/fxge/cfx_color.h> #include <core/fxge/cfx_defaultrenderdevice.h> @@ -348,16 +383,16 @@ #include <core/fxge/cfx_glyphcache.h> #include <core/fxge/cfx_graphstate.h> #include <core/fxge/cfx_graphstatedata.h> -#include <core/fxge/cfx_pathdata.h> +#include <core/fxge/cfx_path.h> #include <core/fxge/cfx_renderdevice.h> #include <core/fxge/cfx_substfont.h> #include <core/fxge/cfx_textrenderoptions.h> #include <core/fxge/cfx_unicodeencoding.h> +#include <core/fxge/dib/blend.h> #include <core/fxge/dib/cfx_bitmapcomposer.h> #include <core/fxge/dib/cfx_bitmapstorer.h> #include <core/fxge/dib/cfx_cmyk_to_srgb.h> #include <core/fxge/dib/cfx_dibbase.h> -#include <core/fxge/dib/cfx_dibextractor.h> #include <core/fxge/dib/cfx_dibitmap.h> #include <core/fxge/dib/cfx_imagerenderer.h> #include <core/fxge/dib/cfx_imagestretcher.h> @@ -367,23 +402,20 @@ #include <core/fxge/dib/fx_dib.h> #include <core/fxge/dib/scanlinecomposer_iface.h> #include <core/fxge/fontdata/chromefontdata/chromefontdata.h> +#include <core/fxge/freetype/fx_freetype.h> #include <core/fxge/fx_font.h> -#include <core/fxge/fx_freetype.h> +#include <core/fxge/fx_fontencoding.h> #include <core/fxge/renderdevicedriver_iface.h> #include <core/fxge/scoped_font_transform.h> #include <core/fxge/systemfontinfo_iface.h> #include <core/fxge/text_char_pos.h> #include <core/fxge/text_glyph_pos.h> -#include <fpdfsdk/cpdfsdk_actionhandler.h> #include <fpdfsdk/cpdfsdk_annot.h> -#include <fpdfsdk/cpdfsdk_annothandlermgr.h> #include <fpdfsdk/cpdfsdk_annotiteration.h> #include <fpdfsdk/cpdfsdk_annotiterator.h> #include <fpdfsdk/cpdfsdk_appstream.h> #include <fpdfsdk/cpdfsdk_baannot.h> -#include <fpdfsdk/cpdfsdk_baannothandler.h> #include <fpdfsdk/cpdfsdk_customaccess.h> -#include <fpdfsdk/cpdfsdk_fieldaction.h> #include <fpdfsdk/cpdfsdk_filewriteadapter.h> #include <fpdfsdk/cpdfsdk_formfillenvironment.h> #include <fpdfsdk/cpdfsdk_helpers.h> @@ -392,35 +424,32 @@ #include <fpdfsdk/cpdfsdk_pauseadapter.h> #include <fpdfsdk/cpdfsdk_renderpage.h> #include <fpdfsdk/cpdfsdk_widget.h> -#include <fpdfsdk/cpdfsdk_widgethandler.h> #include <fpdfsdk/formfiller/cffl_button.h> #include <fpdfsdk/formfiller/cffl_checkbox.h> #include <fpdfsdk/formfiller/cffl_combobox.h> -#include <fpdfsdk/formfiller/cffl_formfiller.h> +#include <fpdfsdk/formfiller/cffl_fieldaction.h> +#include <fpdfsdk/formfiller/cffl_formfield.h> #include <fpdfsdk/formfiller/cffl_interactiveformfiller.h> #include <fpdfsdk/formfiller/cffl_listbox.h> -#include <fpdfsdk/formfiller/cffl_privatedata.h> +#include <fpdfsdk/formfiller/cffl_perwindowdata.h> #include <fpdfsdk/formfiller/cffl_pushbutton.h> #include <fpdfsdk/formfiller/cffl_radiobutton.h> #include <fpdfsdk/formfiller/cffl_textfield.h> #include <fpdfsdk/formfiller/cffl_textobject.h> -#include <fpdfsdk/ipdfsdk_annothandler.h> #include <fpdfsdk/pwl/cpwl_button.h> #include <fpdfsdk/pwl/cpwl_caret.h> #include <fpdfsdk/pwl/cpwl_cbbutton.h> #include <fpdfsdk/pwl/cpwl_cblistbox.h> #include <fpdfsdk/pwl/cpwl_combo_box.h> #include <fpdfsdk/pwl/cpwl_edit.h> -#include <fpdfsdk/pwl/cpwl_edit_ctrl.h> #include <fpdfsdk/pwl/cpwl_edit_impl.h> -#include <fpdfsdk/pwl/cpwl_icon.h> #include <fpdfsdk/pwl/cpwl_list_box.h> #include <fpdfsdk/pwl/cpwl_list_ctrl.h> +#include <fpdfsdk/pwl/cpwl_sbbutton.h> #include <fpdfsdk/pwl/cpwl_scroll_bar.h> #include <fpdfsdk/pwl/cpwl_special_button.h> #include <fpdfsdk/pwl/cpwl_wnd.h> #include <fpdfsdk/pwl/ipwl_fillernotify.h> -#include <fpdfsdk/pwl/ipwl_systemhandler.h> #include <fxjs/cjs_event_context_stub.h> #include <fxjs/cjs_runtimestub.h> #include <fxjs/ijs_event_context.h> @@ -444,6 +473,7 @@ #include <public/fpdf_text.h> #include <public/fpdf_transformpage.h> #include <public/fpdfview.h> +#include <third_party/abseil-cpp/absl/types/variant.h> #include <third_party/agg23/agg_clip_liang_barsky.h> #include <third_party/agg23/agg_conv_dash.h> #include <third_party/agg23/agg_conv_stroke.h> @@ -453,37 +483,6 @@ #include <third_party/agg23/agg_rasterizer_scanline_aa.h> #include <third_party/agg23/agg_renderer_scanline.h> #include <third_party/agg23/agg_scanline_u.h> -#include <third_party/base/allocator/partition_allocator/address_space_randomization.h> -#include <third_party/base/allocator/partition_allocator/oom.h> -#include <third_party/base/allocator/partition_allocator/oom_callback.h> -#include <third_party/base/allocator/partition_allocator/page_allocator.h> -#include <third_party/base/allocator/partition_allocator/page_allocator_internal.h> -#include <third_party/base/allocator/partition_allocator/partition_alloc.h> -#include <third_party/base/allocator/partition_allocator/partition_alloc_check.h> -#include <third_party/base/allocator/partition_allocator/partition_alloc_constants.h> -#include <third_party/base/allocator/partition_allocator/partition_bucket.h> -#include <third_party/base/allocator/partition_allocator/partition_direct_map_extent.h> -#include <third_party/base/allocator/partition_allocator/partition_oom.h> -#include <third_party/base/allocator/partition_allocator/partition_page.h> -#include <third_party/base/allocator/partition_allocator/partition_root_base.h> -#include <third_party/base/allocator/partition_allocator/random.h> -#include <third_party/base/allocator/partition_allocator/spin_lock.h> -#include <third_party/base/bits.h> -#include <third_party/base/check.h> -#include <third_party/base/check_op.h> -#include <third_party/base/compiler_specific.h> -#include <third_party/base/containers/adapters.h> -#include <third_party/base/debug/alias.h> -#include <third_party/base/memory/aligned_memory.h> -#include <third_party/base/no_destructor.h> -#include <third_party/base/notreached.h> -#include <third_party/base/numerics/safe_conversions.h> -#include <third_party/base/numerics/safe_math.h> -#include <third_party/base/optional.h> -#include <third_party/base/ptr_util.h> -#include <third_party/base/span.h> -#include <third_party/base/stl_util.h> -#include <third_party/skia_shared/SkFloatToDecimal.h> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #endif // PCH_LEVEL >= 4 diff --git a/external/pdfium/system-abseil.diff b/external/pdfium/system-abseil.diff new file mode 100644 index 000000000000..841bc8ce9468 --- /dev/null +++ b/external/pdfium/system-abseil.diff @@ -0,0 +1,15 @@ +--- core/fpdfapi/page/cpdf_sampledfunc.cpp 2023-12-15 23:27:10.955659091 +0100 ++++ core/fpdfapi/page/cpdf_sampledfunc.cpp 2023-12-15 23:27:43.420136476 +0100 +@@ -16,8 +16,11 @@ + #include "core/fxcrt/cfx_bitstream.h" + #include "core/fxcrt/fx_memory_wrappers.h" + #include "core/fxcrt/fx_safe_types.h" ++#ifdef USE_SYSTEM_ABSEIL ++#include <absl/container/inlined_vector.h> ++#else + #include "third_party/abseil-cpp/absl/container/inlined_vector.h" +- ++#endif + namespace { + + // See PDF Reference 1.7, page 170, table 3.36. diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch deleted file mode 100644 index 8610e24f2828..000000000000 --- a/external/pdfium/ubsan.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- core/fxcrt/string_data_template.cpp -+++ core/fxcrt/string_data_template.cpp -@@ -82,7 +82,8 @@ void StringDataTemplate<CharType>::CopyContentsAt(size_t offset, - ASSERT(nLen >= 0); - ASSERT(offset + nLen <= m_nAllocLength); - -- memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); -+ if (nLen != 0) -+ memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); - m_String[offset + nLen] = 0; - } - ---- core/fxge/cfx_glyphcache.cpp -+++ core/fxge/cfx_glyphcache.cpp -@@ -183,7 +183,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_GlyphCache::RenderGlyph( - } - } - } else { -- memset(pDestBuf, 0, dest_pitch * bmheight); -+ if (dest_pitch != 0 && bmheight != 0) -+ memset(pDestBuf, 0, dest_pitch * bmheight); - int rowbytes = std::min(abs(src_pitch), dest_pitch); - for (int row = 0; row < bmheight; row++) - memcpy(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch, rowbytes); diff --git a/external/pdfium/windows7.patch.1 b/external/pdfium/windows7.patch.1 index d33f273ff4ca..9c82a8a34d49 100644 --- a/external/pdfium/windows7.patch.1 +++ b/external/pdfium/windows7.patch.1 @@ -1,9 +1,9 @@ -diff --git a/third_party/base/win/win_util.cc b/third_party/base/win/win_util.cc -index ae2dba84d..7a3718848 100644 ---- a/third_party/base/win/win_util.cc -+++ b/third_party/base/win/win_util.cc -@@ -12,28 +12,7 @@ namespace base { - namespace win { +diff --git a/core/fxcrt/win/win_util.cc b/core/fxcrt/win/win_util.cc +index 43e9151d1..76657ac0a 100644 +--- a/core/fxcrt/win/win_util.cc ++++ b/core/fxcrt/win/win_util.cc +@@ -10,28 +10,7 @@ + namespace pdfium { bool IsUser32AndGdi32Available() { - static auto is_user32_and_gdi32_available = []() { @@ -31,4 +31,4 @@ index ae2dba84d..7a3718848 100644 + return true; } - } // namespace win + } // namespace pdfium diff --git a/external/poppler/ExternalPackage_poppler_data.mk b/external/poppler/ExternalPackage_poppler_data.mk new file mode 100644 index 000000000000..b85a73f0e663 --- /dev/null +++ b/external/poppler/ExternalPackage_poppler_data.mk @@ -0,0 +1,297 @@ +# -*- 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_ExternalPackage_ExternalPackage,poppler_data,poppler_data)) + +poppler_unicode-map-files = \ + unicodeMap/Big5 \ + unicodeMap/Big5ascii \ + unicodeMap/EUC-CN \ + unicodeMap/EUC-JP \ + unicodeMap/GBK \ + unicodeMap/ISO-2022-CN \ + unicodeMap/ISO-2022-JP \ + unicodeMap/ISO-2022-KR \ + unicodeMap/ISO-8859-6 \ + unicodeMap/ISO-8859-7 \ + unicodeMap/ISO-8859-8 \ + unicodeMap/ISO-8859-9 \ + unicodeMap/KOI8-R \ + unicodeMap/Latin2 \ + unicodeMap/Shift-JIS \ + unicodeMap/TIS-620 \ + unicodeMap/Windows-1255 + + +poppler_cmap-files = \ + cMap/Adobe-CNS1/Adobe-CNS1-0 \ + cMap/Adobe-CNS1/Adobe-CNS1-1 \ + cMap/Adobe-CNS1/Adobe-CNS1-2 \ + cMap/Adobe-CNS1/Adobe-CNS1-3 \ + cMap/Adobe-CNS1/Adobe-CNS1-4 \ + cMap/Adobe-CNS1/Adobe-CNS1-5 \ + cMap/Adobe-CNS1/Adobe-CNS1-6 \ + cMap/Adobe-CNS1/Adobe-CNS1-7 \ + cMap/Adobe-CNS1/Adobe-CNS1-B5pc \ + cMap/Adobe-CNS1/Adobe-CNS1-ETen-B5 \ + cMap/Adobe-CNS1/Adobe-CNS1-H-CID \ + cMap/Adobe-CNS1/Adobe-CNS1-H-Host \ + cMap/Adobe-CNS1/Adobe-CNS1-H-Mac \ + cMap/Adobe-CNS1/Adobe-CNS1-UCS2 \ + cMap/Adobe-CNS1/B5-H \ + cMap/Adobe-CNS1/B5pc-H \ + cMap/Adobe-CNS1/B5pc-UCS2 \ + cMap/Adobe-CNS1/B5pc-UCS2C \ + cMap/Adobe-CNS1/B5pc-V \ + cMap/Adobe-CNS1/B5-V \ + cMap/Adobe-CNS1/CNS1-H \ + cMap/Adobe-CNS1/CNS1-V \ + cMap/Adobe-CNS1/CNS2-H \ + cMap/Adobe-CNS1/CNS2-V \ + cMap/Adobe-CNS1/CNS-EUC-H \ + cMap/Adobe-CNS1/CNS-EUC-V \ + cMap/Adobe-CNS1/ETen-B5-H \ + cMap/Adobe-CNS1/ETen-B5-UCS2 \ + cMap/Adobe-CNS1/ETen-B5-V \ + cMap/Adobe-CNS1/ETenms-B5-H \ + cMap/Adobe-CNS1/ETenms-B5-V \ + cMap/Adobe-CNS1/ETHK-B5-H \ + cMap/Adobe-CNS1/ETHK-B5-V \ + cMap/Adobe-CNS1/HKdla-B5-H \ + cMap/Adobe-CNS1/HKdla-B5-V \ + cMap/Adobe-CNS1/HKdlb-B5-H \ + cMap/Adobe-CNS1/HKdlb-B5-V \ + cMap/Adobe-CNS1/HKgccs-B5-H \ + cMap/Adobe-CNS1/HKgccs-B5-V \ + cMap/Adobe-CNS1/HKm314-B5-H \ + cMap/Adobe-CNS1/HKm314-B5-V \ + cMap/Adobe-CNS1/HKm471-B5-H \ + cMap/Adobe-CNS1/HKm471-B5-V \ + cMap/Adobe-CNS1/HKscs-B5-H \ + cMap/Adobe-CNS1/HKscs-B5-V \ + cMap/Adobe-CNS1/UCS2-B5pc \ + cMap/Adobe-CNS1/UCS2-ETen-B5 \ + cMap/Adobe-CNS1/UniCNS-UCS2-H \ + cMap/Adobe-CNS1/UniCNS-UCS2-V \ + cMap/Adobe-CNS1/UniCNS-UTF16-H \ + cMap/Adobe-CNS1/UniCNS-UTF16-V \ + cMap/Adobe-CNS1/UniCNS-UTF32-H \ + cMap/Adobe-CNS1/UniCNS-UTF32-V \ + cMap/Adobe-CNS1/UniCNS-UTF8-H \ + cMap/Adobe-CNS1/UniCNS-UTF8-V \ + cMap/Adobe-GB1/Adobe-GB1-0 \ + cMap/Adobe-GB1/Adobe-GB1-1 \ + cMap/Adobe-GB1/Adobe-GB1-2 \ + cMap/Adobe-GB1/Adobe-GB1-3 \ + cMap/Adobe-GB1/Adobe-GB1-4 \ + cMap/Adobe-GB1/Adobe-GB1-5 \ + cMap/Adobe-GB1/Adobe-GB1-GBK-EUC \ + cMap/Adobe-GB1/Adobe-GB1-GBpc-EUC \ + cMap/Adobe-GB1/Adobe-GB1-H-CID \ + cMap/Adobe-GB1/Adobe-GB1-H-Host \ + cMap/Adobe-GB1/Adobe-GB1-H-Mac \ + cMap/Adobe-GB1/Adobe-GB1-UCS2 \ + cMap/Adobe-GB1/GB-EUC-H \ + cMap/Adobe-GB1/GB-EUC-V \ + cMap/Adobe-GB1/GB-H \ + cMap/Adobe-GB1/GB-V \ + cMap/Adobe-GB1/GBK2K-H \ + cMap/Adobe-GB1/GBK2K-V \ + cMap/Adobe-GB1/GBK-EUC-H \ + cMap/Adobe-GB1/GBK-EUC-UCS2 \ + cMap/Adobe-GB1/GBK-EUC-V \ + cMap/Adobe-GB1/GBKp-EUC-H \ + cMap/Adobe-GB1/GBKp-EUC-V \ + cMap/Adobe-GB1/GBpc-EUC-H \ + cMap/Adobe-GB1/GBpc-EUC-UCS2 \ + cMap/Adobe-GB1/GBpc-EUC-UCS2C \ + cMap/Adobe-GB1/GBpc-EUC-V \ + cMap/Adobe-GB1/GBT-EUC-H \ + cMap/Adobe-GB1/GBT-EUC-V \ + cMap/Adobe-GB1/GBT-H \ + cMap/Adobe-GB1/GBT-V \ + cMap/Adobe-GB1/GBTpc-EUC-H \ + cMap/Adobe-GB1/GBTpc-EUC-V \ + cMap/Adobe-GB1/UCS2-GBK-EUC \ + cMap/Adobe-GB1/UCS2-GBpc-EUC \ + cMap/Adobe-GB1/UniGB-UCS2-H \ + cMap/Adobe-GB1/UniGB-UCS2-V \ + cMap/Adobe-GB1/UniGB-UTF16-H \ + cMap/Adobe-GB1/UniGB-UTF16-V \ + cMap/Adobe-GB1/UniGB-UTF32-H \ + cMap/Adobe-GB1/UniGB-UTF32-V \ + cMap/Adobe-GB1/UniGB-UTF8-H \ + cMap/Adobe-GB1/UniGB-UTF8-V \ + cMap/Adobe-Japan1/78-EUC-H \ + cMap/Adobe-Japan1/78-EUC-V \ + cMap/Adobe-Japan1/78-H \ + cMap/Adobe-Japan1/78-RKSJ-H \ + cMap/Adobe-Japan1/78-RKSJ-V \ + cMap/Adobe-Japan1/78-V \ + cMap/Adobe-Japan1/78ms-RKSJ-H \ + cMap/Adobe-Japan1/78ms-RKSJ-V \ + cMap/Adobe-Japan1/83pv-RKSJ-H \ + cMap/Adobe-Japan1/90ms-RKSJ-H \ + cMap/Adobe-Japan1/90ms-RKSJ-UCS2 \ + cMap/Adobe-Japan1/90ms-RKSJ-V \ + cMap/Adobe-Japan1/90msp-RKSJ-H \ + cMap/Adobe-Japan1/90msp-RKSJ-V \ + cMap/Adobe-Japan1/90pv-RKSJ-H \ + cMap/Adobe-Japan1/90pv-RKSJ-UCS2 \ + cMap/Adobe-Japan1/90pv-RKSJ-UCS2C \ + cMap/Adobe-Japan1/90pv-RKSJ-V \ + cMap/Adobe-Japan1/Add-H \ + cMap/Adobe-Japan1/Add-RKSJ-H \ + cMap/Adobe-Japan1/Add-RKSJ-V \ + cMap/Adobe-Japan1/Add-V \ + cMap/Adobe-Japan1/Adobe-Japan1-0 \ + cMap/Adobe-Japan1/Adobe-Japan1-1 \ + cMap/Adobe-Japan1/Adobe-Japan1-2 \ + cMap/Adobe-Japan1/Adobe-Japan1-3 \ + cMap/Adobe-Japan1/Adobe-Japan1-4 \ + cMap/Adobe-Japan1/Adobe-Japan1-5 \ + cMap/Adobe-Japan1/Adobe-Japan1-6 \ + cMap/Adobe-Japan1/Adobe-Japan1-7 \ + cMap/Adobe-Japan1/Adobe-Japan1-90ms-RKSJ \ + cMap/Adobe-Japan1/Adobe-Japan1-90pv-RKSJ \ + cMap/Adobe-Japan1/Adobe-Japan1-H-CID \ + cMap/Adobe-Japan1/Adobe-Japan1-H-Host \ + cMap/Adobe-Japan1/Adobe-Japan1-H-Mac \ + cMap/Adobe-Japan1/Adobe-Japan1-PS-H \ + cMap/Adobe-Japan1/Adobe-Japan1-PS-V \ + cMap/Adobe-Japan1/Adobe-Japan1-UCS2 \ + cMap/Adobe-Japan1/EUC-H \ + cMap/Adobe-Japan1/EUC-V \ + cMap/Adobe-Japan1/Ext-H \ + cMap/Adobe-Japan1/Ext-RKSJ-H \ + cMap/Adobe-Japan1/Ext-RKSJ-V \ + cMap/Adobe-Japan1/Ext-V \ + cMap/Adobe-Japan1/H \ + cMap/Adobe-Japan1/Hankaku \ + cMap/Adobe-Japan1/Hiragana \ + cMap/Adobe-Japan1/Hojo-EUC-H \ + cMap/Adobe-Japan1/Hojo-EUC-V \ + cMap/Adobe-Japan1/Hojo-H \ + cMap/Adobe-Japan1/Hojo-V \ + cMap/Adobe-Japan1/Katakana \ + cMap/Adobe-Japan1/NWP-H \ + cMap/Adobe-Japan1/NWP-V \ + cMap/Adobe-Japan1/RKSJ-H \ + cMap/Adobe-Japan1/RKSJ-V \ + cMap/Adobe-Japan1/Roman \ + cMap/Adobe-Japan1/UCS2-90ms-RKSJ \ + cMap/Adobe-Japan1/UCS2-90pv-RKSJ \ + cMap/Adobe-Japan1/UniHojo-UCS2-H \ + cMap/Adobe-Japan1/UniHojo-UCS2-V \ + cMap/Adobe-Japan1/UniHojo-UTF16-H \ + cMap/Adobe-Japan1/UniHojo-UTF16-V \ + cMap/Adobe-Japan1/UniHojo-UTF32-H \ + cMap/Adobe-Japan1/UniHojo-UTF32-V \ + cMap/Adobe-Japan1/UniHojo-UTF8-H \ + cMap/Adobe-Japan1/UniHojo-UTF8-V \ + cMap/Adobe-Japan1/UniJIS2004-UTF16-H \ + cMap/Adobe-Japan1/UniJIS2004-UTF16-V \ + cMap/Adobe-Japan1/UniJIS2004-UTF32-H \ + cMap/Adobe-Japan1/UniJIS2004-UTF32-V \ + cMap/Adobe-Japan1/UniJIS2004-UTF8-H \ + cMap/Adobe-Japan1/UniJIS2004-UTF8-V \ + cMap/Adobe-Japan1/UniJIS-UCS2-H \ + cMap/Adobe-Japan1/UniJIS-UCS2-HW-H \ + cMap/Adobe-Japan1/UniJIS-UCS2-HW-V \ + cMap/Adobe-Japan1/UniJIS-UCS2-V \ + cMap/Adobe-Japan1/UniJIS-UTF16-H \ + cMap/Adobe-Japan1/UniJIS-UTF16-V \ + cMap/Adobe-Japan1/UniJIS-UTF32-H \ + cMap/Adobe-Japan1/UniJIS-UTF32-V \ + cMap/Adobe-Japan1/UniJIS-UTF8-H \ + cMap/Adobe-Japan1/UniJIS-UTF8-V \ + cMap/Adobe-Japan1/UniJISPro-UCS2-HW-V \ + cMap/Adobe-Japan1/UniJISPro-UCS2-V \ + cMap/Adobe-Japan1/UniJISPro-UTF8-V \ + cMap/Adobe-Japan1/UniJISX0213-UTF32-H \ + cMap/Adobe-Japan1/UniJISX0213-UTF32-V \ + cMap/Adobe-Japan1/UniJISX02132004-UTF32-H \ + cMap/Adobe-Japan1/UniJISX02132004-UTF32-V \ + cMap/Adobe-Japan1/V \ + cMap/Adobe-Japan1/WP-Symbol \ + cMap/Adobe-Japan2/Adobe-Japan2-0 \ + cMap/Adobe-Korea1/Adobe-Korea1-0 \ + cMap/Adobe-Korea1/Adobe-Korea1-1 \ + cMap/Adobe-Korea1/Adobe-Korea1-2 \ + cMap/Adobe-Korea1/Adobe-Korea1-H-CID \ + cMap/Adobe-Korea1/Adobe-Korea1-H-Host \ + cMap/Adobe-Korea1/Adobe-Korea1-H-Mac \ + cMap/Adobe-Korea1/Adobe-Korea1-KSCms-UHC \ + cMap/Adobe-Korea1/Adobe-Korea1-KSCpc-EUC \ + cMap/Adobe-Korea1/Adobe-Korea1-UCS2 \ + cMap/Adobe-Korea1/KSC-EUC-H \ + cMap/Adobe-Korea1/KSC-EUC-V \ + cMap/Adobe-Korea1/KSC-H \ + cMap/Adobe-Korea1/KSC-Johab-H \ + cMap/Adobe-Korea1/KSC-Johab-V \ + cMap/Adobe-Korea1/KSC-V \ + cMap/Adobe-Korea1/KSCms-UHC-H \ + cMap/Adobe-Korea1/KSCms-UHC-HW-H \ + cMap/Adobe-Korea1/KSCms-UHC-HW-V \ + cMap/Adobe-Korea1/KSCms-UHC-UCS2 \ + cMap/Adobe-Korea1/KSCms-UHC-V \ + cMap/Adobe-Korea1/KSCpc-EUC-H \ + cMap/Adobe-Korea1/KSCpc-EUC-UCS2 \ + cMap/Adobe-Korea1/KSCpc-EUC-UCS2C \ + cMap/Adobe-Korea1/KSCpc-EUC-V \ + cMap/Adobe-Korea1/UCS2-KSCms-UHC \ + cMap/Adobe-Korea1/UCS2-KSCpc-EUC \ + cMap/Adobe-Korea1/UniKS-UCS2-H \ + cMap/Adobe-Korea1/UniKS-UCS2-V \ + cMap/Adobe-Korea1/UniKS-UTF16-H \ + cMap/Adobe-Korea1/UniKS-UTF16-V \ + cMap/Adobe-Korea1/UniKS-UTF32-H \ + cMap/Adobe-Korea1/UniKS-UTF32-V \ + cMap/Adobe-Korea1/UniKS-UTF8-H \ + cMap/Adobe-Korea1/UniKS-UTF8-V \ + cMap/Adobe-KR/Adobe-KR-0 \ + cMap/Adobe-KR/Adobe-KR-1 \ + cMap/Adobe-KR/Adobe-KR-2 \ + cMap/Adobe-KR/Adobe-KR-3 \ + cMap/Adobe-KR/Adobe-KR-4 \ + cMap/Adobe-KR/Adobe-KR-5 \ + cMap/Adobe-KR/Adobe-KR-6 \ + cMap/Adobe-KR/Adobe-KR-7 \ + cMap/Adobe-KR/Adobe-KR-8 \ + cMap/Adobe-KR/Adobe-KR-9 \ + cMap/Adobe-KR/Adobe-KR-UCS2 \ + cMap/Adobe-KR/UniAKR-UTF16-H \ + cMap/Adobe-KR/UniAKR-UTF32-H \ + cMap/Adobe-KR/UniAKR-UTF8-H + +poppler_name-to-unicode-files = \ + nameToUnicode/Bulgarian \ + nameToUnicode/Greek \ + nameToUnicode/Thai + +poppler_cid-to-unicode-files = \ + cidToUnicode/Adobe-CNS1 \ + cidToUnicode/Adobe-GB1 \ + cidToUnicode/Adobe-Japan1 \ + cidToUnicode/Adobe-Korea1 + +poppler_DISTFILES = \ + README \ + COPYING \ + COPYING.adobe \ + COPYING.gpl2 \ + $(poppler_unicode-map-files) \ + $(poppler_cmap-files) \ + $(poppler_name-to-unicode-files) \ + $(poppler_cid-to-unicode-files) + +$(eval $(call gb_ExternalPackage_add_unpacked_files_with_dir,poppler_data,$(LIBO_SHARE_FOLDER)/xpdfimport/poppler_data,\ + $(poppler_DISTFILES))) + +# vim: set noet sw=4 ts=4: diff --git a/external/poppler/Module_poppler.mk b/external/poppler/Module_poppler.mk index ebae6e7aaddd..a35bae436a6d 100644 --- a/external/poppler/Module_poppler.mk +++ b/external/poppler/Module_poppler.mk @@ -12,6 +12,8 @@ $(eval $(call gb_Module_Module,poppler)) $(eval $(call gb_Module_add_targets,poppler,\ StaticLibrary_poppler \ UnpackedTarball_poppler \ + ExternalPackage_poppler_data \ + UnpackedTarball_poppler_data \ )) # vim: set noet sw=4 ts=4: diff --git a/external/poppler/README b/external/poppler/README index 35a640264618..08d3612c3542 100644 --- a/external/poppler/README +++ b/external/poppler/README @@ -1 +1 @@ -From [http://poppler.freedesktop.org/]. Not modified. PDF rendering library based on the xpdf-3.0 code base. +From [https://poppler.freedesktop.org/]. Not modified. PDF rendering library based on the xpdf-3.0 code base. diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk index 3cc0a95e3617..726663d983a4 100644 --- a/external/poppler/StaticLibrary_poppler.mk +++ b/external/poppler/StaticLibrary_poppler.mk @@ -11,7 +11,12 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,poppler)) $(eval $(call gb_StaticLibrary_use_unpacked,poppler,poppler)) -$(eval $(call gb_StaticLibrary_use_external,poppler,libjpeg)) +$(eval $(call gb_StaticLibrary_set_precompiled_header,poppler,external/poppler/inc/pch/precompiled_poppler)) + +$(eval $(call gb_StaticLibrary_use_externals,poppler,\ + libjpeg \ + zlib \ +)) $(eval $(call gb_StaticLibrary_set_warnings_disabled,poppler)) @@ -53,25 +58,28 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,poppler,\ )) $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ + UnpackedTarball/poppler/goo/gbase64 \ + UnpackedTarball/poppler/goo/gbasename \ UnpackedTarball/poppler/goo/gfile \ - UnpackedTarball/poppler/goo/GooTimer \ + UnpackedTarball/poppler/goo/glibc \ + UnpackedTarball/poppler/goo/glibc_strtok_r \ + UnpackedTarball/poppler/goo/grandom \ + UnpackedTarball/poppler/goo/gstrtod \ UnpackedTarball/poppler/goo/GooString \ + UnpackedTarball/poppler/goo/GooTimer \ + UnpackedTarball/poppler/goo/ImgWriter \ + UnpackedTarball/poppler/goo/JpegWriter \ UnpackedTarball/poppler/goo/NetPBMWriter \ UnpackedTarball/poppler/goo/PNGWriter \ UnpackedTarball/poppler/goo/TiffWriter \ - UnpackedTarball/poppler/goo/JpegWriter \ - UnpackedTarball/poppler/goo/ImgWriter \ - UnpackedTarball/poppler/goo/gstrtod \ - UnpackedTarball/poppler/goo/grandom \ - UnpackedTarball/poppler/goo/glibc \ - UnpackedTarball/poppler/goo/glibc_strtok_r \ UnpackedTarball/poppler/fofi/FoFiBase \ UnpackedTarball/poppler/fofi/FoFiEncodings \ + UnpackedTarball/poppler/fofi/FoFiIdentifier \ UnpackedTarball/poppler/fofi/FoFiTrueType \ UnpackedTarball/poppler/fofi/FoFiType1 \ UnpackedTarball/poppler/fofi/FoFiType1C \ - UnpackedTarball/poppler/fofi/FoFiIdentifier \ UnpackedTarball/poppler/poppler/Annot \ + UnpackedTarball/poppler/poppler/AnnotStampImageHelper \ UnpackedTarball/poppler/poppler/Array \ UnpackedTarball/poppler/poppler/BBoxOutputDev \ UnpackedTarball/poppler/poppler/CachedFile \ @@ -79,63 +87,79 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/CertificateInfo \ UnpackedTarball/poppler/poppler/CharCodeToUnicode \ UnpackedTarball/poppler/poppler/CMap \ + UnpackedTarball/poppler/poppler/DCTStream \ UnpackedTarball/poppler/poppler/DateInfo \ UnpackedTarball/poppler/poppler/Decrypt \ UnpackedTarball/poppler/poppler/Dict \ UnpackedTarball/poppler/poppler/Error \ + UnpackedTarball/poppler/poppler/FDPDFDocBuilder \ + UnpackedTarball/poppler/poppler/FILECacheLoader \ UnpackedTarball/poppler/poppler/FileSpec \ + UnpackedTarball/poppler/poppler/FlateEncoder \ UnpackedTarball/poppler/poppler/FontEncodingTables \ - UnpackedTarball/poppler/poppler/Form \ UnpackedTarball/poppler/poppler/FontInfo \ + UnpackedTarball/poppler/poppler/Form \ UnpackedTarball/poppler/poppler/Function \ UnpackedTarball/poppler/poppler/Gfx \ UnpackedTarball/poppler/poppler/GfxFont \ UnpackedTarball/poppler/poppler/GfxState \ UnpackedTarball/poppler/poppler/GlobalParams \ UnpackedTarball/poppler/poppler/Hints \ + UnpackedTarball/poppler/poppler/ImageEmbeddingUtils \ UnpackedTarball/poppler/poppler/JArithmeticDecoder \ UnpackedTarball/poppler/poppler/JBIG2Stream \ UnpackedTarball/poppler/poppler/JSInfo \ UnpackedTarball/poppler/poppler/Lexer \ - UnpackedTarball/poppler/poppler/Link \ UnpackedTarball/poppler/poppler/Linearization \ + UnpackedTarball/poppler/poppler/Link \ UnpackedTarball/poppler/poppler/LocalPDFDocBuilder \ UnpackedTarball/poppler/poppler/MarkedContentOutputDev \ + UnpackedTarball/poppler/poppler/Movie \ UnpackedTarball/poppler/poppler/NameToCharCode \ UnpackedTarball/poppler/poppler/Object \ UnpackedTarball/poppler/poppler/OptionalContent \ UnpackedTarball/poppler/poppler/Outline \ UnpackedTarball/poppler/poppler/OutputDev \ UnpackedTarball/poppler/poppler/Page \ + UnpackedTarball/poppler/poppler/PageLabelInfo \ UnpackedTarball/poppler/poppler/PageTransition \ UnpackedTarball/poppler/poppler/Parser \ UnpackedTarball/poppler/poppler/PDFDoc \ UnpackedTarball/poppler/poppler/PDFDocBuilder \ UnpackedTarball/poppler/poppler/PDFDocEncoding \ UnpackedTarball/poppler/poppler/PDFDocFactory \ - UnpackedTarball/poppler/poppler/ProfileData \ UnpackedTarball/poppler/poppler/PreScanOutputDev \ + UnpackedTarball/poppler/poppler/ProfileData \ + UnpackedTarball/poppler/poppler/PSOutputDev \ UnpackedTarball/poppler/poppler/PSTokenizer \ + UnpackedTarball/poppler/poppler/Rendition \ + UnpackedTarball/poppler/poppler/SecurityHandler \ UnpackedTarball/poppler/poppler/SignatureInfo \ + UnpackedTarball/poppler/poppler/Sound \ + UnpackedTarball/poppler/poppler/SplashOutputDev \ UnpackedTarball/poppler/poppler/Stream \ - UnpackedTarball/poppler/poppler/StructTreeRoot \ UnpackedTarball/poppler/poppler/StructElement \ + UnpackedTarball/poppler/poppler/StructTreeRoot \ + UnpackedTarball/poppler/poppler/TextOutputDev \ + UnpackedTarball/poppler/poppler/UTF \ UnpackedTarball/poppler/poppler/UnicodeMap \ UnpackedTarball/poppler/poppler/UnicodeMapFuncs \ UnpackedTarball/poppler/poppler/UnicodeTypeTable \ - UnpackedTarball/poppler/poppler/UTF \ - UnpackedTarball/poppler/poppler/XRef \ - UnpackedTarball/poppler/poppler/PSOutputDev \ - UnpackedTarball/poppler/poppler/TextOutputDev \ - UnpackedTarball/poppler/poppler/PageLabelInfo \ - UnpackedTarball/poppler/poppler/SecurityHandler \ - UnpackedTarball/poppler/poppler/StdinCachedFile \ - UnpackedTarball/poppler/poppler/StdinPDFDocBuilder \ - UnpackedTarball/poppler/poppler/Sound \ UnpackedTarball/poppler/poppler/ViewerPreferences \ - UnpackedTarball/poppler/poppler/Movie \ - UnpackedTarball/poppler/poppler/Rendition \ - UnpackedTarball/poppler/poppler/DCTStream \ + UnpackedTarball/poppler/poppler/XRef \ + UnpackedTarball/poppler/splash/Splash \ + UnpackedTarball/poppler/splash/SplashBitmap \ + UnpackedTarball/poppler/splash/SplashClip \ + UnpackedTarball/poppler/splash/SplashFont \ + UnpackedTarball/poppler/splash/SplashFontEngine \ + UnpackedTarball/poppler/splash/SplashFontFile \ + UnpackedTarball/poppler/splash/SplashFontFileID \ + UnpackedTarball/poppler/splash/SplashPath \ + UnpackedTarball/poppler/splash/SplashPattern \ + UnpackedTarball/poppler/splash/SplashScreen \ + UnpackedTarball/poppler/splash/SplashState \ + UnpackedTarball/poppler/splash/SplashXPath \ + UnpackedTarball/poppler/splash/SplashXPathScanner \ )) # vim: set noet sw=4 ts=4: diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index 68fd06d9403b..c6ddbf9785d3 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -11,8 +11,20 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,poppler)) $(eval $(call gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler)) +$(eval $(call gb_UnpackedTarball_set_patchlevel,poppler,0)) + $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ + external/poppler/char_traits.patch \ + external/poppler/disable-freetype.patch.1 \ + external/poppler/disable-nss-and-gpgmepp.patch.1 \ external/poppler/poppler-config.patch.1 \ + external/poppler/pch.patch.0 \ +)) + +ifneq ($(filter -fsanitize=%,$(CC)),) +$(eval $(call gb_UnpackedTarball_add_patches,poppler, \ + external/poppler/sanitizer.patch \ )) +endif # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_sourcecode.mk b/external/poppler/UnpackedTarball_poppler_data.mk index 7040e9b185ba..e0357df5a182 100644 --- a/external/more_fonts/UnpackedTarball_sourcecode.mk +++ b/external/poppler/UnpackedTarball_poppler_data.mk @@ -7,8 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_sourcecode)) - -$(eval $(call gb_UnpackedTarball_set_tarball,font_sourcecode,$(FONT_SOURCECODE_TARBALL))) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,poppler_data)) +$(eval $(call gb_UnpackedTarball_set_tarball,poppler_data,$(POPPLER_DATA_TARBALL),,poppler_data)) # vim: set noet sw=4 ts=4: diff --git a/external/poppler/char_traits.patch b/external/poppler/char_traits.patch new file mode 100644 index 000000000000..3483f2fe22d8 --- /dev/null +++ b/external/poppler/char_traits.patch @@ -0,0 +1,11 @@ +--- cpp/poppler-global.h ++++ cpp/poppler-global.h +@@ -98,7 +98,7 @@ + # pragma warning(push) + # pragma warning(disable : 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */ + #endif +-class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short> ++class POPPLER_CPP_EXPORT ustring : public std::u16string + { + public: + ustring(); diff --git a/external/poppler/disable-freetype.patch.1 b/external/poppler/disable-freetype.patch.1 new file mode 100644 index 000000000000..d12374f088f9 --- /dev/null +++ b/external/poppler/disable-freetype.patch.1 @@ -0,0 +1,109 @@ +disable freetype dependent code + +--- poppler/poppler/Form.cc.orig 2023-06-05 19:29:14.000000000 +0900 ++++ poppler/poppler/Form.cc 2023-06-14 18:50:22.232312300 +0900 +@@ -48,7 +48,7 @@ + #include <cstdlib> + #include <cstring> + #include <cctype> +-#include "goo/ft_utils.h" ++//#include "goo/ft_utils.h" + #include "goo/gmem.h" + #include "goo/gfile.h" + #include "goo/GooString.h" +@@ -78,8 +78,8 @@ + #include "fofi/FoFiTrueType.h" + #include "fofi/FoFiIdentifier.h" + +-#include <ft2build.h> +-#include FT_FREETYPE_H ++//#include <ft2build.h> ++//#include FT_FREETYPE_H + #include <unordered_set> + + // helper for using std::visit to get a dependent false for static_asserts +@@ -2760,6 +2760,8 @@ + + Form::AddFontResult Form::addFontToDefaultResources(const std::string &filepath, int faceIndex, const std::string &fontFamily, const std::string &fontStyle, bool forceName) + { ++ return {}; ++#if 0 + if (!GooString::endsWith(filepath, ".ttf") && !GooString::endsWith(filepath, ".ttc") && !GooString::endsWith(filepath, ".otf")) { + error(errIO, -1, "We only support embedding ttf/ttc/otf fonts for now. The font file for {0:s} {1:s} was {2:s}", fontFamily.c_str(), fontStyle.c_str(), filepath.c_str()); + return {}; +@@ -2994,6 +2996,7 @@ + } + + return { dictFontName, fontDictRef }; ++#endif + } + + std::string Form::getFallbackFontForChar(Unicode uChar, const GfxFont &fontToEmulate) const +--- poppler/splash/SplashFontEngine.cc.orig 2024-02-21 01:28:10.479645185 +0000 ++++ popller/splash/SplashFontEngine.cc 2023-09-05 22:15:14.000000000 +0100 +@@ -66,9 +66,9 @@ + delete font; + } + +- if (ftEngine) { +- delete ftEngine; +- } ++ //if (ftEngine) { ++ // delete ftEngine; ++ //} + } + + SplashFontFile *SplashFontEngine::getFontFile(SplashFontFileID *id) +--- poppler/splash/SplashFTFontEngine.h.orig 2023-09-05 22:15:14.000000000 +0100 ++++ poppler/splash/SplashFTFontEngine.h 2024-02-21 13:53:29.715423742 +0000 +@@ -26,8 +26,8 @@ + #ifndef SPLASHFTFONTENGINE_H + #define SPLASHFTFONTENGINE_H + +-#include <ft2build.h> +-#include FT_FREETYPE_H ++//#include <ft2build.h> ++//#include FT_FREETYPE_H + + class SplashFontFile; + class SplashFontFileID; +@@ -40,7 +40,7 @@ + class SplashFTFontEngine + { + public: +- static SplashFTFontEngine *init(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHinting); ++ static SplashFTFontEngine *init(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHinting) { return nullptr; }; + + ~SplashFTFontEngine(); + +@@ -48,22 +48,22 @@ + SplashFTFontEngine &operator=(const SplashFTFontEngine &) = delete; + + // Load fonts. +- SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, const char **enc); +- SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc); +- SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc); +- SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src); +- SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen); +- SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex = 0); ++ SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, const char **enc) { return nullptr; }; ++ SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc) { return nullptr; }; ++ SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc) { return nullptr; }; ++ SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src) { return nullptr; }; ++ SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen) { return nullptr; }; ++ SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex = 0) { return nullptr; }; + bool getAA() { return aa; } + void setAA(bool aaA) { aa = aaA; } + + private: +- SplashFTFontEngine(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHintingA, FT_Library libA); ++ //SplashFTFontEngine(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHintingA, FT_Library libA); + + bool aa; + bool enableFreeTypeHinting; + bool enableSlightHinting; +- FT_Library lib; ++ //FT_Library lib; + + friend class SplashFTFontFile; + friend class SplashFTFont; diff --git a/external/poppler/disable-nss-and-gpgmepp.patch.1 b/external/poppler/disable-nss-and-gpgmepp.patch.1 new file mode 100644 index 000000000000..1d7f7f933433 --- /dev/null +++ b/external/poppler/disable-nss-and-gpgmepp.patch.1 @@ -0,0 +1,78 @@ +disable NSS/GPGMEPP dependent code. + +--- poppler/poppler/Form.cc.orig 2023-06-05 19:29:14.000000000 +0900 ++++ poppler/poppler/Form.cc 2023-06-17 16:51:27.873431500 +0900 +@@ -64,7 +64,7 @@ + #include "Form.h" + #include "PDFDoc.h" + #include "DateInfo.h" +-#include "CryptoSignBackend.h" ++/*#include "CryptoSignBackend.h"*/ + #include "SignatureInfo.h" + #include "CertificateInfo.h" + #include "XRef.h" +@@ -578,7 +578,7 @@ + { + return static_cast<FormFieldSignature *>(field)->validateSignature(doVerifyCert, forceRevalidation, validationTime, ocspRevocationCheck, enableAIA); + } +- ++#if 0 + // update hash with the specified range of data from the file + static bool hashFileRange(FILE *f, CryptoSign::SigningInterface *handler, Goffset start, Goffset end) + { +@@ -608,10 +608,12 @@ + delete[] buf; + return true; + } ++#endif + + bool FormWidgetSignature::signDocument(const std::string &saveFilename, const std::string &certNickname, const std::string &password, const GooString *reason, const GooString *location, const std::optional<GooString> &ownerPassword, + const std::optional<GooString> &userPassword) + { ++#if 0 + auto backend = CryptoSign::Factory::createActive(); + if (!backend) { + return false; +@@ -697,8 +699,8 @@ + signatureField->setSignature(*signature); + + fclose(file); +- +- return true; ++#endif ++ return false; + } + + static std::tuple<double, double> calculateDxDy(int rot, const PDFRectangle *rect) +@@ -2355,6 +2357,7 @@ + + void FormFieldSignature::hashSignedDataBlock(CryptoSign::VerificationInterface *handler, Goffset block_len) + { ++#if 0 + if (!handler) { + return; + } +@@ -2374,6 +2377,7 @@ + i += BLOCK_SIZE; + } + } ++#endif + } + + FormSignatureType FormWidgetSignature::signatureType() const +@@ -2388,6 +2392,7 @@ + + SignatureInfo *FormFieldSignature::validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime, bool ocspRevocationCheck, bool enableAIA) + { ++#if 0 + auto backend = CryptoSign::Factory::createActive(); + if (!backend) { + return signature_info; +@@ -2464,6 +2469,7 @@ + const CertificateValidationStatus cert_val_state = signature_handler->validateCertificate(std::chrono::system_clock::from_time_t(validationTime), ocspRevocationCheck, enableAIA); + signature_info->setCertificateValStatus(cert_val_state); + ++#endif + return signature_info; + } + diff --git a/external/poppler/inc/pch/precompiled_poppler.cxx b/external/poppler/inc/pch/precompiled_poppler.cxx new file mode 100644 index 000000000000..5b97c67a777a --- /dev/null +++ b/external/poppler/inc/pch/precompiled_poppler.cxx @@ -0,0 +1,12 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +#include "precompiled_poppler.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/external/poppler/inc/pch/precompiled_poppler.hxx b/external/poppler/inc/pch/precompiled_poppler.hxx new file mode 100644 index 000000000000..50944b80daef --- /dev/null +++ b/external/poppler/inc/pch/precompiled_poppler.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +/* + This file has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2023-06-18 21:15:26 using: + ./bin/update_pch external/poppler poppler --cutoff=1 --exclude:system --include:module --include:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./external/poppler/inc/pch/precompiled_poppler.hxx "make external/poppler.build" --find-conflicts +*/ + +#include <sal/config.h> +#if PCH_LEVEL >= 1 +#include <Object.h> +#include <algorithm> +#include <annot_stamp_approved.h> +#include <annot_stamp_as_is.h> +#include <annot_stamp_confidential.h> +#include <annot_stamp_departmental.h> +#include <annot_stamp_draft.h> +#include <annot_stamp_experimental.h> +#include <annot_stamp_expired.h> +#include <annot_stamp_final.h> +#include <annot_stamp_for_comment.h> +#include <annot_stamp_for_public_release.h> +#include <annot_stamp_not_approved.h> +#include <annot_stamp_not_for_public_release.h> +#include <annot_stamp_sold.h> +#include <annot_stamp_top_secret.h> +#include <array> +#include <cassert> +#include <cctype> +#include <cerrno> +#include <cfloat> +#include <climits> +#include <clocale> +#include <cmath> +#include <config.h> +#include <csignal> +#include <cstdarg> +#include <cstddef> +#include <cstdint> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <ctime> +#include <gbase64.h> +#include <gbasename.h> +#include <gdir.h> +#include <gfile.h> +#include <glibc.h> +#include <gmem.h> +#include <grandom.h> +#include <gstrtod.h> +#include <iomanip> +#include <iostream> +#include <limits> +#include <memory> +#include <poppler-config.h> +#include <random> +#include <regex> +#include <set> +#include <sstream> +#include <vector> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <fofi/FoFiIdentifier.h> +#include <fofi/FoFiTrueType.h> +#include <fofi/FoFiType1.h> +#include <fofi/FoFiType1C.h> +#include <goo/GooCheckedOps.h> +#include <goo/GooLikely.h> +#include <goo/GooString.h> +#include <goo/GooTimer.h> +#include <goo/ImgWriter.h> +#include <goo/JpegWriter.h> +#include <goo/PNGWriter.h> +#include <goo/TiffWriter.h> +#include <goo/gdir.h> +#include <goo/gfile.h> +#include <goo/glibc.h> +#include <goo/gmem.h> +#include <goo/grandom.h> +#include <goo/gstrtod.h> +#include <poppler/Error.h> +#include <poppler/GfxState.h> +#include <poppler/GfxState_helpers.h> +#include <splash/Splash.h> +#include <splash/SplashBitmap.h> +#include <splash/SplashTypes.h> +#include <sys/stat.h> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/external/poppler/pch.patch.0 b/external/poppler/pch.patch.0 new file mode 100644 index 000000000000..9ffeeb8421f5 --- /dev/null +++ b/external/poppler/pch.patch.0 @@ -0,0 +1,11 @@ +--- ./goo/gdir.h.sav 2021-01-02 17:54:42.000000000 +0100 ++++ ./goo/gdir.h 2021-11-03 15:16:04.306277081 +0100 +@@ -37,6 +37,8 @@ + + #include <memory> + ++#include "gfile.h" ++ + class GooString; + + #if defined(_WIN32) diff --git a/external/poppler/poppler-config.patch.1 b/external/poppler/poppler-config.patch.1 index b902402ea4e7..3604b1c16246 100644 --- a/external/poppler/poppler-config.patch.1 +++ b/external/poppler/poppler-config.patch.1 @@ -2,7 +2,7 @@ note: to get the 3rd one, use -DENABLE_CPP=on -mkdir build && cd build && cmake .. -DENABLE_DCTDECODER=libjpeg -DHAVE_CAIRO=off -DENABLE_LIBOPENJPEG=none -DENABLE_CMS=none -DENABLE_LIBCURL=off -DENABLE_ZLIB=off -DENABLE_ZLIB_UNCOMPRESS=off -DENABLE_NSS3=off -DENABLE_LIBPNG=off -DENABLE_LIBTIFF=off -DENABLE_SPLASH=off -DENABLE_UTILS=off -DENABLE_CPP=off -DENABLE_GLIB=off -DENABLE_GOBJECT_INTROSPECTION=off -DENABLE_GTK_DOC=off -DENABLE_QT5=off +mkdir build && cd build && cmake .. -DENABLE_DCTDECODER=libjpeg -DHAVE_CAIRO=off -DENABLE_LIBOPENJPEG=none -DENABLE_CMS=none -DENABLE_LIBCURL=off -DENABLE_ZLIB_UNCOMPRESS=off -DENABLE_GPGME=off -DENABLE_NSS3=off -DENABLE_LIBPNG=off -DENABLE_LIBTIFF=off -DENABLE_SPLASH=on -DENABLE_UTILS=off -DENABLE_CPP=off -DENABLE_GLIB=off -DENABLE_GOBJECT_INTROSPECTION=off -DENABLE_GTK_DOC=off -DENABLE_QT5=off -DENABLE_QT6=off manually disabled these because cmake failed to do it: HAVE_CAIRO @@ -16,7 +16,7 @@ new file mode 100644 index 0fbd336a..451213f8 100644 --- /dev/null +++ b/config.h -@@ -0,0 +1,221 @@ +@@ -0,0 +1,229 @@ +/* config.h. Generated from config.h.cmake by cmake. */ + +/* Build against libcurl. */ @@ -37,15 +37,21 @@ index 0fbd336a..451213f8 100644 +/* Do not hardcode the library location */ +/* #undef ENABLE_RELOCATABLE */ + -+/* Build against zlib. */ -+/* #undef ENABLE_ZLIB */ -+ +/* Use zlib instead of builtin zlib decoder to uncompress flate streams. */ +/* #undef ENABLE_ZLIB_UNCOMPRESS */ + +/* Build against libnss3 for digital signature validation */ +/* #define ENABLE_NSS3 1 */ + ++/* Build against libgpgme for digital signature validation */ ++/* #undef ENABLE_GPGME */ ++ ++/* Signatures enabled */ ++/* #define ENABLE_SIGNATURES 1 */ ++ ++/* Default signature backend */ ++/* #define DEFAULT_SIGNATURE_BACKEND "NSS" */ ++ +/* Use cairo for rendering. */ +/* #define HAVE_CAIRO 1 */ + @@ -105,9 +111,6 @@ index 0fbd336a..451213f8 100644 +#define HAVE_TIMEGM 1 +#endif + -+/* Define if you have the iconv() function and it works. */ -+/* #undef HAVE_ICONV */ -+ +/* Define to 1 if you have the `z' library (-lz). */ +/* #undef HAVE_LIBZ */ + @@ -176,7 +179,7 @@ index 0fbd336a..451213f8 100644 +#define PACKAGE_NAME "poppler" + +/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "poppler 21.01.0" ++#define PACKAGE_STRING "poppler 23.09.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "poppler" @@ -185,7 +188,7 @@ index 0fbd336a..451213f8 100644 +#define PACKAGE_URL "" + +/* Define to the version of this package. */ -+#define PACKAGE_VERSION "21.01.0" ++#define PACKAGE_VERSION "23.09.0" + +/* Poppler data dir */ +#define POPPLER_DATADIR "/usr/local/share/poppler" @@ -203,12 +206,15 @@ index 0fbd336a..451213f8 100644 +/* #undef USE_FLOAT */ + +/* Version number of package */ -+#define VERSION "21.01.0" ++#define VERSION "23.09.0" + +#if defined(__APPLE__) +#elif defined (_WIN32) +/* Use win32 font configuration backend */ +#define WITH_FONTCONFIGURATION_WIN32 1 ++#elif defined (__ANDROID__) ++/* Use android font configuration backend */ ++#define WITH_FONTCONFIGURATION_ANDROID 1 +#else +/* Use fontconfig font configuration backend */ +#define WITH_FONTCONFIGURATION_FONTCONFIG 1 @@ -228,6 +234,8 @@ index 0fbd336a..451213f8 100644 +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define popen _popen +#define pclose _pclose ++#define strncasecmp _strnicmp ++#define strcasecmp _stricmp +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ @@ -243,12 +251,12 @@ new file mode 100644 index 0fbd336a..451213f8 100644 --- /dev/null +++ b/poppler/poppler-config.h -@@ -0,0 +1,166 @@ +@@ -0,0 +1,156 @@ +//================================================= -*- mode: c++ -*- ==== +// +// poppler-config.h +// -+// Copyright 1996-2011 Glyph & Cog, LLC ++// Copyright 1996-2011, 2022 Glyph & Cog, LLC +// +//======================================================================== + @@ -282,7 +290,7 @@ index 0fbd336a..451213f8 100644 + +/* Defines the poppler version. */ +#ifndef POPPLER_VERSION -+#define POPPLER_VERSION "21.01.0" ++#define POPPLER_VERSION "23.09.0" +#endif + +/* Use single precision arithmetic in the Splash backend */ @@ -320,11 +328,6 @@ index 0fbd336a..451213f8 100644 +/* #define ENABLE_LIBPNG 1 */ +#endif + -+/* Use zlib instead of builtin zlib decoder. */ -+#ifndef ENABLE_ZLIB -+/* #undef ENABLE_ZLIB */ -+#endif -+ +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. + */ +#ifndef HAVE_DIRENT_H @@ -369,18 +372,13 @@ index 0fbd336a..451213f8 100644 +/* #undef USE_BOOST_HEADERS */ +#endif + -+/* Is splash backend available */ -+#ifndef HAVE_SPLASH -+/* #undef HAVE_SPLASH */ -+#endif -+ +//------------------------------------------------------------------------ +// version +//------------------------------------------------------------------------ + +// copyright notice -+#define popplerCopyright "Copyright 2005-2021 The Poppler Developers - http://poppler.freedesktop.org" -+#define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC" ++#define popplerCopyright "Copyright 2005-2023 The Poppler Developers - http://poppler.freedesktop.org" ++#define xpdfCopyright "Copyright 1996-2011, 2022 Glyph & Cog, LLC" + +//------------------------------------------------------------------------ +// Win32 stuff @@ -439,9 +437,9 @@ index 0fbd336a..451213f8 100644 + +#include "poppler-global.h" + -+#define POPPLER_VERSION "21.01.0" -+#define POPPLER_VERSION_MAJOR 21 -+#define POPPLER_VERSION_MINOR 1 ++#define POPPLER_VERSION "23.09.0" ++#define POPPLER_VERSION_MAJOR 23 ++#define POPPLER_VERSION_MINOR 9 +#define POPPLER_VERSION_MICRO 0 + +namespace poppler @@ -455,3 +453,38 @@ index 0fbd336a..451213f8 100644 +} + +#endif +diff --git a/poppler_private_export.h b/poppler_private_export.h +new file mode 100644 +index 0fbd336a..451213f8 100644 +--- /dev/null ++++ b/poppler_private_export.h +@@ -0,0 +1,11 @@ ++ ++#ifndef POPPLER_PRIVATE_EXPORT_H ++#define POPPLER_PRIVATE_EXPORT_H ++ ++# define POPPLER_PRIVATE_EXPORT ++# define POPPLER_PRIVATE_NO_EXPORT ++# define POPPLER_PRIVATE_DEPRECATED ++# define POPPLER_PRIVATE_DEPRECATED_EXPORT ++# define POPPLER_PRIVATE_DEPRECATED_NO_EXPORT ++ ++#endif /* POPPLER_PRIVATE_EXPORT_H */ + +diff --git a/cpp/poppler_cpp_export.h b/cpp/poppler_cpp_export.h +new file mode 100644 +index 0fbd336a..451213f8 100644 +--- /dev/null ++++ b/cpp/poppler_cpp_export.h +@@ -0,0 +1,11 @@ ++ ++#ifndef POPPLER_CPP_EXPORT_H ++#define POPPLER_CPP_EXPORT_H ++ ++# define POPPLER_CPP_EXPORT ++# define POPPLER_CPP_NO_EXPORT ++# define POPPLER_CPP_DEPRECATED ++# define POPPLER_CPP_DEPRECATED_EXPORT ++# define POPPLER_CPP_DEPRECATED_NO_EXPORT ++ ++#endif /* POPPLER_CPP_EXPORT_H */ diff --git a/external/poppler/sanitizer.patch b/external/poppler/sanitizer.patch new file mode 100644 index 000000000000..c08e1b4e8a4f --- /dev/null +++ b/external/poppler/sanitizer.patch @@ -0,0 +1,18 @@ +--- poppler/PSOutputDev.cc ++++ poppler/PSOutputDev.cc +@@ -3138,6 +3138,8 @@ + bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, int rotateA, bool useMediaBox, bool crop, int sliceX, int sliceY, int sliceW, int sliceH, bool printing, bool (*abortCheckCbk)(void *data), + void *abortCheckCbkData, bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data), void *annotDisplayDecideCbkData) + { ++ std::abort(); ++#if 0 + PreScanOutputDev *scan; + bool rasterize; + bool useFlate, useLZW; +@@ -3623,5 +3625,6 @@ + + return false; ++#endif + } + + void PSOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) diff --git a/external/postgresql/ExternalProject_postgresql.mk b/external/postgresql/ExternalProject_postgresql.mk index cec1fb62b541..1d0a13b6bb03 100644 --- a/external/postgresql/ExternalProject_postgresql.mk +++ b/external/postgresql/ExternalProject_postgresql.mk @@ -25,7 +25,9 @@ $(eval $(call gb_ExternalProject_use_nmake,postgresql,build)) $(call gb_ExternalProject_get_state_target,postgresql,build) : $(call gb_Trace_StartRange,postgresql,EXTERNAL) $(call gb_ExternalProject_run,build,\ - MSBFLAGS=/p:Platform=$(gb_MSBUILD_PLATFORM) \ + MSBFLAGS="/p:Platform=$(gb_MSBUILD_PLATFORM) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ + $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \ $(PERL) build.pl $(gb_MSBUILD_CONFIG) libpq \ ,src/tools/msvc) $(call gb_Trace_EndRange,postgresql,EXTERNAL) @@ -39,10 +41,10 @@ ifeq ($(SYSTEM_ZLIB),) postgresql_LDFLAGS += $(ZLIB_LIBS) endif -ifeq ($(DISABLE_OPENSSL),) +ifeq ($(ENABLE_OPENSSL),TRUE) ifeq ($(SYSTEM_OPENSSL),) postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include -postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/ $(if $(filter $(OS),LINUX),-pthread) +postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl) $(if $(filter $(OS),LINUX),-pthread) endif endif @@ -52,8 +54,6 @@ postgresql_LDFLAGS += \ -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap_r/.libs \ -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap/.libs \ -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/liblber/.libs \ - $(if $(SYSTEM_NSS),,\ - -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib) \ endif @@ -63,18 +63,18 @@ endif $(call gb_ExternalProject_get_state_target,postgresql,build) : $(call gb_Trace_StartRange,postgresql,EXTERNAL) $(call gb_ExternalProject_run,build,\ - ./configure \ + $(gb_RUN_CONFIGURE) ./configure \ --without-readline \ --without-zlib \ --with-ldap \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ - $(if $(DISABLE_OPENSSL),,--with-openssl \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(ENABLE_OPENSSL),--with-openssl \ $(if $(WITH_GSSAPI),--with-gssapi)) \ $(if $(ENABLE_LDAP),,--with-ldap=no) \ CFLAGS="-fPIC" \ CPPFLAGS="$(postgresql_CPPFLAGS)" \ LDFLAGS="$(postgresql_LDFLAGS)" \ - $(if $(ENABLE_LDAP),EXTRA_LDAP_LIBS="-llber -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4") \ + $(if $(ENABLE_LDAP),EXTRA_LDAP_LIBS="-llber") \ && cd src/interfaces/libpq \ && MAKEFLAGS= && $(MAKE) MAKELEVEL=0 all-static-lib) $(call gb_Trace_EndRange,postgresql,EXTERNAL) diff --git a/external/postgresql/README b/external/postgresql/README index edc3d5df2781..a04037993690 100644 --- a/external/postgresql/README +++ b/external/postgresql/README @@ -1,3 +1,7 @@ PostgreSQL object-relational database management system -We use some pieces of this code for the postgresql database connector.
\ No newline at end of file +We use some pieces of this code for the postgresql database connector. + +From [https://www.postgresql.org/]. + +Release archives at [https://www.postgresql.org/ftp/source/]. diff --git a/external/postgresql/UnpackedTarball_postgresql.mk b/external/postgresql/UnpackedTarball_postgresql.mk index c189b10dcb4b..11fb603ef34f 100644 --- a/external/postgresql/UnpackedTarball_postgresql.mk +++ b/external/postgresql/UnpackedTarball_postgresql.mk @@ -17,8 +17,11 @@ $(eval $(call gb_UnpackedTarball_add_patches,postgresql, \ external/postgresql/windows.patch.0 \ external/postgresql/postgresql.exit.patch.0 \ external/postgresql/postgres-msvc-build.patch.1 \ + $(if $(filter WNT_AARCH64,$(OS)_$(CPUNAME)), external/postgresql/arm64.patch.1) \ )) +ifeq ($(CROSS_COMPILING),) $(eval $(call gb_UnpackedTarball_add_file,postgresql,src/tools/msvc/config.pl,external/postgresql/config.pl)) +endif # vim: set noet sw=4 ts=4: diff --git a/external/postgresql/arm64.patch.1 b/external/postgresql/arm64.patch.1 new file mode 100644 index 000000000000..db8a3ad0a069 --- /dev/null +++ b/external/postgresql/arm64.patch.1 @@ -0,0 +1,53 @@ +diff -ur postgresql.org/src/tools/msvc/Mkvcbuild.pm postgresql/src/tools/msvc/Mkvcbuild.pm +--- postgresql.org/src/tools/msvc/Mkvcbuild.pm 2021-03-14 02:09:15.288060770 +0100 ++++ postgresql/src/tools/msvc/Mkvcbuild.pm 2021-03-14 02:12:22.351726582 +0100 +@@ -107,13 +107,6 @@ + + push(@pgportfiles, 'strtof.c') if ($vsVersion < '14.00'); + +- if ($vsVersion >= '9.00') +- { +- push(@pgportfiles, 'pg_crc32c_sse42_choose.c'); +- push(@pgportfiles, 'pg_crc32c_sse42.c'); +- push(@pgportfiles, 'pg_crc32c_sb8.c'); +- } +- else + { + push(@pgportfiles, 'pg_crc32c_sb8.c'); + } +diff -ur postgresql.org/src/tools/msvc/MSBuildProject.pm postgresql/src/tools/msvc/MSBuildProject.pm +--- postgresql.org/src/tools/msvc/MSBuildProject.pm 2021-03-14 02:09:15.288060770 +0100 ++++ postgresql/src/tools/msvc/MSBuildProject.pm 2021-03-14 02:12:22.351726582 +0100 +@@ -307,8 +307,7 @@ + : ($self->{type} eq "dll" ? 'DynamicLibrary' : 'StaticLibrary'); + my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ';'); + +- my $targetmachine = +- $self->{platform} eq 'Win32' ? 'MachineX86' : 'MachineX64'; ++ my $targetmachine = "MachineARM64"; + + my $includes = $self->{includes}; + unless ($includes eq '' or $includes =~ /;$/) +@@ -347,7 +346,6 @@ + <ProgramDatabaseFile>.\\$cfgname\\$self->{name}\\$self->{name}.pdb</ProgramDatabaseFile> + <GenerateMapFile>false</GenerateMapFile> + <MapFileName>.\\$cfgname\\$self->{name}\\$self->{name}.map</MapFileName> +- <RandomizedBaseAddress>false</RandomizedBaseAddress> + <!-- Permit links to MinGW-built, 32-bit DLLs (default before VS2012). --> + <ImageHasSafeExceptionHandlers/> + <SubSystem>Console</SubSystem> +diff -ur postgresql.org/src/tools/msvc/Solution.pm postgresql/src/tools/msvc/Solution.pm +--- postgresql.org/src/tools/msvc/Solution.pm 2021-03-14 02:09:15.288060770 +0100 ++++ postgresql/src/tools/msvc/Solution.pm 2021-03-14 02:12:22.351726582 +0100 +@@ -62,10 +62,7 @@ + if (1) #($^O eq "MSWin32") + { + # Examine CL help output to determine if we are in 32 or 64-bit mode. +- my $output = `cl /? 2>&1`; +- $? >> 8 == 0 or die "cl command not found"; +- $self->{platform} = +- ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; ++ $self->{platform} = 'ARM64'; + } + else + { diff --git a/external/postgresql/postgres-msvc-build.patch.1 b/external/postgresql/postgres-msvc-build.patch.1 index c217a755918b..dec31742238e 100644 --- a/external/postgresql/postgres-msvc-build.patch.1 +++ b/external/postgresql/postgres-msvc-build.patch.1 @@ -42,7 +42,7 @@ Also Cygwin perl has $Config{osname} different from MSWin32, and why even check { # Examine CL help output to determine if we are in 32 or 64-bit mode. my $output = `cl /? 2>&1`; -@@ -1081,7 +1081,7 @@ +@@ -1100,7 +1100,7 @@ } if ($fld ne "") { @@ -53,7 +53,7 @@ Also Cygwin perl has $Config{osname} different from MSWin32, and why even check EndProject --- postgresql/src/tools/msvc/VSObjectFactory.pm.orig 2021-01-19 18:06:42.633421700 +0100 +++ postgresql/src/tools/msvc/VSObjectFactory.pm 2021-01-19 18:06:28.663523200 +0100 -@@ -111,7 +111,7 @@ +@@ -131,7 +131,7 @@ sub DetermineVisualStudioVersion { @@ -85,7 +85,7 @@ Also Cygwin perl has $Config{osname} different from MSWin32, and why even check my $sslout = `$opensslcmd`; $? >> 8 == 0 -@@ -964,8 +964,8 @@ +@@ -967,8 +967,8 @@ # On both Win32 and Win64 the same library # names are used without a debugging context. $dbgsuffix = 0; @@ -96,7 +96,7 @@ Also Cygwin perl has $Config{osname} different from MSWin32, and why even check } $proj->AddLibrary($self->{options}->{openssl} . $libsslpath, -@@ -990,9 +990,9 @@ +@@ -993,9 +993,9 @@ # to be here, so don't ask for it in last # parameter. $proj->AddLibrary( diff --git a/external/postgresql/postgresql.exit.patch.0 b/external/postgresql/postgresql.exit.patch.0 index 77912038e88e..8eaa1ea52ebb 100644 --- a/external/postgresql/postgresql.exit.patch.0 +++ b/external/postgresql/postgresql.exit.patch.0 @@ -1,7 +1,7 @@ # error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] --- configure +++ configure -@@ -24565,6 +24565,7 @@ +@@ -16997,6 +16997,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9,7 +9,7 @@ typedef long int ac_int64; /* -@@ -24702,6 +24702,7 @@ +@@ -17081,6 +17082,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/external/postgresql/windows.patch.0 b/external/postgresql/windows.patch.0 index dbac548d4659..28fc9046c298 100644 --- a/external/postgresql/windows.patch.0 +++ b/external/postgresql/windows.patch.0 @@ -1,6 +1,6 @@ --- src/port/chklocale.c +++ src/port/chklocale.c -@@ -211,7 +211,7 @@ +@@ -220,7 +220,7 @@ { r = malloc(16); /* excess */ if (r != NULL) diff --git a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 deleted file mode 100644 index 489e5d0e89ee..000000000000 --- a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 +++ /dev/null @@ -1,59 +0,0 @@ -From 582d188e6e3487180891f1fc457a80dec8be26a8 Mon Sep 17 00:00:00 2001 -From: Christian Heimes <christian@python.org> -Date: Mon, 24 Sep 2018 14:38:31 +0200 -Subject: [PATCH] [3.6] bpo-17239: Disable external entities in SAX parser - (GH-9217) (GH-9512) - -The SAX parser no longer processes general external entities by default -to increase security. Before, the parser created network connections -to fetch remote files or loaded local files from the file system for DTD -and entities. - -Signed-off-by: Christian Heimes <christian@python.org> - -https://bugs.python.org/issue17239. -(cherry picked from commit 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45) - -Co-authored-by: Christian Heimes <christian@python.org> - - - -https://bugs.python.org/issue17239 ---- - Doc/library/xml.dom.pulldom.rst | 14 +++++ - Doc/library/xml.rst | 6 +- - Doc/library/xml.sax.rst | 8 +++ - Doc/whatsnew/3.6.rst | 18 +++++- - Lib/test/test_pulldom.py | 7 +++ - Lib/test/test_sax.py | 60 ++++++++++++++++++- - Lib/test/test_xml_etree.py | 13 ++++ - Lib/xml/sax/expatreader.py | 2 +- - .../2018-09-11-18-30-55.bpo-17239.kOpwK2.rst | 3 + - 9 files changed, 125 insertions(+), 6 deletions(-) - create mode 100644 Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst - -diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py -index 421358fa5b..5066ffc2fa 100644 ---- a/Lib/xml/sax/expatreader.py -+++ b/Lib/xml/sax/expatreader.py -@@ -95,7 +95,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): - self._lex_handler_prop = None - self._parsing = 0 - self._entity_stack = [] -- self._external_ges = 1 -+ self._external_ges = 0 - self._interning = None - - # XMLReader methods -diff --git a/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst -new file mode 100644 -index 0000000000..8dd0fe8c1b ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst -@@ -0,0 +1,3 @@ -+The xml.sax and xml.dom.minidom parsers no longer processes external -+entities by default. External DTD and ENTITY declarations no longer -+load files or create network connections. --- -2.20.1 - diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index 8448d24db3b0..907b0b530c46 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -14,7 +14,7 @@ $(eval $(call gb_ExternalPackage_use_external_project,python3,python3)) ifeq ($(OS),WNT) ifeq ($(CPUNAME),X86_64) python_arch_subdir=amd64/ -else ifeq ($(CPUNAME),ARM64) +else ifeq ($(CPUNAME),AARCH64) python_arch_subdir=arm64/ else python_arch_subdir=win32/ @@ -25,8 +25,9 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYT ifeq ($(MSVC_USE_DEBUG_RUNTIME),) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR).dll,PCbuild/$(python_arch_subdir)python$(PYTHON_VERSION_MAJOR).dll)) endif -$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ +python3_EXTENSION_MODULES= \ PCbuild/$(python_arch_subdir)_asyncio$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ + PCbuild/$(python_arch_subdir)_bz2$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_ctypes$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_decimal$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_elementtree$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ @@ -40,29 +41,32 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor PCbuild/$(python_arch_subdir)select$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)unicodedata$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)winsound$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ + +$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ + $(python3_EXTENSION_MODULES) \ )) else $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so)) -$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin-gdb.py,Tools/gdb/libpython.py)) +$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so.1.0-gdb.py,Tools/gdb/libpython.py)) # Unfortunately the python build system does not allow to explicitly enable or # disable these, it just tries to build them and then prints which did not -# build successfully without stopping; so the build will break on delivering if -# one of these failed to build. +# build successfully without stopping; that's why ExternalProject_python3 explicitly checks for the +# existence of all the files on the python3_EXTENSION_MODULES list at the end of the build. # Obviously this list should not contain stuff with external dependencies # that may not be available on baseline systems. -ifneq ($(OS),AIX) python3_EXTENSION_MODULE_SUFFIX=cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d) -$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib-dynload,\ +python3_EXTENSION_MODULES= \ LO_lib/array.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_asyncio.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/audioop.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/binascii.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_bisect.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_blake2.$(python3_EXTENSION_MODULE_SUFFIX).so \ + LO_lib/_bz2.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/cmath.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_codecs_cn.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_codecs_hk.$(python3_EXTENSION_MODULE_SUFFIX).so \ @@ -79,7 +83,7 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor LO_lib/_elementtree.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/fcntl.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/grp.$(python3_EXTENSION_MODULE_SUFFIX).so \ - $(if $(DISABLE_OPENSSL),, \ + $(if $(ENABLE_OPENSSL), \ LO_lib/_hashlib.$(python3_EXTENSION_MODULE_SUFFIX).so \ ) \ LO_lib/_heapq.$(python3_EXTENSION_MODULE_SUFFIX).so \ @@ -107,7 +111,7 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor LO_lib/_sha512.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_socket.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/spwd.$(python3_EXTENSION_MODULE_SUFFIX).so \ - $(if $(DISABLE_OPENSSL),, \ + $(if $(ENABLE_OPENSSL), \ LO_lib/_ssl.$(python3_EXTENSION_MODULE_SUFFIX).so \ ) \ LO_lib/_statistics.$(python3_EXTENSION_MODULE_SUFFIX).so \ @@ -121,9 +125,11 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor LO_lib/_xxsubinterpreters.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_xxtestfuzz.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/zlib.$(python3_EXTENSION_MODULE_SUFFIX).so \ + +$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib-dynload,\ + $(python3_EXTENSION_MODULES) \ )) endif -endif # headers are not delivered, but used from unpacked dir Include/ # (+ toplevel for pyconfig.h) @@ -137,6 +143,16 @@ endif endif # that one is generated... +ifeq ($(HOST_PLATFORM),powerpc64le-unknown-linux-gnu) +$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ + LO_lib/_sysconfigdata_$(if $(ENABLE_DBGUTIL),d)_linux_powerpc64le-linux-gnu.py \ +)) +else +ifeq ($(HOST_PLATFORM),aarch64-unknown-linux-gnu) +$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ + LO_lib/_sysconfigdata_$(if $(ENABLE_DBGUTIL),d)_linux_aarch64-linux-gnu.py \ +)) +else # note: python configure overrides config.guess with something that doesn't # put -pc in its linux platform triplets, so filter that... ifneq ($(OS),WNT) @@ -150,6 +166,8 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor )) endif endif +endif +endif # packages not shipped: diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk index 36fc917168d3..0f95cc36563c 100644 --- a/external/python3/ExternalProject_python3.mk +++ b/external/python3/ExternalProject_python3.mk @@ -10,6 +10,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,python3)) $(eval $(call gb_ExternalProject_use_externals,python3,\ + bzip2 \ expat \ $(if $(filter WNT LINUX,$(OS)),libffi) \ openssl \ @@ -36,14 +37,17 @@ $(call gb_ExternalProject_get_state_target,python3,build) : $(call gb_Trace_StartRange,python3,EXTERNAL) $(call gb_ExternalProject_run,build,\ MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build $(gb_MSBUILD_CONFIG_AND_PLATFORM) \ + /p:bz2Dir=$(call gb_UnpackedTarball_get_dir,bzip2) \ /p:opensslIncludeDir=$(call gb_UnpackedTarball_get_dir,openssl)/include \ /p:opensslOutDir=$(call gb_UnpackedTarball_get_dir,openssl) \ /p:zlibDir=$(call gb_UnpackedTarball_get_dir,zlib) \ /p:libffiOutDir=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs \ /p:libffiIncludeDir=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/include \ /maxcpucount \ - $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ + $(foreach i,$(python3_EXTENSION_MODULES), \ + && { test -e ../$i || { printf 'Error: missing %s\n' $i; false; } }) \ ,PCBuild) $(call gb_Trace_EndRange,python3,EXTERNAL) @@ -56,7 +60,7 @@ else # libffi is not all that stable, with 3 different SONAMEs currently, so we # have to bundle it; --without-system-ffi does not work any more on Linux. -# Unfortuantely (as of 3.7) pkg-config is used to locate libffi so we do some +# Unfortunately (as of 3.7) pkg-config is used to locate libffi so we do some # hacks to find the libffi.pc in workdir by overriding PKG_CONFIG_LIBDIR. # Also, pkg-config is only used to find the headers, the libdir needs to be # passed extra. @@ -84,29 +88,28 @@ $(call gb_ExternalProject_get_state_target,python3,build) : ac_cv_func_clock_gettime=no \ ) \ ) \ - ./configure \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(gb_RUN_CONFIGURE) ./configure \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(ENABLE_VALGRIND),--with-valgrind) \ $(if $(ENABLE_DBGUTIL),--with-pydebug) \ --prefix=/python-inst \ --with-system-expat \ - $(if $(filter AIX,$(OS)), \ - --disable-ipv6 --with-threads OPT="-g0 -fwrapv -O3 -Wall") \ $(if $(filter MACOSX,$(OS)), \ $(if $(filter INTEL,$(CPUNAME)),--enable-universalsdk=$(MACOSX_SDK_PATH) \ --with-universal-archs=intel \ ) \ --enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \ --enable-shared \ - $(if $(filter 1090 101000 101100 101200,$(MAC_OS_X_VERSION_MIN_REQUIRED)),ac_cv_func_utimensat=no) \ ) \ - $(if $(SYSTEM_OPENSSL)$(DISABLE_OPENSSL),,\ + $(if $(ENABLE_OPENSSL),$(if $(SYSTEM_OPENSSL),,\ --with-openssl=$(call gb_UnpackedTarball_get_dir,openssl) \ - ) \ + ) ) \ $(if $(filter LINUX,$(OS)), \ PKG_CONFIG_LIBDIR="$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)$${PKG_CONFIG_LIBDIR:+:$$PKG_CONFIG_LIBDIR}" \ ) \ CC="$(strip $(CC) \ + $(if $(filter -fsanitize=undefined,$(CC)),-fno-sanitize=function) \ + $(if $(SYSTEM_BZIP2),,-I$(call gb_UnpackedTarball_get_dir,bzip2)) \ $(if $(SYSTEM_EXPAT),,-I$(call gb_UnpackedTarball_get_dir,expat)/lib) \ $(if $(SYSBASE), -I$(SYSBASE)/usr/include) \ )" \ @@ -114,6 +117,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) : $(if $(filter -fsanitize=%,$(CC)),LINKCC="$(CXX) -pthread") \ LDFLAGS="$(strip $(LDFLAGS) \ $(if $(filter LINUX,$(OS)),-L$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs) \ + $(if $(SYSTEM_BZIP2),,-L$(call gb_UnpackedTarball_get_dir,bzip2)) \ $(if $(SYSTEM_EXPAT),,-L$(gb_StaticLibrary_WORKDIR)) \ $(if $(SYSTEM_ZLIB),,-L$(gb_StaticLibrary_WORKDIR)) \ $(if $(SYSBASE), -L$(SYSBASE)/usr/lib) \ @@ -123,6 +127,8 @@ $(call gb_ExternalProject_get_state_target,python3,build) : $(if $(filter MACOSX,$(OS)),DESTDIR=$(EXTERNAL_WORKDIR)/python-inst install) \ $(if $(SYSTEM_ZLIB),,ZLIB_INCDIR=$(WORKDIR)/UnpackedTarball/zlib) \ && ln -s build/lib.* LO_lib \ + $(foreach i,$(python3_EXTENSION_MODULES), \ + && { test -e $i || { printf 'Error: missing %s\n' $i; false; } }) \ ) $(call gb_Trace_EndRange,python3,EXTERNAL) @@ -154,7 +160,7 @@ $(call gb_ExternalProject_get_state_target,python3,fixscripts) : $(call gb_Exter pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config \ ; do { rm "$$file" && $(gb_AWK) '\ - BEGIN {print "#!/bin/bash\n\ + BEGIN {print "#!/usr/bin/env bash\n\ origpath=$$(pwd)\n\ bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\ cd \"$$origpath\"\n\ @@ -165,7 +171,8 @@ cd \"$$origpath\"\n\ chmod +x "../Resources/$$file" && ln -s "../Resources/$$file" ; done touch $@ -$(call gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_ExternalProject_get_state_target,python3,build) +$(call gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_ExternalProject_get_state_target,python3,build) \ + | $(call gb_ExternalProject_get_state_target,python3,removeunnecessarystuff) $(INSTALL_NAME_TOOL) -change \ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ @executable_path/../../../../LibreOfficePython \ @@ -188,22 +195,20 @@ $(call gb_ExternalProject_get_state_target,python3,executables) : $(call gb_Exte $(call gb_ExternalProject_get_state_target,python3,removeunnecessarystuff) : $(call gb_ExternalProject_get_state_target,python3,build) $(call gb_Output_announce,python3 - remove the stuff we don't need to ship,build,CUS,5) - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/dbm - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/sqlite3 - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/curses - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/idlelib - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/tkinter - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/turtledemo - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/test - rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/venv + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/dbm + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/sqlite3 + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/curses + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/idlelib + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/tkinter + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/turtledemo + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/test + rm -r $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/venv # Then the binary libraries - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_dbm.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_sqlite3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses_panel.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_idlelib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_tkinter.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so - rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_test*.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so + rm $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_dbm.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.so + rm $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_sqlite3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.so + rm $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.so + rm $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses_panel.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.so + rm $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_test*.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.so touch $@ endif diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index ea54b630f752..cbb85e14e405 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -12,18 +12,28 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,python3)) $(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL),,python3)) $(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\ + PCbuild/libffi.props \ PCbuild/pcbuild.sln \ )) +ifneq ($(MSYSTEM),) +# use binary flag so patch from git-bash won't choke on mixed line-endings in patches +$(eval $(call gb_UnpackedTarball_set_patchflags,python3,--binary)) +endif + $(eval $(call gb_UnpackedTarball_add_patches,python3,\ external/python3/i100492-freebsd.patch.1 \ external/python3/python-3.3.0-darwin.patch.1 \ + external/python3/python-3.8-msvc-sdk.patch.1 \ + external/python3/python-3.8-msvc-libffi.patch.1 \ external/python3/python-3.7.6-msvc-ssl.patch.1 \ external/python3/python-3.5.4-msvc-disable.patch.1 \ external/python3/ubsan.patch.0 \ external/python3/python-3.5.tweak.strip.soabi.patch \ external/python3/darwin.patch.0 \ external/python3/macos-11.patch.0 \ + external/python3/tsan.patch.0 \ + external/python3/init-sys-streams-cant-initialize-stdin.patch.0 \ )) ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),) diff --git a/external/python3/i100492-freebsd.patch.1 b/external/python3/i100492-freebsd.patch.1 index 074e5fc489f8..b2ca1ee7117f 100644 --- a/external/python3/i100492-freebsd.patch.1 +++ b/external/python3/i100492-freebsd.patch.1 @@ -2,7 +2,7 @@ FreeBSD porting fixes, patch by maho@openoffice.org --- Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:00:41.097955124 +0000 +++ Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:01:13.018329351 +0000 -@@ -186,6 +189,9 @@ +@@ -238,6 +238,9 @@ { pthread_t th; int status; @@ -12,7 +12,7 @@ FreeBSD porting fixes, patch by maho@openoffice.org #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_t attrs; #endif -@@ -214,6 +220,10 @@ +@@ -277,6 +280,10 @@ callback->func = func; callback->arg = arg; @@ -23,7 +23,7 @@ FreeBSD porting fixes, patch by maho@openoffice.org status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, -@@ -225,6 +234,9 @@ +@@ -285,6 +292,9 @@ #endif pythread_wrapper, callback); diff --git a/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 b/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 new file mode 100644 index 000000000000..61b2464ab4b8 --- /dev/null +++ b/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 @@ -0,0 +1,43 @@ +--- Python/pylifecycle.c 2024-03-27 14:34:43.905367358 +0000 ++++ Python/pylifecycle.c 2024-03-27 14:40:16.339134322 +0000 +@@ -1723,6 +1723,20 @@ + if (!is_valid_fd(fd)) + Py_RETURN_NONE; + ++ /* Check that stdin, etc is not a directory ++ Using shell redirection, you can redirect stdin to a directory, ++ crashing the Python interpreter. Catch this common mistake here ++ and output a useful error message. Note that under MS Windows, ++ the shell already prevents that. */ ++#ifndef MS_WINDOWS ++ struct _Py_stat_struct sb; ++ if (_Py_fstat_noraise(fd, &sb) == 0 && ++ S_ISDIR(sb.st_mode)) { ++ // "name" is a directory, cannot continue ++ Py_RETURN_NONE; ++ } ++#endif ++ + /* stdin is always opened in buffered mode, first because it shouldn't + make a difference in common use cases, second because TextIOWrapper + depends on the presence of a read1() method which only exists on +@@ -1854,19 +1868,6 @@ + PyStatus res = _PyStatus_OK(); + PyConfig *config = &interp->config; + +- /* Check that stdin is not a directory +- Using shell redirection, you can redirect stdin to a directory, +- crashing the Python interpreter. Catch this common mistake here +- and output a useful error message. Note that under MS Windows, +- the shell already prevents that. */ +-#ifndef MS_WINDOWS +- struct _Py_stat_struct sb; +- if (_Py_fstat_noraise(fileno(stdin), &sb) == 0 && +- S_ISDIR(sb.st_mode)) { +- return _PyStatus_ERR("<stdin> is a directory, cannot continue"); +- } +-#endif +- + /* Hack to avoid a nasty recursion issue when Python is invoked + in verbose mode: pre-import the Latin-1 and UTF-8 codecs */ + if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) { diff --git a/external/python3/internal-zlib.patch.0 b/external/python3/internal-zlib.patch.0 index de68d9e7dec8..d4305c6df95d 100644 --- a/external/python3/internal-zlib.patch.0 +++ b/external/python3/internal-zlib.patch.0 @@ -1,6 +1,6 @@ --- configure +++ configure -@@ -11607,13 +11607,13 @@ +@@ -12333,13 +12333,13 @@ ;; esac @@ -19,7 +19,7 @@ --- setup.py +++ setup.py -@@ -1362,7 +1362,7 @@ +@@ -1483,7 +1483,7 @@ # # You can upgrade zlib to version 1.1.4 yourself by going to # http://www.gzip.org/zlib/ @@ -28,7 +28,7 @@ have_zlib = False if zlib_inc is not None: zlib_h = zlib_inc[0] + '/zlib.h' -@@ -1379,13 +1379,13 @@ +@@ -1500,13 +1500,13 @@ version = line.split()[2] break if version >= version_req: @@ -44,7 +44,7 @@ extra_link_args=zlib_extra_link_args)) have_zlib = True else: -@@ -1399,7 +1399,7 @@ +@@ -1520,7 +1520,7 @@ # crc32 if we have it. Otherwise binascii uses its own. if have_zlib: extra_compile_args = ['-DUSE_ZLIB_CRC32'] diff --git a/external/python3/macos-11.patch.0 b/external/python3/macos-11.patch.0 index 3c42d515f6bd..2c8b419bbdb9 100644 --- a/external/python3/macos-11.patch.0 +++ b/external/python3/macos-11.patch.0 @@ -1,30 +1,6 @@ --*- Mode: diff -*- ---- configure -+++ configure -@@ -9372,6 +9275,9 @@ - esac - else - case `/usr/bin/arch` in -+ arm64) -+ MACOSX_DEFAULT_ARCH="arm64" -+ ;; - i386) - MACOSX_DEFAULT_ARCH="x86_64" - ;; ---- Mac/Tools/pythonw.c -+++ Mac/Tools/pythonw.c -@@ -121,6 +121,8 @@ - cpu_types[0] = CPU_TYPE_POWERPC; - #elif defined(__i386__) - cpu_types[0] = CPU_TYPE_X86; -+#elif defined(__arm64__) -+ cpu_types[0] = CPU_TYPE_ARM64; - #else - # error "Unknown CPU" - #endif --- setup.py +++ setup.py -@@ -670,7 +670,10 @@ +@@ -655,7 +655,10 @@ add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) @@ -36,21 +12,9 @@ system_include_dirs = ['/usr/include'] # lib_dirs and inc_dirs are used to search for files; # if a file is found in one of those directories, it can ---- Modules/_decimal/libmpdec/mpdecimal.h -+++ Modules/_decimal/libmpdec/mpdecimal.h -@@ -135,6 +135,9 @@ - #elif defined(__x86_64__) - #define CONFIG_64 - #define ASM -+ #elif defined(__arm64__) -+ #define CONFIG_64 -+ #define ANSI - #else - #error "unknown architecture for universal build." - #endif --- Modules/_posixsubprocess.c +++ Modules/_posixsubprocess.c -@@ -31,6 +31,8 @@ +@@ -30,6 +30,8 @@ # define SYS_getdents64 __NR_getdents64 #endif @@ -59,7 +23,7 @@ #if defined(__sun) && defined(__SVR4) /* readdir64 is used to work around Solaris 9 bug 6395699. */ # define readdir readdir64 -@@ -202,7 +202,7 @@ +@@ -201,7 +203,7 @@ #endif #ifdef _SC_OPEN_MAX local_max_fd = sysconf(_SC_OPEN_MAX); diff --git a/external/python3/python-3.3.0-darwin.patch.1 b/external/python3/python-3.3.0-darwin.patch.1 index 27a355e2ad21..d262d55cd5b3 100644 --- a/external/python3/python-3.3.0-darwin.patch.1 +++ b/external/python3/python-3.3.0-darwin.patch.1 @@ -5,7 +5,7 @@ LO needs to build both against MacOSX SDK and not produce universal binaries. diff -ru python3.orig/configure python3/configure --- python3.orig/configure 2015-07-26 17:36:11.808497783 +0200 +++ python3/configure 2015-07-26 17:38:49.016508337 +0200 -@@ -6794,7 +6794,20 @@ +@@ -7385,7 +7385,20 @@ then case "$UNIVERSAL_ARCHS" in 32-bit) @@ -30,7 +30,7 @@ diff -ru python3.orig/configure python3/configure diff -ru python3.orig/Mac/Makefile.in python3/Mac/Makefile.in --- python3.orig/Mac/Makefile.in 2015-07-05 18:50:07.000000000 +0200 +++ python3/Mac/Makefile.in 2015-07-26 17:40:14.860514100 +0200 -@@ -43,7 +43,7 @@ +@@ -44,7 +44,7 @@ INSTALL_SCRIPT= @INSTALL_SCRIPT@ INSTALL_DATA=@INSTALL_DATA@ LN=@LN@ @@ -49,7 +49,7 @@ diff -ru python3.orig/Mac/Resources/app/Info.plist.in python3/Mac/Resources/app/ - <string>Python</string> + <string>LibreOfficePython</string> <key>CFBundleGetInfoString</key> - <string>%version%, (c) 2001-2020 Python Software Foundation.</string> + <string>%version%, (c) 2001-2023 Python Software Foundation.</string> <key>CFBundleHelpBookFolder</key> diff -ru python3.orig/Mac/Resources/framework/Info.plist.in python3/Mac/Resources/framework/Info.plist.in --- python3.orig/Mac/Resources/framework/Info.plist.in 2015-07-05 18:50:07.000000000 +0200 diff --git a/external/python3/python-3.3.3-disable-obmalloc.patch.0 b/external/python3/python-3.3.3-disable-obmalloc.patch.0 index 0963a5f1bb1d..c4a1dea61ecf 100644 --- a/external/python3/python-3.3.3-disable-obmalloc.patch.0 +++ b/external/python3/python-3.3.3-disable-obmalloc.patch.0 @@ -1,6 +1,6 @@ --- Objects/obmalloc.c +++ Objects/obmalloc.c -@@ -413,8 +413,8 @@ +@@ -712,8 +712,8 @@ #ifdef WITH_PYMALLOC @@ -10,7 +10,7 @@ /* If we're using GCC, use __builtin_expect() to reduce overhead of the valgrind checks */ -@@ -1181,7 +1181,7 @@ +@@ -1430,7 +1430,7 @@ #ifdef WITH_VALGRIND if (UNLIKELY(running_on_valgrind == -1)) { diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1 index 55546afd9844..a408858f5917 100644 --- a/external/python3/python-3.3.3-elf-rpath.patch.1 +++ b/external/python3/python-3.3.3-elf-rpath.patch.1 @@ -5,7 +5,7 @@ set RPATH (only to be used on ELF platforms) diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in --- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200 +++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200 -@@ -563,7 +563,7 @@ +@@ -566,7 +566,7 @@ # Build the interpreter $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) @@ -14,7 +14,7 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in platform: $(BUILDPYTHON) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform -@@ -625,7 +625,7 @@ +@@ -628,7 +628,7 @@ fi libpython3.so: libpython$(LDVERSION).so diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 b/external/python3/python-3.5.4-msvc-disable.patch.1 index 52c007d7d5b6..880e4a9cfb5b 100644 --- a/external/python3/python-3.5.4-msvc-disable.patch.1 +++ b/external/python3/python-3.5.4-msvc-disable.patch.1 @@ -1,9 +1,9 @@ Disable some stuff LO does not need, especially stuff with external dependencies diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln ---- python3.orig/PCbuild/pcbuild.sln 2017-08-10 00:04:44.359879894 +0200 -+++ python3/PCbuild/pcbuild.sln 2017-08-10 00:13:51.179873748 +0200 -@@ -12,8 +12,6 @@ +--- python3.orig/PCbuild/pcbuild.sln 2023-08-25 04:36:32.000000000 +0900 ++++ python3/PCbuild/pcbuild.sln 2023-09-20 17:43:05.442089400 +0900 +@@ -15,8 +15,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" EndProject @@ -12,7 +12,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_decimal", "_decimal.vcxproj", "{0E9791DB-593A-465F-98BC-681011311617}" -@@ -28,34 +26,20 @@ +@@ -31,8 +29,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}" EndProject @@ -21,15 +21,14 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testinternalcapi", "_testinternalcapi.vcxproj", "{900342D7-516A-4469-B1AD-59A66E49A25F}" +@@ -41,24 +37,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}" -EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bz2", "_bz2.vcxproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}" --EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bz2", "_bz2.vcxproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}" + EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcxproj", "{18CAE28C-B454-46C1-87A0-493D91D97F03}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_lzma", "_lzma.vcxproj", "{F9D71780-F393-11E0-BE50-0800200C9A66}" @@ -47,7 +46,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}" -@@ -75,8 +75,6 @@ +@@ -93,8 +79,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", "{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}" EndProject diff --git a/external/python3/python-3.5.tweak.strip.soabi.patch b/external/python3/python-3.5.tweak.strip.soabi.patch index 48ac7f82f8be..4c2bb2bb9a29 100644 --- a/external/python3/python-3.5.tweak.strip.soabi.patch +++ b/external/python3/python-3.5.tweak.strip.soabi.patch @@ -1,7 +1,7 @@ diff -ru python3.orig/configure python3/configure --- misc/python3.orig/configure 2015-07-26 21:14:31.127377193 +0200 +++ misc/python3/configure 2015-07-26 21:21:34.975405648 +0200 -@@ -14388,7 +14388,7 @@ +@@ -15229,7 +15229,7 @@ $as_echo "$ABIFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 $as_echo_n "checking SOABI... " >&6; } diff --git a/external/python3/python-3.7.6-msvc-ssl.patch.1 b/external/python3/python-3.7.6-msvc-ssl.patch.1 index 7c4a6ebc0fb7..50b1c65645df 100644 --- a/external/python3/python-3.7.6-msvc-ssl.patch.1 +++ b/external/python3/python-3.7.6-msvc-ssl.patch.1 @@ -2,7 +2,7 @@ No use for applink.c OPENSSL_Applink, everything is compiled with the same MSVC --- python3/PCbuild/_ssl.vcxproj.orig2 2019-12-23 15:54:19.254298900 +0100 +++ python3/PCbuild/_ssl.vcxproj 2019-12-23 15:54:24.693251200 +0100 -@@ -67,9 +67,6 @@ +@@ -99,9 +99,6 @@ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_ssl.c" />
@@ -14,12 +14,14 @@ No use for applink.c OPENSSL_Applink, everything is compiled with the same MSVC <ResourceCompile Include="..\PC\python_nt.rc" />
--- python3/PCbuild/openssl.props.orig 2019-12-23 16:20:34.588135900 +0100 +++ python3/PCbuild/openssl.props 2019-12-23 16:20:51.074001300 +0100 -@@ -6,8 +6,6 @@ +@@ -10,9 +10,7 @@ + </Link>
</ItemDefinitionGroup>
<PropertyGroup>
- <_DLLSuffix>-1_1</_DLLSuffix>
+- <_DLLSuffix>-1_1</_DLLSuffix>
- <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
- <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
++ <_DLLSuffix>-3</_DLLSuffix>
</PropertyGroup>
<ItemGroup>
<_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
diff --git a/external/python3/python-3.8-msvc-libffi.patch.1 b/external/python3/python-3.8-msvc-libffi.patch.1 new file mode 100644 index 000000000000..674043a7dca6 --- /dev/null +++ b/external/python3/python-3.8-msvc-libffi.patch.1 @@ -0,0 +1,16 @@ +--- python3/PCbuild/libffi.props.orig 2023-08-25 04:36:32.000000000 +0900 ++++ python3/PCbuild/libffi.props 2023-10-14 15:13:24.850511531 +0900 +@@ -6,11 +6,11 @@ + </ClCompile> + <Link> + <AdditionalLibraryDirectories>$(libffiOutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> +- <AdditionalDependencies>libffi-7.lib;%(AdditionalDependencies)</AdditionalDependencies> ++ <AdditionalDependencies>libffi-8.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemGroup> +- <_LIBFFIDLL Include="$(libffiOutDir)\libffi-7.dll" /> ++ <_LIBFFIDLL Include="$(libffiOutDir)\libffi-8.dll" /> + </ItemGroup> + <Target Name="_CopyLIBFFIDLL" Inputs="@(_LIBFFIDLL)" Outputs="@(_LIBFFIDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build"> + <Copy SourceFiles="@(_LIBFFIDLL)" DestinationFolder="$(OutDir)" /> diff --git a/external/python3/python-3.8-msvc-sdk.patch.1 b/external/python3/python-3.8-msvc-sdk.patch.1 new file mode 100644 index 000000000000..fabdbb53ea63 --- /dev/null +++ b/external/python3/python-3.8-msvc-sdk.patch.1 @@ -0,0 +1,173 @@ +diff --git a/PC/pylauncher.rc b/PC/pylauncher.rc +index 92987af713..d21f9b6e9d 100644 +--- a/PC/pylauncher.rc ++++ b/PC/pylauncher.rc +@@ -4,7 +4,6 @@ + + // Include the manifest file that indicates we support all + // current versions of Windows. +-#include <winuser.h> + 1 RT_MANIFEST "python.manifest" + + #if defined(PY_ICON) +diff --git a/PC/pyshellext.rc b/PC/pyshellext.rc +index e5924a42da..fc607e9784 100644 +--- a/PC/pyshellext.rc ++++ b/PC/pyshellext.rc +@@ -4,7 +4,6 @@ + + // Include the manifest file that indicates we support all + // current versions of Windows. +-#include <winuser.h> + 1 RT_MANIFEST "python.manifest" + + ///////////////////////////////////////////////////////////////////////////// +diff --git a/PC/python_exe.rc b/PC/python_exe.rc +index ae0b029b80..5eba89962b 100644 +--- a/PC/python_exe.rc ++++ b/PC/python_exe.rc +@@ -4,7 +4,6 @@ + + // Include the manifest file that indicates we support all + // current versions of Windows. +-#include <winuser.h> + 1 RT_MANIFEST "python.manifest" + + 1 ICON DISCARDABLE "icons\python.ico" +diff --git a/PC/python_nt.rc b/PC/python_nt.rc +index fac6105d8a..33cee42cb7 100644 +--- a/PC/python_nt.rc ++++ b/PC/python_nt.rc +@@ -4,7 +4,6 @@ + + // Include the manifest file that indicates we support all + // current versions of Windows. +-#include <winuser.h> + 2 RT_MANIFEST "python.manifest" + + // String Tables +diff --git a/PC/pythonw_exe.rc b/PC/pythonw_exe.rc +index 88bf3592e1..562652be18 100644 +--- a/PC/pythonw_exe.rc ++++ b/PC/pythonw_exe.rc +@@ -4,7 +4,6 @@ + + // Include the manifest file that indicates we support all + // current versions of Windows. +-#include <winuser.h> + 1 RT_MANIFEST "python.manifest" + + 1 ICON DISCARDABLE "icons\pythonw.ico" +diff --git a/PC/sqlite3.rc b/PC/sqlite3.rc +index 84bd87d9d5..d2c18f8add 100644 +--- a/PC/sqlite3.rc ++++ b/PC/sqlite3.rc +@@ -4,7 +4,6 @@ + + // Include the manifest file that indicates we support all + // current versions of Windows. +-#include <winuser.h> + 2 RT_MANIFEST "python.manifest" + + ///////////////////////////////////////////////////////////////////////////// +diff --git a/PC/pylauncher.rc b/PC/pylauncher.rc +index d21f9b6e9d..ff7e71e0fd 100644 +--- a/PC/pylauncher.rc ++++ b/PC/pylauncher.rc +@@ -2,6 +2,11 @@ + + #include "python_ver_rc.h" + ++#ifndef RT_MANIFEST ++// bpo-45220: Cannot reliably #include RT_MANIFEST from ++// anywhere, so we hardcode it ++#define RT_MANIFEST 24 ++#endif + // Include the manifest file that indicates we support all + // current versions of Windows. + 1 RT_MANIFEST "python.manifest" +diff --git a/PC/pyshellext.rc b/PC/pyshellext.rc +index fc607e9784..af797ce95d 100644 +--- a/PC/pyshellext.rc ++++ b/PC/pyshellext.rc +@@ -2,6 +2,12 @@ + + #include "python_ver_rc.h" + ++#ifndef RT_MANIFEST ++// bpo-45220: Cannot reliably #include RT_MANIFEST from ++// anywhere, so we hardcode it ++#define RT_MANIFEST 24 ++#endif ++ + // Include the manifest file that indicates we support all + // current versions of Windows. + 1 RT_MANIFEST "python.manifest" +diff --git a/PC/python_exe.rc b/PC/python_exe.rc +index 5eba89962b..c3d3bff019 100644 +--- a/PC/python_exe.rc ++++ b/PC/python_exe.rc +@@ -2,6 +2,12 @@ + + #include "python_ver_rc.h" + ++#ifndef RT_MANIFEST ++// bpo-45220: Cannot reliably #include RT_MANIFEST from ++// anywhere, so we hardcode it ++#define RT_MANIFEST 24 ++#endif ++ + // Include the manifest file that indicates we support all + // current versions of Windows. + 1 RT_MANIFEST "python.manifest" +diff --git a/PC/python_nt.rc b/PC/python_nt.rc +index 33cee42cb7..539362cdc2 100644 +--- a/PC/python_nt.rc ++++ b/PC/python_nt.rc +@@ -2,6 +2,12 @@ + + #include "python_ver_rc.h" + ++#ifndef RT_MANIFEST ++// bpo-45220: Cannot reliably #include RT_MANIFEST from ++// anywhere, so we hardcode it ++#define RT_MANIFEST 24 ++#endif ++ + // Include the manifest file that indicates we support all + // current versions of Windows. + 2 RT_MANIFEST "python.manifest" +diff --git a/PC/pythonw_exe.rc b/PC/pythonw_exe.rc +index 562652be18..38570b74fa 100644 +--- a/PC/pythonw_exe.rc ++++ b/PC/pythonw_exe.rc +@@ -2,6 +2,12 @@ + + #include "python_ver_rc.h" + ++#ifndef RT_MANIFEST ++// bpo-45220: Cannot reliably #include RT_MANIFEST from ++// anywhere, so we hardcode it ++#define RT_MANIFEST 24 ++#endif ++ + // Include the manifest file that indicates we support all + // current versions of Windows. + 1 RT_MANIFEST "python.manifest" +diff --git a/PC/sqlite3.rc b/PC/sqlite3.rc +index d2c18f8add..9ae2aa0f6f 100644 +--- a/PC/sqlite3.rc ++++ b/PC/sqlite3.rc +@@ -2,6 +2,12 @@ + + #include <winver.h> + ++#ifndef RT_MANIFEST ++// bpo-45220: Cannot reliably #include RT_MANIFEST from ++// anywhere, so we hardcode it ++#define RT_MANIFEST 24 ++#endif ++ + // Include the manifest file that indicates we support all + // current versions of Windows. + 2 RT_MANIFEST "python.manifest" diff --git a/external/python3/tsan.patch.0 b/external/python3/tsan.patch.0 new file mode 100644 index 000000000000..d599ec046109 --- /dev/null +++ b/external/python3/tsan.patch.0 @@ -0,0 +1,10 @@ +--- Python/ceval_gil.h ++++ Python/ceval_gil.h +@@ -135,6 +135,7 @@ + + static void recreate_gil(struct _gil_runtime_state *gil) + { ++ _Py_ANNOTATE_RWLOCK_RELEASED(&gil->locked, 1); + _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked); + /* XXX should we destroy the old OS resources here? */ + create_gil(gil); diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0 index 9f458b1e0f95..d44fbe055c86 100644 --- a/external/python3/ubsan.patch.0 +++ b/external/python3/ubsan.patch.0 @@ -20,7 +20,7 @@ This is clc or stc, together with the first byte of the jmp. */ --- Modules/posixmodule.c +++ Modules/posixmodule.c -@@ -23,6 +23,9 @@ +@@ -13998,6 +13998,9 @@ }; static int @@ -32,7 +32,7 @@ #ifdef F_OK --- Objects/listobject.c +++ Objects/listobject.c -@@ -548,7 +548,7 @@ +@@ -554,7 +554,7 @@ dest[i] = v; } src = b->ob_item; diff --git a/external/qrcodegen/Makefile b/external/qrcodegen/Makefile deleted file mode 100644 index e4968cf85fb6..000000000000 --- a/external/qrcodegen/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- - -module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -include $(module_directory)/../../solenv/gbuild/partial_build.mk - -# vim: set noet sw=4 ts=4: diff --git a/external/qrcodegen/README b/external/qrcodegen/README deleted file mode 100644 index d6f19abdc833..000000000000 --- a/external/qrcodegen/README +++ /dev/null @@ -1,3 +0,0 @@ -QR code generating library, available from [https://github.com/nayuki/QR-Code-generator/tree/master/cpp]. - -qrcodegenerator to make the QR code out of a link or text in libreoffice. diff --git a/external/qrcodegen/StaticLibrary_qrcodegen.mk b/external/qrcodegen/StaticLibrary_qrcodegen.mk deleted file mode 100644 index d4b21673bd79..000000000000 --- a/external/qrcodegen/StaticLibrary_qrcodegen.mk +++ /dev/null @@ -1,26 +0,0 @@ -# -*- 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,qrcodegen)) - -$(eval $(call gb_StaticLibrary_use_unpacked,qrcodegen,qrcodegen)) - -$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,qrcodegen,cpp)) - -$(eval $(call gb_StaticLibrary_use_external,qrcodegen,icu_headers)) - -$(eval $(call gb_StaticLibrary_set_warnings_disabled,qrcodegen)) - -$(eval $(call gb_StaticLibrary_add_generated_exception_objects,qrcodegen,\ - UnpackedTarball/qrcodegen/cpp/BitBuffer \ - UnpackedTarball/qrcodegen/cpp/QrCode \ - UnpackedTarball/qrcodegen/cpp/QrSegment \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk index 4bc91c375b85..74759c65be31 100644 --- a/external/redland/ExternalProject_raptor.mk +++ b/external/redland/ExternalProject_raptor.mk @@ -19,18 +19,21 @@ $(call gb_ExternalProject_get_state_target,raptor,build): $(call gb_Trace_StartRange,raptor,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(if $(filter iOS,$(OS)),LIBS="-liconv") \ - CFLAGS="$(CFLAGS) $(if $(debug),-g,-O) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS="$(CFLAGS) \ + $(call gb_ExternalProject_get_build_flags,raptor) \ + $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \ $(if $(filter GCCLINUXPOWERPC64,$(COM)$(OS)$(CPUNAME)),-mminimal-toc)" \ LDFLAGS=" \ $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ - CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include)" \ - ./configure --disable-gtk-doc \ + CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(gb_EMSCRIPTEN_CPPFLAGS)" \ + $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \ --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \ --with-www=xml \ --without-xslt-config \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ diff --git a/external/redland/ExternalProject_rasqal.mk b/external/redland/ExternalProject_rasqal.mk index 0e765e098eb9..de53b4e4f3d2 100644 --- a/external/redland/ExternalProject_rasqal.mk +++ b/external/redland/ExternalProject_rasqal.mk @@ -22,7 +22,8 @@ $(eval $(call gb_ExternalProject_register_targets,rasqal,\ $(call gb_ExternalProject_get_state_target,rasqal,build): $(call gb_Trace_StartRange,rasqal,EXTERNAL) $(call gb_ExternalProject_run,build,\ - CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(call gb_ExternalProject_get_build_flags,rasqal) $(gb_EMSCRIPTEN_CPPFLAGS)" \ LDFLAGS=" \ $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ @@ -30,13 +31,13 @@ $(call gb_ExternalProject_get_state_target,rasqal,build): PKG_CONFIG="" \ RAPTOR2_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,raptor)/src" \ RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2" \ - ./configure --disable-gtk-doc \ + $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \ --with-regex-library=posix \ --with-decimal=none \ --with-uuid-library=internal \ --with-digest-library=internal \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(DISABLE_DYNLOADING), \ --enable-static --disable-shared \ diff --git a/external/redland/ExternalProject_redland.mk b/external/redland/ExternalProject_redland.mk index f6101f0d288e..0f7afa6d8182 100644 --- a/external/redland/ExternalProject_redland.mk +++ b/external/redland/ExternalProject_redland.mk @@ -23,7 +23,8 @@ $(eval $(call gb_ExternalProject_register_targets,redland,\ $(call gb_ExternalProject_get_state_target,redland,build): $(call gb_Trace_StartRange,redland,EXTERNAL) $(call gb_ExternalProject_run,build,\ - CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(call gb_ExternalProject_get_build_flags,redland) $(gb_EMSCRIPTEN_CPPFLAGS)" \ LDFLAGS=" \ $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ @@ -33,13 +34,13 @@ $(call gb_ExternalProject_get_state_target,redland,build): RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 $(LIBXML_LIBS)" \ RASQAL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,rasqal)/src" \ RASQAL_LIBS="-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal" \ - ./configure --disable-gtk-doc \ + $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \ --disable-modular \ --without-threads \ --without-bdb --without-sqlite --without-mysql \ --without-postgresql --without-threestone --without-virtuoso \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ - $(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ + $(gb_CONFIGURE_PLATFORMS) \ + $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(ENABLE_DEBUG),--enable-debug) \ $(if $(DISABLE_DYNLOADING), \ diff --git a/external/redland/UnpackedTarball_raptor.mk b/external/redland/UnpackedTarball_raptor.mk index c5ff226168d8..ae61e9e4f3dd 100644 --- a/external/redland/UnpackedTarball_raptor.mk +++ b/external/redland/UnpackedTarball_raptor.mk @@ -22,6 +22,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,raptor,0)) $(eval $(call gb_UnpackedTarball_add_patches,raptor,\ external/redland/raptor/raptor-freebsd.patch.1 \ external/redland/raptor/raptor-msvc.patch.1 \ + external/redland/raptor/raptor-emscripten.patch.1 \ $(if $(filter-out WNT,$(OS)),external/redland/raptor/raptor-bundled-soname.patch.1) \ $(if $(filter ANDROID,$(OS)),external/redland/raptor/raptor-android.patch.1) \ external/redland/raptor/ubsan.patch \ @@ -30,7 +31,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,raptor,\ external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1 \ external/redland/raptor/0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1 \ external/redland/raptor/libtool.patch \ - external/redland/raptor/libxml-override.patch \ + external/redland/raptor/Wint-conversion.patch \ + external/redland/raptor/raptor-libxml2-11.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/redland/UnpackedTarball_rasqal.mk b/external/redland/UnpackedTarball_rasqal.mk index bb44f39a6f5a..16d67d6c18f2 100644 --- a/external/redland/UnpackedTarball_rasqal.mk +++ b/external/redland/UnpackedTarball_rasqal.mk @@ -22,7 +22,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,rasqal,\ external/redland/rasqal/rasqal-pkgconfig.patch.1 \ external/redland/rasqal/rasqal-freebsd.patch.1 \ external/redland/rasqal/rasqal-msvc.patch.1 \ - external/redland/rasqal/rasqal-aix.patch.1 \ $(if $(filter-out WNT,$(OS)),external/redland/rasqal/rasqal-bundled-soname.patch.1) \ $(if $(filter ANDROID,$(OS)),external/redland/rasqal/rasqal-android.patch.1) \ $(if $(CROSS_COMPILING),external/redland/rasqal/rasqal-xcompile.patch.1) \ diff --git a/external/redland/raptor/Wint-conversion.patch b/external/redland/raptor/Wint-conversion.patch new file mode 100644 index 000000000000..fb85f4f13518 --- /dev/null +++ b/external/redland/raptor/Wint-conversion.patch @@ -0,0 +1,22 @@ +--- src/raptor_parse.c ++++ src/raptor_parse.c +@@ -257,7 +257,7 @@ + int + raptor_world_get_parsers_count(raptor_world* world) + { +- RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); ++ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, 0); + + raptor_world_open(world); + +--- src/raptor_serialize.c ++++ src/raptor_serialize.c +@@ -240,7 +240,7 @@ + int + raptor_world_get_serializers_count(raptor_world* world) + { +- RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); ++ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, 0); + + raptor_world_open(world); + diff --git a/external/redland/raptor/libxml-override.patch b/external/redland/raptor/libxml-override.patch deleted file mode 100644 index edc2d0d497a4..000000000000 --- a/external/redland/raptor/libxml-override.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- configure -+++ configure -@@ -14387,8 +14387,8 @@ - - libxml_source=no - if test "X$XML_CONFIG" != "X"; then -- LIBXML_CFLAGS=`$XML_CONFIG --cflags` -- LIBXML_LIBS=`$XML_CONFIG --libs` -+ : ${LIBXML_CFLAGS=`$XML_CONFIG --cflags`} -+ : ${LIBXML_LIBS=`$XML_CONFIG --libs`} - - CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" - LIBS="$LIBS $LIBXML_LIBS" diff --git a/external/redland/raptor/raptor-emscripten.patch.1 b/external/redland/raptor/raptor-emscripten.patch.1 new file mode 100644 index 000000000000..e3c53b35b7b0 --- /dev/null +++ b/external/redland/raptor/raptor-emscripten.patch.1 @@ -0,0 +1,12 @@ +-*- Mode: Diff -*- +--- raptor/src/sort_r.h ++++ raptor/src/sort_r.h +@@ -27,7 +27,7 @@ + defined AMIGA) + # define _SORT_R_BSD + #elif (defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__ || \ +- defined __linux__ || defined __MINGW32__ || defined __GLIBC__) ++ defined __linux__ || defined __MINGW32__ || defined __GLIBC__ || defined __EMSCRIPTEN__) + # define _SORT_R_LINUX + #elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__) + # define _SORT_R_WINDOWS diff --git a/external/redland/raptor/raptor-libxml2-11.patch.1 b/external/redland/raptor/raptor-libxml2-11.patch.1 new file mode 100644 index 000000000000..9bed29e50d0b --- /dev/null +++ b/external/redland/raptor/raptor-libxml2-11.patch.1 @@ -0,0 +1,15 @@ +--- raptor/src/raptor_libxml.c 2023-05-24 09:55:21.589275008 +0100 ++++ raptor/src/raptor_libxml.c 2023-05-24 09:56:41.100324810 +0100 +@@ -246,9 +246,11 @@ + + ret->owner = 1; + +-#if LIBXML_VERSION >= 20627 ++#if LIBXML_VERSION >= 20627 && LIBXML_VERSION < 21100 + /* Checked field was released in 2.6.27 on 2006-10-25 + * http://git.gnome.org/browse/libxml2/commit/?id=a37a6ad91a61d168ecc4b29263def3363fff4da6 ++ * and removed with ++ * https://gitlab.gnome.org/GNOME/libxml2/-/commit/ce76ebfd1312459951d555ad9d87fb9a89eede55 + * + */ + diff --git a/external/redland/rasqal/rasqal-aix.patch.1 b/external/redland/rasqal/rasqal-aix.patch.1 deleted file mode 100644 index d755aa2e568e..000000000000 --- a/external/redland/rasqal/rasqal-aix.patch.1 +++ /dev/null @@ -1,25 +0,0 @@ ---- a/src/rasqal_literal.c 2013-03-29 21:22:57.413852072 +0100 -+++ b/src/rasqal_literal.c 2013-03-29 21:23:34.092851757 +0100 -@@ -46,10 +46,22 @@ - #include <stddef.h> - #endif - #include <stdarg.h> -+#ifdef _AIX -+# ifndef isnan -+# define isnan(x) \ -+ (sizeof (x) == sizeof (long double) ? isnan_ld (x) \ -+ : sizeof (x) == sizeof (double) ? isnan_d (x) \ -+ : isnan_f (x)) -+ static inline int isnan_f (float x) { return x != x; } -+ static inline int isnan_d (double x) { return x != x; } -+ static inline int isnan_ld (long double x) { return x != x; } -+# endif -+#else - /* for isnan() */ - #ifdef HAVE_MATH_H - #include <math.h> - #endif -+#endif - /* for INT_MIN and INT_MAX */ - #ifdef HAVE_LIMITS_H - #include <limits.h> diff --git a/external/rhino/ExternalPackage_rhino.mk b/external/rhino/ExternalPackage_rhino.mk index 0ee1d60e309d..faac15c6978e 100644 --- a/external/rhino/ExternalPackage_rhino.mk +++ b/external/rhino/ExternalPackage_rhino.mk @@ -11,6 +11,6 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,rhino,rhino)) $(eval $(call gb_ExternalPackage_use_external_project,rhino,rhino)) -$(eval $(call gb_ExternalPackage_add_file,rhino,$(LIBO_SHARE_JAVA_FOLDER)/js.jar,build/rhino1_5R5/js.jar)) +$(eval $(call gb_ExternalPackage_add_file,rhino,$(LIBO_SHARE_JAVA_FOLDER)/js.jar,build/js.jar)) # vim: set noet sw=4 ts=4: diff --git a/external/rhino/ExternalProject_rhino.mk b/external/rhino/ExternalProject_rhino.mk index 6ef30ca34f24..3df0aaa4e2d9 100644 --- a/external/rhino/ExternalProject_rhino.mk +++ b/external/rhino/ExternalProject_rhino.mk @@ -16,16 +16,32 @@ $(eval $(call gb_ExternalProject_register_targets,rhino,\ $(call gb_ExternalProject_get_state_target,rhino,build) : $(call gb_Trace_StartRange,rhino,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ - $(ICECREAM_RUN) "$(ANT)" \ - $(if $(verbose),-v,-q) \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - -DTARFILE_LOCATION="$(if $(findstring -cygwin,$(BUILD_PLATFORM)),$(shell cygpath -m $(TARFILE_LOCATION)),$(TARFILE_LOCATION))" \ - -Dant.build.javac.source=$(JAVA_SOURCE_VER) \ - -Dant.build.javac.target=$(JAVA_TARGET_VER) \ - $(if $(debug),-Dbuild.debug="on") \ - jar \ + mkdir $(call gb_UnpackedTarball_get_dir,rhino)/build \ + && cd $(call gb_UnpackedTarball_get_dir,rhino) \ + && $(call gb_JavaClassSet_JAVACCOMMAND,$(JAVA_TARGET_VER)) $(gb_JavaClassSet_JAVACDEBUG) \ + -d $(call gb_UnpackedTarball_get_dir,rhino)/build/content \ + @$(SRCDIR)/external/rhino/filelist.txt \ + && mkdir $(call gb_UnpackedTarball_get_dir,rhino)/build/content/META-INF \ + && cp $(call gb_UnpackedTarball_get_dir,rhino)/LICENSE.txt \ + $(call gb_UnpackedTarball_get_dir,rhino)/NOTICE-tools.txt \ + $(call gb_UnpackedTarball_get_dir,rhino)/NOTICE.txt \ + $(call gb_UnpackedTarball_get_dir,rhino)/build/content/META-INF/ \ + && $(gb_Jar_JARCOMMAND) -cf $(call gb_UnpackedTarball_get_dir,rhino)/build/js.jar \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/build/content . \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/commonjs/module/package.html \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/commonjs/module/provider/package.html \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/resources/Messages.properties \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/resources/Messages_en.properties \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/resources/Messages_fr.properties \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/tools/debugger/test.js \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/tools/resources/Messages.properties \ ) $(call gb_Trace_EndRange,rhino,EXTERNAL) diff --git a/external/rhino/OfficeScriptInfo.java b/external/rhino/OfficeScriptInfo.java deleted file mode 100644 index eb1d78641d23..000000000000 --- a/external/rhino/OfficeScriptInfo.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -package org.mozilla.javascript.tools.debugger; -import java.net.URL; -import java.util.HashMap; -import org.mozilla.javascript.Scriptable; - -public class OfficeScriptInfo -{ - private HashMap<String, SFScriptInfo> loadedSFScripts = new HashMap<String, SFScriptInfo>(); - - public void addScript( URL url, Scriptable scope, Runnable closeCallback ) - { - addScript( url.toString(), url, scope, closeCallback ); - } - - public void addScript( String key, URL url, Scriptable scope, Runnable closeCallback ) - { - SFScriptInfo si = loadedSFScripts.get( key ); - if ( si == null ) - { - si = new SFScriptInfo(); - si.url = url; - si.scope = scope; - si.closeCallback = closeCallback; - loadedSFScripts.put( key, si ); - } - } - - public void deleteScript( String key ) - { - SFScriptInfo info = loadedSFScripts.remove( key ); - if ( info != null ) - { - if ( info.closeCallback != null ) - { - System.out.println("** In removeSFScriptInfo have callback for " + key ); - info.closeCallback.run(); // really need to do this in separate thread???? - } - } - } - - public Scriptable getScriptScope( String key ) - { - Scriptable result = null; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - result = info.scope; - } - return result; - } - - public URL getScriptUrl( String key ) - { - URL result = null; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - result = info.url; - } - return result; - } - public boolean hasScript( String key ) - { - boolean result = true; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info == null ) - { - result = false; - } - return result; - } - - public void setScriptRunning( String key, boolean running ) - { - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - info.isExecuting = running; - } - } - - public boolean isScriptRunning( String key ) - { - boolean result = false; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - result = info.isExecuting; - } - return result; - } - - class SFScriptInfo - { - Scriptable scope; - boolean isExecuting; - URL url; - Runnable closeCallback; - } -} diff --git a/external/rhino/README b/external/rhino/README index 83e4135d0b89..c60378c32262 100644 --- a/external/rhino/README +++ b/external/rhino/README @@ -3,12 +3,3 @@ JavaScript engine/interpreter written in Java, used to provide JavaScript extens The Scripting Framework makes use of the Rhino ([http://www.mozilla.org/rhino/]) JavaScript interpreter, available under the Mozilla Public License ([http://www.mozilla.org/MPL/MPL-1.1.html]). - -In addition, to support the debugging of scripts contained in OpenOffice.org -documents, we have modified the Java source file Main.java. - -The Rhino source tarball is unpacked and patched with the modified code. The -Rhino Jar file (js.jar) is then built (download/swingExSrc.zip is unpacked and -built as part of this procesS) and delivered to the solver. The file -rhino1_5R5.patch contains the changes made in order to build Rhino. The patch -was generated using the command: diff -wurN diff --git a/external/rhino/UnpackedTarball_rhino.mk b/external/rhino/UnpackedTarball_rhino.mk index 0a1492b88da6..8cb9fd387384 100644 --- a/external/rhino/UnpackedTarball_rhino.mk +++ b/external/rhino/UnpackedTarball_rhino.mk @@ -11,14 +11,4 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,rhino)) $(eval $(call gb_UnpackedTarball_set_tarball,rhino,$(RHINO_TARBALL),,rhino)) -$(eval $(call gb_UnpackedTarball_set_patchlevel,rhino,2)) - -$(eval $(call gb_UnpackedTarball_add_patches,rhino,\ - external/rhino/rhino1_5R5.patch \ - external/rhino/rhino1_5R5-find_swing.patch \ - external/rhino/rhino1_5R5-updateToolTip.patch \ -)) - -$(eval $(call gb_UnpackedTarball_add_file,rhino,toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java,external/rhino/OfficeScriptInfo.java)) - # vim: set noet sw=4 ts=4: diff --git a/external/rhino/filelist.txt b/external/rhino/filelist.txt new file mode 100644 index 000000000000..9ded7087e132 --- /dev/null +++ b/external/rhino/filelist.txt @@ -0,0 +1,330 @@ +src/org/mozilla/classfile/ByteCode.java +src/org/mozilla/classfile/ClassFileField.java +src/org/mozilla/classfile/ClassFileMethod.java +src/org/mozilla/classfile/ClassFileWriter.java +src/org/mozilla/classfile/ConstantEntry.java +src/org/mozilla/classfile/ConstantPool.java +src/org/mozilla/classfile/ExceptionTableEntry.java +src/org/mozilla/classfile/FieldOrMethodRef.java +src/org/mozilla/classfile/SuperBlock.java +src/org/mozilla/classfile/TypeInfo.java +src/org/mozilla/javascript/AbstractEcmaObjectOperations.java +src/org/mozilla/javascript/AccessorSlot.java +src/org/mozilla/javascript/Arguments.java +src/org/mozilla/javascript/ArrowFunction.java +src/org/mozilla/javascript/BaseFunction.java +src/org/mozilla/javascript/BoundFunction.java +src/org/mozilla/javascript/Callable.java +src/org/mozilla/javascript/ClassCache.java +src/org/mozilla/javascript/ClassShutter.java +src/org/mozilla/javascript/CodeGenerator.java +src/org/mozilla/javascript/CompilerEnvirons.java +src/org/mozilla/javascript/ConsString.java +src/org/mozilla/javascript/ConstProperties.java +src/org/mozilla/javascript/Constructable.java +src/org/mozilla/javascript/Context.java +src/org/mozilla/javascript/ContextAction.java +src/org/mozilla/javascript/ContextFactory.java +src/org/mozilla/javascript/ContextListener.java +src/org/mozilla/javascript/ContinuationPending.java +src/org/mozilla/javascript/DToA.java +src/org/mozilla/javascript/Decompiler.java +src/org/mozilla/javascript/DefaultErrorReporter.java +src/org/mozilla/javascript/DefiningClassLoader.java +src/org/mozilla/javascript/Delegator.java +src/org/mozilla/javascript/ES6Generator.java +src/org/mozilla/javascript/ES6Iterator.java +src/org/mozilla/javascript/EcmaError.java +src/org/mozilla/javascript/EmbeddedSlotMap.java +src/org/mozilla/javascript/EqualObjectGraphs.java +src/org/mozilla/javascript/ErrorReporter.java +src/org/mozilla/javascript/Evaluator.java +src/org/mozilla/javascript/EvaluatorException.java +src/org/mozilla/javascript/ExternalArrayData.java +src/org/mozilla/javascript/Function.java +src/org/mozilla/javascript/FunctionObject.java +src/org/mozilla/javascript/GeneratedClassLoader.java +src/org/mozilla/javascript/HashSlotMap.java +src/org/mozilla/javascript/Hashtable.java +src/org/mozilla/javascript/IRFactory.java +src/org/mozilla/javascript/Icode.java +src/org/mozilla/javascript/IdFunctionCall.java +src/org/mozilla/javascript/IdFunctionObject.java +src/org/mozilla/javascript/IdFunctionObjectES6.java +src/org/mozilla/javascript/IdScriptableObject.java +src/org/mozilla/javascript/ImplementationVersion.java +src/org/mozilla/javascript/ImporterTopLevel.java +src/org/mozilla/javascript/InterfaceAdapter.java +src/org/mozilla/javascript/InterpretedFunction.java +src/org/mozilla/javascript/Interpreter.java +src/org/mozilla/javascript/InterpreterData.java +src/org/mozilla/javascript/IteratorLikeIterable.java +src/org/mozilla/javascript/JavaAdapter.java +src/org/mozilla/javascript/JavaMembers.java +src/org/mozilla/javascript/JavaMembers_jdk11.java +src/org/mozilla/javascript/JavaScriptException.java +src/org/mozilla/javascript/JavaToJSONConverters.java +src/org/mozilla/javascript/Kit.java +src/org/mozilla/javascript/LambdaConstructor.java +src/org/mozilla/javascript/LambdaFunction.java +src/org/mozilla/javascript/LambdaSlot.java +src/org/mozilla/javascript/LazilyLoadedCtor.java +src/org/mozilla/javascript/LazyLoadSlot.java +src/org/mozilla/javascript/MemberBox.java +src/org/mozilla/javascript/NativeArray.java +src/org/mozilla/javascript/NativeArrayIterator.java +src/org/mozilla/javascript/NativeBigInt.java +src/org/mozilla/javascript/NativeBoolean.java +src/org/mozilla/javascript/NativeCall.java +src/org/mozilla/javascript/NativeCallSite.java +src/org/mozilla/javascript/NativeCollectionIterator.java +src/org/mozilla/javascript/NativeContinuation.java +src/org/mozilla/javascript/NativeDate.java +src/org/mozilla/javascript/NativeError.java +src/org/mozilla/javascript/NativeFunction.java +src/org/mozilla/javascript/NativeGenerator.java +src/org/mozilla/javascript/NativeGlobal.java +src/org/mozilla/javascript/NativeIterator.java +src/org/mozilla/javascript/NativeJSON.java +src/org/mozilla/javascript/NativeJavaArray.java +src/org/mozilla/javascript/NativeJavaClass.java +src/org/mozilla/javascript/NativeJavaConstructor.java +src/org/mozilla/javascript/NativeJavaList.java +src/org/mozilla/javascript/NativeJavaMap.java +src/org/mozilla/javascript/NativeJavaMethod.java +src/org/mozilla/javascript/NativeJavaObject.java +src/org/mozilla/javascript/NativeJavaPackage.java +src/org/mozilla/javascript/NativeJavaTopPackage.java +src/org/mozilla/javascript/NativeMap.java +src/org/mozilla/javascript/NativeMath.java +src/org/mozilla/javascript/NativeNumber.java +src/org/mozilla/javascript/NativeObject.java +src/org/mozilla/javascript/NativePromise.java +src/org/mozilla/javascript/NativeScript.java +src/org/mozilla/javascript/NativeSet.java +src/org/mozilla/javascript/NativeString.java +src/org/mozilla/javascript/NativeStringIterator.java +src/org/mozilla/javascript/NativeSymbol.java +src/org/mozilla/javascript/NativeWeakMap.java +src/org/mozilla/javascript/NativeWeakSet.java +src/org/mozilla/javascript/NativeWith.java +src/org/mozilla/javascript/Node.java +src/org/mozilla/javascript/NodeTransformer.java +src/org/mozilla/javascript/ObjArray.java +src/org/mozilla/javascript/ObjToIntMap.java +src/org/mozilla/javascript/Parser.java +src/org/mozilla/javascript/PolicySecurityController.java +src/org/mozilla/javascript/Ref.java +src/org/mozilla/javascript/RefCallable.java +src/org/mozilla/javascript/RegExpProxy.java +src/org/mozilla/javascript/RhinoException.java +src/org/mozilla/javascript/RhinoSecurityManager.java +src/org/mozilla/javascript/Script.java +src/org/mozilla/javascript/ScriptRuntime.java +src/org/mozilla/javascript/ScriptRuntimeES6.java +src/org/mozilla/javascript/ScriptStackElement.java +src/org/mozilla/javascript/Scriptable.java +src/org/mozilla/javascript/ScriptableObject.java +src/org/mozilla/javascript/SecureCaller.java +src/org/mozilla/javascript/SecurityController.java +src/org/mozilla/javascript/SecurityUtilities.java +src/org/mozilla/javascript/Slot.java +src/org/mozilla/javascript/SlotMap.java +src/org/mozilla/javascript/SlotMapContainer.java +src/org/mozilla/javascript/Sorting.java +src/org/mozilla/javascript/SpecialRef.java +src/org/mozilla/javascript/StackStyle.java +src/org/mozilla/javascript/Symbol.java +src/org/mozilla/javascript/SymbolKey.java +src/org/mozilla/javascript/SymbolScriptable.java +src/org/mozilla/javascript/Synchronizer.java +src/org/mozilla/javascript/ThreadSafeSlotMapContainer.java +src/org/mozilla/javascript/Token.java +src/org/mozilla/javascript/TokenStream.java +src/org/mozilla/javascript/TopLevel.java +src/org/mozilla/javascript/UintMap.java +src/org/mozilla/javascript/Undefined.java +src/org/mozilla/javascript/UnhandledRejectionTracker.java +src/org/mozilla/javascript/UniqueTag.java +src/org/mozilla/javascript/VMBridge.java +src/org/mozilla/javascript/WrapFactory.java +src/org/mozilla/javascript/WrappedException.java +src/org/mozilla/javascript/Wrapper.java +src/org/mozilla/javascript/annotations/JSConstructor.java +src/org/mozilla/javascript/annotations/JSFunction.java +src/org/mozilla/javascript/annotations/JSGetter.java +src/org/mozilla/javascript/annotations/JSSetter.java +src/org/mozilla/javascript/annotations/JSStaticFunction.java +src/org/mozilla/javascript/ast/ArrayComprehension.java +src/org/mozilla/javascript/ast/ArrayComprehensionLoop.java +src/org/mozilla/javascript/ast/ArrayLiteral.java +src/org/mozilla/javascript/ast/Assignment.java +src/org/mozilla/javascript/ast/AstNode.java +src/org/mozilla/javascript/ast/AstRoot.java +src/org/mozilla/javascript/ast/BigIntLiteral.java +src/org/mozilla/javascript/ast/Block.java +src/org/mozilla/javascript/ast/BreakStatement.java +src/org/mozilla/javascript/ast/CatchClause.java +src/org/mozilla/javascript/ast/Comment.java +src/org/mozilla/javascript/ast/ConditionalExpression.java +src/org/mozilla/javascript/ast/ContinueStatement.java +src/org/mozilla/javascript/ast/DestructuringForm.java +src/org/mozilla/javascript/ast/DoLoop.java +src/org/mozilla/javascript/ast/ElementGet.java +src/org/mozilla/javascript/ast/EmptyExpression.java +src/org/mozilla/javascript/ast/EmptyStatement.java +src/org/mozilla/javascript/ast/ErrorCollector.java +src/org/mozilla/javascript/ast/ErrorNode.java +src/org/mozilla/javascript/ast/ExpressionStatement.java +src/org/mozilla/javascript/ast/ForInLoop.java +src/org/mozilla/javascript/ast/ForLoop.java +src/org/mozilla/javascript/ast/FunctionCall.java +src/org/mozilla/javascript/ast/FunctionNode.java +src/org/mozilla/javascript/ast/GeneratorExpression.java +src/org/mozilla/javascript/ast/GeneratorExpressionLoop.java +src/org/mozilla/javascript/ast/IdeErrorReporter.java +src/org/mozilla/javascript/ast/IfStatement.java +src/org/mozilla/javascript/ast/InfixExpression.java +src/org/mozilla/javascript/ast/Jump.java +src/org/mozilla/javascript/ast/KeywordLiteral.java +src/org/mozilla/javascript/ast/Label.java +src/org/mozilla/javascript/ast/LabeledStatement.java +src/org/mozilla/javascript/ast/LetNode.java +src/org/mozilla/javascript/ast/Loop.java +src/org/mozilla/javascript/ast/Name.java +src/org/mozilla/javascript/ast/NewExpression.java +src/org/mozilla/javascript/ast/NodeVisitor.java +src/org/mozilla/javascript/ast/NumberLiteral.java +src/org/mozilla/javascript/ast/ObjectLiteral.java +src/org/mozilla/javascript/ast/ObjectProperty.java +src/org/mozilla/javascript/ast/ParenthesizedExpression.java +src/org/mozilla/javascript/ast/ParseProblem.java +src/org/mozilla/javascript/ast/PropertyGet.java +src/org/mozilla/javascript/ast/RegExpLiteral.java +src/org/mozilla/javascript/ast/ReturnStatement.java +src/org/mozilla/javascript/ast/Scope.java +src/org/mozilla/javascript/ast/ScriptNode.java +src/org/mozilla/javascript/ast/StringLiteral.java +src/org/mozilla/javascript/ast/SwitchCase.java +src/org/mozilla/javascript/ast/SwitchStatement.java +src/org/mozilla/javascript/ast/Symbol.java +src/org/mozilla/javascript/ast/TaggedTemplateLiteral.java +src/org/mozilla/javascript/ast/TemplateCharacters.java +src/org/mozilla/javascript/ast/TemplateLiteral.java +src/org/mozilla/javascript/ast/ThrowStatement.java +src/org/mozilla/javascript/ast/TryStatement.java +src/org/mozilla/javascript/ast/UnaryExpression.java +src/org/mozilla/javascript/ast/UpdateExpression.java +src/org/mozilla/javascript/ast/VariableDeclaration.java +src/org/mozilla/javascript/ast/VariableInitializer.java +src/org/mozilla/javascript/ast/WhileLoop.java +src/org/mozilla/javascript/ast/WithStatement.java +src/org/mozilla/javascript/ast/XmlDotQuery.java +src/org/mozilla/javascript/ast/XmlElemRef.java +src/org/mozilla/javascript/ast/XmlExpression.java +src/org/mozilla/javascript/ast/XmlFragment.java +src/org/mozilla/javascript/ast/XmlLiteral.java +src/org/mozilla/javascript/ast/XmlMemberGet.java +src/org/mozilla/javascript/ast/XmlPropRef.java +src/org/mozilla/javascript/ast/XmlRef.java +src/org/mozilla/javascript/ast/XmlString.java +src/org/mozilla/javascript/ast/Yield.java +src/org/mozilla/javascript/commonjs/module/ModuleScope.java +src/org/mozilla/javascript/commonjs/module/ModuleScript.java +src/org/mozilla/javascript/commonjs/module/ModuleScriptProvider.java +src/org/mozilla/javascript/commonjs/module/Require.java +src/org/mozilla/javascript/commonjs/module/RequireBuilder.java +src/org/mozilla/javascript/commonjs/module/provider/CachingModuleScriptProviderBase.java +src/org/mozilla/javascript/commonjs/module/provider/DefaultUrlConnectionExpiryCalculator.java +src/org/mozilla/javascript/commonjs/module/provider/ModuleSource.java +src/org/mozilla/javascript/commonjs/module/provider/ModuleSourceProvider.java +src/org/mozilla/javascript/commonjs/module/provider/ModuleSourceProviderBase.java +src/org/mozilla/javascript/commonjs/module/provider/MultiModuleScriptProvider.java +src/org/mozilla/javascript/commonjs/module/provider/ParsedContentType.java +src/org/mozilla/javascript/commonjs/module/provider/SoftCachingModuleScriptProvider.java +src/org/mozilla/javascript/commonjs/module/provider/StrongCachingModuleScriptProvider.java +src/org/mozilla/javascript/commonjs/module/provider/UrlConnectionExpiryCalculator.java +src/org/mozilla/javascript/commonjs/module/provider/UrlConnectionSecurityDomainProvider.java +src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java +src/org/mozilla/javascript/debug/DebugFrame.java +src/org/mozilla/javascript/debug/DebuggableObject.java +src/org/mozilla/javascript/debug/DebuggableScript.java +src/org/mozilla/javascript/debug/Debugger.java +src/org/mozilla/javascript/jdk18/VMBridge_jdk18.java +src/org/mozilla/javascript/json/JsonParser.java +src/org/mozilla/javascript/optimizer/Block.java +src/org/mozilla/javascript/optimizer/BodyCodegen.java +src/org/mozilla/javascript/optimizer/ClassCompiler.java +src/org/mozilla/javascript/optimizer/Codegen.java +src/org/mozilla/javascript/optimizer/OptFunctionNode.java +src/org/mozilla/javascript/optimizer/OptRuntime.java +src/org/mozilla/javascript/optimizer/OptTransformer.java +src/org/mozilla/javascript/optimizer/Optimizer.java +src/org/mozilla/javascript/regexp/NativeRegExp.java +src/org/mozilla/javascript/regexp/NativeRegExpCallable.java +src/org/mozilla/javascript/regexp/NativeRegExpCtor.java +src/org/mozilla/javascript/regexp/NativeRegExpInstantiator.java +src/org/mozilla/javascript/regexp/RegExpImpl.java +src/org/mozilla/javascript/regexp/SubString.java +src/org/mozilla/javascript/serialize/ScriptableInputStream.java +src/org/mozilla/javascript/serialize/ScriptableOutputStream.java +src/org/mozilla/javascript/tools/SourceReader.java +src/org/mozilla/javascript/tools/ToolErrorReporter.java +src/org/mozilla/javascript/tools/debugger/Dim.java +src/org/mozilla/javascript/tools/debugger/GuiCallback.java +src/org/mozilla/javascript/tools/debugger/Main.java +src/org/mozilla/javascript/tools/debugger/ScopeProvider.java +src/org/mozilla/javascript/tools/debugger/SourceProvider.java +src/org/mozilla/javascript/tools/debugger/SwingGui.java +src/org/mozilla/javascript/tools/debugger/treetable/AbstractCellEditor.java +src/org/mozilla/javascript/tools/debugger/treetable/JTreeTable.java +src/org/mozilla/javascript/tools/debugger/treetable/TreeTableModel.java +src/org/mozilla/javascript/tools/debugger/treetable/TreeTableModelAdapter.java +src/org/mozilla/javascript/tools/jsc/Main.java +src/org/mozilla/javascript/tools/shell/ConsoleTextArea.java +src/org/mozilla/javascript/tools/shell/Environment.java +src/org/mozilla/javascript/tools/shell/Global.java +src/org/mozilla/javascript/tools/shell/JSConsole.java +src/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java +src/org/mozilla/javascript/tools/shell/Main.java +src/org/mozilla/javascript/tools/shell/QuitAction.java +src/org/mozilla/javascript/tools/shell/SecurityProxy.java +src/org/mozilla/javascript/tools/shell/ShellConsole.java +src/org/mozilla/javascript/tools/shell/ShellContextFactory.java +src/org/mozilla/javascript/tools/shell/ShellLine.java +src/org/mozilla/javascript/tools/shell/Timers.java +src/org/mozilla/javascript/typedarrays/ByteIo.java +src/org/mozilla/javascript/typedarrays/Conversions.java +src/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java +src/org/mozilla/javascript/typedarrays/NativeArrayBufferView.java +src/org/mozilla/javascript/typedarrays/NativeDataView.java +src/org/mozilla/javascript/typedarrays/NativeFloat32Array.java +src/org/mozilla/javascript/typedarrays/NativeFloat64Array.java +src/org/mozilla/javascript/typedarrays/NativeInt16Array.java +src/org/mozilla/javascript/typedarrays/NativeInt32Array.java +src/org/mozilla/javascript/typedarrays/NativeInt8Array.java +src/org/mozilla/javascript/typedarrays/NativeTypedArrayIterator.java +src/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java +src/org/mozilla/javascript/typedarrays/NativeUint16Array.java +src/org/mozilla/javascript/typedarrays/NativeUint32Array.java +src/org/mozilla/javascript/typedarrays/NativeUint8Array.java +src/org/mozilla/javascript/typedarrays/NativeUint8ClampedArray.java +src/org/mozilla/javascript/v8dtoa/CachedPowers.java +src/org/mozilla/javascript/v8dtoa/DiyFp.java +src/org/mozilla/javascript/v8dtoa/DoubleConversion.java +src/org/mozilla/javascript/v8dtoa/DoubleHelper.java +src/org/mozilla/javascript/v8dtoa/FastDtoa.java +src/org/mozilla/javascript/v8dtoa/FastDtoaBuilder.java +src/org/mozilla/javascript/xml/XMLLib.java +src/org/mozilla/javascript/xml/XMLObject.java +src/org/mozilla/javascript/xmlimpl/Namespace.java +src/org/mozilla/javascript/xmlimpl/QName.java +src/org/mozilla/javascript/xmlimpl/XML.java +src/org/mozilla/javascript/xmlimpl/XMLCtor.java +src/org/mozilla/javascript/xmlimpl/XMLLibImpl.java +src/org/mozilla/javascript/xmlimpl/XMLList.java +src/org/mozilla/javascript/xmlimpl/XMLName.java +src/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java +src/org/mozilla/javascript/xmlimpl/XMLWithScope.java +src/org/mozilla/javascript/xmlimpl/XmlNode.java +src/org/mozilla/javascript/xmlimpl/XmlProcessor.java diff --git a/external/rhino/rhino1_5R5-find_swing.patch b/external/rhino/rhino1_5R5-find_swing.patch deleted file mode 100644 index 905336eb1b0d..000000000000 --- a/external/rhino/rhino1_5R5-find_swing.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- misc/rhino1_5R5/toolsrc/build.xml 2009-10-29 18:29:46.605524507 +0100 -+++ misc/build/rhino1_5R5/toolsrc/build.xml 2009-10-29 18:29:26.536908810 +0100 -@@ -38,11 +38,12 @@ - property="swing-ex-available"/> - </target> - -+ <property name="swing_zip" value="${TARFILE_LOCATION}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip"/> - <target name="get-swing-ex" unless="swing-ex-available"> - <!-- Download source from Sun's site, unzip it, remove - the files we don't need, and change the package - --> -- <unzip src="../../../../../download/swingExSrc.zip" dest="${src.debugger}"/> -+ <unzip src="${swing_zip}" dest="${src.debugger}"/> - <delete file="${src.debugger}/FileSystemModel2.java" /> - <delete file="${src.debugger}/MergeSort.java" /> - <delete file="${src.debugger}/TreeTableExample2.java" /> diff --git a/external/rhino/rhino1_5R5-updateToolTip.patch b/external/rhino/rhino1_5R5-updateToolTip.patch deleted file mode 100644 index be0700daf6c5..000000000000 --- a/external/rhino/rhino1_5R5-updateToolTip.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java Wed Feb 23 10:25:09 2011 -+++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java Wed Feb 23 10:25:01 2011 -@@ -1045,9 +1045,18 @@ - } ); - } - -+ // Fix taken from <ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip> -+ // toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java: - private void updateToolTip() { -- // in case fileName is very long, try to set tool tip on frame -- Component c = getComponent(1); -+ // Try to set tool tip on frame. On macOS 10.5, -+ // the number of components is different, so try to be safe. -+ int n = getComponentCount() - 1; -+ if (n > 1) { -+ n = 1; -+ } else if (n < 0) { -+ return; -+ } -+ Component c = getComponent(n); - // this will work at least for Metal L&F - if (c != null && c instanceof JComponent) { - ((JComponent)c).setToolTipText(getUrl()); diff --git a/external/rhino/rhino1_5R5.patch b/external/rhino/rhino1_5R5.patch deleted file mode 100644 index 40fc6cc9427b..000000000000 --- a/external/rhino/rhino1_5R5.patch +++ /dev/null @@ -1,1067 +0,0 @@ ---- misc/rhino1_5R5/src/org/mozilla/javascript/DefiningClassLoader.java Thu Mar 25 21:54:34 2004 -+++ misc/build/rhino1_5R5/src/org/mozilla/javascript/DefiningClassLoader.java Fri Mar 28 17:24:23 2008 -@@ -38,6 +38,7 @@ - package org.mozilla.javascript; - - import java.lang.reflect.Method; -+import java.lang.reflect.InvocationTargetException; - - /** - * Load generated classes. -@@ -48,11 +49,34 @@ - implements GeneratedClassLoader - { - public DefiningClassLoader() { -- this.parentLoader = getClass().getClassLoader(); -+ init(getClass().getClassLoader()); - } - - public DefiningClassLoader(ClassLoader parentLoader) { -+ -+ init(parentLoader); -+ } -+ -+ private void init(ClassLoader parentLoader) { -+ - this.parentLoader = parentLoader; -+ -+ this.contextLoader = null; -+ if (method_getContextClassLoader != null) { -+ try { -+ this.contextLoader = (ClassLoader) -+ method_getContextClassLoader.invoke( -+ Thread.currentThread(), -+ ScriptRuntime.emptyArgs); -+ } catch (IllegalAccessException ex) { -+ } catch (InvocationTargetException ex) { -+ } catch (SecurityException ex) { -+ } -+ if (this.contextLoader == this.parentLoader) { -+ this.contextLoader = null; -+ } -+ } -+ - } - - public Class defineClass(String name, byte[] data) { -@@ -68,10 +92,20 @@ - { - Class cl = findLoadedClass(name); - if (cl == null) { -- if (parentLoader != null) { -- cl = parentLoader.loadClass(name); -+ // First try parent class loader and if that does not work, try -+ // contextLoader, but that will be null if -+ // Thread.getContextClassLoader() == parentLoader -+ // or on JDK 1.1 due to lack Thread.getContextClassLoader(). -+ // To avoid catching and rethrowing ClassNotFoundException -+ // in this cases, use try/catch check only if contextLoader != null. -+ if (contextLoader == null) { -+ cl = loadFromParent(name); - } else { -- cl = findSystemClass(name); -+ try { -+ cl = loadFromParent(name); -+ } catch (ClassNotFoundException ex) { -+ cl = contextLoader.loadClass(name); -+ } - } - } - if (resolve) { -@@ -80,5 +114,37 @@ - return cl; - } - -+ private Class loadFromParent(String name) -+ throws ClassNotFoundException -+ { -+ if (parentLoader != null) { -+ return parentLoader.loadClass(name); -+ } else { -+ return findSystemClass(name); -+ } -+ -+ } -+ - private ClassLoader parentLoader; -+ -+ private ClassLoader contextLoader; -+ -+ // We'd like to use "Thread.getContextClassLoader", but -+ // that's only available on Java2. -+ private static Method method_getContextClassLoader; -+ -+ static { -+ try { -+ // Don't use "Thread.class": that performs the lookup -+ // in the class initializer, which doesn't allow us to -+ // catch possible security exceptions. -+ Class threadClass = Class.forName("java.lang.Thread"); -+ method_getContextClassLoader = -+ threadClass.getDeclaredMethod("getContextClassLoader", -+ new Class[0]); -+ } catch (ClassNotFoundException e) { -+ } catch (NoSuchMethodException e) { -+ } catch (SecurityException e) { -+ } -+ } - } ---- misc/rhino1_5R5/toolsrc/build.xml 2004-03-25 21:54:34.000000000 +0100 -+++ misc/build/rhino1_5R5/toolsrc/build.xml 2009-01-17 20:46:44.000000000 +0100 -@@ -6,6 +6,28 @@ - --> - <project name="toolsrc" default="compile" basedir="."> - -+ <condition property="boot_refID" value="macPath" else="nonMacPath"> -+ <and> -+ <os family="mac"/> -+ <os family="unix"/> -+ <or> -+ <equals arg1="${ant.java.version}" arg2="1.5"/> -+ <equals arg1="${ant.java.version}" arg2="1.6"/> -+ </or> -+ </and> -+ </condition> -+ <path id="macPath" location="${java.home}/../Classes/classes.jar"/> -+ <!-- rhino.jar from OpenJDK breaks build --> -+ <path id="nonMacPath"> -+ <fileset dir="${java.home}/"> -+ <include name="jre/lib/*.jar"/> -+ <include name="lib/*.jar"/> -+ <exclude name="jre/lib/rhino.jar"/> -+ <exclude name="lib/rhino.jar"/> -+ </fileset> -+ </path> -+ <path id="my.bootstrap.classpath" refID="${boot_refID}"/> -+ - <target name="properties"> - <property name="nest" value=".."/> - <property name="build.dir" value="./build"/> -@@ -20,46 +42,10 @@ - <!-- Download source from Sun's site, unzip it, remove - the files we don't need, and change the package - --> -- <get src="http://java.sun.com/products/jfc/tsc/articles/treetable2/downloads/src.zip" dest="${nest}/${build.dir}/swingExSrc.zip"/> -- <unzip src="${nest}/${build.dir}/swingExSrc.zip" dest="${src.debugger}"/> -+ <unzip src="../../../../../download/swingExSrc.zip" dest="${src.debugger}"/> - <delete file="${src.debugger}/FileSystemModel2.java" /> - <delete file="${src.debugger}/MergeSort.java" /> - <delete file="${src.debugger}/TreeTableExample2.java" /> -- <replace file="${src.debugger}/AbstractCellEditor.java"> -- <replacetoken>import java.awt.Component;</replacetoken> -- <replacevalue> -- package org.mozilla.javascript.tools.debugger; -- import java.awt.Component; -- </replacevalue> -- </replace> -- <replace file="${src.debugger}/AbstractTreeTableModel.java"> -- <replacetoken>import javax.swing.tree.*;</replacetoken> -- <replacevalue> -- package org.mozilla.javascript.tools.debugger; -- import javax.swing.tree.*; -- </replacevalue> -- </replace> -- <replace file="${src.debugger}/JTreeTable.java"> -- <replacetoken>import javax.swing.*;</replacetoken> -- <replacevalue> -- package org.mozilla.javascript.tools.debugger; -- import javax.swing.*; -- </replacevalue> -- </replace> -- <replace file="${src.debugger}/TreeTableModel.java"> -- <replacetoken>import javax.swing.tree.TreeModel;</replacetoken> -- <replacevalue> -- package org.mozilla.javascript.tools.debugger; -- import javax.swing.tree.TreeModel; -- </replacevalue> -- </replace> -- <replace file="${src.debugger}/TreeTableModelAdapter.java"> -- <replacetoken>import javax.swing.JTree;</replacetoken> -- <replacevalue> -- package org.mozilla.javascript.tools.debugger; -- import javax.swing.JTree; -- </replacevalue> -- </replace> - </target> - - <target name="compile" depends="properties,get-swing-ex"> ---- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java 2004-03-25 21:54:34.000000000 +0100 -+++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java 2009-01-17 20:44:22.000000000 +0100 -@@ -470,15 +470,21 @@ - case KeyEvent.VK_BACK_SPACE: - case KeyEvent.VK_ENTER: - case KeyEvent.VK_DELETE: -+ if (w.isEditable() == false) { - e.consume(); -+ } - break; - } - } - public void keyTyped(KeyEvent e) { -+ if (w.isEditable() == false) { - e.consume(); -+ } - } - public void keyReleased(KeyEvent e) { -+ if (w.isEditable() == false) { - e.consume(); -+ } - } - } - -@@ -879,7 +885,7 @@ - } - }; - --class FileWindow extends JInternalFrame implements ActionListener { -+class FileWindow extends JInternalFrame implements ActionListener, DocumentListener { - - Main db; - SourceInfo sourceInfo; -@@ -888,15 +894,16 @@ - JScrollPane p; - int currentPos; - JLabel statusBar; -+ boolean isModified = false; - - public void actionPerformed(ActionEvent e) { - String cmd = e.getActionCommand(); - if (cmd.equals("Cut")) { -- // textArea.cut(); -+ textArea.cut(); - } else if (cmd.equals("Copy")) { - textArea.copy(); - } else if (cmd.equals("Paste")) { -- // textArea.paste(); -+ textArea.paste(); - } - } - -@@ -910,17 +917,73 @@ - } - - void load() { -- Scriptable scope = db.getScope(); -+ //Scriptable scope = db.getScope(); -+ Scriptable scope = db.officeScripts.getScriptScope( getUrl() ); -+ if ( scope == null ) -+ { -+ scope = db.getScope(); -+ } - if (scope == null) { - MessageDialogWrapper.showMessageDialog(db, "Can't load scripts: no scope available", "Run", JOptionPane.ERROR_MESSAGE); - } else { - String url = getUrl(); - if (url != null) { -- new Thread(new LoadFile(db,scope,url)).start(); -+ new Thread(new LoadFile(db,scope, url, new StringReader(textArea.getText()))).start(); - } - } - } - -+ void save() { -+ if (getUrl() != null) { -+ OutputStream os = null; -+ try { -+ if ( getUrl().startsWith("vnd.sun.star") ) -+ { -+ URL scriptUrl = db.officeScripts.getScriptUrl( getUrl() ); -+ if ( scriptUrl == null ) -+ { -+ throw new IOException("Can't optain stream for " + getUrl() ); -+ } -+ os = scriptUrl.openConnection().getOutputStream(); -+ } -+ else -+ { -+ os = new FileOutputStream( getUrl() ); -+ } -+ String s = textArea.getText(); -+ os.write(s.getBytes(), 0, s.length()); -+ -+ this.isModified = false; -+ } -+ catch (IOException ioe) { -+ JOptionPane.showMessageDialog(this, -+ "Error saving file: " + ioe.getMessage(), -+ "Error", JOptionPane.ERROR_MESSAGE); -+ } -+ finally -+ { -+ if ( os != null ) -+ { -+ try -+ { -+ os.close(); -+ os = null; -+ } -+ catch( IOException ioe ) -+ { -+ System.err.println("Error closing stream: " + ioe.getMessage() ); -+ ioe.printStackTrace(); -+ } -+ } -+ } -+ } -+ } -+ -+ public boolean isEditable() { -+ return db.isSourceEditingEnabled(); -+ } -+ -+ - public int getPosition(int line) { - int result = -1; - try { -@@ -953,7 +1016,7 @@ - fileHeader.repaint(); - } - } -- -+ public Main getDB() { return db; } - FileWindow(Main db, SourceInfo sourceInfo) { - super(SourceInfo.getShortName(sourceInfo.getUrl()), - true, true, true, true); -@@ -972,6 +1035,14 @@ - pack(); - updateText(); - textArea.select(0); -+ addInternalFrameListener( new InternalFrameAdapter() { -+ public void internalFrameClosed(InternalFrameEvent e) { -+ // clean up scriptItems and sourceNames hashes -+ getDB().removeScript( getUrl() ); -+ // remove scripts for officeScripts -+ getDB().officeScripts.deleteScript( getUrl() ); -+ } -+ } ); - } - - private void updateToolTip() { -@@ -990,7 +1061,10 @@ - void updateText() { - String newText = sourceInfo.getSource(); - if (!textArea.getText().equals(newText)) { -+ textArea.getDocument().removeDocumentListener(this); - textArea.setText(newText); -+ this.isModified = false; -+ textArea.getDocument().addDocumentListener(this); - int pos = 0; - if (currentPos != -1) { - pos = currentPos; -@@ -1001,6 +1075,31 @@ - fileHeader.repaint(); - } - -+ /* Implementation of DocumentListener interface */ -+ public void insertUpdate(DocumentEvent e) { -+ doChanged(e); -+ } -+ -+ public void removeUpdate(DocumentEvent e) { -+ doChanged(e); -+ } -+ -+ public void changedUpdate(DocumentEvent e) { -+ doChanged(e); -+ } -+ -+ public void doChanged(DocumentEvent e) { -+ this.isModified = true; -+ } -+ -+ public boolean isModified() { -+ return this.isModified; -+ } -+ -+ public String getText() { -+ return textArea.getText(); -+ } -+ - void setPosition(int pos) { - textArea.select(pos); - currentPos = pos; -@@ -1618,7 +1717,7 @@ - if (line != -1) { - db.currentWindow = w; - } -- db.menubar.addFile(url); -+ // db.menubar.addFile(url); - w.setVisible(true); - if (activate) { - try { -@@ -1752,8 +1851,10 @@ - Menubar(Main db) { - super(); - this.db = db; -- String[] fileItems = {"Open...", "Run...", "", "Exit"}; -- String[] fileCmds = {"Open", "Load", "", "Exit"}; -+ // String[] fileItems = {"Open...", "Run...", "", "Exit"}; -+ // String[] fileCmds = {"Open", "Load", "", "Exit"}; -+ String[] fileItems = {"Run", "Save", "", "Exit"}; -+ String[] fileCmds = {"Run", "Save", "", "Exit"}; - char[] fileShortCuts = {'0', 'N', '\0', 'X'}; - int[] fileAccelerators = {KeyEvent.VK_O, - KeyEvent.VK_N, -@@ -1795,6 +1896,9 @@ - KeyStroke k = KeyStroke.getKeyStroke(fileAccelerators[i], Event.CTRL_MASK); - item.setAccelerator(k); - } -+ if (fileItems[i].equals("Save")) { -+ saveItem = item; -+ } - } - } - for (int i = 0; i < editItems.length; ++i) { -@@ -1849,9 +1953,9 @@ - item.addActionListener(this); - windowMenu.add(item = new JMenuItem("Tile", 'T')); - item.addActionListener(this); -- windowMenu.addSeparator(); -- windowMenu.add(item = new JMenuItem("Console", 'C')); -- item.addActionListener(this); -+// windowMenu.addSeparator(); -+// windowMenu.add(item = new JMenuItem("Console", 'C')); -+// item.addActionListener(this); - add(windowMenu); - - } -@@ -1925,11 +2029,16 @@ - item.addActionListener(this); - } - -+ public void setSaveEnabled(boolean state) { -+ saveItem.setEnabled(state); -+ } -+ - Main db; - JMenu windowMenu; - JCheckBoxMenuItem breakOnExceptions; - JCheckBoxMenuItem breakOnEnter; - JCheckBoxMenuItem breakOnReturn; -+ JMenuItem saveItem; - }; - - class EnterInterrupt implements Runnable { -@@ -1942,6 +2051,13 @@ - public void run() { - JMenu menu = db.getJMenuBar().getMenu(0); - //menu.getItem(0).setEnabled(false); // File->Load -+ -+ // disable Edit menu Cut, Copy, Paste items -+ menu = db.getJMenuBar().getMenu(1); -+ for (int i = 0; i < 3; i++) { -+ menu.getItem(i).setEnabled(false); -+ } -+ - menu = db.getJMenuBar().getMenu(2); - menu.getItem(0).setEnabled(false); // Debug->Break - int count = menu.getItemCount(); -@@ -1954,6 +2070,10 @@ - b = true; - } - db.toolBar.setEnabled(true); -+ -+ // set flag to disable source editing -+ db.setSourceEditingEnabled(false); -+ - // raise the debugger window - db.toFront(); - } -@@ -1967,6 +2087,13 @@ - public void run() { - JMenu menu = db.getJMenuBar().getMenu(0); - menu.getItem(0).setEnabled(true); // File->Load -+ -+ // enable Edit menu items -+ menu = db.getJMenuBar().getMenu(1); -+ for (int i = 0; i < 3; i++) { -+ menu.getItem(i).setEnabled(true); -+ } -+ - menu = db.getJMenuBar().getMenu(2); - menu.getItem(0).setEnabled(true); // Debug->Break - int count = menu.getItemCount() - 1; -@@ -1980,6 +2107,10 @@ - db.toolBar.getComponent(ci).setEnabled(b); - b = false; - } -+ -+ // set flag to enable source editing -+ db.setSourceEditingEnabled(true); -+ - //db.console.consoleTextArea.requestFocus(); - } - }; -@@ -1988,17 +2119,24 @@ - { - String fileName; - Main db; -+ Reader reader = null; - OpenFile(Main db, String fileName) - { - this.fileName = fileName; - this.db = db; - } -+ OpenFile(Main db, String fileName, Reader reader) { -+ this(db, fileName); -+ this.reader = reader; -+ } - public void run() { - Context cx = Context.enter(); - ContextData contextData = ContextData.get(cx); - contextData.breakNextLine = true; - try { -- cx.compileReader(new FileReader(fileName), fileName, 1, null); -+ cx.compileReader( -+ reader == null ? new FileReader(fileName) : reader, -+ fileName, 1, null); - } catch (Exception exc) { - String msg = exc.getMessage(); - if (exc instanceof EcmaError) { -@@ -2019,29 +2157,79 @@ - Scriptable scope; - String fileName; - Main db; -+ Reader reader = null; -+ Object result = null; -+ Exception exception = null; -+ int lineNum = -1; -+ boolean sfExecute = false; -+ - LoadFile(Main db, Scriptable scope, String fileName) { - this.scope = scope; - this.fileName = fileName; - this.db = db; - } -+ -+ LoadFile(Main db, Scriptable scope, String fileName, Reader reader) { -+ this(db, scope, fileName); -+ this.reader = reader; -+ } -+ LoadFile(Main db, Scriptable scope, String fileName, Reader reader, boolean sfExecute ) { -+ this(db, scope, fileName); -+ this.reader = reader; -+ this.sfExecute = sfExecute; -+ } -+ - public void run() { -+ if ( db.officeScripts.isScriptRunning( fileName ) ) -+ { -+ exception = new Exception("The script is already executing"); -+ if ( !sfExecute ) { -+ MessageDialogWrapper.showMessageDialog(db, -+ "Script already executing", -+ "Run", -+ JOptionPane.ERROR_MESSAGE); -+ } -+ return; -+ } -+ db.officeScripts.setScriptRunning( fileName, true ); - Context cx = Context.enter(); - ContextData contextData = ContextData.get(cx); -+ if ( sfExecute ) -+ { -+ contextData.breakNextLine = false; -+ } -+ else -+ { - contextData.breakNextLine = true; -+ } -+ /* -+ FileWindow w = (FileWindow)db.getSelectedFrame(); -+ if ( sfExecute ) -+ { -+ db.swingInvoke(new SetFilePosition(db, w, -1 ) ); -+ }*/ - try { -- cx.evaluateReader(scope, new FileReader(fileName), -+ result = cx.evaluateReader(scope, -+ reader == null ? new FileReader(fileName) : reader, - fileName, 1, null); - } catch (Exception exc) { -+ exception = exc; - String msg = exc.getMessage(); - if (exc instanceof EcmaError) { - EcmaError err = (EcmaError)exc; - msg = err.getSourceName() + ", line " + err.getLineNumber() + ": " + msg; -- } -+ -+ int lineNum = err.getLineNumber() ; -+ //db.swingInvoke(new SetFilePosition(db, w, lineNum ) ); -+ if ( !sfExecute ) { - MessageDialogWrapper.showMessageDialog(db, - msg, - "Run", - JOptionPane.ERROR_MESSAGE); -+ } -+ } - } finally { -+ db.officeScripts.setScriptRunning( fileName, false ); - cx.exit(); - } - } -@@ -2416,13 +2604,13 @@ - super.setVisible(b); - if (b) { - // this needs to be done after the window is visible -- console.consoleTextArea.requestFocus(); -+ // console.consoleTextArea.requestFocus(); - context.split.setDividerLocation(0.5); - try { -- console.setMaximum(true); -- console.setSelected(true); -- console.show(); -- console.consoleTextArea.requestFocus(); -+ // console.setMaximum(true); -+ // console.setSelected(true); -+ // console.show(); -+ // console.consoleTextArea.requestFocus(); - } catch (Exception exc) { - } - } -@@ -2449,35 +2637,6 @@ - - Hashtable functionNames = new Hashtable(); - -- ScriptItem getScriptItem(DebuggableScript fnOrScript) { -- ScriptItem item = (ScriptItem)scriptItems.get(fnOrScript); -- if (item == null) { -- String url = getNormilizedUrl(fnOrScript); -- SourceInfo si = (SourceInfo)sourceNames.get(url); -- if (si == null) { -- if (!fnOrScript.isGeneratedScript()) { -- // Not eval or Function, try to load it from URL -- String source = null; -- try { -- InputStream is = openSource(url); -- try { source = readSource(is); } -- finally { is.close(); } -- } catch (IOException ex) { -- System.err.println -- ("Failed to load source from "+url+": "+ ex); -- } -- if (source != null) { -- si = registerSource(url, source); -- } -- } -- } -- if (si != null) { -- item = registerScript(si, fnOrScript); -- } -- } -- return item; -- } -- - /* Debugger Interface */ - - public void handleCompilationDone(Context cx, DebuggableScript fnOrScript, -@@ -2490,7 +2649,7 @@ - - String getNormilizedUrl(DebuggableScript fnOrScript) { - String url = fnOrScript.getSourceName(); -- if (url == null) { url = "<stdin>"; } -+ if (url == null) { url = "document"; } - else { - // Not to produce window for eval from different lines, - // strip line numbers, i.e. replace all #[0-9]+\(eval\) by (eval) -@@ -2601,7 +2760,7 @@ - if (si == null) { - si = new SourceInfo(sourceUrl, source); - sourceNames.put(sourceUrl, si); -- } else { -+ } else if (!source.equals(si.getSource())) { - si.setSource(source); - } - } -@@ -2762,7 +2921,7 @@ - desk = new JDesktopPane(); - desk.setPreferredSize(new Dimension(600, 300)); - desk.setMinimumSize(new Dimension(150, 50)); -- desk.add(console = new JSInternalConsole("JavaScript Console")); -+ // desk.add(console = new JSInternalConsole("JavaScript Console")); - context = new ContextWindow(this); - context.setPreferredSize(new Dimension(600, 120)); - context.setMinimumSize(new Dimension(50, 50)); -@@ -2871,7 +3030,7 @@ - FrameHelper frame = contextData.getFrame(frameIndex); - String sourceName = frame.getUrl(); - if (sourceName == null || sourceName.equals("<stdin>")) { -- console.show(); -+ // console.show(); - helper.reset(); - return; - } -@@ -2895,6 +3054,19 @@ - int dispatcherIsWaiting = 0; - Context currentContext = null; - -+ // Flag used to establish whether source code editing is allowed in -+ // the debugger, switched on and off depending on whether a debug session -+ // is active -+ boolean sourceEditingEnabled = true; -+ -+ public boolean isSourceEditingEnabled() { -+ return sourceEditingEnabled; -+ } -+ -+ void setSourceEditingEnabled(boolean b) { -+ sourceEditingEnabled = b; -+ } -+ - Context getCurrentContext() { - return currentContext; - } -@@ -3028,14 +3200,14 @@ - swingInvoke(CreateFileWindow.action(this, si, line)); - } - } else { -- if (console.isVisible()) { -+ /* if (console.isVisible()) { - final JSInternalConsole finalConsole = console; - swingInvoke(new Runnable() { - public void run() { - finalConsole.show(); - } - }); -- } -+ } */ - } - swingInvoke(new EnterInterrupt(this, cx)); - swingInvoke(new UpdateContext(this, cx)); -@@ -3217,6 +3389,14 @@ - fileName)).start(); - } - } -+ } else if (cmd.equals("Run")) { -+ FileWindow w = (FileWindow)getSelectedFrame(); -+ if (w != null) -+ w.load(); -+ } else if (cmd.equals("Save")) { -+ FileWindow w = (FileWindow)getSelectedFrame(); -+ if (w != null) -+ w.save(); - } else if (cmd.equals("More Windows...")) { - MoreWindows dlg = new MoreWindows(this, fileWindows, - "Window", "Files"); -@@ -3509,6 +3689,60 @@ - } - } - -+ JInternalFrame getFrameForUrl( URL url ) -+ { -+ JInternalFrame[] frames = desk.getAllFrames(); -+ for (int i = 0; i < frames.length; i++) { -+ FileWindow w = (FileWindow)frames[i]; -+ if ( url.toString().equals( w.getUrl() ) ) { -+ return w; -+ } -+ } -+ return null; -+ } -+ public void highlighLineInSelectedWindow(URL url, int lineNum ){ -+ //FileWindow w = (FileWindow)getFrameForUrl( url ); -+ FileWindow w = (FileWindow)getSelectedFrame(); -+ if (w != null) -+ { -+ if ( lineNum > -1 ) -+ swingInvoke(new SetFilePosition(this, w, lineNum ) ); -+ } -+ } -+ public Object runSelectedWindow( URL scriptUrl ) throws Exception -+ { -+ Object result = null; -+ FileWindow w = (FileWindow)getSelectedFrame(); -+ //FileWindow w = (FileWindow)getFrameForUrl( scriptUrl ); -+ w.toFront(); -+ if (w != null) -+ { -+ Scriptable scope = w.db.getScope(); -+ if (scope == null) -+ { -+ MessageDialogWrapper.showMessageDialog(w.db, "Can't load scripts: no scope available", "Run", JOptionPane.ERROR_MESSAGE); -+ result = null; -+ } -+ else -+ { -+ String url = w.getUrl(); -+ Thread executorThread = null; -+ if (url != null) -+ { -+ LoadFile executor = new LoadFile(w.db,scope, url, new StringReader(w.textArea.getText()), true ); -+ executor.run(); -+ result = executor.result; -+ if ( executor.exception != null ) -+ { -+ throw executor.exception; -+ } -+ } -+ } -+ } -+ return result; -+ -+ } -+ - // - // public interface - // -@@ -3604,6 +3838,69 @@ - return console.getErr(); - } - -+ public void openFile(URL scriptUrl, Scriptable scope, Runnable closeCallback ) { -+ if (scope == null) { -+ MessageDialogWrapper.showMessageDialog(this, -+ "Can't compile scripts: no scope available", -+ "Open", JOptionPane.ERROR_MESSAGE); -+ } else { -+ if (scriptUrl != null) { -+ try -+ { -+ InputStreamReader reader = new InputStreamReader(scriptUrl.openStream()); -+ String fileName = null; -+ if ( scriptUrl.getProtocol().startsWith("vnd.sun.star.") ) -+ { -+ fileName = scriptUrl.toString(); -+ } -+ else -+ { -+ fileName = scriptUrl.getPath(); -+ } -+ officeScripts.addScript( fileName, scriptUrl, scope, closeCallback ); -+ //new Thread(new OpenFile(this, scope, fileName, reader )).start(); -+ swingInvoke( new OpenFile(this, fileName, reader )); -+ } -+ catch ( IOException e ) -+ { -+ MessageDialogWrapper.showMessageDialog(this, -+ "Can't open stream for script: " + e.toString(), -+ "Open", JOptionPane.ERROR_MESSAGE); -+ } -+ } -+ } -+ split1.setDividerLocation(1.0); -+ } -+ -+ public void openFile(String fileName) { -+ Scriptable scope = getScope(); -+ if (scope == null) { -+ MessageDialogWrapper.showMessageDialog(this, -+ "Can't compile scripts: no scope available", -+ "Open", JOptionPane.ERROR_MESSAGE); -+ } else { -+ if (fileName != null) { -+ new Thread(new OpenFile(this, fileName)).start(); -+ } -+ } -+ split1.setDividerLocation(1.0); -+ } -+ -+ public void openStream(InputStream in) { -+ Scriptable scope = getScope(); -+ if (scope == null) { -+ MessageDialogWrapper.showMessageDialog(this, -+ "Can't compile scripts: no scope available", -+ "Open", JOptionPane.ERROR_MESSAGE); -+ } else { -+ if (in != null) { -+ new Thread(new OpenFile(this, null, new InputStreamReader(in))).start(); -+ } -+ } -+ split1.setDividerLocation(1.0); -+ menubar.setSaveEnabled(false); -+ } -+ - public static void main(String[] args) { - try { - mainThread = Thread.currentThread(); -@@ -3635,5 +3932,162 @@ - } - } - -+ // patched Office specific interface -+ -+ OfficeScriptInfo officeScripts = new OfficeScriptInfo(); -+ -+ void removeScript( String url ) -+ { -+ // Remove the FileWindow from list of open sources -+ fileWindows.remove( url ); -+ -+ // Remove sourceInfo from sourceNames, ensures that -+ // breakpoints etc are deleted -+ synchronized (sourceNames) { -+ sourceNames.remove( url ); -+ } -+ // Removes scriptItems for the script, ensures that a new open ( from openFile ) -+ // will succeed, openFile should open file but fails due to fact that -+ synchronized ( scriptItems ) -+ { -+ Iterator iter = scriptItems.entrySet().iterator(); -+ while ( iter.hasNext() ) -+ { -+ Map.Entry me = ( Map.Entry )iter.next(); -+ ScriptItem item = (ScriptItem)me.getValue(); -+ SourceInfo si = item.getSourceInfo(); -+ if ( si.getUrl().equals( url ) ) -+ { -+ //match -+ scriptItems.remove( me.getKey() ); -+ break; -+ } -+ } -+ } -+ officeScripts.deleteScript( url ); -+ } -+ -+ -+ ScriptItem getScriptItem(DebuggableScript fnOrScript) { -+ ScriptItem item = (ScriptItem)scriptItems.get(fnOrScript); -+ if (item == null) { -+ String url = getNormilizedUrl(fnOrScript); -+ SourceInfo si = (SourceInfo)sourceNames.get(url); -+ if (si == null) { -+ if (!fnOrScript.isGeneratedScript()) { -+ // Not eval or Function, try to load it from URL -+ String source = null; -+ try { -+ InputStream is = openSource(url); -+ try { source = readSource(is); } -+ finally { is.close(); } -+ } catch (IOException ex) { -+ System.err.println -+ ("Failed to load source from "+url+": "+ ex); -+ } -+ if (source != null) { -+ si = registerSource(url, source); -+ } -+ } -+ } -+ if (si != null) { -+ item = registerScript(si, fnOrScript); -+ } -+ } -+ -+ return item; -+ } -+ -+ public void showScriptWindow(URL url ){ -+ String key = url.getPath(); -+ if ( url.getProtocol().startsWith("vnd.sun.star") ) -+ { -+ key = url.toString(); -+ } -+ FileWindow w = (FileWindow)getFileWindow( key ); -+ if ( w != null ) -+ { -+ //w.maximize(); -+ desk.getDesktopManager().deiconifyFrame(w); -+ desk.getDesktopManager().activateFrame(w); -+ w.show(); -+ w.toFront(); -+ } -+ } -+ -+ public void highlighLineInScriptWindow(URL url, int lineNum ){ -+ String key = url.getPath(); -+ if ( url.getProtocol().startsWith("vnd.sun.star") ) -+ { -+ key = url.getPath(); -+ } -+ FileWindow w = (FileWindow)getFileWindow( key ); -+ if (w != null) -+ { -+ if ( lineNum > -1 ) -+ swingInvoke(new SetFilePosition(this, w, lineNum ) ); -+ } -+ } -+ public Object runScriptWindow( URL scriptUrl ) throws Exception -+ { -+ String key = scriptUrl.getPath(); -+ if ( scriptUrl.getProtocol().startsWith("vnd.sun.star") ) -+ { -+ key = scriptUrl.toString(); -+ } -+ FileWindow w = (FileWindow)getFileWindow( key ); -+ Object result = null; -+ w.toFront(); -+ if (w != null) -+ { -+ //Scriptable scope = w.db.getScope(); -+ Scriptable scope = w.db.officeScripts.getScriptScope( key ); -+ if (scope == null) -+ { -+ MessageDialogWrapper.showMessageDialog(w.db, "Can't load scripts: no scope available", "Run", JOptionPane.ERROR_MESSAGE); -+ result = null; -+ } -+ else -+ { -+ String url = w.getUrl(); -+ Thread executorThread = null; -+ if (url != null) -+ { -+ LoadFile executor = new LoadFile(w.db,scope, url, new StringReader(w.textArea.getText()), true ); -+ executor.run(); -+ result = executor.result; -+ if ( executor.exception != null ) -+ { -+ throw executor.exception; -+ } -+ } -+ } -+ } -+ return result; -+ -+ } -+ -+ public boolean isModified( URL url ) -+ { -+ String key = url.getPath(); -+ if ( url.getProtocol().startsWith("vnd.sun.star") ) -+ { -+ key = url.toString(); -+ } -+ FileWindow w = (FileWindow)getFileWindow( key ); -+ return w.isModified(); -+ } -+ -+ public String getText( URL url ) -+ { -+ String key = url.toString(); -+ if ( url.getProtocol().startsWith("vnd.sun.star") ) -+ { -+ key = url.toString(); -+ } -+ FileWindow w = (FileWindow)getFileWindow( key ); -+ return w.getText(); -+ } -+ - } - ---- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java Thu Mar 25 21:54:34 2004 -+++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java Fri Mar 28 17:24:23 2008 -@@ -36,6 +36,7 @@ - package org.mozilla.javascript.tools.shell; - - import java.security.*; -+import java.security.cert.Certificate; - import java.net.MalformedURLException; - import java.net.URL; - import java.util.Hashtable; -@@ -124,7 +125,7 @@ - - public JavaPolicySecurity() { - // To trigger error on jdk-1.1 with lazy load -- new CodeSource(null, null); -+ new CodeSource(null, (Certificate [])null); - } - - protected void callProcessFileSecure(final Context cx, -@@ -167,7 +168,7 @@ - } - - private ProtectionDomain getUrlDomain(URL url) { -- CodeSource cs = new CodeSource(url, null); -+ CodeSource cs = new CodeSource(url, (Certificate [])null); - PermissionCollection pc = Policy.getPolicy().getPermissions(cs); - return new ProtectionDomain(cs, pc); - } diff --git a/external/serf/ExternalProject_serf.mk b/external/serf/ExternalProject_serf.mk deleted file mode 100644 index 043045654956..000000000000 --- a/external/serf/ExternalProject_serf.mk +++ /dev/null @@ -1,52 +0,0 @@ -# -*- 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_ExternalProject_ExternalProject,serf)) - -$(eval $(call gb_ExternalProject_use_externals,serf,\ - apr \ -)) - -$(eval $(call gb_ExternalProject_register_targets,serf,\ - build \ -)) - -$(eval $(call gb_ExternalProject_use_nmake,serf,build)) - -ifeq ($(COM),MSC) -$(call gb_ExternalProject_get_state_target,serf,build): - $(call gb_Trace_StartRange,serf,EXTERNAL) - $(call gb_ExternalProject_run,build,\ - APR_SRC="..\apr" \ - APRUTIL_SRC="..\apr_util" \ - OPENSSL_SRC="..\openssl" \ - ZLIB_SRC="..\zlib" \ - nmake -nologo -f serf.mak \ - $(if $(MSVC_USE_DEBUG_RUNTIME),DEBUG_BUILD=T Debug,Release)/serf-1.lib \ - ) - $(call gb_Trace_EndRange,serf,EXTERNAL) - -else -# serf is using SERF_LIBS variable, so pass it empty -$(call gb_ExternalProject_get_state_target,serf,build): - $(call gb_Trace_StartRange,serf,EXTERNAL) - +$(call gb_ExternalProject_run,build,\ - ./configure SERF_LIBS= \ - --enable-option-checking=fatal \ - $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\ - $(if $(SYSTEM_APR),,--with-apr=$(call gb_UnpackedTarball_get_dir,apr)/apr-1-config) \ - $(if $(SYSTEM_APR),,--with-apr-util=$(call gb_UnpackedTarball_get_dir,apr_util)/apu-1-config) \ - $(if $(SYSTEM_OPENSSL),,--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl)) \ - && $(MAKE) libserf-1.la \ - ) - $(call gb_Trace_EndRange,serf,EXTERNAL) - -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/serf/Makefile b/external/serf/Makefile deleted file mode 100644 index e4968cf85fb6..000000000000 --- a/external/serf/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- - -module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -include $(module_directory)/../../solenv/gbuild/partial_build.mk - -# vim: set noet sw=4 ts=4: diff --git a/external/serf/README b/external/serf/README deleted file mode 100644 index 0cfe55fb26c0..000000000000 --- a/external/serf/README +++ /dev/null @@ -1,4 +0,0 @@ -The serf library is a high performance C-based HTTP client library -built upon the Apache Portable Runtime (APR) library. - -From [http://code.google.com/p/serf/]. diff --git a/external/serf/UnpackedTarball_serf.mk b/external/serf/UnpackedTarball_serf.mk deleted file mode 100644 index e6e950920b95..000000000000 --- a/external/serf/UnpackedTarball_serf.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,serf)) - -$(eval $(call gb_UnpackedTarball_set_tarball,serf,$(SERF_TARBALL))) - -$(eval $(call gb_UnpackedTarball_fix_end_of_line,serf,\ - serf.mak \ -)) - -$(eval $(call gb_UnpackedTarball_add_patches,serf,\ - external/serf/windows.build.patch.1 \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/serf/windows.build.patch.1 b/external/serf/windows.build.patch.1 deleted file mode 100644 index c659d41cdf43..000000000000 --- a/external/serf/windows.build.patch.1 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ur serf.org/serf.mak serf/serf.mak ---- serf.org/serf.mak 2014-03-05 16:31:26.681695709 +0100 -+++ serf/serf.mak 2014-03-05 16:32:20.969696348 +0100 -@@ -93,7 +93,7 @@ - WIN32_DEFS = /D WIN32 /D WIN32_LEAN_AND_MEAN /D NOUSER /D NOGDI /D NONLS /D NOCRYPT /D SERF_HAVE_SSPI - - CPP=cl.exe --CPP_PROJ = /c /nologo $(CFLAGS) $(WIN32_DEFS) $(APR_FLAGS) $(APRUTIL_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" -+CPP_PROJ = /c /nologo /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC $(CFLAGS) $(WIN32_DEFS) $(APR_FLAGS) $(APRUTIL_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" - LIB32=link.exe - LIB32_FLAGS=/nologo - -@@ -127,16 +127,6 @@ - "$(INTDIR)\socket_buckets.obj" \ - "$(INTDIR)\ssl_buckets.obj" \ - --!IFDEF OPENSSL_STATIC --LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32\libeay32.lib" \ -- "$(OPENSSL_SRC)\out32\ssleay32.lib" --!ELSE --LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32dll\libeay32.lib" \ -- "$(OPENSSL_SRC)\out32dll\ssleay32.lib" --!ENDIF -- --LIB32_OBJS = $(LIB32_OBJS) $(APR_LIBS) $(APRUTIL_LIBS) $(ZLIB_LIBS) -- - SYS_LIBS = secur32.lib - - TEST_OBJS = \ diff --git a/external/skia/0001-Added-missing-include-cstdio.patch b/external/skia/0001-Added-missing-include-cstdio.patch new file mode 100644 index 000000000000..cfe2ffdb0bd8 --- /dev/null +++ b/external/skia/0001-Added-missing-include-cstdio.patch @@ -0,0 +1,29 @@ +From 29d492b60c84ca784ea0943efc7d2e6e0f3bdaac Mon Sep 17 00:00:00 2001 +From: Adam Sawicki <adam.sawicki@amd.com> +Date: Thu, 19 Jan 2023 13:19:55 +0100 +Subject: [PATCH] Added missing #include <cstdio> + +For snprintf, for compatibility with GCC 13. +Fixes #312 - thanks @marxin ! +--- + include/vk_mem_alloc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h +index b787c36..0fe459b 100644 +--- a/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h ++++ b/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h +@@ -2614,6 +2614,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include <bit> // For std::popcount
+ #endif
+
++#if VMA_STATS_STRING_ENABLED
++ #include <cstdio> // For snprintf
++#endif
++
+ /*******************************************************************************
+ CONFIGURATION SECTION
+
+-- +2.39.1 + diff --git a/external/skia/0001-AvoidCombiningExtrememelyLargeMeshes.patch.1 b/external/skia/0001-AvoidCombiningExtrememelyLargeMeshes.patch.1 new file mode 100644 index 000000000000..ca58048a75f0 --- /dev/null +++ b/external/skia/0001-AvoidCombiningExtrememelyLargeMeshes.patch.1 @@ -0,0 +1,34 @@ +From 6169a1fabae1743709bc9641ad43fcbb6a4f62e1 Mon Sep 17 00:00:00 2001 +From: John Stiles <johnstiles@google.com> +Date: Fri, 24 Nov 2023 09:40:11 -0500 +Subject: [PATCH] Avoid combining extremely large meshes. + +Bug: chromium:1505053 +Change-Id: I42f2ff872bbf054686ec7af0cc85ff63055fcfbf +Reviewed-on: https://skia-review.googlesource.com/c/skia/+/782936 +Commit-Queue: Michael Ludwig <michaelludwig@google.com> +Reviewed-by: Michael Ludwig <michaelludwig@google.com> +Auto-Submit: John Stiles <johnstiles@google.com> +--- + src/gpu/ganesh/ops/DrawMeshOp.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/gpu/ganesh/ops/DrawMeshOp.cpp b/src/gpu/ganesh/ops/DrawMeshOp.cpp +index d827009b993..eed2757579e 100644 +--- a/src/gpu/ganesh/ops/DrawMeshOp.cpp ++++ b/src/gpu/ganesh/ops/DrawMeshOp.cpp +@@ -1178,10 +1178,13 @@ GrOp::CombineResult MeshOp::onCombineIfPossible(GrOp* t, SkArenaAlloc*, const Gr + return CombineResult::kCannotCombine; + } + ++ if (fVertexCount > INT32_MAX - that->fVertexCount) { ++ return CombineResult::kCannotCombine; ++ } + if (SkToBool(fIndexCount) != SkToBool(that->fIndexCount)) { + return CombineResult::kCannotCombine; + } +- if (SkToBool(fIndexCount) && fVertexCount + that->fVertexCount > SkToInt(UINT16_MAX)) { ++ if (SkToBool(fIndexCount) && fVertexCount > UINT16_MAX - that->fVertexCount) { + return CombineResult::kCannotCombine; + } + diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk index 8c805fd787dd..55af14cd2daf 100644 --- a/external/skia/Library_skia.mk +++ b/external/skia/Library_skia.mk @@ -13,23 +13,25 @@ $(eval $(call gb_Library_set_warnings_disabled,skia)) $(eval $(call gb_Library_use_unpacked,skia,skia)) -ifneq ($(OS)_$(CPUNAME),WNT_ARM64) $(eval $(call gb_Library_use_clang,skia)) -$(eval $(call gb_Library_set_clang_precompiled_header,skia,external/skia/inc/pch/precompiled_skia)) -else -$(eval $(call gb_Library_set_precompiled_header,skia,external/skia/inc/pch/precompiled_skia)) -endif +#This currently results in all sorts of compile complaints +#$(eval $(call gb_Library_set_clang_precompiled_header,skia,external/skia/inc/pch/precompiled_skia)) $(eval $(call gb_Library_add_defs,skia,\ -DSKIA_IMPLEMENTATION=1 \ -DSKIA_DLL \ -DSK_USER_CONFIG_HEADER="<$(BUILDDIR)/config_host/config_skia.h>" \ + $(if $(filter INTEL,$(CPUNAME)),$(if $(filter WNT,$(OS)),-DSK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE1,-DSK_CPU_SSE_LEVEL=0)) \ + $(if $(filter X86_64,$(CPUNAME)),-DSK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2) \ + -DSK_ENABLE_SKSL_IN_RASTER_PIPELINE \ )) # SK_DEBUG controls runtime checks and is controlled by config_skia.h and depends on DBG_UTIL. # This controls whether to build with compiler optimizations, normally yes, --enable-skia=debug # allows to build non-optimized. We normally wouldn't debug a 3rd-party library, and Skia # performance is relatively important (it may be the drawing engine used in software mode). +# Some code may be always built with optimizations, even with Skia debug enabled (see +# $(gb_COMPILEROPTFLAGS) usage). ifeq ($(ENABLE_SKIA_DEBUG),) $(eval $(call gb_Library_add_cxxflags,skia, \ $(gb_COMPILEROPTFLAGS) \ @@ -49,6 +51,15 @@ $(eval $(call gb_Library_add_cxxflags,skia, \ )) endif +# The clang-cl provided with at least VS 2019 16.11.28 is known-broken with -std:c++20: +ifneq ($(filter -std:c++20,$(CXXFLAGS_CXX11)),) +ifeq ($(LO_CLANG_VERSION),120000) +$(eval $(call gb_Library_add_cxxflags,skia, \ + -std:c++17 \ +)) +endif +endif + $(eval $(call gb_Library_use_system_win32_libs,skia,\ fontsub \ ole32 \ @@ -57,8 +68,35 @@ $(eval $(call gb_Library_use_system_win32_libs,skia,\ usp10 \ gdi32 \ )) + +# cl.exe (and thus clang-cl) likes to emit copies of inline functions even when not needed, +# which means that for e.g. AVX-compiled sources the .o may contain a copy of an inline +# function built using AVX, and the linker may select that copy as the one to keep, thus +# introducing AVX code into generic code. Avoid generating such inlines. The flag currently +# cannot be used for the whole Skia, because code built without the flag cannot use +# libraries built with the flag, so cl.exe-built VCL would have undefined references. +ifeq ($(HAVE_LO_CLANG_DLLEXPORTINLINES),TRUE) +LO_SKIA_AVOID_INLINE_COPIES := -Zc:dllexportInlines- +endif + +else ifeq ($(OS),MACOSX) + +$(eval $(call gb_Library_use_system_darwin_frameworks,skia,\ + Cocoa \ + Metal \ + QuartzCore \ +)) + +ifneq ($(SKIA_DISABLE_VMA_USE_STL_SHARED_MUTEX),) +# Disable std::shared_mutex usage on MacOSX < 10.12. +$(eval $(call gb_Library_add_defs,skia,\ + -DVMA_USE_STL_SHARED_MUTEX=0 \ +)) +endif + else $(eval $(call gb_Library_use_externals,skia,\ + expat \ freetype \ fontconfig \ )) @@ -87,7 +125,7 @@ $(eval $(call gb_Library_use_libraries,skia,\ $(eval $(call gb_Library_set_include,skia,\ $$(INCLUDE) \ -I$(call gb_UnpackedTarball_get_dir,skia) \ - -I$(call gb_UnpackedTarball_get_dir,skia)/include/third_party/skcms/ \ + -I$(call gb_UnpackedTarball_get_dir,skia)/modules/skcms/ \ -I$(call gb_UnpackedTarball_get_dir,skia)/third_party/vulkanmemoryallocator/ \ -I$(call gb_UnpackedTarball_get_dir,skia)/include/third_party/vulkan/ \ -I$(SRCDIR)/external/skia/inc/ \ @@ -99,13 +137,30 @@ $(eval $(call gb_Library_add_exception_objects,skia,\ external/skia/source/skia_opts \ )) -$(eval $(call gb_Library_add_exception_objects,skia,\ - external/skia/source/skia_opts_ssse3, $(CXXFLAGS_INTRINSICS_SSSE3) $(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3) \ -)) - $(eval $(call gb_Library_set_generated_cxx_suffix,skia,cpp)) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ + UnpackedTarball/skia/src/base/SkArenaAlloc \ + UnpackedTarball/skia/src/base/SkBezierCurves \ + UnpackedTarball/skia/src/base/SkBlockAllocator \ + UnpackedTarball/skia/src/base/SkBuffer \ + UnpackedTarball/skia/src/base/SkContainers \ + UnpackedTarball/skia/src/base/SkCubics \ + UnpackedTarball/skia/src/base/SkDeque \ + UnpackedTarball/skia/src/base/SkFloatingPoint \ + UnpackedTarball/skia/src/base/SkHalf \ + UnpackedTarball/skia/src/base/SkMalloc \ + UnpackedTarball/skia/src/base/SkMathPriv \ + UnpackedTarball/skia/src/base/SkQuads \ + UnpackedTarball/skia/src/base/SkSafeMath \ + UnpackedTarball/skia/src/base/SkSemaphore \ + UnpackedTarball/skia/src/base/SkSharedMutex \ + UnpackedTarball/skia/src/base/SkSpinlock \ + UnpackedTarball/skia/src/base/SkTDArray \ + UnpackedTarball/skia/src/base/SkThreadID \ + UnpackedTarball/skia/src/base/SkTSearch \ + UnpackedTarball/skia/src/base/SkUtils \ + UnpackedTarball/skia/src/base/SkUTF \ UnpackedTarball/skia/src/codec/SkAndroidCodecAdapter \ UnpackedTarball/skia/src/codec/SkAndroidCodec \ UnpackedTarball/skia/src/codec/SkBmpBaseCodec \ @@ -115,23 +170,22 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/codec/SkBmpStandardCodec \ UnpackedTarball/skia/src/codec/SkCodec \ UnpackedTarball/skia/src/codec/SkCodecImageGenerator \ - UnpackedTarball/skia/src/codec/SkColorTable \ + UnpackedTarball/skia/src/codec/SkColorPalette \ UnpackedTarball/skia/src/codec/SkEncodedInfo \ UnpackedTarball/skia/src/codec/SkIcoCodec \ UnpackedTarball/skia/src/codec/SkMasks \ UnpackedTarball/skia/src/codec/SkMaskSwizzler \ UnpackedTarball/skia/src/codec/SkParseEncodedOrigin \ + UnpackedTarball/skia/src/codec/SkPixmapUtils \ UnpackedTarball/skia/src/codec/SkPngCodec \ UnpackedTarball/skia/src/codec/SkSampledCodec \ UnpackedTarball/skia/src/codec/SkSampler \ - UnpackedTarball/skia/src/codec/SkStreamBuffer \ UnpackedTarball/skia/src/codec/SkSwizzler \ UnpackedTarball/skia/src/codec/SkWbmpCodec \ UnpackedTarball/skia/src/core/SkAAClip \ UnpackedTarball/skia/src/core/SkAlphaRuns \ UnpackedTarball/skia/src/core/SkAnalyticEdge \ UnpackedTarball/skia/src/core/SkAnnotation \ - UnpackedTarball/skia/src/core/SkArenaAlloc \ UnpackedTarball/skia/src/core/SkATrace \ UnpackedTarball/skia/src/core/SkAutoPixmapStorage \ UnpackedTarball/skia/src/core/SkBBHFactory \ @@ -142,25 +196,28 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkBitmapProcState \ UnpackedTarball/skia/src/core/SkBitmapProcState_matrixProcs \ UnpackedTarball/skia/src/core/SkBlendMode \ + UnpackedTarball/skia/src/core/SkBlendModeBlender \ UnpackedTarball/skia/src/core/SkBlitRow_D32 \ UnpackedTarball/skia/src/core/SkBlitter_ARGB32 \ UnpackedTarball/skia/src/core/SkBlitter_A8 \ UnpackedTarball/skia/src/core/SkBlitter \ - UnpackedTarball/skia/src/core/SkBlitter_RGB565 \ UnpackedTarball/skia/src/core/SkBlitter_Sprite \ UnpackedTarball/skia/src/core/SkBlurMask \ - UnpackedTarball/skia/src/core/SkBlurMF \ - UnpackedTarball/skia/src/core/SkBuffer \ + UnpackedTarball/skia/src/core/SkBlurMaskFilterImpl \ UnpackedTarball/skia/src/core/SkCachedData \ UnpackedTarball/skia/src/core/SkCanvas \ + UnpackedTarball/skia/src/core/SkCanvas_Raster \ UnpackedTarball/skia/src/core/SkCanvasPriv \ + UnpackedTarball/skia/src/core/SkCapabilities \ + UnpackedTarball/skia/src/core/SkChecksum \ + UnpackedTarball/skia/src/core/SkChromeRemoteGlyphCache \ UnpackedTarball/skia/src/core/SkClipStack \ UnpackedTarball/skia/src/core/SkClipStackDevice \ UnpackedTarball/skia/src/core/SkColor \ UnpackedTarball/skia/src/core/SkColorFilter \ - UnpackedTarball/skia/src/core/SkColorFilter_Matrix \ UnpackedTarball/skia/src/core/SkColorSpace \ UnpackedTarball/skia/src/core/SkColorSpaceXformSteps \ + UnpackedTarball/skia/src/core/SkColorTable \ UnpackedTarball/skia/src/core/SkCompressedDataUtils \ UnpackedTarball/skia/src/core/SkContourMeasure \ UnpackedTarball/skia/src/core/SkConvertPixels \ @@ -170,15 +227,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkData \ UnpackedTarball/skia/src/core/SkDataTable \ UnpackedTarball/skia/src/core/SkDebug \ - UnpackedTarball/skia/src/core/SkDeferredDisplayList \ - UnpackedTarball/skia/src/core/SkDeferredDisplayListRecorder \ - UnpackedTarball/skia/src/core/SkDeque \ UnpackedTarball/skia/src/core/SkDescriptor \ UnpackedTarball/skia/src/core/SkDevice \ UnpackedTarball/skia/src/core/SkDistanceFieldGen \ UnpackedTarball/skia/src/core/SkDocument \ UnpackedTarball/skia/src/core/SkDrawable \ UnpackedTarball/skia/src/core/SkDraw \ + UnpackedTarball/skia/src/core/SkDrawBase \ UnpackedTarball/skia/src/core/SkDrawLooper \ UnpackedTarball/skia/src/core/SkDrawShadowInfo \ UnpackedTarball/skia/src/core/SkDraw_atlas \ @@ -192,6 +247,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkFont \ UnpackedTarball/skia/src/core/SkFont_serial \ UnpackedTarball/skia/src/core/SkFontDescriptor \ + UnpackedTarball/skia/src/core/SkFontMetricsPriv \ UnpackedTarball/skia/src/core/SkFontMgr \ UnpackedTarball/skia/src/core/SkFontStream \ UnpackedTarball/skia/src/core/SkGaussFilter \ @@ -199,12 +255,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkIDChangeListener \ UnpackedTarball/skia/src/core/SkGlobalInitialization_core \ UnpackedTarball/skia/src/core/SkGlyph \ - UnpackedTarball/skia/src/core/SkGlyphBuffer \ - UnpackedTarball/skia/src/core/SkGlyphRun \ UnpackedTarball/skia/src/core/SkGlyphRunPainter \ UnpackedTarball/skia/src/core/SkGraphics \ - UnpackedTarball/skia/src/core/SkHalf \ - UnpackedTarball/skia/src/core/SkICC \ UnpackedTarball/skia/src/core/SkImageFilterCache \ UnpackedTarball/skia/src/core/SkImageFilterTypes \ UnpackedTarball/skia/src/core/SkImageFilter \ @@ -213,24 +265,20 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkLatticeIter \ UnpackedTarball/skia/src/core/SkLineClipper \ UnpackedTarball/skia/src/core/SkLocalMatrixImageFilter \ - UnpackedTarball/skia/src/core/SkMalloc \ UnpackedTarball/skia/src/core/SkMallocPixelRef \ - UnpackedTarball/skia/src/core/SkMarkerStack \ UnpackedTarball/skia/src/core/SkMaskBlurFilter \ UnpackedTarball/skia/src/core/SkMaskCache \ UnpackedTarball/skia/src/core/SkMask \ UnpackedTarball/skia/src/core/SkMaskFilter \ UnpackedTarball/skia/src/core/SkMaskGamma \ - UnpackedTarball/skia/src/core/SkMath \ UnpackedTarball/skia/src/core/SkMatrix \ - UnpackedTarball/skia/src/core/SkMatrixImageFilter \ - UnpackedTarball/skia/src/core/SkMatrix44 \ + UnpackedTarball/skia/src/core/SkMatrixInvert \ UnpackedTarball/skia/src/core/SkM44 \ UnpackedTarball/skia/src/core/SkMD5 \ - UnpackedTarball/skia/src/core/SkMiniRecorder \ + UnpackedTarball/skia/src/core/SkMesh \ UnpackedTarball/skia/src/core/SkMipmap \ UnpackedTarball/skia/src/core/SkMipmapAccessor \ - UnpackedTarball/skia/src/core/SkModeColorFilter \ + UnpackedTarball/skia/src/core/SkMipmapBuilder \ UnpackedTarball/skia/src/core/SkOpts \ UnpackedTarball/skia/src/core/SkOpts_erms \ UnpackedTarball/skia/src/core/SkOverdrawCanvas \ @@ -241,19 +289,19 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkPathEffect \ UnpackedTarball/skia/src/core/SkPathMeasure \ UnpackedTarball/skia/src/core/SkPathRef \ + UnpackedTarball/skia/src/core/SkPathUtils \ UnpackedTarball/skia/src/core/SkPath_serial \ UnpackedTarball/skia/src/core/SkPicture \ UnpackedTarball/skia/src/core/SkPictureData \ UnpackedTarball/skia/src/core/SkPictureFlat \ - UnpackedTarball/skia/src/core/SkPictureImageGenerator \ UnpackedTarball/skia/src/core/SkPicturePlayback \ UnpackedTarball/skia/src/core/SkPictureRecord \ UnpackedTarball/skia/src/core/SkPictureRecorder \ UnpackedTarball/skia/src/core/SkPixelRef \ UnpackedTarball/skia/src/core/SkPixmap \ + UnpackedTarball/skia/src/core/SkPixmapDraw \ UnpackedTarball/skia/src/core/SkPoint \ UnpackedTarball/skia/src/core/SkPoint3 \ - UnpackedTarball/skia/src/core/SkPromiseImageTexture \ UnpackedTarball/skia/src/core/SkPtrRecorder \ UnpackedTarball/skia/src/core/SkQuadClipper \ UnpackedTarball/skia/src/core/SkRasterClip \ @@ -261,6 +309,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkRasterPipeline \ UnpackedTarball/skia/src/core/SkReadBuffer \ UnpackedTarball/skia/src/core/SkRecord \ + UnpackedTarball/skia/src/core/SkReadPixelsRec \ UnpackedTarball/skia/src/core/SkRecordDraw \ UnpackedTarball/skia/src/core/SkRecordedDrawable \ UnpackedTarball/skia/src/core/SkRecorder \ @@ -269,13 +318,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkRect \ UnpackedTarball/skia/src/core/SkRegion \ UnpackedTarball/skia/src/core/SkRegion_path \ - UnpackedTarball/skia/src/core/SkRemoteGlyphCache \ UnpackedTarball/skia/src/core/SkResourceCache \ UnpackedTarball/skia/src/core/SkRRect \ + UnpackedTarball/skia/src/core/SkRSXform \ UnpackedTarball/skia/src/core/SkRTree \ + UnpackedTarball/skia/src/core/SkRuntimeBlender \ UnpackedTarball/skia/src/core/SkRuntimeEffect \ UnpackedTarball/skia/src/core/SkScalar \ - UnpackedTarball/skia/src/core/SkScalerCache \ UnpackedTarball/skia/src/core/SkScalerContext \ UnpackedTarball/skia/src/core/SkScan_AAAPath \ UnpackedTarball/skia/src/core/SkScan_Antihair \ @@ -283,71 +332,71 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkScan \ UnpackedTarball/skia/src/core/SkScan_Hairline \ UnpackedTarball/skia/src/core/SkScan_Path \ - UnpackedTarball/skia/src/core/SkSemaphore \ - UnpackedTarball/skia/src/core/SkSharedMutex \ + UnpackedTarball/skia/src/core/SkScan_SAAPath \ + UnpackedTarball/skia/src/core/SkSLTypeShared \ UnpackedTarball/skia/src/core/SkSpecialImage \ UnpackedTarball/skia/src/core/SkSpecialSurface \ - UnpackedTarball/skia/src/core/SkSpinlock \ UnpackedTarball/skia/src/core/SkSpriteBlitter_ARGB32 \ - UnpackedTarball/skia/src/core/SkSpriteBlitter_RGB565 \ UnpackedTarball/skia/src/core/SkStream \ + UnpackedTarball/skia/src/core/SkStrike \ UnpackedTarball/skia/src/core/SkStrikeCache \ - UnpackedTarball/skia/src/core/SkStrikeForGPU \ UnpackedTarball/skia/src/core/SkStrikeSpec \ UnpackedTarball/skia/src/core/SkString \ UnpackedTarball/skia/src/core/SkStringUtils \ UnpackedTarball/skia/src/core/SkStroke \ UnpackedTarball/skia/src/core/SkStrokeRec \ UnpackedTarball/skia/src/core/SkStrokerPriv \ - UnpackedTarball/skia/src/core/SkSurfaceCharacterization \ UnpackedTarball/skia/src/core/SkSwizzle \ UnpackedTarball/skia/src/core/SkTaskGroup \ UnpackedTarball/skia/src/core/SkTextBlob \ UnpackedTarball/skia/src/core/SkTextBlobTrace \ - UnpackedTarball/skia/src/core/SkThreadID \ UnpackedTarball/skia/src/core/SkTime \ - UnpackedTarball/skia/src/core/SkTSearch \ UnpackedTarball/skia/src/core/SkTypefaceCache \ UnpackedTarball/skia/src/core/SkTypeface \ UnpackedTarball/skia/src/core/SkTypeface_remote \ UnpackedTarball/skia/src/core/SkUnPreMultiply \ - UnpackedTarball/skia/src/core/SkUtilsArm \ - UnpackedTarball/skia/src/core/SkUtils \ UnpackedTarball/skia/src/core/SkVertices \ UnpackedTarball/skia/src/core/SkVertState \ UnpackedTarball/skia/src/core/SkVM \ UnpackedTarball/skia/src/core/SkVMBlitter \ UnpackedTarball/skia/src/core/SkWriteBuffer \ + UnpackedTarball/skia/src/core/SkWritePixelsRec \ UnpackedTarball/skia/src/core/SkWriter32 \ - UnpackedTarball/skia/src/core/SkXfermode \ - UnpackedTarball/skia/src/core/SkXfermodeInterpretation \ UnpackedTarball/skia/src/core/SkYUVAInfo \ UnpackedTarball/skia/src/core/SkYUVAPixmaps \ UnpackedTarball/skia/src/core/SkYUVMath \ UnpackedTarball/skia/src/core/SkYUVPlanesCache \ - UnpackedTarball/skia/src/c/sk_effects \ - UnpackedTarball/skia/src/c/sk_imageinfo \ - UnpackedTarball/skia/src/c/sk_paint \ - UnpackedTarball/skia/src/c/sk_surface \ - UnpackedTarball/skia/src/effects/imagefilters/SkAlphaThresholdFilter \ - UnpackedTarball/skia/src/effects/imagefilters/SkArithmeticImageFilter \ + UnpackedTarball/skia/src/encode/SkICC \ + UnpackedTarball/skia/src/encode/SkPngEncoderImpl \ + UnpackedTarball/skia/src/encode/SkEncoder \ + UnpackedTarball/skia/src/effects/colorfilters/SkBlendModeColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkColorFilterBase \ + UnpackedTarball/skia/src/effects/colorfilters/SkColorSpaceXformColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkComposeColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkGaussianColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkMatrixColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkRuntimeColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkTableColorFilter \ + UnpackedTarball/skia/src/effects/colorfilters/SkWorkingFormatColorFilter \ + UnpackedTarball/skia/src/effects/imagefilters/SkBlendImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkBlurImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkColorFilterImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkComposeImageFilter \ - UnpackedTarball/skia/src/effects/imagefilters/SkDisplacementMapEffect \ + UnpackedTarball/skia/src/effects/imagefilters/SkCropImageFilter \ + UnpackedTarball/skia/src/effects/imagefilters/SkDisplacementMapImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkDropShadowImageFilter \ - UnpackedTarball/skia/src/effects/imagefilters/SkImageFilters \ - UnpackedTarball/skia/src/effects/imagefilters/SkImageSource \ + UnpackedTarball/skia/src/effects/imagefilters/SkImageImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkLightingImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkMagnifierImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkMatrixConvolutionImageFilter \ + UnpackedTarball/skia/src/effects/imagefilters/SkMatrixTransformImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkMergeImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkMorphologyImageFilter \ - UnpackedTarball/skia/src/effects/imagefilters/SkOffsetImageFilter \ - UnpackedTarball/skia/src/effects/imagefilters/SkPaintImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkPictureImageFilter \ + UnpackedTarball/skia/src/effects/imagefilters/SkShaderImageFilter \ + UnpackedTarball/skia/src/effects/imagefilters/SkRuntimeImageFilter \ UnpackedTarball/skia/src/effects/imagefilters/SkTileImageFilter \ - UnpackedTarball/skia/src/effects/imagefilters/SkXfermodeImageFilter \ + UnpackedTarball/skia/src/effects/SkBlenders \ UnpackedTarball/skia/src/effects/SkColorMatrix \ UnpackedTarball/skia/src/effects/SkColorMatrixFilter \ UnpackedTarball/skia/src/effects/SkCornerPathEffect \ @@ -357,26 +406,27 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/effects/SkEmbossMaskFilter \ UnpackedTarball/skia/src/effects/SkHighContrastFilter \ UnpackedTarball/skia/src/effects/SkLayerDrawLooper \ - UnpackedTarball/skia/src/effects/SkLumaColorFilter \ UnpackedTarball/skia/src/effects/SkOpPathEffect \ - UnpackedTarball/skia/src/effects/SkOverdrawColorFilter \ - UnpackedTarball/skia/src/effects/SkPackBits \ - UnpackedTarball/skia/src/effects/SkShaderMaskFilter \ - UnpackedTarball/skia/src/effects/SkTableColorFilter \ + UnpackedTarball/skia/src/effects/SkShaderMaskFilterImpl \ UnpackedTarball/skia/src/effects/SkTableMaskFilter \ UnpackedTarball/skia/src/effects/SkTrimPathEffect \ UnpackedTarball/skia/src/effects/Sk1DPathEffect \ UnpackedTarball/skia/src/effects/Sk2DPathEffect \ UnpackedTarball/skia/src/fonts/SkRemotableFontMgr \ UnpackedTarball/skia/src/image/SkImage \ + UnpackedTarball/skia/src/image/SkImage_Base \ UnpackedTarball/skia/src/image/SkImage_Lazy \ + UnpackedTarball/skia/src/image/SkImage_LazyFactories \ + UnpackedTarball/skia/src/image/SkImage_Picture \ UnpackedTarball/skia/src/image/SkImage_Raster \ + UnpackedTarball/skia/src/image/SkImage_RasterFactories \ + UnpackedTarball/skia/src/image/SkPictureImageGenerator \ UnpackedTarball/skia/src/image/SkRescaleAndReadPixels \ UnpackedTarball/skia/src/image/SkSurface \ + UnpackedTarball/skia/src/image/SkSurface_Base\ + UnpackedTarball/skia/src/image/SkSurface_Null \ UnpackedTarball/skia/src/image/SkSurface_Raster \ - UnpackedTarball/skia/src/images/SkImageEncoder \ - UnpackedTarball/skia/src/images/SkPngEncoder \ - UnpackedTarball/skia/src/images/SkWebpEncoder \ + UnpackedTarball/skia/src/image/SkTiledImageUtils \ UnpackedTarball/skia/src/lazy/SkDiscardableMemoryPool \ UnpackedTarball/skia/src/pathops/SkAddIntersections \ UnpackedTarball/skia/src/pathops/SkDConicLineIntersection \ @@ -412,63 +462,133 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/pathops/SkReduceOrder \ UnpackedTarball/skia/src/sfnt/SkOTTable_name \ UnpackedTarball/skia/src/sfnt/SkOTUtils \ - UnpackedTarball/skia/src/shaders/gradients/SkGradientShader \ + UnpackedTarball/skia/src/shaders/gradients/SkConicalGradient \ + UnpackedTarball/skia/src/shaders/gradients/SkGradientBaseShader \ UnpackedTarball/skia/src/shaders/gradients/SkLinearGradient \ UnpackedTarball/skia/src/shaders/gradients/SkRadialGradient \ UnpackedTarball/skia/src/shaders/gradients/SkSweepGradient \ - UnpackedTarball/skia/src/shaders/gradients/SkTwoPointConicalGradient \ - UnpackedTarball/skia/src/shaders/gradients/Sk4fGradientBase \ - UnpackedTarball/skia/src/shaders/gradients/Sk4fLinearGradient \ + UnpackedTarball/skia/src/shaders/SkBlendShader \ UnpackedTarball/skia/src/shaders/SkBitmapProcShader \ UnpackedTarball/skia/src/shaders/SkColorFilterShader \ UnpackedTarball/skia/src/shaders/SkColorShader \ - UnpackedTarball/skia/src/shaders/SkComposeShader \ + UnpackedTarball/skia/src/shaders/SkCoordClampShader \ + UnpackedTarball/skia/src/shaders/SkEmptyShader \ UnpackedTarball/skia/src/shaders/SkImageShader \ UnpackedTarball/skia/src/shaders/SkLocalMatrixShader \ - UnpackedTarball/skia/src/shaders/SkPerlinNoiseShader \ UnpackedTarball/skia/src/shaders/SkPictureShader \ + UnpackedTarball/skia/src/shaders/SkPerlinNoiseShaderImpl \ + UnpackedTarball/skia/src/shaders/SkRuntimeShader \ UnpackedTarball/skia/src/shaders/SkShader \ - UnpackedTarball/skia/src/sksl/dsl/DSLCore \ + UnpackedTarball/skia/src/shaders/SkShaderBase \ + UnpackedTarball/skia/src/shaders/SkTransformShader \ + UnpackedTarball/skia/src/shaders/SkTriColorShader \ UnpackedTarball/skia/src/sksl/dsl/DSLExpression \ + UnpackedTarball/skia/src/sksl/dsl/DSLStatement \ UnpackedTarball/skia/src/sksl/dsl/DSLType \ - UnpackedTarball/skia/src/sksl/dsl/DSLVar \ - UnpackedTarball/skia/src/sksl/dsl/priv/DSLWriter \ + UnpackedTarball/skia/src/sksl/ir/SkSLBinaryExpression \ + UnpackedTarball/skia/src/sksl/ir/SkSLBlock \ + UnpackedTarball/skia/src/sksl/ir/SkSLChildCall \ UnpackedTarball/skia/src/sksl/ir/SkSLConstructor \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorArray \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorArrayCast \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorCompound \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorCompoundCast \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorDiagonalMatrix \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorMatrixResize \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorScalarCast \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorSplat \ + UnpackedTarball/skia/src/sksl/ir/SkSLConstructorStruct \ + UnpackedTarball/skia/src/sksl/ir/SkSLDiscardStatement \ + UnpackedTarball/skia/src/sksl/ir/SkSLDoStatement \ + UnpackedTarball/skia/src/sksl/ir/SkSLExpression \ + UnpackedTarball/skia/src/sksl/ir/SkSLExpressionStatement \ + UnpackedTarball/skia/src/sksl/ir/SkSLExtension \ + UnpackedTarball/skia/src/sksl/ir/SkSLFieldAccess \ + UnpackedTarball/skia/src/sksl/ir/SkSLForStatement \ + UnpackedTarball/skia/src/sksl/ir/SkSLFunctionCall \ + UnpackedTarball/skia/src/sksl/ir/SkSLFunctionDeclaration \ + UnpackedTarball/skia/src/sksl/ir/SkSLFunctionDefinition \ + UnpackedTarball/skia/src/sksl/ir/SkSLIfStatement \ + UnpackedTarball/skia/src/sksl/ir/SkSLIndexExpression \ + UnpackedTarball/skia/src/sksl/ir/SkSLInterfaceBlock \ + UnpackedTarball/skia/src/sksl/ir/SkSLLayout \ + UnpackedTarball/skia/src/sksl/ir/SkSLLiteral \ + UnpackedTarball/skia/src/sksl/ir/SkSLModifiers \ + UnpackedTarball/skia/src/sksl/ir/SkSLModifiersDeclaration \ + UnpackedTarball/skia/src/sksl/ir/SkSLProgram \ UnpackedTarball/skia/src/sksl/ir/SkSLPrefixExpression \ + UnpackedTarball/skia/src/sksl/ir/SkSLPostfixExpression \ UnpackedTarball/skia/src/sksl/ir/SkSLSetting \ + UnpackedTarball/skia/src/sksl/ir/SkSLStructDefinition \ + UnpackedTarball/skia/src/sksl/ir/SkSLSwitchCase \ + UnpackedTarball/skia/src/sksl/ir/SkSLSwitchStatement \ + UnpackedTarball/skia/src/sksl/ir/SkSLSwizzle \ UnpackedTarball/skia/src/sksl/ir/SkSLSymbolTable \ + UnpackedTarball/skia/src/sksl/ir/SkSLTernaryExpression \ UnpackedTarball/skia/src/sksl/ir/SkSLType \ + UnpackedTarball/skia/src/sksl/ir/SkSLTypeReference \ + UnpackedTarball/skia/src/sksl/ir/SkSLVarDeclarations \ + UnpackedTarball/skia/src/sksl/ir/SkSLVariable \ UnpackedTarball/skia/src/sksl/ir/SkSLVariableReference \ - UnpackedTarball/skia/src/sksl/SkSLASTNode \ + UnpackedTarball/skia/src/sksl/tracing/SkSLTraceHook \ + UnpackedTarball/skia/src/sksl/tracing/SkSLDebugTracePriv \ + UnpackedTarball/skia/src/sksl/tracing/SkSLDebugTracePlayer \ UnpackedTarball/skia/src/sksl/SkSLAnalysis \ - UnpackedTarball/skia/src/sksl/SkSLByteCode \ - UnpackedTarball/skia/src/sksl/SkSLByteCodeGenerator \ - UnpackedTarball/skia/src/sksl/SkSLCFGGenerator \ + UnpackedTarball/skia/src/sksl/SkSLBuiltinTypes \ UnpackedTarball/skia/src/sksl/SkSLCompiler \ UnpackedTarball/skia/src/sksl/SkSLConstantFolder \ UnpackedTarball/skia/src/sksl/SkSLContext \ - UnpackedTarball/skia/src/sksl/SkSLCPPCodeGenerator \ - UnpackedTarball/skia/src/sksl/SkSLCPPUniformCTypes \ - UnpackedTarball/skia/src/sksl/SkSLDehydrator \ - UnpackedTarball/skia/src/sksl/SkSLGLSLCodeGenerator \ - UnpackedTarball/skia/src/sksl/SkSLHCodeGenerator \ - UnpackedTarball/skia/src/sksl/SkSLIRGenerator \ + UnpackedTarball/skia/src/sksl/SkSLErrorReporter \ UnpackedTarball/skia/src/sksl/SkSLInliner \ + UnpackedTarball/skia/src/sksl/SkSLIntrinsicList \ UnpackedTarball/skia/src/sksl/SkSLLexer \ UnpackedTarball/skia/src/sksl/SkSLMangler \ - UnpackedTarball/skia/src/sksl/SkSLMetalCodeGenerator \ + UnpackedTarball/skia/src/sksl/SkSLModuleLoader \ + UnpackedTarball/skia/src/sksl/SkSLOperator \ UnpackedTarball/skia/src/sksl/SkSLOutputStream \ UnpackedTarball/skia/src/sksl/SkSLParser \ UnpackedTarball/skia/src/sksl/SkSLPool \ - UnpackedTarball/skia/src/sksl/SkSLPipelineStageCodeGenerator \ - UnpackedTarball/skia/src/sksl/SkSLRehydrator \ + UnpackedTarball/skia/src/sksl/SkSLPosition \ UnpackedTarball/skia/src/sksl/SkSLSampleUsage \ - UnpackedTarball/skia/src/sksl/SkSLSPIRVCodeGenerator \ - UnpackedTarball/skia/src/sksl/SkSLSPIRVtoHLSL \ - UnpackedTarball/skia/src/sksl/SkSLSectionAndParameterHelper \ UnpackedTarball/skia/src/sksl/SkSLString \ + UnpackedTarball/skia/src/sksl/SkSLThreadContext \ UnpackedTarball/skia/src/sksl/SkSLUtil \ - UnpackedTarball/skia/src/sksl/SkSLVMGenerator \ + UnpackedTarball/skia/src/sksl/analysis/SkSLCanExitWithoutReturningValue \ + UnpackedTarball/skia/src/sksl/analysis/SkSLCheckProgramStructure \ + UnpackedTarball/skia/src/sksl/analysis/SkSLFinalizationChecks \ + UnpackedTarball/skia/src/sksl/analysis/SkSLGetLoopUnrollInfo \ + UnpackedTarball/skia/src/sksl/analysis/SkSLGetReturnComplexity \ + UnpackedTarball/skia/src/sksl/analysis/SkSLHasSideEffects \ + UnpackedTarball/skia/src/sksl/analysis/SkSLIsConstantExpression \ + UnpackedTarball/skia/src/sksl/analysis/SkSLIsSameExpressionTree \ + UnpackedTarball/skia/src/sksl/analysis/SkSLIsTrivialExpression \ + UnpackedTarball/skia/src/sksl/analysis/SkSLProgramUsage \ + UnpackedTarball/skia/src/sksl/analysis/SkSLReturnsInputAlpha \ + UnpackedTarball/skia/src/sksl/analysis/SkSLSymbolTableStackBuilder \ + UnpackedTarball/skia/src/sksl/analysis/SkSLSwitchCaseContainsExit \ + UnpackedTarball/skia/src/sksl/analysis/SkSLGetLoopControlFlowInfo \ + UnpackedTarball/skia/src/sksl/analysis/SkSLIsDynamicallyUniformExpression \ + UnpackedTarball/skia/src/sksl/codegen/SkSLGLSLCodeGenerator \ + UnpackedTarball/skia/src/sksl/codegen/SkSLMetalCodeGenerator \ + UnpackedTarball/skia/src/sksl/codegen/SkSLPipelineStageCodeGenerator \ + UnpackedTarball/skia/src/sksl/codegen/SkSLSPIRVCodeGenerator \ + UnpackedTarball/skia/src/sksl/codegen/SkSLSPIRVtoHLSL \ + UnpackedTarball/skia/src/sksl/codegen/SkSLVMCodeGenerator \ + UnpackedTarball/skia/src/sksl/codegen/SkSLWGSLCodeGenerator \ + UnpackedTarball/skia/src/sksl/codegen/SkSLRasterPipelineBuilder \ + UnpackedTarball/skia/src/sksl/codegen/SkSLRasterPipelineCodeGenerator \ + UnpackedTarball/skia/src/sksl/transform/SkSLAddConstToVarModifiers \ + UnpackedTarball/skia/src/sksl/transform/SkSLEliminateDeadFunctions \ + UnpackedTarball/skia/src/sksl/transform/SkSLEliminateDeadGlobalVariables \ + UnpackedTarball/skia/src/sksl/transform/SkSLEliminateDeadLocalVariables \ + UnpackedTarball/skia/src/sksl/transform/SkSLEliminateEmptyStatements \ + UnpackedTarball/skia/src/sksl/transform/SkSLEliminateUnreachableCode \ + UnpackedTarball/skia/src/sksl/transform/SkSLFindAndDeclareBuiltinFunctions \ + UnpackedTarball/skia/src/sksl/transform/SkSLFindAndDeclareBuiltinVariables \ + UnpackedTarball/skia/src/sksl/transform/SkSLHoistSwitchVarDeclarationsAtTopLevel \ + UnpackedTarball/skia/src/sksl/transform/SkSLRenamePrivateSymbols \ + UnpackedTarball/skia/src/sksl/transform/SkSLReplaceConstVarsWithLiterals \ + UnpackedTarball/skia/src/sksl/transform/SkSLRewriteIndexedSwizzle \ UnpackedTarball/skia/src/utils/SkBase64 \ UnpackedTarball/skia/src/utils/SkCamera \ UnpackedTarball/skia/src/utils/SkCanvasStack \ @@ -479,7 +599,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/utils/SkCharToGlyphCache \ UnpackedTarball/skia/src/utils/SkClipStackUtils \ UnpackedTarball/skia/src/utils/SkCustomTypeface \ - UnpackedTarball/skia/src/utils/SkInterpolator \ UnpackedTarball/skia/src/utils/SkJSON \ UnpackedTarball/skia/src/utils/SkJSONWriter \ UnpackedTarball/skia/src/utils/SkMatrix22 \ @@ -487,361 +606,341 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/utils/SkNullCanvas \ UnpackedTarball/skia/src/utils/SkNWayCanvas \ UnpackedTarball/skia/src/utils/SkOSPath \ + UnpackedTarball/skia/src/utils/SkOrderedFontMgr \ UnpackedTarball/skia/src/utils/SkPaintFilterCanvas \ UnpackedTarball/skia/src/utils/SkParseColor \ UnpackedTarball/skia/src/utils/SkParse \ UnpackedTarball/skia/src/utils/SkParsePath \ UnpackedTarball/skia/src/utils/SkPatchUtils \ UnpackedTarball/skia/src/utils/SkPolyUtils \ + UnpackedTarball/skia/src/utils/SkShaderUtils \ UnpackedTarball/skia/src/utils/SkShadowTessellator \ UnpackedTarball/skia/src/utils/SkShadowUtils \ - UnpackedTarball/skia/src/utils/SkShaperJSONWriter \ UnpackedTarball/skia/src/utils/SkTextUtils \ - UnpackedTarball/skia/src/utils/SkThreadUtils_pthread \ - UnpackedTarball/skia/src/utils/SkThreadUtils_win \ - UnpackedTarball/skia/src/utils/SkUTF \ UnpackedTarball/skia/src/xps/SkXPSDevice \ UnpackedTarball/skia/src/xps/SkXPSDocument \ )) +ifneq ($(SKIA_GPU),) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkGpuBlurUtils \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCAtlas \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCClipPath \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCClipProcessor \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCConicShader \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCCoverageProcessor \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCCubicShader \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCDrawPathsOp \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCFiller \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCFillGeometry \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCPathCache \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCPathProcessor \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCPerFlushResources \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCQuadraticShader \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCStrokeGeometry \ - UnpackedTarball/skia/src/gpu/ccpr/GrCCStroker \ - UnpackedTarball/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer \ - UnpackedTarball/skia/src/gpu/ccpr/GrGSCoverageProcessor \ - UnpackedTarball/skia/src/gpu/ccpr/GrOctoBounds \ - UnpackedTarball/skia/src/gpu/ccpr/GrSampleMaskProcessor \ - UnpackedTarball/skia/src/gpu/ccpr/GrStencilAtlasOp \ - UnpackedTarball/skia/src/gpu/ccpr/GrVSCoverageProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrAARectEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrArithmeticProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrCircleBlurFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrCircleEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrClampFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrColorMatrixFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrComposeLerpEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrConfigConversionEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrConstColorProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrDitherEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrEllipseEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrDeviceSpaceEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrHSLToRGBFilterEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrHighContrastFilterEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrLumaColorFilterEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrMagnifierEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrMixerEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrOverrideInputFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/generated/GrRectBlurEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrRGBToHSLFilterEffect \ - UnpackedTarball/skia/src/gpu/effects/generated/GrRRectBlurEffect \ - UnpackedTarball/skia/src/gpu/effects/GrBezierEffect \ - UnpackedTarball/skia/src/gpu/effects/GrBicubicEffect \ - UnpackedTarball/skia/src/gpu/effects/GrBitmapTextGeoProc \ - UnpackedTarball/skia/src/gpu/effects/GrBlendFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/GrConvexPolyEffect \ - UnpackedTarball/skia/src/gpu/effects/GrCoverageSetOpXP \ - UnpackedTarball/skia/src/gpu/effects/GrCustomXfermode \ - UnpackedTarball/skia/src/gpu/effects/GrDisableColorXP \ - UnpackedTarball/skia/src/gpu/effects/GrDistanceFieldGeoProc \ - UnpackedTarball/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor \ - UnpackedTarball/skia/src/gpu/effects/GrMatrixConvolutionEffect \ - UnpackedTarball/skia/src/gpu/effects/GrMatrixEffect \ - UnpackedTarball/skia/src/gpu/effects/GrOvalEffect \ - UnpackedTarball/skia/src/gpu/effects/GrPorterDuffXferProcessor \ - UnpackedTarball/skia/src/gpu/effects/GrRRectEffect \ - UnpackedTarball/skia/src/gpu/effects/GrShadowGeoProc \ - UnpackedTarball/skia/src/gpu/effects/GrSkSLFP \ - UnpackedTarball/skia/src/gpu/effects/GrTextureEffect \ - UnpackedTarball/skia/src/gpu/effects/GrYUVtoRGBEffect \ - UnpackedTarball/skia/src/gpu/geometry/GrPathUtils \ - UnpackedTarball/skia/src/gpu/geometry/GrQuad \ - UnpackedTarball/skia/src/gpu/geometry/GrQuadUtils \ - UnpackedTarball/skia/src/gpu/geometry/GrShape \ - UnpackedTarball/skia/src/gpu/geometry/GrStyledShape \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLBlend \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSL \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLFragmentProcessor \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLFragmentShaderBuilder \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLGeometryProcessor \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLPrimitiveProcessor \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLProgramBuilder \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLProgramDataManager \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLShaderBuilder \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLUniformHandler \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLVarying \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder \ - UnpackedTarball/skia/src/gpu/glsl/GrGLSLXferProcessor \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrClampedGradientEffect \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrDualIntervalGradientColorizer \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrLinearGradientLayout \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrRadialGradientLayout \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrSweepGradientLayout \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrTiledGradientEffect \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout \ - UnpackedTarball/skia/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer \ - UnpackedTarball/skia/src/gpu/gradients/GrGradientBitmapCache \ - UnpackedTarball/skia/src/gpu/gradients/GrGradientShader \ - UnpackedTarball/skia/src/gpu/GrAATriangulator \ - UnpackedTarball/skia/src/gpu/GrAHardwareBufferImageGenerator \ - UnpackedTarball/skia/src/gpu/GrAHardwareBufferUtils \ - UnpackedTarball/skia/src/gpu/GrAttachment \ - UnpackedTarball/skia/src/gpu/GrAuditTrail \ - UnpackedTarball/skia/src/gpu/GrBackendSemaphore \ - UnpackedTarball/skia/src/gpu/GrBackendSurfaceMutableState \ - UnpackedTarball/skia/src/gpu/GrBackendSurface \ - UnpackedTarball/skia/src/gpu/GrBackendTextureImageGenerator \ - UnpackedTarball/skia/src/gpu/GrBackendUtils \ - UnpackedTarball/skia/src/gpu/GrBitmapTextureMaker \ - UnpackedTarball/skia/src/gpu/GrBlockAllocator \ - UnpackedTarball/skia/src/gpu/GrBlurUtils \ - UnpackedTarball/skia/src/gpu/GrBufferAllocPool \ - UnpackedTarball/skia/src/gpu/GrCaps \ - UnpackedTarball/skia/src/gpu/GrClientMappedBufferManager \ - UnpackedTarball/skia/src/gpu/GrClipStack \ - UnpackedTarball/skia/src/gpu/GrClipStackClip \ - UnpackedTarball/skia/src/gpu/GrColorInfo \ - UnpackedTarball/skia/src/gpu/GrColorSpaceXform \ - UnpackedTarball/skia/src/gpu/GrContext_Base \ - UnpackedTarball/skia/src/gpu/GrContextThreadSafeProxy \ - UnpackedTarball/skia/src/gpu/GrCopyRenderTask \ - UnpackedTarball/skia/src/gpu/GrDataUtils \ - UnpackedTarball/skia/src/gpu/GrDDLContext \ - UnpackedTarball/skia/src/gpu/GrDDLTask \ - UnpackedTarball/skia/src/gpu/GrDefaultGeoProcFactory \ - UnpackedTarball/skia/src/gpu/GrDirectContext \ - UnpackedTarball/skia/src/gpu/GrDirectContextPriv \ - UnpackedTarball/skia/src/gpu/GrDistanceFieldGenFromVector \ - UnpackedTarball/skia/src/gpu/GrDrawingManager \ - UnpackedTarball/skia/src/gpu/GrDrawOpAtlas \ - UnpackedTarball/skia/src/gpu/GrDrawOpTest \ - UnpackedTarball/skia/src/gpu/GrDriverBugWorkarounds \ - UnpackedTarball/skia/src/gpu/GrDynamicAtlas \ - UnpackedTarball/skia/src/gpu/GrFinishCallbacks \ - UnpackedTarball/skia/src/gpu/GrFixedClip \ - UnpackedTarball/skia/src/gpu/GrFragmentProcessor \ - UnpackedTarball/skia/src/gpu/GrGpu \ - UnpackedTarball/skia/src/gpu/GrGpuBuffer \ - UnpackedTarball/skia/src/gpu/GrGpuResource \ - UnpackedTarball/skia/src/gpu/GrImageContext \ - UnpackedTarball/skia/src/gpu/GrImageTextureMaker \ - UnpackedTarball/skia/src/gpu/GrManagedResource \ - UnpackedTarball/skia/src/gpu/GrMemoryPool \ - UnpackedTarball/skia/src/gpu/GrOnFlushResourceProvider \ - UnpackedTarball/skia/src/gpu/GrOpFlushState \ - UnpackedTarball/skia/src/gpu/GrOpsRenderPass \ - UnpackedTarball/skia/src/gpu/GrOpsTask \ - UnpackedTarball/skia/src/gpu/GrPaint \ - UnpackedTarball/skia/src/gpu/GrPath \ - UnpackedTarball/skia/src/gpu/GrPathProcessor \ - UnpackedTarball/skia/src/gpu/GrPathRenderer \ - UnpackedTarball/skia/src/gpu/GrPathRendererChain \ - UnpackedTarball/skia/src/gpu/GrPathRendering \ - UnpackedTarball/skia/src/gpu/GrPipeline \ - UnpackedTarball/skia/src/gpu/GrPrimitiveProcessor \ - UnpackedTarball/skia/src/gpu/GrProcessorAnalysis \ - UnpackedTarball/skia/src/gpu/GrProcessor \ - UnpackedTarball/skia/src/gpu/GrProcessorSet \ - UnpackedTarball/skia/src/gpu/GrProcessorUnitTest \ - UnpackedTarball/skia/src/gpu/GrProgramDesc \ - UnpackedTarball/skia/src/gpu/GrProgramInfo \ - UnpackedTarball/skia/src/gpu/GrProxyProvider \ - UnpackedTarball/skia/src/gpu/GrRecordingContext \ - UnpackedTarball/skia/src/gpu/GrRecordingContextPriv \ - UnpackedTarball/skia/src/gpu/GrRectanizerPow2 \ - UnpackedTarball/skia/src/gpu/GrRectanizerSkyline \ - UnpackedTarball/skia/src/gpu/GrRenderTask \ - UnpackedTarball/skia/src/gpu/GrReducedClip \ - UnpackedTarball/skia/src/gpu/GrRenderTarget \ - UnpackedTarball/skia/src/gpu/GrRenderTargetProxy \ - UnpackedTarball/skia/src/gpu/GrResourceAllocator \ - UnpackedTarball/skia/src/gpu/GrResourceCache \ - UnpackedTarball/skia/src/gpu/GrResourceProvider \ - UnpackedTarball/skia/src/gpu/GrRingBuffer \ - UnpackedTarball/skia/src/gpu/GrSamplePatternDictionary \ - UnpackedTarball/skia/src/gpu/GrShaderCaps \ - UnpackedTarball/skia/src/gpu/GrShaderUtils \ - UnpackedTarball/skia/src/gpu/GrShaderVar \ - UnpackedTarball/skia/src/gpu/GrSoftwarePathRenderer \ - UnpackedTarball/skia/src/gpu/GrSPIRVUniformHandler \ - UnpackedTarball/skia/src/gpu/GrSPIRVVaryingHandler \ - UnpackedTarball/skia/src/gpu/GrStagingBufferManager \ - UnpackedTarball/skia/src/gpu/GrStencilMaskHelper \ - UnpackedTarball/skia/src/gpu/GrStencilSettings \ - UnpackedTarball/skia/src/gpu/GrStyle \ - UnpackedTarball/skia/src/gpu/GrSurfaceContext \ - UnpackedTarball/skia/src/gpu/GrSurfaceDrawContext \ - UnpackedTarball/skia/src/gpu/GrSurfaceFillContext \ - UnpackedTarball/skia/src/gpu/GrSurface \ - UnpackedTarball/skia/src/gpu/GrSurfaceProxy \ - UnpackedTarball/skia/src/gpu/GrSwizzle \ - UnpackedTarball/skia/src/gpu/GrSWMaskHelper \ - UnpackedTarball/skia/src/gpu/GrTestUtils \ - UnpackedTarball/skia/src/gpu/GrTriangulator \ - UnpackedTarball/skia/src/gpu/GrUniformDataManager \ - UnpackedTarball/skia/src/gpu/GrTextureAdjuster \ - UnpackedTarball/skia/src/gpu/GrTexture \ - UnpackedTarball/skia/src/gpu/GrTextureMaker \ - UnpackedTarball/skia/src/gpu/GrTextureProducer \ - UnpackedTarball/skia/src/gpu/GrTextureProxy \ - UnpackedTarball/skia/src/gpu/GrTextureRenderTargetProxy \ - UnpackedTarball/skia/src/gpu/GrTextureResolveRenderTask \ - UnpackedTarball/skia/src/gpu/GrThreadSafeCache \ - UnpackedTarball/skia/src/gpu/GrTransferFromRenderTask \ - UnpackedTarball/skia/src/gpu/GrUtil \ - UnpackedTarball/skia/src/gpu/GrWaitRenderTask \ - UnpackedTarball/skia/src/gpu/GrXferProcessor \ - UnpackedTarball/skia/src/gpu/GrYUVABackendTextures \ - UnpackedTarball/skia/src/gpu/GrYUVATextureProxies \ - UnpackedTarball/skia/src/gpu/mock/GrMockCaps \ - UnpackedTarball/skia/src/gpu/mock/GrMockGpu \ - UnpackedTarball/skia/src/gpu/mock/GrMockTypes \ - UnpackedTarball/skia/src/gpu/ops/GrAAConvexPathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrAAConvexTessellator \ - UnpackedTarball/skia/src/gpu/ops/GrAAHairLinePathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrAtlasTextOp \ - UnpackedTarball/skia/src/gpu/ops/GrClearOp \ - UnpackedTarball/skia/src/gpu/ops/GrDashLinePathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrDashOp \ - UnpackedTarball/skia/src/gpu/ops/GrDefaultPathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrDrawableOp \ - UnpackedTarball/skia/src/gpu/ops/GrDrawAtlasOp \ - UnpackedTarball/skia/src/gpu/ops/GrDrawPathOp \ - UnpackedTarball/skia/src/gpu/ops/GrDrawVerticesOp \ - UnpackedTarball/skia/src/gpu/ops/GrFillRectOp \ - UnpackedTarball/skia/src/gpu/ops/GrFillRRectOp \ - UnpackedTarball/skia/src/gpu/ops/GrLatticeOp \ - UnpackedTarball/skia/src/gpu/ops/GrMeshDrawOp \ - UnpackedTarball/skia/src/gpu/ops/GrOp \ - UnpackedTarball/skia/src/gpu/ops/GrOvalOpFactory \ - UnpackedTarball/skia/src/gpu/ops/GrQuadPerEdgeAA \ - UnpackedTarball/skia/src/gpu/ops/GrRegionOp \ - UnpackedTarball/skia/src/gpu/ops/GrShadowRRectOp \ - UnpackedTarball/skia/src/gpu/ops/GrSimpleMeshDrawOpHelper \ - UnpackedTarball/skia/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil \ - UnpackedTarball/skia/src/gpu/ops/GrSmallPathAtlasMgr \ - UnpackedTarball/skia/src/gpu/ops/GrSmallPathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrStencilAndCoverPathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrStencilPathOp \ - UnpackedTarball/skia/src/gpu/ops/GrSmallPathShapeData \ - UnpackedTarball/skia/src/gpu/ops/GrStrokeRectOp \ - UnpackedTarball/skia/src/gpu/ops/GrTriangulatingPathRenderer \ - UnpackedTarball/skia/src/gpu/ops/GrTextureOp \ - UnpackedTarball/skia/src/gpu/SkGpuDevice \ - UnpackedTarball/skia/src/gpu/SkGpuDevice_drawTexture \ - UnpackedTarball/skia/src/gpu/SkGr \ - UnpackedTarball/skia/src/gpu/tessellate/GrDrawAtlasPathOp \ - UnpackedTarball/skia/src/gpu/tessellate/GrFillPathShader \ - UnpackedTarball/skia/src/gpu/tessellate/GrPathTessellateOp \ - UnpackedTarball/skia/src/gpu/tessellate/GrStencilPathShader \ - UnpackedTarball/skia/src/gpu/tessellate/GrStrokeIndirectOp \ - UnpackedTarball/skia/src/gpu/tessellate/GrStrokeOp \ - UnpackedTarball/skia/src/gpu/tessellate/GrStrokeTessellateOp \ - UnpackedTarball/skia/src/gpu/tessellate/GrStrokeTessellateShader \ - UnpackedTarball/skia/src/gpu/tessellate/GrTessellationPathRenderer \ - UnpackedTarball/skia/src/gpu/text/GrAtlasManager \ - UnpackedTarball/skia/src/gpu/text/GrDistanceFieldAdjustTable \ - UnpackedTarball/skia/src/gpu/text/GrSDFMaskFilter \ - UnpackedTarball/skia/src/gpu/text/GrSDFTOptions \ - UnpackedTarball/skia/src/gpu/text/GrStrikeCache \ - UnpackedTarball/skia/src/gpu/text/GrTextBlobCache \ - UnpackedTarball/skia/src/gpu/text/GrTextBlob \ - UnpackedTarball/skia/src/image/SkImage_GpuBase \ - UnpackedTarball/skia/src/image/SkImage_Gpu \ - UnpackedTarball/skia/src/image/SkImage_GpuYUVA \ - UnpackedTarball/skia/src/image/SkSurface_Gpu \ - UnpackedTarball/skia/src/gpu/vk/GrVkAMDMemoryAllocator \ - UnpackedTarball/skia/src/gpu/vk/GrVkAttachment \ - UnpackedTarball/skia/src/gpu/vk/GrVkBuffer \ - UnpackedTarball/skia/src/gpu/vk/GrVkCaps \ - UnpackedTarball/skia/src/gpu/vk/GrVkCommandBuffer \ - UnpackedTarball/skia/src/gpu/vk/GrVkCommandPool \ - UnpackedTarball/skia/src/gpu/vk/GrVkDescriptorPool \ - UnpackedTarball/skia/src/gpu/vk/GrVkDescriptorSet \ - UnpackedTarball/skia/src/gpu/vk/GrVkDescriptorSetManager \ - UnpackedTarball/skia/src/gpu/vk/GrVkExtensions \ - UnpackedTarball/skia/src/gpu/vk/GrVkFramebuffer \ - UnpackedTarball/skia/src/gpu/vk/GrVkGpu \ - UnpackedTarball/skia/src/gpu/vk/GrVkImage \ - UnpackedTarball/skia/src/gpu/vk/GrVkImageView \ - UnpackedTarball/skia/src/gpu/vk/GrVkInterface \ - UnpackedTarball/skia/src/gpu/vk/GrVkMSAALoadManager \ - UnpackedTarball/skia/src/gpu/vk/GrVkMemory \ - UnpackedTarball/skia/src/gpu/vk/GrVkMeshBuffer \ - UnpackedTarball/skia/src/gpu/vk/GrVkOpsRenderPass \ - UnpackedTarball/skia/src/gpu/vk/GrVkPipeline \ - UnpackedTarball/skia/src/gpu/vk/GrVkPipelineStateBuilder \ - UnpackedTarball/skia/src/gpu/vk/GrVkPipelineStateCache \ - UnpackedTarball/skia/src/gpu/vk/GrVkPipelineState \ - UnpackedTarball/skia/src/gpu/vk/GrVkPipelineStateDataManager \ - UnpackedTarball/skia/src/gpu/vk/GrVkRenderPass \ - UnpackedTarball/skia/src/gpu/vk/GrVkRenderTarget \ - UnpackedTarball/skia/src/gpu/vk/GrVkResourceProvider \ - UnpackedTarball/skia/src/gpu/vk/GrVkSampler \ - UnpackedTarball/skia/src/gpu/vk/GrVkSamplerYcbcrConversion \ - UnpackedTarball/skia/src/gpu/vk/GrVkSecondaryCBDrawContext \ - UnpackedTarball/skia/src/gpu/vk/GrVkSemaphore \ - UnpackedTarball/skia/src/gpu/vk/GrVkTexture \ - UnpackedTarball/skia/src/gpu/vk/GrVkTextureRenderTarget \ - UnpackedTarball/skia/src/gpu/vk/GrVkTransferBuffer \ - UnpackedTarball/skia/src/gpu/vk/GrVkTypesPriv \ - UnpackedTarball/skia/src/gpu/vk/GrVkUniformBuffer \ - UnpackedTarball/skia/src/gpu/vk/GrVkUniformHandler \ - UnpackedTarball/skia/src/gpu/vk/GrVkUtil \ - UnpackedTarball/skia/src/gpu/vk/GrVkVaryingHandler \ + UnpackedTarball/skia/src/gpu/AtlasTypes \ + UnpackedTarball/skia/src/gpu/Blend \ + UnpackedTarball/skia/src/gpu/BlendFormula \ + UnpackedTarball/skia/src/gpu/DitherUtils \ + UnpackedTarball/skia/src/gpu/RectanizerPow2 \ + UnpackedTarball/skia/src/gpu/RectanizerSkyline \ + UnpackedTarball/skia/src/gpu/ResourceKey \ + UnpackedTarball/skia/src/gpu/ShaderErrorHandler \ + UnpackedTarball/skia/src/gpu/Swizzle \ + UnpackedTarball/skia/src/gpu/TiledTextureUtils \ + UnpackedTarball/skia/src/gpu/ganesh/ClipStack \ + UnpackedTarball/skia/src/gpu/ganesh/Device \ + UnpackedTarball/skia/src/gpu/ganesh/Device_drawTexture \ + UnpackedTarball/skia/src/gpu/ganesh/GrBufferTransferRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrBufferUpdateRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrFragmentProcessors \ + UnpackedTarball/skia/src/gpu/ganesh/GrSurfaceProxyView \ + UnpackedTarball/skia/src/gpu/ganesh/PathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/PathRendererChain \ + UnpackedTarball/skia/src/gpu/ganesh/StencilMaskHelper \ + UnpackedTarball/skia/src/gpu/ganesh/SurfaceDrawContext \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrBezierEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrBicubicEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrBitmapTextGeoProc \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrBlendFragmentProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrColorTableEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrConvexPolyEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrCoverageSetOpXP \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrCustomXfermode \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrDisableColorXP \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrDistanceFieldGeoProc \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrGaussianConvolutionFragmentProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrMatrixConvolutionEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrMatrixEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrModulateAtlasCoverageEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrOvalEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrPerlinNoise2Effect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrPorterDuffXferProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrRRectEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrShadowGeoProc \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrSkSLFP \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrTextureEffect \ + UnpackedTarball/skia/src/gpu/ganesh/effects/GrYUVtoRGBEffect \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrPathUtils \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrQuad \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrQuadUtils \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrShape \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrStyledShape \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLBlend \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLProgramBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLProgramDataManager \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLShaderBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLUniformHandler \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLVarying \ + UnpackedTarball/skia/src/gpu/ganesh/glsl/GrGLSLVertexGeoBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/gradients/GrGradientBitmapCache \ + UnpackedTarball/skia/src/gpu/ganesh/gradients/GrGradientShader \ + UnpackedTarball/skia/src/gpu/ganesh/image/GrImageUtils \ + UnpackedTarball/skia/src/gpu/ganesh/image/GrTextureGenerator \ + UnpackedTarball/skia/src/gpu/ganesh/image/SkImage_Ganesh \ + UnpackedTarball/skia/src/gpu/ganesh/image/SkImage_GaneshBase \ + UnpackedTarball/skia/src/gpu/ganesh/image/SkImage_GaneshFactories \ + UnpackedTarball/skia/src/gpu/ganesh/image/SkImage_GaneshYUVA \ + UnpackedTarball/skia/src/gpu/ganesh/image/SkImage_LazyTexture \ + UnpackedTarball/skia/src/gpu/ganesh/image/SkImage_RasterPinnable \ + UnpackedTarball/skia/src/gpu/ganesh/GrAHardwareBufferImageGenerator \ + UnpackedTarball/skia/src/gpu/ganesh/GrAHardwareBufferUtils \ + UnpackedTarball/skia/src/gpu/ganesh/GrAttachment \ + UnpackedTarball/skia/src/gpu/ganesh/GrBackendSemaphore \ + UnpackedTarball/skia/src/gpu/ganesh/GrBackendSurface \ + UnpackedTarball/skia/src/gpu/ganesh/GrBackendTextureImageGenerator \ + UnpackedTarball/skia/src/gpu/ganesh/GrBackendUtils \ + UnpackedTarball/skia/src/gpu/ganesh/GrBufferAllocPool \ + UnpackedTarball/skia/src/gpu/ganesh/GrCaps \ + UnpackedTarball/skia/src/gpu/ganesh/GrClientMappedBufferManager \ + UnpackedTarball/skia/src/gpu/ganesh/GrColorInfo \ + UnpackedTarball/skia/src/gpu/ganesh/GrColorSpaceXform \ + UnpackedTarball/skia/src/gpu/ganesh/GrContext_Base \ + UnpackedTarball/skia/src/gpu/ganesh/GrContextThreadSafeProxy \ + UnpackedTarball/skia/src/gpu/ganesh/GrCopyRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrDataUtils \ + UnpackedTarball/skia/src/gpu/ganesh/GrDDLContext \ + UnpackedTarball/skia/src/gpu/ganesh/GrDDLTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrDefaultGeoProcFactory \ + UnpackedTarball/skia/src/gpu/ganesh/GrDeferredDisplayList \ + UnpackedTarball/skia/src/gpu/ganesh/GrDirectContext \ + UnpackedTarball/skia/src/gpu/ganesh/GrDirectContextPriv \ + UnpackedTarball/skia/src/gpu/ganesh/GrDistanceFieldGenFromVector \ + UnpackedTarball/skia/src/gpu/ganesh/GrDrawingManager \ + UnpackedTarball/skia/src/gpu/ganesh/GrDrawOpAtlas \ + UnpackedTarball/skia/src/gpu/ganesh/GrDriverBugWorkarounds \ + UnpackedTarball/skia/src/gpu/ganesh/GrDynamicAtlas \ + UnpackedTarball/skia/src/gpu/ganesh/GrEagerVertexAllocator \ + UnpackedTarball/skia/src/gpu/ganesh/GrFinishCallbacks \ + UnpackedTarball/skia/src/gpu/ganesh/GrFixedClip \ + UnpackedTarball/skia/src/gpu/ganesh/GrFragmentProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/GrGeometryProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/GrGpu \ + UnpackedTarball/skia/src/gpu/ganesh/GrGpuBuffer \ + UnpackedTarball/skia/src/gpu/ganesh/GrGpuResource \ + UnpackedTarball/skia/src/gpu/ganesh/GrImageContext \ + UnpackedTarball/skia/src/gpu/ganesh/GrImageInfo \ + UnpackedTarball/skia/src/gpu/ganesh/GrManagedResource \ + UnpackedTarball/skia/src/gpu/ganesh/GrMemoryPool \ + UnpackedTarball/skia/src/gpu/ganesh/GrMeshDrawTarget \ + UnpackedTarball/skia/src/gpu/ganesh/GrOnFlushResourceProvider \ + UnpackedTarball/skia/src/gpu/ganesh/GrOpFlushState \ + UnpackedTarball/skia/src/gpu/ganesh/GrOpsRenderPass \ + UnpackedTarball/skia/src/gpu/ganesh/GrPaint \ + UnpackedTarball/skia/src/gpu/ganesh/GrPersistentCacheUtils \ + UnpackedTarball/skia/src/gpu/ganesh/GrPipeline \ + UnpackedTarball/skia/src/gpu/ganesh/GrProcessorAnalysis \ + UnpackedTarball/skia/src/gpu/ganesh/GrProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/GrProcessorSet \ + UnpackedTarball/skia/src/gpu/ganesh/GrProcessorUnitTest \ + UnpackedTarball/skia/src/gpu/ganesh/GrProgramDesc \ + UnpackedTarball/skia/src/gpu/ganesh/GrProgramInfo \ + UnpackedTarball/skia/src/gpu/ganesh/GrPromiseImageTexture \ + UnpackedTarball/skia/src/gpu/ganesh/GrProxyProvider \ + UnpackedTarball/skia/src/gpu/ganesh/GrRecordingContext \ + UnpackedTarball/skia/src/gpu/ganesh/GrRecordingContextPriv \ + UnpackedTarball/skia/src/gpu/ganesh/GrRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrRenderTaskCluster \ + UnpackedTarball/skia/src/gpu/ganesh/GrRenderTarget \ + UnpackedTarball/skia/src/gpu/ganesh/GrRenderTargetProxy \ + UnpackedTarball/skia/src/gpu/ganesh/GrResourceAllocator \ + UnpackedTarball/skia/src/gpu/ganesh/GrResourceCache \ + UnpackedTarball/skia/src/gpu/ganesh/GrResourceProvider \ + UnpackedTarball/skia/src/gpu/ganesh/GrRingBuffer \ + UnpackedTarball/skia/src/gpu/ganesh/GrShaderCaps \ + UnpackedTarball/skia/src/gpu/ganesh/GrShaderVar \ + UnpackedTarball/skia/src/gpu/ganesh/GrSPIRVUniformHandler \ + UnpackedTarball/skia/src/gpu/ganesh/GrSPIRVVaryingHandler \ + UnpackedTarball/skia/src/gpu/ganesh/GrStagingBufferManager \ + UnpackedTarball/skia/src/gpu/ganesh/GrStencilSettings \ + UnpackedTarball/skia/src/gpu/ganesh/GrStyle \ + UnpackedTarball/skia/src/gpu/ganesh/GrSurface \ + UnpackedTarball/skia/src/gpu/ganesh/GrSurfaceCharacterization \ + UnpackedTarball/skia/src/gpu/ganesh/GrSurfaceInfo \ + UnpackedTarball/skia/src/gpu/ganesh/GrSurfaceProxy \ + UnpackedTarball/skia/src/gpu/ganesh/GrSWMaskHelper \ + UnpackedTarball/skia/src/gpu/ganesh/GrTestUtils \ + UnpackedTarball/skia/src/gpu/ganesh/GrUniformDataManager \ + UnpackedTarball/skia/src/gpu/ganesh/GrTexture \ + UnpackedTarball/skia/src/gpu/ganesh/GrTextureProxy \ + UnpackedTarball/skia/src/gpu/ganesh/GrTextureRenderTargetProxy \ + UnpackedTarball/skia/src/gpu/ganesh/GrTextureResolveRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrThreadSafeCache \ + UnpackedTarball/skia/src/gpu/ganesh/GrThreadSafePipelineBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/GrTransferFromRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrUtil \ + UnpackedTarball/skia/src/gpu/ganesh/GrVertexChunkArray \ + UnpackedTarball/skia/src/gpu/ganesh/GrWaitRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrWritePixelsRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/GrXferProcessor \ + UnpackedTarball/skia/src/gpu/ganesh/GrYUVABackendTextures \ + UnpackedTarball/skia/src/gpu/ganesh/GrYUVATextureProxies \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrAAConvexTessellator \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrAATriangulator \ + UnpackedTarball/skia/src/gpu/ganesh/geometry/GrTriangulator \ + UnpackedTarball/skia/src/gpu/ganesh/mock/GrMockCaps \ + UnpackedTarball/skia/src/gpu/ganesh/mock/GrMockGpu \ + UnpackedTarball/skia/src/gpu/ganesh/mock/GrMockTypes \ + UnpackedTarball/skia/src/gpu/ganesh/surface/SkSurface_Ganesh \ + UnpackedTarball/skia/src/gpu/ganesh/SkGr \ + UnpackedTarball/skia/src/gpu/ganesh/SurfaceContext \ + UnpackedTarball/skia/src/gpu/ganesh/SurfaceFillContext \ + UnpackedTarball/skia/src/gpu/ganesh/tessellate/GrPathTessellationShader \ + UnpackedTarball/skia/src/gpu/ganesh/tessellate/GrStrokeTessellationShader \ + UnpackedTarball/skia/src/gpu/ganesh/tessellate/GrTessellationShader \ + UnpackedTarball/skia/src/gpu/ganesh/tessellate/PathTessellator \ + UnpackedTarball/skia/src/gpu/ganesh/tessellate/StrokeTessellator \ + UnpackedTarball/skia/src/gpu/ganesh/text/GrAtlasManager \ + UnpackedTarball/skia/src/gpu/PipelineUtils \ + UnpackedTarball/skia/src/gpu/tessellate/FixedCountBufferUtils \ + UnpackedTarball/skia/src/gpu/tessellate/Tessellation \ + UnpackedTarball/skia/src/text/GlyphRun \ + UnpackedTarball/skia/src/text/StrikeForGPU \ + UnpackedTarball/skia/src/text/gpu/DistanceFieldAdjustTable \ + UnpackedTarball/skia/src/text/gpu/GlyphVector \ + UnpackedTarball/skia/src/text/gpu/Slug \ + UnpackedTarball/skia/src/text/gpu/SlugImpl \ + UnpackedTarball/skia/src/text/gpu/StrikeCache \ + UnpackedTarball/skia/src/text/gpu/SubRunContainer \ + UnpackedTarball/skia/src/text/gpu/SubRunAllocator \ + UnpackedTarball/skia/src/text/gpu/SDFMaskFilter \ + UnpackedTarball/skia/src/text/gpu/SDFTControl \ + UnpackedTarball/skia/src/text/gpu/TextBlob \ + UnpackedTarball/skia/src/text/gpu/TextBlobRedrawCoordinator \ + UnpackedTarball/skia/src/text/gpu/VertexFiller \ +)) + +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ + UnpackedTarball/skia/src/gpu/ganesh/GrAuditTrail \ + UnpackedTarball/skia/src/gpu/ganesh/GrBlurUtils \ + UnpackedTarball/skia/src/gpu/ganesh/GrDrawOpTest \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AAConvexPathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AAHairLinePathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AALinearizingConvexPathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AtlasInstancedHelper \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AtlasPathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AtlasRenderTask \ + UnpackedTarball/skia/src/gpu/ganesh/ops/AtlasTextOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/ClearOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DashLinePathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DashOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DefaultPathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DrawAtlasOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DrawAtlasPathOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DrawMeshOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/DrawableOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/FillRRectOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/FillRectOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/GrMeshDrawOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/GrOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/GrOvalOpFactory \ + UnpackedTarball/skia/src/gpu/ganesh/ops/GrSimpleMeshDrawOpHelper \ + UnpackedTarball/skia/src/gpu/ganesh/ops/GrSimpleMeshDrawOpHelperWithStencil \ + UnpackedTarball/skia/src/gpu/ganesh/ops/LatticeOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/OpsTask \ + UnpackedTarball/skia/src/gpu/ganesh/ops/PathInnerTriangulateOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/PathStencilCoverOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/PathTessellateOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/QuadPerEdgeAA \ + UnpackedTarball/skia/src/gpu/ganesh/ops/RegionOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/ShadowRRectOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/SmallPathAtlasMgr \ + UnpackedTarball/skia/src/gpu/ganesh/ops/SmallPathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/SmallPathShapeData \ + UnpackedTarball/skia/src/gpu/ganesh/ops/SoftwarePathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/StrokeRectOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/StrokeTessellateOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/TessellationPathRenderer \ + UnpackedTarball/skia/src/gpu/ganesh/ops/TextureOp \ + UnpackedTarball/skia/src/gpu/ganesh/ops/TriangulatingPathRenderer \ +)) + +ifeq ($(SKIA_GPU),VULKAN) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkBuffer \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkCaps \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkCommandBuffer \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkCommandPool \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkDescriptorPool \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkDescriptorSet \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkDescriptorSetManager \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkFramebuffer \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkGpu \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkImage \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkImageView \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkMSAALoadManager \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkOpsRenderPass \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkPipeline \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkPipelineStateBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkPipelineStateCache \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkPipelineState \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkPipelineStateDataManager \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkRenderPass \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkRenderTarget \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkResourceProvider \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkSampler \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkSamplerYcbcrConversion \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkSecondaryCBDrawContext \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkSemaphore \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkTexture \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkTextureRenderTarget \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkTypesPriv \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkUniformHandler \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkUtil \ + UnpackedTarball/skia/src/gpu/ganesh/vk/GrVkVaryingHandler \ + UnpackedTarball/skia/src/gpu/vk/VulkanAMDMemoryAllocator \ + UnpackedTarball/skia/src/gpu/vk/VulkanExtensions \ + UnpackedTarball/skia/src/gpu/vk/VulkanInterface \ + UnpackedTarball/skia/src/gpu/vk/VulkanMemory \ )) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ + UnpackedTarball/skia/tools/gpu/vk/VkTestUtils \ + UnpackedTarball/skia/tools/sk_app/VulkanWindowContext \ + UnpackedTarball/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator \ +)) + +endif +endif + +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/ports/SkGlobalInitialization_default \ UnpackedTarball/skia/src/ports/SkImageGenerator_none \ UnpackedTarball/skia/src/ports/SkOSFile_stdio \ )) +$(eval $(call gb_Library_add_exception_objects,skia,\ + external/skia/source/skia_opts_ssse3, $(CXXFLAGS_INTRINSICS_SSSE3) $(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3) \ +)) + $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/opts/SkOpts_avx, $(CXXFLAGS_INTRINSICS_AVX) $(LO_CLANG_CXXFLAGS_INTRINSICS_AVX) \ + $(LO_SKIA_AVOID_INLINE_COPIES) \ )) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/opts/SkOpts_hsw, \ $(CXXFLAGS_INTRINSICS_AVX2) $(CXXFLAGS_INTRINSICS_F16C) $(CXXFLAGS_INTRINSICS_FMA) \ $(LO_CLANG_CXXFLAGS_INTRINSICS_AVX2) $(LO_CLANG_CXXFLAGS_INTRINSICS_F16C) $(LO_CLANG_CXXFLAGS_INTRINSICS_FMA) \ -)) -$(eval $(call gb_Library_add_generated_exception_objects,skia,\ - UnpackedTarball/skia/src/opts/SkOpts_sse41, $(CXXFLAGS_INTRINSICS_SSE41) $(LO_CLANG_CXXFLAGS_INTRINSICS_SSE41) \ -)) -$(eval $(call gb_Library_add_generated_exception_objects,skia,\ - UnpackedTarball/skia/src/opts/SkOpts_sse42, $(CXXFLAGS_INTRINSICS_SSE42) $(LO_CLANG_CXXFLAGS_INTRINSICS_SSE42) \ + $(LO_SKIA_AVOID_INLINE_COPIES) \ )) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/opts/SkOpts_ssse3, $(CXXFLAGS_INTRINSICS_SSSE3) $(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3) \ -)) -$(eval $(call gb_Library_add_generated_exception_objects,skia,\ - UnpackedTarball/skia/src/opts/SkOpts_crc32 \ + $(LO_SKIA_AVOID_INLINE_COPIES) \ )) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/opts/SkOpts_skx, $(CXXFLAGS_INTRINSICS_AVX512) $(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512)\ + $(LO_SKIA_AVOID_INLINE_COPIES) \ )) $(eval $(call gb_Library_add_generated_exception_objects,skia,\ - UnpackedTarball/skia/tools/gpu/vk/VkTestUtils \ - UnpackedTarball/skia/tools/sk_app/VulkanWindowContext \ UnpackedTarball/skia/tools/sk_app/WindowContext \ )) @@ -866,8 +965,66 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/tools/sk_app/win/RasterWindowContext_win \ +)) + +ifeq ($(SKIA_GPU),VULKAN) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/tools/sk_app/win/VulkanWindowContext_win \ )) +endif + +else ifeq ($(OS),MACOSX) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ + UnpackedTarball/skia/src/ports/SkDebug_stdio \ + UnpackedTarball/skia/src/ports/SkImageGeneratorCG \ + UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct \ + UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct_factory \ + UnpackedTarball/skia/src/ports/SkScalerContext_mac_ct \ + UnpackedTarball/skia/src/ports/SkTypeface_mac_ct \ + UnpackedTarball/skia/src/ports/SkOSFile_posix \ + UnpackedTarball/skia/src/ports/SkOSLibrary_posix \ + UnpackedTarball/skia/src/utils/mac/SkCTFont \ + UnpackedTarball/skia/src/utils/mac/SkCreateCGImageRef \ +)) + +ifeq ($(SKIA_GPU),METAL) +$(eval $(call gb_Library_add_generated_objcxxobjects,skia,\ + UnpackedTarball/skia/tools/sk_app/MetalWindowContext \ + UnpackedTarball/skia/tools/sk_app/mac/MetalWindowContext_mac \ + UnpackedTarball/skia/tools/sk_app/mac/WindowContextFactory_mac \ +)) + +# Not used, uses OpenGL - UnpackedTarball/skia/tools/sk_app/mac/RasterWindowContext_mac + +$(eval $(call gb_Library_add_generated_objcxxobjects,skia,\ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlAttachment \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlBuffer \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlCaps \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlCommandBuffer \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlDepthStencil \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlFramebuffer \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlGpu \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlOpsRenderPass \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlPipelineState \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlPipelineStateBuilder \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlPipelineStateDataManager \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlRenderTarget \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlResourceProvider \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlSampler \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlSemaphore \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlTexture \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlTextureRenderTarget \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlTrampoline \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlTypesPriv \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlUniformHandler \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlUtil \ + UnpackedTarball/skia/src/gpu/ganesh/mtl/GrMtlVaryingHandler \ + UnpackedTarball/skia/src/gpu/ganesh/surface/SkSurface_GaneshMtl \ + UnpackedTarball/skia/src/gpu/mtl/MtlUtils \ + , -fobjc-arc \ +)) +endif + else $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/ports/SkDebug_stdio \ @@ -885,13 +1042,20 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/tools/sk_app/unix/RasterWindowContext_unix \ +)) +ifeq ($(SKIA_GPU),VULKAN) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/tools/sk_app/unix/VulkanWindowContext_unix \ )) endif +endif + +# Skcms code is used by png writer, which is used by SkiaHelper::dump(). Building +# this without optimizations would mean having each pixel of saved images be +# processed by unoptimized code. $(eval $(call gb_Library_add_generated_exception_objects,skia,\ - UnpackedTarball/skia/third_party/skcms/skcms \ - UnpackedTarball/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator \ + UnpackedTarball/skia/modules/skcms/skcms, $(gb_COMPILEROPTFLAGS) \ )) # vim: set noet sw=4 ts=4: diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk index e1ea21b3cd35..683de8e9d69c 100644 --- a/external/skia/UnpackedTarball_skia.mk +++ b/external/skia/UnpackedTarball_skia.mk @@ -11,43 +11,51 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,skia)) $(eval $(call gb_UnpackedTarball_set_tarball,skia,$(SKIA_TARBALL))) -# * c++20.patch.0 has been reported upstream at -# <https://groups.google.com/forum/#!topic/skia-discuss/pYZQq_sLnv8> "C++20 operator== issue": skia_patches := \ fix-pch.patch.1 \ fix-ddi.patch \ make-api-visible.patch.1 \ no-trace-resources-on-exit.patch.1 \ fix-alpha-difference-copy.patch.1 \ - libvulkan-name.patch.1 \ share-grcontext.patch.1 \ - fix-gcc-x86.patch.1 \ - clang11-flax-vector-conversion.patch.0 \ clang-attributes-warning.patch.1 \ fontconfig-get-typeface.patch.0 \ windows-do-not-modify-logfont.patch.0 \ windows-text-gamma.patch.0 \ windows-force-unicode-api.patch.0 \ - fix-without-gl.patch.0 \ + fix-without-gl.patch.1 \ windows-typeface-directwrite.patch.0 \ windows-raster-surface-no-copies.patch.1 \ fix-windows-dwrite.patch.1 \ - c++20.patch.0 \ - constexpr-debug-std-max.patch.1 \ swap-buffers-rect.patch.1 \ - ubsan.patch.0 \ - fast-png-write.patch.1 \ - skia_sk_cpu_sse_level_0_by_default.patch.1 \ + ubsan.patch.1 \ fix-warnings.patch.1 \ + windows-libraries-system32.patch.1 \ + allow-no-es2restrictions.patch.1 \ + vk_mem_alloc.patch.1 \ + tdf147342.patch.0 \ + redefinition-of-op.patch.0 \ + 0001-Added-missing-include-cstdio.patch \ + fix-SkDebugf-link-error.patch.1 \ + incomplete.patch.0 \ + ubsan-missing-typeinfo.patch.1 \ + incomplete-type-SkImageGenerator.patch.1 \ + 0001-AvoidCombiningExtrememelyLargeMeshes.patch.1 \ + sort-comparison-assumption.patch.0 \ $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1)) +ifneq ($(MSYSTEM),) +# use binary flag so patch from git-bash won't choke on mixed line-endings in patches +$(eval $(call gb_UnpackedTarball_set_patchflags,skia,--binary)) +endif + $(eval $(call gb_UnpackedTarball_add_patches,skia,\ $(foreach patch,$(skia_patches),external/skia/$(patch)) \ )) $(eval $(call gb_UnpackedTarball_set_post_action,skia,\ - mv third_party/skcms/skcms.cc third_party/skcms/skcms.cpp \ + mv modules/skcms/skcms.cc modules/skcms/skcms.cpp \ )) # vim: set noet sw=4 ts=4: diff --git a/external/skia/allow-no-es2restrictions.patch.1 b/external/skia/allow-no-es2restrictions.patch.1 new file mode 100644 index 000000000000..ea2dd02191f6 --- /dev/null +++ b/external/skia/allow-no-es2restrictions.patch.1 @@ -0,0 +1,13 @@ +diff --git a/include/effects/SkRuntimeEffect.h b/include/effects/SkRuntimeEffect.h +index e424910b34..cee7794d3a 100644 +--- a/include/effects/SkRuntimeEffect.h ++++ b/include/effects/SkRuntimeEffect.h +@@ -108,7 +108,7 @@ public: + // painted.) + bool forceUnoptimized = false; + +- private: ++// private: + friend class SkRuntimeEffect; + friend class SkRuntimeEffectPriv; + diff --git a/external/skia/c++20.patch.0 b/external/skia/c++20.patch.0 deleted file mode 100644 index 34edcb065735..000000000000 --- a/external/skia/c++20.patch.0 +++ /dev/null @@ -1,17 +0,0 @@ ---- include/private/SkTemplates.h -+++ include/private/SkTemplates.h -@@ -453,12 +453,12 @@ - - template<typename C, std::size_t... Is> - constexpr auto SkMakeArrayFromIndexSequence(C c, std::index_sequence<Is...>) ---> std::array<std::result_of_t<C(std::size_t)>, sizeof...(Is)> { -+-> std::array<std::invoke_result_t<C, std::size_t>, sizeof...(Is)> { - return {{ c(Is)... }}; - } - - template<size_t N, typename C> constexpr auto SkMakeArray(C c) ---> std::array<std::result_of_t<C(std::size_t)>, N> { -+-> std::array<std::invoke_result_t<C, std::size_t>, N> { - return SkMakeArrayFromIndexSequence(c, std::make_index_sequence<N>{}); - } - diff --git a/external/skia/clang-attributes-warning.patch.1 b/external/skia/clang-attributes-warning.patch.1 index 6384735e9c05..ba48ea8b14ed 100644 --- a/external/skia/clang-attributes-warning.patch.1 +++ b/external/skia/clang-attributes-warning.patch.1 @@ -1,13 +1,13 @@ -diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h +diff --git a/include/private/base/SkFloatingPoint.h b/include/private/base/SkFloatingPoint.h index 3c6d22c310..60500b2d2c 100644 ---- a/include/private/SkFloatingPoint.h -+++ b/include/private/SkFloatingPoint.h +--- a/include/private/base/SkFloatingPoint.h ++++ b/include/private/base/SkFloatingPoint.h @@ -159,7 +159,9 @@ static inline int64_t sk_float_saturate2int64(float x) { // Cast double to float, ignoring any warning about too-large finite values being cast to float. // Clang thinks this is undefined, but it's actually implementation defined to return either // the largest float or infinity (one of the two bracketing representable floats). Good enough! +#if defined(__clang__) - SK_ATTRIBUTE(no_sanitize("float-cast-overflow")) + SK_NO_SANITIZE("float-cast-overflow") +#endif static inline float sk_double_to_float(double x) { return static_cast<float>(x); @@ -17,14 +17,14 @@ index 3c6d22c310..60500b2d2c 100644 // so we have a helper that suppresses the possible undefined-behavior warnings. +#if defined(__clang__) - SK_ATTRIBUTE(no_sanitize("float-divide-by-zero")) + SK_NO_SANITIZE("float-divide-by-zero") +#endif static inline float sk_ieee_float_divide(float numer, float denom) { return numer / denom; } +#if defined(__clang__) - SK_ATTRIBUTE(no_sanitize("float-divide-by-zero")) + SK_NO_SANITIZE("float-divide-by-zero") +#endif static inline double sk_ieee_double_divide(double numer, double denom) { return numer / denom; diff --git a/external/skia/clang11-flax-vector-conversion.patch.0 b/external/skia/clang11-flax-vector-conversion.patch.0 deleted file mode 100644 index 40cf4e0a4fd5..000000000000 --- a/external/skia/clang11-flax-vector-conversion.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ ---- src/opts/SkRasterPipeline_opts.h -+++ src/opts/SkRasterPipeline_opts.h -@@ -68,7 +68,7 @@ - }; - - --#if !defined(__clang__) -+#if !defined(__clang__) || __clang_major__ >= 11 - #define JUMPER_IS_SCALAR - #elif defined(SK_ARM_HAS_NEON) - #define JUMPER_IS_NEON diff --git a/external/skia/constexpr-debug-std-max.patch.1 b/external/skia/constexpr-debug-std-max.patch.1 deleted file mode 100644 index 9f3784836c70..000000000000 --- a/external/skia/constexpr-debug-std-max.patch.1 +++ /dev/null @@ -1,69 +0,0 @@ -diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp -index 52dda13e29..cafe2e672a 100755 ---- a/src/shaders/SkImageShader.cpp -+++ b/src/shaders/SkImageShader.cpp -@@ -322,6 +322,18 @@ sk_sp<SkShader> SkImageShader::Make(sk_sp<SkImage> image, SkTileMode tmx, SkTile - #include "src/gpu/effects/GrBlendFragmentProcessor.h" - #include "src/gpu/effects/GrTextureEffect.h" - -+namespace { -+template<typename T> -+constexpr T skia_max( std::initializer_list<T> list ) -+{ -+T max = *list.begin(); -+for(auto i: list) -+ if( max < i ) -+ max = i; -+return max; -+} -+} -+ - std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor( - const GrFPArgs& args) const { - const auto lm = this->totalLocalMatrix(args.fPreLocalMatrix); -@@ -331,11 +343,11 @@ std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor( - } - - // This would all be much nicer with std::variant. -- static constexpr size_t kSize = std::max({sizeof(GrYUVAImageTextureMaker), -+ static constexpr size_t kSize = skia_max({sizeof(GrYUVAImageTextureMaker), - sizeof(GrTextureAdjuster ), - sizeof(GrImageTextureMaker ), - sizeof(GrBitmapTextureMaker )}); -- static constexpr size_t kAlign = std::max({alignof(GrYUVAImageTextureMaker), -+ static constexpr size_t kAlign = skia_max({alignof(GrYUVAImageTextureMaker), - alignof(GrTextureAdjuster ), - alignof(GrImageTextureMaker ), - alignof(GrBitmapTextureMaker )}); -diff --git a/src/sksl/SkSLASTNode.h b/src/sksl/SkSLASTNode.h -index 5922cd5fb3..17a877ee21 100644 ---- a/src/sksl/SkSLASTNode.h -+++ b/src/sksl/SkSLASTNode.h -@@ -17,6 +17,18 @@ - - namespace SkSL { - -+namespace { -+template<typename T> -+constexpr T skia_max( std::initializer_list<T> list ) -+{ -+T max = *list.begin(); -+for(auto i: list) -+ if( max < i ) -+ max = i; -+return max; -+} -+} -+ - /** - * Represents a node in the abstract syntax tree (AST). The AST is based directly on the parse tree; - * it is a parsed-but-not-yet-analyzed version of the program. -@@ -263,7 +275,7 @@ struct ASTNode { - }; - - struct NodeData { -- char fBytes[std::max({sizeof(Token), -+ char fBytes[skia_max({sizeof(Token), - sizeof(StringFragment), - sizeof(bool), - sizeof(SKSL_INT), diff --git a/external/skia/fast-png-write.patch.1 b/external/skia/fast-png-write.patch.1 deleted file mode 100644 index f47a2af70460..000000000000 --- a/external/skia/fast-png-write.patch.1 +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/images/SkImageEncoder.cpp b/src/images/SkImageEncoder.cpp -index a96a93e0fc..1c110afa58 100644 ---- a/src/images/SkImageEncoder.cpp -+++ b/src/images/SkImageEncoder.cpp -@@ -46,6 +46,10 @@ bool SkEncodeImage(SkWStream* dst, const SkPixmap& src, - } - case SkEncodedImageFormat::kPNG: { - SkPngEncoder::Options opts; -+ if (quality == 1) { -+ opts.fFilterFlags = SkPngEncoder::FilterFlag::kNone; -+ opts.fZLibLevel = 1; -+ } - return SkPngEncoder::Encode(dst, src, opts); - } - case SkEncodedImageFormat::kWEBP: { diff --git a/external/skia/fix-SkDebugf-link-error.patch.1 b/external/skia/fix-SkDebugf-link-error.patch.1 new file mode 100644 index 000000000000..989e8c407815 --- /dev/null +++ b/external/skia/fix-SkDebugf-link-error.patch.1 @@ -0,0 +1,20 @@ +diff -ur skia.org/src/ports/SkDebug_stdio.cpp skia/src/ports/SkDebug_stdio.cpp +--- skia.org/src/ports/SkDebug_stdio.cpp 2023-07-09 19:30:53.272682125 +0200 ++++ skia/src/ports/SkDebug_stdio.cpp 2023-07-09 19:34:44.812723870 +0200 +@@ -5,6 +5,7 @@ + * found in the LICENSE file. + */ + ++#include "include/private/base/SkAPI.h" + #include "include/private/base/SkFeatures.h" + #include "include/private/base/SkLoadUserConfig.h" + +@@ -13,7 +14,7 @@ + #include <stdarg.h> + #include <stdio.h> + +-void SkDebugf(const char format[], ...) { ++SK_API void SkDebugf(const char format[], ...) { + va_list args; + va_start(args, format); + #pragma GCC diagnostic push diff --git a/external/skia/fix-alpha-difference-copy.patch.1 b/external/skia/fix-alpha-difference-copy.patch.1 index 61a61e621fbd..a8db7377b55b 100644 --- a/external/skia/fix-alpha-difference-copy.patch.1 +++ b/external/skia/fix-alpha-difference-copy.patch.1 @@ -3,7 +3,7 @@ index df7d9a7025..7f94c2a660 100644 --- a/src/core/SkBlitter_Sprite.cpp +++ b/src/core/SkBlitter_Sprite.cpp @@ -191,7 +191,7 @@ SkBlitter* SkBlitter::ChooseSprite(const SkPixmap& dst, const SkPaint& paint, - } + SkASSERT(alloc != nullptr); // TODO: in principle SkRasterPipelineSpriteBlitter could be made to handle this. - if (source.alphaType() == kUnpremul_SkAlphaType) { diff --git a/external/skia/fix-gcc-x86.patch.1 b/external/skia/fix-gcc-x86.patch.1 deleted file mode 100644 index 097c59475c5b..000000000000 --- a/external/skia/fix-gcc-x86.patch.1 +++ /dev/null @@ -1,16 +0,0 @@ ---- skia/third_party/skcms/src/Transform_inl.h 2020-04-13 00:38:56.363207994 +0200 -+++ skia/third_party/skcms/src/Transform_inl.h~ 2020-04-13 00:39:18.215603244 +0200 -@@ -689,11 +689,11 @@ - && (defined(__mips64) || defined(__i386) || defined(__s390x__)) - #define MAYBE_NOINLINE __attribute__((noinline)) - #else -- #define MAYBE_NOINLINE -+ #define MAYBE_NOINLINE static - #endif - - MAYBE_NOINLINE --static void clut(const skcms_A2B* a2b, F* r, F* g, F* b, F a) { -+void clut(const skcms_A2B* a2b, F* r, F* g, F* b, F a) { - const int dim = (int)a2b->input_channels; - assert (0 < dim && dim <= 4); - diff --git a/external/skia/fix-pch.patch.1 b/external/skia/fix-pch.patch.1 index 14199fc2feb2..9adb47903013 100644 --- a/external/skia/fix-pch.patch.1 +++ b/external/skia/fix-pch.patch.1 @@ -1,20 +1,8 @@ -diff --git a/include/core/SkColor.h b/include/core/SkColor.h -index 9cba771ddd..6d324b75d0 100644 ---- a/include/core/SkColor.h -+++ b/include/core/SkColor.h -@@ -420,6 +420,7 @@ using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType>; - - template <> SK_API SkColor4f SkColor4f::FromColor(SkColor); - template <> SK_API SkColor SkColor4f::toSkColor() const; -+template <> uint32_t SkColor4f::toBytes_RGBA() const; - - namespace SkColors { - constexpr SkColor4f kTransparent = {0, 0, 0, 0}; diff --git a/include/private/SkColorData.h b/include/private/SkColorData.h -index aba610eacf..792da4e9fb 100644 +index a59e7b0446..960b4c0313 100644 --- a/include/private/SkColorData.h +++ b/include/private/SkColorData.h -@@ -442,4 +442,6 @@ constexpr SkPMColor4f SK_PMColor4fILLEGAL = { SK_FloatNegativeInfinity, +@@ -438,4 +438,6 @@ constexpr SkPMColor4f SK_PMColor4fILLEGAL = { SK_FloatNegativeInfinity, SK_FloatNegativeInfinity, SK_FloatNegativeInfinity }; @@ -22,54 +10,50 @@ index aba610eacf..792da4e9fb 100644 + #endif diff --git a/src/core/SkM44.cpp b/src/core/SkM44.cpp -index 248917423f..3d0bc00307 100644 +index 02b1741763..4cece999d2 100644 --- a/src/core/SkM44.cpp +++ b/src/core/SkM44.cpp -@@ -283,6 +283,8 @@ SkM44 Sk3LookAt(const SkV3& eye, const SkV3& center, const SkV3& up) { +@@ -341,6 +341,8 @@ SkM44 SkM44::LookAt(const SkV3& eye, const SkV3& center, const SkV3& up) { return m; } +#undef near +#undef far - SkM44 Sk3Perspective(float near, float far, float angle) { + SkM44 SkM44::Perspective(float near, float far, float angle) { SkASSERT(far > near); -diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp -index 76f69754c6..01ce4a1e2d 100644 ---- a/src/gpu/gl/GrGLGpu.cpp -+++ b/src/gpu/gl/GrGLGpu.cpp -@@ -3531,6 +3531,8 @@ void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) { - } - } - -+#undef MemoryBarrier -+ - void GrGLGpu::insertManualFramebufferBarrier() { - SkASSERT(this->caps()->requiresManualFBBarrierAfterTessellatedStencilDraw()); - GL_CALL(MemoryBarrier(GR_GL_FRAMEBUFFER_BARRIER_BIT)); -diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h -index c973384081..8943198ddd 100644 ---- a/src/gpu/text/GrTextBlobCache.h -+++ b/src/gpu/text/GrTextBlobCache.h -@@ -91,4 +91,6 @@ private: - SkMessageBus<PurgeBlobMessage>::Inbox fPurgeBlobInbox SK_GUARDED_BY(fSpinLock); - }; - -+template<> SkMessageBus<GrTextBlobCache::PurgeBlobMessage>* SkMessageBus<GrTextBlobCache::PurgeBlobMessage>::Get(); -+ - #endif -diff --git a/src/gpu/vk/GrVkSemaphore.cpp b/src/gpu/vk/GrVkSemaphore.cpp -index 23bf656bf8..f926ebfdc2 100644 ---- a/src/gpu/vk/GrVkSemaphore.cpp -+++ b/src/gpu/vk/GrVkSemaphore.cpp +diff --git a/src/gpu/ganesh/vk/GrVkSemaphore.cpp b/src/gpu/ganesh/vk/GrVkSemaphore.cpp +index 70c7f0ea80..ab8319a447 100644 +--- a/src/gpu/ganesh/vk/GrVkSemaphore.cpp ++++ b/src/gpu/ganesh/vk/GrVkSemaphore.cpp @@ -10,6 +10,7 @@ #include "include/gpu/GrBackendSemaphore.h" - #include "src/gpu/vk/GrVkGpu.h" - #include "src/gpu/vk/GrVkUtil.h" + #include "src/gpu/ganesh/vk/GrVkGpu.h" + #include "src/gpu/ganesh/vk/GrVkUtil.h" +#include "tools/gpu/vk/GrVulkanDefines.h" #ifdef VK_USE_PLATFORM_WIN32_KHR // windows wants to define this as CreateSemaphoreA or CreateSemaphoreW +diff --git a/src/sksl/ir/SkSLPoison.h b/src/sksl/ir/SkSLPoison.h +index 035f94e1f6..3cf12db902 100644 +--- a/src/sksl/ir/SkSLPoison.h ++++ b/src/sksl/ir/SkSLPoison.h +@@ -5,6 +5,9 @@ + * found in the LICENSE file. + */ + ++#ifndef SKSL_POISON ++#define SKSL_POISON ++ + #include "src/sksl/SkSLBuiltinTypes.h" + #include "src/sksl/SkSLCompiler.h" + #include "src/sksl/SkSLContext.h" +@@ -38,3 +41,5 @@ private: + }; + + } // namespace SkSL ++ ++#endif diff --git a/src/utils/win/SkDWriteGeometrySink.h b/src/utils/win/SkDWriteGeometrySink.h index af4909aaaf..825ec35c83 100644 --- a/src/utils/win/SkDWriteGeometrySink.h @@ -83,21 +67,11 @@ index af4909aaaf..825ec35c83 100644 #include <dwrite.h> #include <d2d1.h> -diff --git a/third_party/skcms/skcms.cc b/third_party/skcms/skcms.cc -index 4f983439b9..f6fc53c91a 100644 ---- a/third_party/skcms/skcms.cc -+++ b/third_party/skcms/skcms.cc -@@ -130,7 +130,8 @@ static float minus_1_ulp(float x) { - // Most transfer functions we work with are sRGBish. - // For exotic HDR transfer functions, we encode them using a tf.g that makes no sense, - // and repurpose the other fields to hold the parameters of the HDR functions. --enum TFKind { Bad, sRGBish, PQish, HLGish, HLGinvish }; -+enum TFKind_skcms { Bad, sRGBish, PQish, HLGish, HLGinvish }; -+#define TFKind TFKind_skcms - struct TF_PQish { float A,B,C,D,E,F; }; - struct TF_HLGish { float R,G,a,b,c,K_minus_1; }; - // We didn't originally support a scale factor K for HLG, and instead just stored 0 in -@@ -2059,7 +2060,9 @@ typedef enum { +diff --git a/modules/skcms/skcms.cc b/modules/skcms/skcms.cc +index 1b643f45cf..c1981110da 100644 +--- a/modules/skcms/skcms.cc ++++ b/modules/skcms/skcms.cc +@@ -2371,7 +2372,9 @@ typedef enum { Op_store_hhhh, Op_store_fff, Op_store_ffff, diff --git a/external/skia/fix-warnings.patch.1 b/external/skia/fix-warnings.patch.1 index fc9418739810..46d55e493bd3 100644 --- a/external/skia/fix-warnings.patch.1 +++ b/external/skia/fix-warnings.patch.1 @@ -26,3 +26,14 @@ index f143dab013..be3cde0f4f 100644 const DisplayParams& getDisplayParams() { return fDisplayParams; } virtual void setDisplayParams(const DisplayParams& params) = 0; +--- skia/include/core/SkSamplingOptions.h.orig 2022-05-22 12:25:06.112544528 +0200 ++++ skia/include/core/SkSamplingOptions.h 2022-05-22 12:25:09.207636134 +0200 +@@ -97,7 +97,7 @@ + bool isAniso() const { return maxAniso != 0; } + + private: +- constexpr SkSamplingOptions(int maxAniso) : maxAniso(maxAniso) {} ++ constexpr SkSamplingOptions(int maxAniso_) : maxAniso(maxAniso_) {} + }; + + #endif diff --git a/external/skia/fix-without-gl.patch.0 b/external/skia/fix-without-gl.patch.0 deleted file mode 100644 index 476978ff2b33..000000000000 --- a/external/skia/fix-without-gl.patch.0 +++ /dev/null @@ -1,67 +0,0 @@ -diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h -index 378646ebc1..af3b9ce290 100644 ---- ./include/gpu/GrBackendSurface.h -+++ ./include/gpu/GrBackendSurface.h -@@ -74,9 +74,11 @@ public: - GrBackendFormat(const GrBackendFormat&); - GrBackendFormat& operator=(const GrBackendFormat&); - -+#ifdef SK_GL - static GrBackendFormat MakeGL(GrGLenum format, GrGLenum target) { - return GrBackendFormat(format, target); - } -+#endif - - static GrBackendFormat MakeVk(VkFormat format) { - return GrBackendFormat(format, GrVkYcbcrConversionInfo()); -diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h -index 17655bdbed..ce0641f423 100644 ---- ./include/gpu/gl/GrGLInterface.h -+++ ./include/gpu/gl/GrGLInterface.h -@@ -65,7 +65,9 @@ public: - - GrGLExtensions fExtensions; - -+#ifdef SK_GL - bool hasExtension(const char ext[]) const { return fExtensions.has(ext); } -+#endif - - /** - * The function pointers are in a struct so that we can have a compiler generated assignment -diff --git a/src/gpu/gl/GrGLContext.h b/src/gpu/gl/GrGLContext.h -index 66bfe29331..034cd21838 100644 ---- ./src/gpu/gl/GrGLContext.h -+++ ./src/gpu/gl/GrGLContext.h -@@ -45,10 +45,11 @@ public: - GrGLDriverVersion driverVersion() const { return fDriverVersion; } - const GrGLCaps* caps() const { return fGLCaps.get(); } - GrGLCaps* caps() { return fGLCaps.get(); } -+#ifdef SK_GL - bool hasExtension(const char* ext) const { - return fInterface->hasExtension(ext); - } -- -+#endif - const GrGLExtensions& extensions() const { return fInterface->fExtensions; } - - protected: -diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h -index 8e550c36e6..27fb5efe9b 100644 ---- ./src/gpu/gl/GrGLGpu.h -+++ ./src/gpu/gl/GrGLGpu.h -@@ -259,6 +259,7 @@ private: - // compatible stencil format, or negative if there is no compatible stencil format. - int getCompatibleStencilIndex(GrGLFormat format); - -+#ifdef SK_GL - GrBackendFormat getPreferredStencilFormat(const GrBackendFormat& format) override { - int idx = this->getCompatibleStencilIndex(format.asGLFormat()); - if (idx < 0) { -@@ -267,6 +268,7 @@ private: - return GrBackendFormat::MakeGL(GrGLFormatToEnum(this->glCaps().stencilFormats()[idx]), - GR_GL_TEXTURE_NONE); - } -+#endif - - void onFBOChanged(); - diff --git a/external/skia/fix-without-gl.patch.1 b/external/skia/fix-without-gl.patch.1 new file mode 100644 index 000000000000..8735dc81d039 --- /dev/null +++ b/external/skia/fix-without-gl.patch.1 @@ -0,0 +1,50 @@ +diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h +index e10242b3b7..a1c0058caa 100644 +--- a/include/gpu/gl/GrGLInterface.h ++++ b/include/gpu/gl/GrGLInterface.h +@@ -83,7 +83,9 @@ public: + + GrGLExtensions fExtensions; + ++#ifdef SK_GL + bool hasExtension(const char ext[]) const { return fExtensions.has(ext); } ++#endif + + /** + * The function pointers are in a struct so that we can have a compiler generated assignment +diff --git a/src/gpu/ganesh/gl/GrGLContext.h b/src/gpu/ganesh/gl/GrGLContext.h +index d5424ca6cf..5b730fe176 100644 +--- a/src/gpu/ganesh/gl/GrGLContext.h ++++ b/src/gpu/ganesh/gl/GrGLContext.h +@@ -64,9 +64,11 @@ public: + const GrGLCaps* caps() const { return fGLCaps.get(); } + GrGLCaps* caps() { return fGLCaps.get(); } + ++#ifdef SK_GL + bool hasExtension(const char* ext) const { + return fInterface->hasExtension(ext); + } ++#endif + + const GrGLExtensions& extensions() const { return fInterface->fExtensions; } + +diff --git a/src/gpu/ganesh/gl/GrGLGpu.h b/src/gpu/ganesh/gl/GrGLGpu.h +index a3ac1ad25d..ffc18093e6 100644 +--- a/src/gpu/ganesh/gl/GrGLGpu.h ++++ b/src/gpu/ganesh/gl/GrGLGpu.h +@@ -279,6 +279,7 @@ private: + // compatible stencil format, or negative if there is no compatible stencil format. + int getCompatibleStencilIndex(GrGLFormat format); + ++#ifdef SK_GL + GrBackendFormat getPreferredStencilFormat(const GrBackendFormat& format) override { + int idx = this->getCompatibleStencilIndex(format.asGLFormat()); + if (idx < 0) { +@@ -287,6 +288,7 @@ private: + return GrBackendFormat::MakeGL(GrGLFormatToEnum(this->glCaps().stencilFormats()[idx]), + GR_GL_TEXTURE_NONE); + } ++#endif + + void onFBOChanged(); + diff --git a/external/skia/inc/pch/precompiled_skia.hxx b/external/skia/inc/pch/precompiled_skia.hxx index 4e508931fc75..a37318ba079d 100644 --- a/external/skia/inc/pch/precompiled_skia.hxx +++ b/external/skia/inc/pch/precompiled_skia.hxx @@ -13,26 +13,30 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-01-18 18:16:50 using: + Generated on 2023-07-09 12:12:38 using: ./bin/update_pch external/skia skia --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: ./bin/update_pch_bisect ./external/skia/inc/pch/precompiled_skia.hxx "make external/skia.build" --find-conflicts */ +#include <sal/config.h> #if PCH_LEVEL >= 1 #include <algorithm> #include <array> -#include <assert.h> #include <atomic> #include <bitset> +#include <cassert> #include <cctype> +#include <cerrno> #include <cfloat> #include <chrono> #include <cinttypes> #include <climits> #include <cmath> +#include <csetjmp> #include <cstddef> +#include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> @@ -40,21 +44,23 @@ #include <deque> #include <errno.h> #include <float.h> -#include <fstream> +#include <forward_list> #include <functional> +#include <initializer_list> #include <inttypes.h> #include <iterator> #include <limits.h> #include <limits> #include <locale> -#include <map> -#include <math.h> #include <memory> #include <new> +#include <numeric> +#include <optional> #include <png.h> +#include <pngconf.h> #include <queue> +#include <ratio> #include <set> -#include <skcms.h> #include <sstream> #include <stdarg.h> #include <stddef.h> @@ -62,11 +68,11 @@ #include <stdlib.h> #include <string.h> #include <string> +#include <string_view> #include <thread> #include <tuple> #include <type_traits> #include <unordered_map> -#include <unordered_set> #include <utility> #include <vector> #endif // PCH_LEVEL >= 1 @@ -75,88 +81,90 @@ #include <sal/log.hxx> #endif // PCH_LEVEL >= 2 #if PCH_LEVEL >= 3 -#include <include/c/sk_canvas.h> -#include <include/c/sk_colorspace.h> -#include <include/c/sk_data.h> -#include <include/c/sk_image.h> -#include <include/c/sk_imageinfo.h> -#include <include/c/sk_maskfilter.h> -#include <include/c/sk_paint.h> -#include <include/c/sk_path.h> -#include <include/c/sk_picture.h> -#include <include/c/sk_shader.h> -#include <include/c/sk_surface.h> #include <include/codec/SkAndroidCodec.h> #include <include/codec/SkCodec.h> +#include <include/codec/SkCodecAnimation.h> +#include <include/codec/SkEncodedImageFormat.h> +#include <include/codec/SkEncodedOrigin.h> +#include <include/codec/SkPixmapUtils.h> +#include <include/codec/SkPngChunkReader.h> +#include <include/core/SkAlphaType.h> #include <include/core/SkAnnotation.h> #include <include/core/SkBBHFactory.h> #include <include/core/SkBitmap.h> #include <include/core/SkBlendMode.h> +#include <include/core/SkBlender.h> +#include <include/core/SkBlurTypes.h> #include <include/core/SkCanvas.h> +#include <include/core/SkCapabilities.h> +#include <include/core/SkClipOp.h> #include <include/core/SkColor.h> #include <include/core/SkColorFilter.h> #include <include/core/SkColorPriv.h> #include <include/core/SkColorSpace.h> +#include <include/core/SkColorTable.h> +#include <include/core/SkColorType.h> #include <include/core/SkContourMeasure.h> #include <include/core/SkCubicMap.h> #include <include/core/SkData.h> #include <include/core/SkDataTable.h> -#include <include/core/SkDeferredDisplayList.h> -#include <include/core/SkDeferredDisplayListRecorder.h> #include <include/core/SkDocument.h> -#include <include/core/SkDrawLooper.h> #include <include/core/SkDrawable.h> #include <include/core/SkExecutor.h> -#include <include/core/SkFilterQuality.h> #include <include/core/SkFlattenable.h> #include <include/core/SkFont.h> +#include <include/core/SkFontArguments.h> #include <include/core/SkFontMetrics.h> #include <include/core/SkFontMgr.h> +#include <include/core/SkFontParameters.h> +#include <include/core/SkFontStyle.h> +#include <include/core/SkFontTypes.h> #include <include/core/SkGraphics.h> -#include <include/core/SkICC.h> #include <include/core/SkImage.h> -#include <include/core/SkImageEncoder.h> #include <include/core/SkImageFilter.h> #include <include/core/SkImageGenerator.h> #include <include/core/SkImageInfo.h> #include <include/core/SkM44.h> #include <include/core/SkMallocPixelRef.h> #include <include/core/SkMaskFilter.h> -#include <include/core/SkMath.h> #include <include/core/SkMatrix.h> -#include <include/core/SkMatrix44.h> +#include <include/core/SkMesh.h> +#include <include/core/SkOpenTypeSVGDecoder.h> #include <include/core/SkOverdrawCanvas.h> #include <include/core/SkPaint.h> #include <include/core/SkPath.h> #include <include/core/SkPathBuilder.h> #include <include/core/SkPathEffect.h> #include <include/core/SkPathMeasure.h> +#include <include/core/SkPathTypes.h> +#include <include/core/SkPathUtils.h> #include <include/core/SkPicture.h> #include <include/core/SkPictureRecorder.h> #include <include/core/SkPixelRef.h> #include <include/core/SkPixmap.h> #include <include/core/SkPoint.h> #include <include/core/SkPoint3.h> -#include <include/core/SkPromiseImageTexture.h> #include <include/core/SkRRect.h> #include <include/core/SkRSXform.h> #include <include/core/SkRasterHandleAllocator.h> #include <include/core/SkRect.h> #include <include/core/SkRefCnt.h> #include <include/core/SkRegion.h> +#include <include/core/SkSamplingOptions.h> #include <include/core/SkScalar.h> #include <include/core/SkSerialProcs.h> #include <include/core/SkShader.h> #include <include/core/SkSize.h> +#include <include/core/SkSpan.h> #include <include/core/SkStream.h> #include <include/core/SkString.h> #include <include/core/SkStrokeRec.h> #include <include/core/SkSurface.h> -#include <include/core/SkSurfaceCharacterization.h> #include <include/core/SkSurfaceProps.h> #include <include/core/SkSwizzle.h> #include <include/core/SkTextBlob.h> #include <include/core/SkTileMode.h> +#include <include/core/SkTiledImageUtils.h> #include <include/core/SkTime.h> #include <include/core/SkTraceMemoryDump.h> #include <include/core/SkTypeface.h> @@ -167,119 +175,115 @@ #include <include/core/SkYUVAPixmaps.h> #include <include/effects/Sk1DPathEffect.h> #include <include/effects/Sk2DPathEffect.h> -#include <include/effects/SkAlphaThresholdFilter.h> -#include <include/effects/SkArithmeticImageFilter.h> -#include <include/effects/SkBlurDrawLooper.h> -#include <include/effects/SkBlurImageFilter.h> -#include <include/effects/SkBlurMaskFilter.h> -#include <include/effects/SkColorFilterImageFilter.h> +#include <include/effects/SkBlenders.h> #include <include/effects/SkColorMatrix.h> -#include <include/effects/SkColorMatrixFilter.h> -#include <include/effects/SkComposeImageFilter.h> #include <include/effects/SkCornerPathEffect.h> #include <include/effects/SkDashPathEffect.h> #include <include/effects/SkDiscretePathEffect.h> -#include <include/effects/SkDisplacementMapEffect.h> -#include <include/effects/SkDropShadowImageFilter.h> #include <include/effects/SkGradientShader.h> #include <include/effects/SkHighContrastFilter.h> #include <include/effects/SkImageFilters.h> -#include <include/effects/SkImageSource.h> -#include <include/effects/SkLayerDrawLooper.h> -#include <include/effects/SkLightingImageFilter.h> #include <include/effects/SkLumaColorFilter.h> -#include <include/effects/SkMagnifierImageFilter.h> -#include <include/effects/SkMatrixConvolutionImageFilter.h> -#include <include/effects/SkMergeImageFilter.h> -#include <include/effects/SkMorphologyImageFilter.h> -#include <include/effects/SkOffsetImageFilter.h> +#include <include/effects/SkOpPathEffect.h> #include <include/effects/SkOverdrawColorFilter.h> -#include <include/effects/SkPaintImageFilter.h> #include <include/effects/SkPerlinNoiseShader.h> -#include <include/effects/SkPictureImageFilter.h> #include <include/effects/SkRuntimeEffect.h> #include <include/effects/SkShaderMaskFilter.h> #include <include/effects/SkStrokeAndFillPathEffect.h> -#include <include/effects/SkTableColorFilter.h> #include <include/effects/SkTableMaskFilter.h> -#include <include/effects/SkTileImageFilter.h> #include <include/effects/SkTrimPathEffect.h> -#include <include/effects/SkXfermodeImageFilter.h> -#include <include/encode/SkJpegEncoder.h> +#include <include/encode/SkEncoder.h> +#include <include/encode/SkICC.h> #include <include/encode/SkPngEncoder.h> -#include <include/encode/SkWebpEncoder.h> -#include <include/gpu/GrBackendDrawableInfo.h> -#include <include/gpu/GrBackendSemaphore.h> -#include <include/gpu/GrBackendSurface.h> -#include <include/gpu/GrBackendSurfaceMutableState.h> -#include <include/gpu/GrConfig.h> -#include <include/gpu/GrContextOptions.h> -#include <include/gpu/GrContextThreadSafeProxy.h> #include <include/gpu/GrDirectContext.h> -#include <include/gpu/GrDriverBugWorkarounds.h> -#include <include/gpu/GrRecordingContext.h> -#include <include/gpu/GrTypes.h> -#include <include/gpu/GrYUVABackendTextures.h> -#include <include/gpu/mock/GrMockTypes.h> -#include <include/gpu/vk/GrVkBackendContext.h> -#include <include/gpu/vk/GrVkExtensions.h> -#include <include/gpu/vk/GrVkMemoryAllocator.h> -#include <include/gpu/vk/GrVkTypes.h> #include <include/pathops/SkPathOps.h> #include <include/ports/SkRemotableFontMgr.h> -#include <include/private/GrContext_Base.h> -#include <include/private/GrImageContext.h> -#include <include/private/GrResourceKey.h> -#include <include/private/GrSingleOwner.h> -#include <include/private/GrTypesPriv.h> -#include <include/private/GrVkTypesPriv.h> -#include <include/private/SkChecksum.h> +#include <include/private/SkBitmaskEnum.h> #include <include/private/SkColorData.h> -#include <include/private/SkDeque.h> #include <include/private/SkEncodedInfo.h> -#include <include/private/SkFixed.h> -#include <include/private/SkFloatBits.h> -#include <include/private/SkFloatingPoint.h> -#include <include/private/SkHalf.h> +#include <include/private/SkGainmapInfo.h> #include <include/private/SkIDChangeListener.h> -#include <include/private/SkImageInfoPriv.h> -#include <include/private/SkMacros.h> -#include <include/private/SkMalloc.h> -#include <include/private/SkMutex.h> -#include <include/private/SkNx.h> -#include <include/private/SkOnce.h> #include <include/private/SkPathRef.h> +#include <include/private/SkSLDefines.h> #include <include/private/SkSLSampleUsage.h> -#include <include/private/SkSafe32.h> -#include <include/private/SkSemaphore.h> #include <include/private/SkShadowFlags.h> -#include <include/private/SkSpinlock.h> -#include <include/private/SkTArray.h> -#include <include/private/SkTDArray.h> -#include <include/private/SkTFitsIn.h> -#include <include/private/SkTHash.h> -#include <include/private/SkTPin.h> -#include <include/private/SkTemplates.h> -#include <include/private/SkThreadAnnotations.h> -#include <include/private/SkThreadID.h> -#include <include/private/SkTo.h> -#include <include/private/SkVx.h> -#include <include/third_party/skcms/skcms.h> +#include <include/private/base/SkAlign.h> +#include <include/private/base/SkAssert.h> +#include <include/private/base/SkCPUTypes.h> +#include <include/private/base/SkContainers.h> +#include <include/private/base/SkDebug.h> +#include <include/private/base/SkDeque.h> +#include <include/private/base/SkFeatures.h> +#include <include/private/base/SkFixed.h> +#include <include/private/base/SkFloatBits.h> +#include <include/private/base/SkFloatingPoint.h> +#include <include/private/base/SkMacros.h> +#include <include/private/base/SkMalloc.h> +#include <include/private/base/SkMath.h> +#include <include/private/base/SkMutex.h> +#include <include/private/base/SkNoncopyable.h> +#include <include/private/base/SkOnce.h> +#include <include/private/base/SkPathEnums.h> +#include <include/private/base/SkPoint_impl.h> +#include <include/private/base/SkSafe32.h> +#include <include/private/base/SkSemaphore.h> +#include <include/private/base/SkSpan_impl.h> +#include <include/private/base/SkTArray.h> +#include <include/private/base/SkTDArray.h> +#include <include/private/base/SkTFitsIn.h> +#include <include/private/base/SkTPin.h> +#include <include/private/base/SkTemplates.h> +#include <include/private/base/SkThreadAnnotations.h> +#include <include/private/base/SkThreadID.h> +#include <include/private/base/SkTo.h> +#include <include/private/chromium/SkChromeRemoteGlyphCache.h> +#include <include/private/chromium/SkDiscardableMemory.h> +#include <include/private/chromium/Slug.h> #include <include/utils/SkBase64.h> #include <include/utils/SkCamera.h> #include <include/utils/SkCanvasStateUtils.h> #include <include/utils/SkCustomTypeface.h> #include <include/utils/SkEventTracer.h> -#include <include/utils/SkInterpolator.h> #include <include/utils/SkNWayCanvas.h> #include <include/utils/SkNoDrawCanvas.h> #include <include/utils/SkNullCanvas.h> +#include <include/utils/SkOrderedFontMgr.h> #include <include/utils/SkPaintFilterCanvas.h> #include <include/utils/SkParse.h> #include <include/utils/SkParsePath.h> -#include <include/utils/SkRandom.h> #include <include/utils/SkShadowUtils.h> #include <include/utils/SkTextUtils.h> +#include <include/utils/SkTraceEventPhase.h> +#include <modules/skcms/skcms.h> +#include <src/base/SkArenaAlloc.h> +#include <src/base/SkAutoMalloc.h> +#include <src/base/SkBezierCurves.h> +#include <src/base/SkBlockAllocator.h> +#include <src/base/SkBuffer.h> +#include <src/base/SkCubics.h> +#include <src/base/SkEndian.h> +#include <src/base/SkHalf.h> +#include <src/base/SkLeanWindows.h> +#include <src/base/SkMSAN.h> +#include <src/base/SkMathPriv.h> +#include <src/base/SkNoDestructor.h> +#include <src/base/SkQuads.h> +#include <src/base/SkRandom.h> +#include <src/base/SkRectMemcpy.h> +#include <src/base/SkSafeMath.h> +#include <src/base/SkScopeExit.h> +#include <src/base/SkSharedMutex.h> +#include <src/base/SkSpinlock.h> +#include <src/base/SkStringView.h> +#include <src/base/SkTDPQueue.h> +#include <src/base/SkTInternalLList.h> +#include <src/base/SkTLazy.h> +#include <src/base/SkTSearch.h> +#include <src/base/SkTSort.h> +#include <src/base/SkUTF.h> +#include <src/base/SkUtils.h> +#include <src/base/SkVx.h> +#include <src/base/SkZip.h> #include <src/codec/SkAndroidCodecAdapter.h> #include <src/codec/SkBmpBaseCodec.h> #include <src/codec/SkBmpCodec.h> @@ -288,49 +292,44 @@ #include <src/codec/SkBmpStandardCodec.h> #include <src/codec/SkCodecImageGenerator.h> #include <src/codec/SkCodecPriv.h> -#include <src/codec/SkColorTable.h> +#include <src/codec/SkColorPalette.h> #include <src/codec/SkFrameHolder.h> #include <src/codec/SkIcoCodec.h> -#include <src/codec/SkJpegCodec.h> #include <src/codec/SkMaskSwizzler.h> #include <src/codec/SkMasks.h> +#include <src/codec/SkPixmapUtilsPriv.h> #include <src/codec/SkPngCodec.h> #include <src/codec/SkPngPriv.h> -#include <src/codec/SkRawCodec.h> #include <src/codec/SkSampledCodec.h> #include <src/codec/SkSampler.h> -#include <src/codec/SkStreamBuffer.h> #include <src/codec/SkSwizzler.h> #include <src/codec/SkWbmpCodec.h> -#include <src/codec/SkWebpCodec.h> #include <src/core/SkAAClip.h> -#include <src/core/SkASAN.h> #include <src/core/SkATrace.h> #include <src/core/SkAdvancedTypefaceMetrics.h> +#include <src/core/SkAlphaRuns.h> #include <src/core/SkAnalyticEdge.h> #include <src/core/SkAnnotationKeys.h> -#include <src/core/SkAntiRun.h> -#include <src/core/SkArenaAlloc.h> #include <src/core/SkAutoBlitterChoose.h> -#include <src/core/SkAutoMalloc.h> #include <src/core/SkAutoPixmapStorage.h> #include <src/core/SkBigPicture.h> #include <src/core/SkBitmapCache.h> #include <src/core/SkBitmapDevice.h> #include <src/core/SkBitmapProcState.h> +#include <src/core/SkBlendModeBlender.h> #include <src/core/SkBlendModePriv.h> +#include <src/core/SkBlenderBase.h> #include <src/core/SkBlitRow.h> #include <src/core/SkBlitter.h> +#include <src/core/SkBlitter_A8.h> #include <src/core/SkBlurMask.h> -#include <src/core/SkBuffer.h> +#include <src/core/SkBlurMaskFilterImpl.h> #include <src/core/SkCachedData.h> #include <src/core/SkCanvasPriv.h> -#include <src/core/SkClipOpPriv.h> +#include <src/core/SkChecksum.h> #include <src/core/SkClipStack.h> #include <src/core/SkClipStackDevice.h> -#include <src/core/SkColorFilterBase.h> #include <src/core/SkColorFilterPriv.h> -#include <src/core/SkColorFilter_Matrix.h> #include <src/core/SkColorSpacePriv.h> #include <src/core/SkColorSpaceXformSteps.h> #include <src/core/SkCompressedDataUtils.h> @@ -338,78 +337,67 @@ #include <src/core/SkCoreBlitters.h> #include <src/core/SkCpu.h> #include <src/core/SkCubicClipper.h> -#include <src/core/SkDeferredDisplayListPriv.h> #include <src/core/SkDescriptor.h> #include <src/core/SkDevice.h> -#include <src/core/SkDiscardableMemory.h> #include <src/core/SkDistanceFieldGen.h> #include <src/core/SkDraw.h> +#include <src/core/SkDrawBase.h> #include <src/core/SkDrawProcs.h> #include <src/core/SkDrawShadowInfo.h> #include <src/core/SkEdge.h> #include <src/core/SkEdgeBuilder.h> #include <src/core/SkEdgeClipper.h> #include <src/core/SkEffectPriv.h> -#include <src/core/SkEndian.h> #include <src/core/SkEnumerate.h> #include <src/core/SkFDot6.h> +#include <src/core/SkFilterColorProgram.h> #include <src/core/SkFontDescriptor.h> +#include <src/core/SkFontMetricsPriv.h> #include <src/core/SkFontPriv.h> #include <src/core/SkFontStream.h> #include <src/core/SkFuzzLogging.h> #include <src/core/SkGaussFilter.h> #include <src/core/SkGeometry.h> #include <src/core/SkGlyph.h> -#include <src/core/SkGlyphBuffer.h> -#include <src/core/SkGlyphRun.h> #include <src/core/SkGlyphRunPainter.h> -#include <src/core/SkGpuBlurUtils.h> -#include <src/core/SkICCPriv.h> -#include <src/core/SkIPoint16.h> #include <src/core/SkImageFilterCache.h> #include <src/core/SkImageFilterTypes.h> #include <src/core/SkImageFilter_Base.h> +#include <src/core/SkImageInfoPriv.h> #include <src/core/SkImagePriv.h> #include <src/core/SkLRUCache.h> #include <src/core/SkLatticeIter.h> -#include <src/core/SkLeanWindows.h> #include <src/core/SkLineClipper.h> #include <src/core/SkLocalMatrixImageFilter.h> #include <src/core/SkMD5.h> -#include <src/core/SkMSAN.h> -#include <src/core/SkMarkerStack.h> #include <src/core/SkMask.h> #include <src/core/SkMaskBlurFilter.h> #include <src/core/SkMaskCache.h> #include <src/core/SkMaskFilterBase.h> #include <src/core/SkMaskGamma.h> -#include <src/core/SkMathPriv.h> -#include <src/core/SkMatrixImageFilter.h> +#include <src/core/SkMatrixInvert.h> #include <src/core/SkMatrixPriv.h> #include <src/core/SkMatrixProvider.h> #include <src/core/SkMatrixUtils.h> #include <src/core/SkMessageBus.h> -#include <src/core/SkMiniRecorder.h> #include <src/core/SkMipmap.h> #include <src/core/SkMipmapAccessor.h> #include <src/core/SkMipmapBuilder.h> -#include <src/core/SkModeColorFilter.h> #include <src/core/SkNextID.h> #include <src/core/SkOSFile.h> #include <src/core/SkOpts.h> #include <src/core/SkPaintDefaults.h> #include <src/core/SkPaintPriv.h> +#include <src/core/SkPathEffectBase.h> #include <src/core/SkPathMakers.h> #include <src/core/SkPathMeasurePriv.h> #include <src/core/SkPathPriv.h> -#include <src/core/SkPictureCommon.h> #include <src/core/SkPictureData.h> #include <src/core/SkPictureFlat.h> #include <src/core/SkPicturePlayback.h> #include <src/core/SkPicturePriv.h> #include <src/core/SkPictureRecord.h> #include <src/core/SkPixelRefPriv.h> -#include <src/core/SkPixmapPriv.h> #include <src/core/SkPointPriv.h> #include <src/core/SkPtrRecorder.h> #include <src/core/SkQuadClipper.h> @@ -417,7 +405,10 @@ #include <src/core/SkRTree.h> #include <src/core/SkRasterClip.h> #include <src/core/SkRasterPipeline.h> +#include <src/core/SkRasterPipelineOpContexts.h> +#include <src/core/SkRasterPipelineOpList.h> #include <src/core/SkReadBuffer.h> +#include <src/core/SkReadPixelsRec.h> #include <src/core/SkRecord.h> #include <src/core/SkRecordDraw.h> #include <src/core/SkRecordOpts.h> @@ -427,55 +418,45 @@ #include <src/core/SkRecords.h> #include <src/core/SkRectPriv.h> #include <src/core/SkRegionPriv.h> -#include <src/core/SkRemoteGlyphCache.h> #include <src/core/SkResourceCache.h> -#include <src/core/SkSafeMath.h> +#include <src/core/SkRuntimeBlender.h> +#include <src/core/SkRuntimeEffectPriv.h> +#include <src/core/SkSLTypeShared.h> #include <src/core/SkSafeRange.h> #include <src/core/SkSamplingPriv.h> #include <src/core/SkScaleToSides.h> -#include <src/core/SkScalerCache.h> #include <src/core/SkScalerContext.h> #include <src/core/SkScan.h> #include <src/core/SkScanPriv.h> -#include <src/core/SkScopeExit.h> -#include <src/core/SkSharedMutex.h> -#include <src/core/SkSpan.h> #include <src/core/SkSpecialImage.h> #include <src/core/SkSpecialSurface.h> #include <src/core/SkSpriteBlitter.h> #include <src/core/SkStreamPriv.h> +#include <src/core/SkStrike.h> #include <src/core/SkStrikeCache.h> -#include <src/core/SkStrikeForGPU.h> #include <src/core/SkStrikeSpec.h> #include <src/core/SkStringUtils.h> #include <src/core/SkStroke.h> #include <src/core/SkStrokerPriv.h> #include <src/core/SkSurfacePriv.h> -#include <src/core/SkTDPQueue.h> +#include <src/core/SkSwizzlePriv.h> #include <src/core/SkTDynamicHash.h> -#include <src/core/SkTInternalLList.h> -#include <src/core/SkTLList.h> -#include <src/core/SkTLazy.h> -#include <src/core/SkTSearch.h> -#include <src/core/SkTSort.h> +#include <src/core/SkTHash.h> #include <src/core/SkTaskGroup.h> #include <src/core/SkTextBlobPriv.h> #include <src/core/SkTextBlobTrace.h> #include <src/core/SkTextFormatParams.h> #include <src/core/SkTraceEvent.h> -#include <src/core/SkTraceEventCommon.h> #include <src/core/SkTypefaceCache.h> #include <src/core/SkTypeface_remote.h> -#include <src/core/SkUtils.h> #include <src/core/SkVM.h> +#include <src/core/SkVMBlitter.h> #include <src/core/SkValidationUtils.h> #include <src/core/SkVertState.h> #include <src/core/SkVerticesPriv.h> #include <src/core/SkWriteBuffer.h> #include <src/core/SkWritePixelsRec.h> #include <src/core/SkWriter32.h> -#include <src/core/SkXfermodeInterpretation.h> -#include <src/core/SkXfermodePriv.h> #include <src/core/SkYUVAInfoLocation.h> #include <src/core/SkYUVMath.h> #include <src/core/SkYUVPlanesCache.h> @@ -483,354 +464,31 @@ #include <src/effects/SkEmbossMask.h> #include <src/effects/SkEmbossMaskFilter.h> #include <src/effects/SkOpPE.h> -#include <src/effects/SkPackBits.h> +#include <src/effects/SkShaderMaskFilterImpl.h> #include <src/effects/SkTrimPE.h> -#include <src/gpu/GrAATriangulator.h> -#include <src/gpu/GrAHardwareBufferImageGenerator.h> -#include <src/gpu/GrAHardwareBufferUtils.h> -#include <src/gpu/GrAppliedClip.h> -#include <src/gpu/GrAttachment.h> -#include <src/gpu/GrAuditTrail.h> -#include <src/gpu/GrAutoLocaleSetter.h> -#include <src/gpu/GrBackendSurfaceMutableStateImpl.h> -#include <src/gpu/GrBackendTextureImageGenerator.h> -#include <src/gpu/GrBackendUtils.h> -#include <src/gpu/GrBaseContextPriv.h> -#include <src/gpu/GrBitmapTextureMaker.h> -#include <src/gpu/GrBlend.h> -#include <src/gpu/GrBlockAllocator.h> -#include <src/gpu/GrBlurUtils.h> -#include <src/gpu/GrBuffer.h> -#include <src/gpu/GrBufferAllocPool.h> -#include <src/gpu/GrCaps.h> -#include <src/gpu/GrClientMappedBufferManager.h> -#include <src/gpu/GrClip.h> -#include <src/gpu/GrClipStack.h> -#include <src/gpu/GrClipStackClip.h> -#include <src/gpu/GrColor.h> -#include <src/gpu/GrColorInfo.h> -#include <src/gpu/GrColorSpaceXform.h> -#include <src/gpu/GrContextThreadSafeProxyPriv.h> -#include <src/gpu/GrCopyRenderTask.h> -#include <src/gpu/GrCpuBuffer.h> -#include <src/gpu/GrDDLTask.h> -#include <src/gpu/GrDataUtils.h> -#include <src/gpu/GrDefaultGeoProcFactory.h> -#include <src/gpu/GrDeferredProxyUploader.h> -#include <src/gpu/GrDirectContextPriv.h> -#include <src/gpu/GrDistanceFieldGenFromVector.h> -#include <src/gpu/GrDrawOpAtlas.h> -#include <src/gpu/GrDrawOpTest.h> -#include <src/gpu/GrDrawingManager.h> -#include <src/gpu/GrDynamicAtlas.h> -#include <src/gpu/GrEagerVertexAllocator.h> -#include <src/gpu/GrFPArgs.h> -#include <src/gpu/GrFinishCallbacks.h> -#include <src/gpu/GrFixedClip.h> -#include <src/gpu/GrFragmentProcessor.h> -#include <src/gpu/GrGeometryProcessor.h> -#include <src/gpu/GrGlyph.h> -#include <src/gpu/GrGpu.h> -#include <src/gpu/GrGpuBuffer.h> -#include <src/gpu/GrGpuResource.h> -#include <src/gpu/GrGpuResourceCacheAccess.h> -#include <src/gpu/GrGpuResourcePriv.h> -#include <src/gpu/GrImageContextPriv.h> -#include <src/gpu/GrImageInfo.h> -#include <src/gpu/GrImageTextureMaker.h> -#include <src/gpu/GrManagedResource.h> -#include <src/gpu/GrMemoryPool.h> -#include <src/gpu/GrNativeRect.h> -#include <src/gpu/GrOnFlushResourceProvider.h> -#include <src/gpu/GrOpFlushState.h> -#include <src/gpu/GrOpsRenderPass.h> -#include <src/gpu/GrOpsTask.h> -#include <src/gpu/GrPaint.h> -#include <src/gpu/GrPath.h> -#include <src/gpu/GrPathProcessor.h> -#include <src/gpu/GrPathRenderer.h> -#include <src/gpu/GrPathRendererChain.h> -#include <src/gpu/GrPathRendering.h> -#include <src/gpu/GrPersistentCacheUtils.h> -#include <src/gpu/GrPipeline.h> -#include <src/gpu/GrPrimitiveProcessor.h> -#include <src/gpu/GrProcessor.h> -#include <src/gpu/GrProcessorAnalysis.h> -#include <src/gpu/GrProcessorSet.h> -#include <src/gpu/GrProcessorUnitTest.h> -#include <src/gpu/GrProgramDesc.h> -#include <src/gpu/GrProgramInfo.h> -#include <src/gpu/GrProxyProvider.h> -#include <src/gpu/GrRecordingContextPriv.h> -#include <src/gpu/GrRectanizerPow2.h> -#include <src/gpu/GrRectanizerSkyline.h> -#include <src/gpu/GrReducedClip.h> -#include <src/gpu/GrRenderTarget.h> -#include <src/gpu/GrRenderTargetProxy.h> -#include <src/gpu/GrRenderTask.h> -#include <src/gpu/GrResourceAllocator.h> -#include <src/gpu/GrResourceCache.h> -#include <src/gpu/GrResourceProvider.h> -#include <src/gpu/GrResourceProviderPriv.h> -#include <src/gpu/GrRingBuffer.h> -#include <src/gpu/GrSPIRVUniformHandler.h> -#include <src/gpu/GrSPIRVVaryingHandler.h> -#include <src/gpu/GrSWMaskHelper.h> -#include <src/gpu/GrSamplePatternDictionary.h> -#include <src/gpu/GrSamplerState.h> -#include <src/gpu/GrScissorState.h> -#include <src/gpu/GrSemaphore.h> -#include <src/gpu/GrShaderCaps.h> -#include <src/gpu/GrShaderUtils.h> -#include <src/gpu/GrShaderVar.h> -#include <src/gpu/GrSimpleMesh.h> -#include <src/gpu/GrSoftwarePathRenderer.h> -#include <src/gpu/GrStagingBufferManager.h> -#include <src/gpu/GrStencilClip.h> -#include <src/gpu/GrStencilMaskHelper.h> -#include <src/gpu/GrStencilSettings.h> -#include <src/gpu/GrStyle.h> -#include <src/gpu/GrSurface.h> -#include <src/gpu/GrSurfaceContext.h> -#include <src/gpu/GrSurfaceDrawContext.h> -#include <src/gpu/GrSurfaceFillContext.h> -#include <src/gpu/GrSurfaceProxy.h> -#include <src/gpu/GrSurfaceProxyPriv.h> -#include <src/gpu/GrSurfaceProxyView.h> -#include <src/gpu/GrSwizzle.h> -#include <src/gpu/GrTCluster.h> -#include <src/gpu/GrTTopoSort.h> -#include <src/gpu/GrTestUtils.h> -#include <src/gpu/GrTexture.h> -#include <src/gpu/GrTextureAdjuster.h> -#include <src/gpu/GrTextureMaker.h> -#include <src/gpu/GrTextureProducer.h> -#include <src/gpu/GrTextureProxy.h> -#include <src/gpu/GrTextureProxyCacheAccess.h> -#include <src/gpu/GrTextureProxyPriv.h> -#include <src/gpu/GrTextureRenderTargetProxy.h> -#include <src/gpu/GrTextureResolveRenderTask.h> -#include <src/gpu/GrThreadSafeCache.h> -#include <src/gpu/GrTracing.h> -#include <src/gpu/GrTransferFromRenderTask.h> -#include <src/gpu/GrTriangulator.h> -#include <src/gpu/GrUniformDataManager.h> -#include <src/gpu/GrUserStencilSettings.h> -#include <src/gpu/GrVertexWriter.h> -#include <src/gpu/GrVx.h> -#include <src/gpu/GrWaitRenderTask.h> -#include <src/gpu/GrWindowRectangles.h> -#include <src/gpu/GrXferProcessor.h> -#include <src/gpu/GrYUVATextureProxies.h> -#include <src/gpu/SkGpuDevice.h> -#include <src/gpu/SkGr.h> -#include <src/gpu/ccpr/GrAutoMapVertexBuffer.h> -#include <src/gpu/ccpr/GrCCAtlas.h> -#include <src/gpu/ccpr/GrCCClipPath.h> -#include <src/gpu/ccpr/GrCCClipProcessor.h> -#include <src/gpu/ccpr/GrCCConicShader.h> -#include <src/gpu/ccpr/GrCCCoverageProcessor.h> -#include <src/gpu/ccpr/GrCCCubicShader.h> -#include <src/gpu/ccpr/GrCCDrawPathsOp.h> -#include <src/gpu/ccpr/GrCCFillGeometry.h> -#include <src/gpu/ccpr/GrCCFiller.h> -#include <src/gpu/ccpr/GrCCPathCache.h> -#include <src/gpu/ccpr/GrCCPathProcessor.h> -#include <src/gpu/ccpr/GrCCPerFlushResources.h> -#include <src/gpu/ccpr/GrCCPerOpsTaskPaths.h> -#include <src/gpu/ccpr/GrCCQuadraticShader.h> -#include <src/gpu/ccpr/GrCCStrokeGeometry.h> -#include <src/gpu/ccpr/GrCCStroker.h> -#include <src/gpu/ccpr/GrCoverageCountingPathRenderer.h> -#include <src/gpu/ccpr/GrGSCoverageProcessor.h> -#include <src/gpu/ccpr/GrOctoBounds.h> -#include <src/gpu/ccpr/GrSampleMaskProcessor.h> -#include <src/gpu/ccpr/GrStencilAtlasOp.h> -#include <src/gpu/ccpr/GrVSCoverageProcessor.h> -#include <src/gpu/effects/GrAtlasedShaderHelpers.h> -#include <src/gpu/effects/GrBezierEffect.h> -#include <src/gpu/effects/GrBicubicEffect.h> -#include <src/gpu/effects/GrBitmapTextGeoProc.h> -#include <src/gpu/effects/GrBlendFragmentProcessor.h> -#include <src/gpu/effects/GrConvexPolyEffect.h> -#include <src/gpu/effects/GrCoverageSetOpXP.h> -#include <src/gpu/effects/GrCustomXfermode.h> -#include <src/gpu/effects/GrDisableColorXP.h> -#include <src/gpu/effects/GrDistanceFieldGeoProc.h> -#include <src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h> -#include <src/gpu/effects/GrMatrixConvolutionEffect.h> -#include <src/gpu/effects/GrMatrixEffect.h> -#include <src/gpu/effects/GrOvalEffect.h> -#include <src/gpu/effects/GrPorterDuffXferProcessor.h> -#include <src/gpu/effects/GrRRectEffect.h> -#include <src/gpu/effects/GrShadowGeoProc.h> -#include <src/gpu/effects/GrSkSLFP.h> -#include <src/gpu/effects/GrTextureEffect.h> -#include <src/gpu/effects/GrYUVtoRGBEffect.h> -#include <src/gpu/effects/generated/GrAARectEffect.h> -#include <src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h> -#include <src/gpu/effects/generated/GrArithmeticProcessor.h> -#include <src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h> -#include <src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h> -#include <src/gpu/effects/generated/GrCircleEffect.h> -#include <src/gpu/effects/generated/GrClampFragmentProcessor.h> -#include <src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h> -#include <src/gpu/effects/generated/GrComposeLerpEffect.h> -#include <src/gpu/effects/generated/GrConfigConversionEffect.h> -#include <src/gpu/effects/generated/GrConstColorProcessor.h> -#include <src/gpu/effects/generated/GrDeviceSpaceEffect.h> -#include <src/gpu/effects/generated/GrDitherEffect.h> -#include <src/gpu/effects/generated/GrEllipseEffect.h> -#include <src/gpu/effects/generated/GrHSLToRGBFilterEffect.h> -#include <src/gpu/effects/generated/GrHighContrastFilterEffect.h> -#include <src/gpu/effects/generated/GrLumaColorFilterEffect.h> -#include <src/gpu/effects/generated/GrMagnifierEffect.h> -#include <src/gpu/effects/generated/GrMixerEffect.h> -#include <src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h> -#include <src/gpu/effects/generated/GrRGBToHSLFilterEffect.h> -#include <src/gpu/effects/generated/GrRRectBlurEffect.h> -#include <src/gpu/effects/generated/GrRectBlurEffect.h> -#include <src/gpu/geometry/GrPathUtils.h> -#include <src/gpu/geometry/GrQuad.h> -#include <src/gpu/geometry/GrQuadBuffer.h> -#include <src/gpu/geometry/GrQuadUtils.h> -#include <src/gpu/geometry/GrRect.h> -#include <src/gpu/geometry/GrShape.h> -#include <src/gpu/geometry/GrStyledShape.h> -#include <src/gpu/gl/GrGLGpu.h> -#include <src/gpu/gl/GrGLTexture.h> -#include <src/gpu/gl/GrGLUtil.h> -#include <src/gpu/glsl/GrGLSL.h> -#include <src/gpu/glsl/GrGLSLBlend.h> -#include <src/gpu/glsl/GrGLSLColorSpaceXformHelper.h> -#include <src/gpu/glsl/GrGLSLFragmentProcessor.h> -#include <src/gpu/glsl/GrGLSLFragmentShaderBuilder.h> -#include <src/gpu/glsl/GrGLSLGeometryProcessor.h> -#include <src/gpu/glsl/GrGLSLPrimitiveProcessor.h> -#include <src/gpu/glsl/GrGLSLProgramBuilder.h> -#include <src/gpu/glsl/GrGLSLProgramDataManager.h> -#include <src/gpu/glsl/GrGLSLShaderBuilder.h> -#include <src/gpu/glsl/GrGLSLUniformHandler.h> -#include <src/gpu/glsl/GrGLSLVarying.h> -#include <src/gpu/glsl/GrGLSLVertexGeoBuilder.h> -#include <src/gpu/glsl/GrGLSLXferProcessor.h> -#include <src/gpu/gradients/GrGradientBitmapCache.h> -#include <src/gpu/gradients/GrGradientShader.h> -#include <src/gpu/gradients/generated/GrClampedGradientEffect.h> -#include <src/gpu/gradients/generated/GrDualIntervalGradientColorizer.h> -#include <src/gpu/gradients/generated/GrLinearGradientLayout.h> -#include <src/gpu/gradients/generated/GrRadialGradientLayout.h> -#include <src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.h> -#include <src/gpu/gradients/generated/GrSweepGradientLayout.h> -#include <src/gpu/gradients/generated/GrTiledGradientEffect.h> -#include <src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h> -#include <src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.h> -#include <src/gpu/mock/GrMockAttachment.h> -#include <src/gpu/mock/GrMockBuffer.h> -#include <src/gpu/mock/GrMockCaps.h> -#include <src/gpu/mock/GrMockGpu.h> -#include <src/gpu/mock/GrMockOpsRenderPass.h> -#include <src/gpu/mock/GrMockTexture.h> -#include <src/gpu/ops/GrAAConvexPathRenderer.h> -#include <src/gpu/ops/GrAAConvexTessellator.h> -#include <src/gpu/ops/GrAAHairLinePathRenderer.h> -#include <src/gpu/ops/GrAALinearizingConvexPathRenderer.h> -#include <src/gpu/ops/GrAtlasTextOp.h> -#include <src/gpu/ops/GrClearOp.h> -#include <src/gpu/ops/GrDashLinePathRenderer.h> -#include <src/gpu/ops/GrDashOp.h> -#include <src/gpu/ops/GrDefaultPathRenderer.h> -#include <src/gpu/ops/GrDrawAtlasOp.h> -#include <src/gpu/ops/GrDrawOp.h> -#include <src/gpu/ops/GrDrawPathOp.h> -#include <src/gpu/ops/GrDrawVerticesOp.h> -#include <src/gpu/ops/GrDrawableOp.h> -#include <src/gpu/ops/GrFillRRectOp.h> -#include <src/gpu/ops/GrFillRectOp.h> -#include <src/gpu/ops/GrLatticeOp.h> -#include <src/gpu/ops/GrMeshDrawOp.h> -#include <src/gpu/ops/GrOp.h> -#include <src/gpu/ops/GrOvalOpFactory.h> -#include <src/gpu/ops/GrQuadPerEdgeAA.h> -#include <src/gpu/ops/GrRegionOp.h> -#include <src/gpu/ops/GrShadowRRectOp.h> -#include <src/gpu/ops/GrSimpleMeshDrawOpHelper.h> -#include <src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h> -#include <src/gpu/ops/GrSmallPathAtlasMgr.h> -#include <src/gpu/ops/GrSmallPathRenderer.h> -#include <src/gpu/ops/GrSmallPathShapeData.h> -#include <src/gpu/ops/GrStencilAndCoverPathRenderer.h> -#include <src/gpu/ops/GrStencilPathOp.h> -#include <src/gpu/ops/GrStrokeRectOp.h> -#include <src/gpu/ops/GrTextureOp.h> -#include <src/gpu/ops/GrTriangulatingPathRenderer.h> -#include <src/gpu/tessellate/GrDrawAtlasPathOp.h> -#include <src/gpu/tessellate/GrFillPathShader.h> -#include <src/gpu/tessellate/GrMiddleOutPolygonTriangulator.h> -#include <src/gpu/tessellate/GrMidpointContourParser.h> -#include <src/gpu/tessellate/GrPathTessellateOp.h> -#include <src/gpu/tessellate/GrResolveLevelCounter.h> -#include <src/gpu/tessellate/GrStencilPathShader.h> -#include <src/gpu/tessellate/GrStrokeIndirectOp.h> -#include <src/gpu/tessellate/GrStrokeIterator.h> -#include <src/gpu/tessellate/GrStrokeOp.h> -#include <src/gpu/tessellate/GrStrokeTessellateOp.h> -#include <src/gpu/tessellate/GrStrokeTessellateShader.h> -#include <src/gpu/tessellate/GrTessellationPathRenderer.h> -#include <src/gpu/tessellate/GrWangsFormula.h> -#include <src/gpu/text/GrAtlasManager.h> -#include <src/gpu/text/GrDistanceFieldAdjustTable.h> -#include <src/gpu/text/GrSDFMaskFilter.h> -#include <src/gpu/text/GrSDFTOptions.h> -#include <src/gpu/text/GrStrikeCache.h> -#include <src/gpu/text/GrTextBlob.h> -#include <src/gpu/text/GrTextBlobCache.h> -#include <src/gpu/vk/GrVkAttachment.h> -#include <src/gpu/vk/GrVkBuffer.h> -#include <src/gpu/vk/GrVkCaps.h> -#include <src/gpu/vk/GrVkCommandBuffer.h> -#include <src/gpu/vk/GrVkCommandPool.h> -#include <src/gpu/vk/GrVkDescriptorPool.h> -#include <src/gpu/vk/GrVkDescriptorSet.h> -#include <src/gpu/vk/GrVkDescriptorSetManager.h> -#include <src/gpu/vk/GrVkFramebuffer.h> -#include <src/gpu/vk/GrVkGpu.h> -#include <src/gpu/vk/GrVkImage.h> -#include <src/gpu/vk/GrVkImageLayout.h> -#include <src/gpu/vk/GrVkImageView.h> -#include <src/gpu/vk/GrVkInterface.h> -#include <src/gpu/vk/GrVkMSAALoadManager.h> -#include <src/gpu/vk/GrVkMemory.h> -#include <src/gpu/vk/GrVkMeshBuffer.h> -#include <src/gpu/vk/GrVkOpsRenderPass.h> -#include <src/gpu/vk/GrVkPipeline.h> -#include <src/gpu/vk/GrVkPipelineState.h> -#include <src/gpu/vk/GrVkPipelineStateBuilder.h> -#include <src/gpu/vk/GrVkPipelineStateDataManager.h> -#include <src/gpu/vk/GrVkRenderPass.h> -#include <src/gpu/vk/GrVkRenderTarget.h> -#include <src/gpu/vk/GrVkResourceProvider.h> -#include <src/gpu/vk/GrVkSampler.h> -#include <src/gpu/vk/GrVkSamplerYcbcrConversion.h> -#include <src/gpu/vk/GrVkSecondaryCBDrawContext.h> -#include <src/gpu/vk/GrVkSemaphore.h> -#include <src/gpu/vk/GrVkTexture.h> -#include <src/gpu/vk/GrVkTextureRenderTarget.h> -#include <src/gpu/vk/GrVkTransferBuffer.h> -#include <src/gpu/vk/GrVkUniformBuffer.h> -#include <src/gpu/vk/GrVkUniformHandler.h> -#include <src/gpu/vk/GrVkUtil.h> -#include <src/gpu/vk/GrVkVaryingHandler.h> +#include <src/effects/colorfilters/SkBlendModeColorFilter.h> +#include <src/effects/colorfilters/SkColorFilterBase.h> +#include <src/effects/colorfilters/SkColorSpaceXformColorFilter.h> +#include <src/effects/colorfilters/SkComposeColorFilter.h> +#include <src/effects/colorfilters/SkGaussianColorFilter.h> +#include <src/effects/colorfilters/SkMatrixColorFilter.h> +#include <src/effects/colorfilters/SkRuntimeColorFilter.h> +#include <src/effects/colorfilters/SkTableColorFilter.h> +#include <src/effects/colorfilters/SkWorkingFormatColorFilter.h> +#include <src/effects/imagefilters/SkCropImageFilter.h> +#include <src/encode/SkICCPriv.h> +#include <src/encode/SkImageEncoderFns.h> +#include <src/encode/SkImageEncoderPriv.h> +#include <src/encode/SkPngEncoderImpl.h> +#include <src/image/SkImageGeneratorPriv.h> #include <src/image/SkImage_Base.h> -#include <src/image/SkImage_Gpu.h> -#include <src/image/SkImage_GpuBase.h> -#include <src/image/SkImage_GpuYUVA.h> #include <src/image/SkImage_Lazy.h> -#include <src/image/SkReadPixelsRec.h> +#include <src/image/SkImage_Picture.h> +#include <src/image/SkImage_Raster.h> +#include <src/image/SkPictureImageGenerator.h> #include <src/image/SkRescaleAndReadPixels.h> #include <src/image/SkSurface_Base.h> -#include <src/image/SkSurface_Gpu.h> -#include <src/images/SkImageEncoderPriv.h> +#include <src/image/SkSurface_Raster.h> #include <src/lazy/SkDiscardableMemoryPool.h> #include <src/pathops/SkAddIntersections.h> #include <src/pathops/SkIntersectionHelper.h> @@ -852,129 +510,41 @@ #include <src/pathops/SkPathOpsPoint.h> #include <src/pathops/SkPathOpsQuad.h> #include <src/pathops/SkPathOpsRect.h> +#include <src/pathops/SkPathOpsTCurve.h> #include <src/pathops/SkPathOpsTSect.h> #include <src/pathops/SkPathOpsTypes.h> #include <src/pathops/SkPathWriter.h> #include <src/pathops/SkReduceOrder.h> -#include <src/ports/SkOSLibrary.h> #include <src/sfnt/SkOTTableTypes.h> #include <src/sfnt/SkOTTable_OS_2.h> #include <src/sfnt/SkOTTable_head.h> #include <src/sfnt/SkOTTable_name.h> #include <src/sfnt/SkOTUtils.h> #include <src/shaders/SkBitmapProcShader.h> +#include <src/shaders/SkBlendShader.h> #include <src/shaders/SkColorFilterShader.h> #include <src/shaders/SkColorShader.h> -#include <src/shaders/SkComposeShader.h> +#include <src/shaders/SkCoordClampShader.h> #include <src/shaders/SkEmptyShader.h> #include <src/shaders/SkImageShader.h> #include <src/shaders/SkLocalMatrixShader.h> +#include <src/shaders/SkPerlinNoiseShaderImpl.h> #include <src/shaders/SkPictureShader.h> +#include <src/shaders/SkRuntimeShader.h> #include <src/shaders/SkShaderBase.h> -#include <src/shaders/gradients/Sk4fGradientBase.h> -#include <src/shaders/gradients/Sk4fLinearGradient.h> -#include <src/shaders/gradients/SkGradientShaderPriv.h> +#include <src/shaders/SkTransformShader.h> +#include <src/shaders/SkTriColorShader.h> +#include <src/shaders/gradients/SkConicalGradient.h> +#include <src/shaders/gradients/SkGradientBaseShader.h> #include <src/shaders/gradients/SkLinearGradient.h> #include <src/shaders/gradients/SkRadialGradient.h> #include <src/shaders/gradients/SkSweepGradient.h> -#include <src/shaders/gradients/SkTwoPointConicalGradient.h> -#include <src/sksl/GLSL.std.450.h> -#include <src/sksl/SkSLASTNode.h> -#include <src/sksl/SkSLAnalysis.h> -#include <src/sksl/SkSLByteCode.h> -#include <src/sksl/SkSLByteCodeGenerator.h> -#include <src/sksl/SkSLCFGGenerator.h> -#include <src/sksl/SkSLCPPCodeGenerator.h> -#include <src/sksl/SkSLCPPUniformCTypes.h> -#include <src/sksl/SkSLCodeGenerator.h> -#include <src/sksl/SkSLCompiler.h> -#include <src/sksl/SkSLConstantFolder.h> -#include <src/sksl/SkSLContext.h> -#include <src/sksl/SkSLDefines.h> -#include <src/sksl/SkSLDehydrator.h> -#include <src/sksl/SkSLErrorReporter.h> -#include <src/sksl/SkSLExternalFunction.h> -#include <src/sksl/SkSLGLSLCodeGenerator.h> -#include <src/sksl/SkSLHCodeGenerator.h> -#include <src/sksl/SkSLIRGenerator.h> -#include <src/sksl/SkSLInliner.h> -#include <src/sksl/SkSLLexer.h> -#include <src/sksl/SkSLMemoryLayout.h> -#include <src/sksl/SkSLMetalCodeGenerator.h> -#include <src/sksl/SkSLOutputStream.h> -#include <src/sksl/SkSLParser.h> -#include <src/sksl/SkSLPipelineStageCodeGenerator.h> -#include <src/sksl/SkSLPool.h> -#include <src/sksl/SkSLRehydrator.h> -#include <src/sksl/SkSLSPIRVCodeGenerator.h> -#include <src/sksl/SkSLSPIRVtoHLSL.h> -#include <src/sksl/SkSLSectionAndParameterHelper.h> -#include <src/sksl/SkSLString.h> -#include <src/sksl/SkSLStringStream.h> -#include <src/sksl/SkSLUtil.h> -#include <src/sksl/SkSLVMGenerator.h> -#include <src/sksl/dsl/DSLCore.h> -#include <src/sksl/dsl/DSLExpression.h> -#include <src/sksl/dsl/DSLType.h> -#include <src/sksl/dsl/DSLVar.h> -#include <src/sksl/dsl/priv/DSLWriter.h> -#include <src/sksl/ir/SkSLBinaryExpression.h> -#include <src/sksl/ir/SkSLBlock.h> -#include <src/sksl/ir/SkSLBoolLiteral.h> -#include <src/sksl/ir/SkSLBreakStatement.h> -#include <src/sksl/ir/SkSLConstructor.h> -#include <src/sksl/ir/SkSLContinueStatement.h> -#include <src/sksl/ir/SkSLDiscardStatement.h> -#include <src/sksl/ir/SkSLDoStatement.h> -#include <src/sksl/ir/SkSLEnum.h> -#include <src/sksl/ir/SkSLExpression.h> -#include <src/sksl/ir/SkSLExpressionStatement.h> -#include <src/sksl/ir/SkSLExtension.h> -#include <src/sksl/ir/SkSLExternalFunctionCall.h> -#include <src/sksl/ir/SkSLExternalFunctionReference.h> -#include <src/sksl/ir/SkSLField.h> -#include <src/sksl/ir/SkSLFieldAccess.h> -#include <src/sksl/ir/SkSLFloatLiteral.h> -#include <src/sksl/ir/SkSLForStatement.h> -#include <src/sksl/ir/SkSLFunctionCall.h> -#include <src/sksl/ir/SkSLFunctionDeclaration.h> -#include <src/sksl/ir/SkSLFunctionDefinition.h> -#include <src/sksl/ir/SkSLFunctionPrototype.h> -#include <src/sksl/ir/SkSLFunctionReference.h> -#include <src/sksl/ir/SkSLIfStatement.h> -#include <src/sksl/ir/SkSLIndexExpression.h> -#include <src/sksl/ir/SkSLInlineMarker.h> -#include <src/sksl/ir/SkSLIntLiteral.h> -#include <src/sksl/ir/SkSLInterfaceBlock.h> -#include <src/sksl/ir/SkSLLayout.h> -#include <src/sksl/ir/SkSLModifiers.h> -#include <src/sksl/ir/SkSLModifiersDeclaration.h> -#include <src/sksl/ir/SkSLNop.h> -#include <src/sksl/ir/SkSLPostfixExpression.h> -#include <src/sksl/ir/SkSLPrefixExpression.h> -#include <src/sksl/ir/SkSLProgram.h> -#include <src/sksl/ir/SkSLProgramElement.h> -#include <src/sksl/ir/SkSLReturnStatement.h> -#include <src/sksl/ir/SkSLSection.h> -#include <src/sksl/ir/SkSLSetting.h> -#include <src/sksl/ir/SkSLStatement.h> -#include <src/sksl/ir/SkSLStructDefinition.h> -#include <src/sksl/ir/SkSLSwitchCase.h> -#include <src/sksl/ir/SkSLSwitchStatement.h> -#include <src/sksl/ir/SkSLSwizzle.h> -#include <src/sksl/ir/SkSLSymbol.h> -#include <src/sksl/ir/SkSLSymbolAlias.h> -#include <src/sksl/ir/SkSLSymbolTable.h> -#include <src/sksl/ir/SkSLTernaryExpression.h> -#include <src/sksl/ir/SkSLType.h> -#include <src/sksl/ir/SkSLTypeReference.h> -#include <src/sksl/ir/SkSLUnresolvedFunction.h> -#include <src/sksl/ir/SkSLVarDeclarations.h> -#include <src/sksl/ir/SkSLVariable.h> -#include <src/sksl/ir/SkSLVariableReference.h> +#include <src/text/GlyphRun.h> +#include <src/text/StrikeForGPU.h> #include <src/utils/SkBitSet.h> #include <src/utils/SkCanvasStack.h> #include <src/utils/SkCharToGlyphCache.h> +#include <src/utils/SkClipStackUtils.h> #include <src/utils/SkDashPathPriv.h> #include <src/utils/SkFloatToDecimal.h> #include <src/utils/SkJSON.h> @@ -985,14 +555,9 @@ #include <src/utils/SkOSPath.h> #include <src/utils/SkPatchUtils.h> #include <src/utils/SkPolyUtils.h> +#include <src/utils/SkShaderUtils.h> #include <src/utils/SkShadowTessellator.h> -#include <src/utils/SkShaperJSONWriter.h> -#include <src/utils/SkUTF.h> -#include <tools/gpu/vk/GrVulkanDefines.h> -#include <tools/gpu/vk/VkTestUtils.h> -#include <tools/sk_app/VulkanWindowContext.h> #include <tools/sk_app/WindowContext.h> -#include <vulkan/vulkan_core.h> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #include <skia_compiler.hxx> diff --git a/external/skia/incomplete-type-SkImageGenerator.patch.1 b/external/skia/incomplete-type-SkImageGenerator.patch.1 new file mode 100644 index 000000000000..e22c62d05dcf --- /dev/null +++ b/external/skia/incomplete-type-SkImageGenerator.patch.1 @@ -0,0 +1,11 @@ +diff -ur skia.org/src/ports/SkImageGenerator_none.cpp skia/src/ports/SkImageGenerator_none.cpp +--- skia.org/src/ports/SkImageGenerator_none.cpp 2023-07-13 12:45:22.893718610 +0200 ++++ skia/src/ports/SkImageGenerator_none.cpp 2023-07-13 12:45:46.621816770 +0200 +@@ -6,6 +6,7 @@ + */ + + #include "include/core/SkData.h" ++#include "include/core/SkImageGenerator.h" + #include "src/image/SkImageGeneratorPriv.h" + + namespace SkImageGenerators { diff --git a/external/skia/incomplete.patch.0 b/external/skia/incomplete.patch.0 new file mode 100644 index 000000000000..f8450b1c1da2 --- /dev/null +++ b/external/skia/incomplete.patch.0 @@ -0,0 +1,18 @@ +--- src/gpu/ganesh/image/GrImageUtils.h ++++ src/gpu/ganesh/image/GrImageUtils.h +@@ -12,6 +12,7 @@ + #include "include/core/SkSamplingOptions.h" + #include "include/core/SkYUVAPixmaps.h" + #include "include/gpu/GrTypes.h" ++#include "src/gpu/ganesh/GrFragmentProcessor.h" + #include "src/gpu/ganesh/GrSurfaceProxyView.h" // IWYU pragma: keep + #include "src/gpu/ganesh/SkGr.h" + +@@ -21,7 +22,6 @@ + #include <tuple> + + class GrCaps; +-class GrFragmentProcessor; + class GrImageContext; + class GrRecordingContext; + class SkImage; diff --git a/external/skia/libvulkan-name.patch.1 b/external/skia/libvulkan-name.patch.1 deleted file mode 100644 index 265d8daa11df..000000000000 --- a/external/skia/libvulkan-name.patch.1 +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/tools/gpu/vk/VkTestUtils.cpp b/tools/gpu/vk/VkTestUtils.cpp -index 5b7e8c29ae..1580136b5c 100644 ---- a/tools/gpu/vk/VkTestUtils.cpp -+++ b/tools/gpu/vk/VkTestUtils.cpp -@@ -13,7 +13,7 @@ - #if defined _WIN32 - #define SK_GPU_TOOLS_VK_LIBRARY_NAME "vulkan-1.dll" - #else -- #define SK_GPU_TOOLS_VK_LIBRARY_NAME "libvulkan.so" -+ #define SK_GPU_TOOLS_VK_LIBRARY_NAME "libvulkan.so.1" - #endif - #endif - diff --git a/external/skia/make-api-visible.patch.1 b/external/skia/make-api-visible.patch.1 index 6f2cd3b05a6c..4248fb526ef2 100644 --- a/external/skia/make-api-visible.patch.1 +++ b/external/skia/make-api-visible.patch.1 @@ -1,23 +1,34 @@ +diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h +index 79f6d72f35..428d198159 100644 --- a/tools/sk_app/WindowContext.h +++ b/tools/sk_app/WindowContext.h -@@ -17,7 +17,11 @@ +@@ -22,7 +22,7 @@ class Context; namespace sk_app { -class WindowContext { -+class -+#if defined __clang__ && !defined _MSC_VER -+__attribute__((type_visibility("default"))) -+#endif -+WindowContext { ++class SK_API WindowContext { public: WindowContext(const DisplayParams&); +diff --git a/tools/sk_app/mac/WindowContextFactory_mac.h b/tools/sk_app/mac/WindowContextFactory_mac.h +index 3e136a8f57..affb89e43e 100644 +--- a/tools/sk_app/mac/WindowContextFactory_mac.h ++++ b/tools/sk_app/mac/WindowContextFactory_mac.h +@@ -52,7 +52,7 @@ std::unique_ptr<WindowContext> MakeDawnMTLForMac(const MacWindowInfo&, const Dis + #endif + + #ifdef SK_METAL +-std::unique_ptr<WindowContext> MakeMetalForMac(const MacWindowInfo&, const DisplayParams&); ++SK_API std::unique_ptr<WindowContext> MakeMetalForMac(const MacWindowInfo&, const DisplayParams&); + #if defined(SK_GRAPHITE) + std::unique_ptr<WindowContext> MakeGraphiteMetalForMac(const MacWindowInfo&, const DisplayParams&); + #endif diff --git a/tools/sk_app/unix/WindowContextFactory_unix.h b/tools/sk_app/unix/WindowContextFactory_unix.h index 11bd2d2ac2..09c92dc417 100644 --- a/tools/sk_app/unix/WindowContextFactory_unix.h +++ b/tools/sk_app/unix/WindowContextFactory_unix.h -@@ -36,15 +36,15 @@ struct XlibWindowInfo { +@@ -36,20 +36,20 @@ struct XlibWindowInfo { int fHeight; }; @@ -32,6 +43,11 @@ index 11bd2d2ac2..09c92dc417 100644 +SK_API std::unique_ptr<WindowContext> MakeDawnVulkanForXlib(const XlibWindowInfo&, const DisplayParams&); #endif + #if defined(SK_DAWN) && defined(SK_GRAPHITE) + std::unique_ptr<WindowContext> MakeGraphiteDawnVulkanForXlib(const XlibWindowInfo&, + const DisplayParams&); + #endif + -std::unique_ptr<WindowContext> MakeRasterForXlib(const XlibWindowInfo&, const DisplayParams&); +SK_API std::unique_ptr<WindowContext> MakeRasterForXlib(const XlibWindowInfo&, const DisplayParams&); @@ -41,7 +57,16 @@ diff --git a/tools/sk_app/win/WindowContextFactory_win.h b/tools/sk_app/win/Wind index c05a4f0acf..fc27cd2afb 100644 --- a/tools/sk_app/win/WindowContextFactory_win.h +++ b/tools/sk_app/win/WindowContextFactory_win.h -@@ -20,21 +20,21 @@ struct DisplayParams; +@@ -13,31 +13,33 @@ struct DisplayParams; + + #include <memory> + ++#include "include/core/SkTypes.h" ++ + namespace sk_app { + + class WindowContext; + struct DisplayParams; namespace window_context_factory { @@ -62,6 +87,9 @@ index c05a4f0acf..fc27cd2afb 100644 #ifdef SK_DAWN -std::unique_ptr<WindowContext> MakeDawnD3D12ForWin(HWND, const DisplayParams&); +SK_API std::unique_ptr<WindowContext> MakeDawnD3D12ForWin(HWND, const DisplayParams&); + #if defined(SK_GRAPHITE) + std::unique_ptr<WindowContext> MakeGraphiteDawnD3D12ForWin(HWND, const DisplayParams&); + #endif #endif -std::unique_ptr<WindowContext> MakeRasterForWin(HWND, const DisplayParams&); diff --git a/external/skia/no-trace-resources-on-exit.patch.1 b/external/skia/no-trace-resources-on-exit.patch.1 index fa563fee21d0..4d52a37dc56c 100644 --- a/external/skia/no-trace-resources-on-exit.patch.1 +++ b/external/skia/no-trace-resources-on-exit.patch.1 @@ -1,7 +1,7 @@ diff --git a/src/gpu/vk/GrVkResource.h b/src/gpu/vk/GrVkResource.h index 7b9949ba1b..4e8fb48c7c 100644 ---- a/src/gpu/GrManagedResource.h -+++ b/src/gpu/GrManagedResource.h +--- a/src/gpu/ganesh/GrManagedResource.h ++++ b/src/gpu/ganesh/GrManagedResource.h @@ -17,7 +17,7 @@ class GrVkGpu; // uncomment to enable tracing of resource refs diff --git a/external/skia/redefinition-of-op.patch.0 b/external/skia/redefinition-of-op.patch.0 new file mode 100644 index 000000000000..9d8e421d12e4 --- /dev/null +++ b/external/skia/redefinition-of-op.patch.0 @@ -0,0 +1,11 @@ +--- src/core/SkRasterPipeline.cpp 2023-01-27 11:37:56.102294572 +0200 ++++ src/core/SkRasterPipeline.cpp 2023-01-27 11:40:24.300538398 +0200 +@@ -21,7 +21,7 @@ + #include <vector> + + using namespace skia_private; +-using Op = SkRasterPipelineOp; ++#define Op SkRasterPipelineOp + + bool gForceHighPrecisionRasterPipeline; + diff --git a/external/skia/share-grcontext.patch.1 b/external/skia/share-grcontext.patch.1 index 3cf2133aa1a9..9d491868bf44 100644 --- a/external/skia/share-grcontext.patch.1 +++ b/external/skia/share-grcontext.patch.1 @@ -1,21 +1,268 @@ +diff --git a/tools/sk_app/MetalWindowContext.h b/tools/sk_app/MetalWindowContext.h +index 106d366415..08dc19b5c8 100644 +--- a/tools/sk_app/MetalWindowContext.h ++++ b/tools/sk_app/MetalWindowContext.h +@@ -14,13 +14,18 @@ + + #include "tools/sk_app/WindowContext.h" + ++#ifdef __OBJC__ + #import <Metal/Metal.h> + #import <QuartzCore/CAMetalLayer.h> ++#endif + + namespace sk_app { + ++#ifdef __OBJC__ + class MetalWindowContext : public WindowContext { + public: ++ static GrDirectContext* getSharedGrDirectContext() { return fGlobalShared ? fGlobalShared->fContext.get() : nullptr; } ++ + sk_sp<SkSurface> getBackbufferSurface() override; + + bool isValid() override { return fValid; } +@@ -44,18 +49,36 @@ + void destroyContext(); + virtual void onDestroyContext() = 0; + ++ static void checkDestroyShared(); ++ + void onSwapBuffers() override; + + bool fValid; ++ ++ // We need to use just one GrDirectContext, so share all the relevant data. ++ struct Shared : public SkRefCnt ++ { + sk_cfp<id<MTLDevice>> fDevice; + sk_cfp<id<MTLCommandQueue>> fQueue; +- CAMetalLayer* fMetalLayer; +- GrMTLHandle fDrawableHandle; + #if SKGPU_GRAPHITE_METAL_SDK_VERSION >= 230 + // wrapping this in sk_cfp throws up an availability warning, so we'll track lifetime manually + id<MTLBinaryArchive> fPipelineArchive SK_API_AVAILABLE(macos(11.0), ios(14.0)); + #endif ++ ++ sk_sp<GrDirectContext> fContext; ++ }; ++ ++ sk_sp<Shared> fShared; ++ ++ static sk_sp<Shared> fGlobalShared; ++ ++ CAMetalLayer* fMetalLayer; ++ GrMTLHandle fDrawableHandle; + }; ++#endif // __OBJC__ ++ ++// Access function when header is used from C++ code that wouldn't handle ObjC++ headers. ++extern "C" SK_API GrDirectContext* getMetalSharedGrDirectContext(); + + } // namespace sk_app + +diff --git a/tools/sk_app/MetalWindowContext.mm b/tools/sk_app/MetalWindowContext.mm +index d972e321a6..9f576944b7 100644 +--- a/tools/sk_app/MetalWindowContext.mm ++++ b/tools/sk_app/MetalWindowContext.mm +@@ -40,24 +40,30 @@ NSURL* MetalWindowContext::CacheURL() { + } + + void MetalWindowContext::initializeContext() { ++ fShared = fGlobalShared; ++ if( !fShared ) ++ { ++ // TODO do we need a mutex? ++ ++ fGlobalShared = sk_make_sp<Shared>(); ++ Shared* d = fGlobalShared.get(); // shorter variable name ++ + SkASSERT(!fContext); + +- fDevice.reset(MTLCreateSystemDefaultDevice()); +- fQueue.reset([*fDevice newCommandQueue]); ++ d->fDevice.reset(MTLCreateSystemDefaultDevice()); ++ d->fQueue.reset([*d->fDevice newCommandQueue]); + + if (fDisplayParams.fMSAASampleCount > 1) { + if (@available(macOS 10.11, iOS 9.0, *)) { +- if (![*fDevice supportsTextureSampleCount:fDisplayParams.fMSAASampleCount]) { ++ if (![*d->fDevice supportsTextureSampleCount:fDisplayParams.fMSAASampleCount]) { ++ fGlobalShared.reset(); + return; + } + } else { ++ fGlobalShared.reset(); + return; + } + } +- fSampleCount = fDisplayParams.fMSAASampleCount; +- fStencilBits = 8; +- +- fValid = this->onInitializeContext(); + + #if SKGPU_GRAPHITE_METAL_SDK_VERSION >= 230 + if (fDisplayParams.fEnableBinaryArchive) { +@@ -62,11 +68,11 @@ void MetalWindowContext::initializeContext() { + sk_cfp<MTLBinaryArchiveDescriptor*> desc([MTLBinaryArchiveDescriptor new]); + (*desc).url = CacheURL(); // try to load + NSError* error; +- fPipelineArchive = [*fDevice newBinaryArchiveWithDescriptor:*desc error:&error]; +- if (!fPipelineArchive) { ++ d->fPipelineArchive = [*d->fDevice newBinaryArchiveWithDescriptor:*desc error:&error]; ++ if (!d->fPipelineArchive) { + (*desc).url = nil; // create new +- fPipelineArchive = [*fDevice newBinaryArchiveWithDescriptor:*desc error:&error]; +- if (!fPipelineArchive) { ++ d->fPipelineArchive = [*d->fDevice newBinaryArchiveWithDescriptor:*desc error:&error]; ++ if (!d->fPipelineArchive) { + SkDebugf("Error creating MTLBinaryArchive:\n%s\n", + error.debugDescription.UTF8String); + } +@@ -77,46 +83,75 @@ void MetalWindowContext::initializeContext() { + } + } else { + if (@available(macOS 11.0, iOS 14.0, *)) { +- fPipelineArchive = nil; ++ d->fPipelineArchive = nil; + } + } + #endif + + GrMtlBackendContext backendContext = {}; +- backendContext.fDevice.retain((GrMTLHandle)fDevice.get()); +- backendContext.fQueue.retain((GrMTLHandle)fQueue.get()); ++ backendContext.fDevice.retain((GrMTLHandle)d->fDevice.get()); ++ backendContext.fQueue.retain((GrMTLHandle)d->fQueue.get()); + #if SKGPU_GRAPHITE_METAL_SDK_VERSION >= 230 + if (@available(macOS 11.0, iOS 14.0, *)) { +- backendContext.fBinaryArchive.retain((__bridge GrMTLHandle)fPipelineArchive); ++ backendContext.fBinaryArchive.retain((__bridge GrMTLHandle)d->fPipelineArchive); + } + #endif +- fContext = GrDirectContext::MakeMetal(backendContext, fDisplayParams.fGrContextOptions); +- if (!fContext && fDisplayParams.fMSAASampleCount > 1) { ++ d->fContext = GrDirectContext::MakeMetal(backendContext, fDisplayParams.fGrContextOptions); ++ if (!d->fContext && fDisplayParams.fMSAASampleCount > 1) { + fDisplayParams.fMSAASampleCount /= 2; ++ fGlobalShared.reset(); + this->initializeContext(); + return; + } ++ ++ fShared = fGlobalShared; ++ } // if( !fShared ) ++ ++ fContext = fShared->fContext; ++ ++ fSampleCount = fDisplayParams.fMSAASampleCount; ++ fStencilBits = 8; ++ ++ fValid = this->onInitializeContext(); + } + + void MetalWindowContext::destroyContext() { +- if (fContext) { +- // in case we have outstanding refs to this (lua?) +- fContext->abandonContext(); +- fContext.reset(); +- } +- + this->onDestroyContext(); + + fMetalLayer = nil; + fValid = false; + ++ fContext.reset(); ++ fShared.reset(); ++ ++ checkDestroyShared(); ++} ++ ++void MetalWindowContext::checkDestroyShared() ++{ ++ if(!fGlobalShared || !fGlobalShared->unique()) // TODO mutex? ++ return; ++#ifndef SK_TRACE_VK_RESOURCES ++ if(!fGlobalShared->fContext->unique()) ++ return; ++#endif ++ SkASSERT(fGlobalShared->fContext->unique()); ++ ++ if (fGlobalShared->fContext) { ++ // in case we have outstanding refs to this (lua?) ++ fGlobalShared->fContext->abandonContext(); ++ fGlobalShared->fContext.reset(); ++ } ++ + #if SKGPU_GRAPHITE_METAL_SDK_VERSION >= 230 + if (@available(macOS 11.0, iOS 14.0, *)) { +- [fPipelineArchive release]; ++ [fGlobalShared->fPipelineArchive release]; + } + #endif +- fQueue.reset(); +- fDevice.reset(); ++ fGlobalShared->fQueue.reset(); ++ fGlobalShared->fDevice.reset(); ++ ++ fGlobalShared.reset(); + } + + sk_sp<SkSurface> MetalWindowContext::getBackbufferSurface() { +@@ -159,7 +194,7 @@ sk_sp<SkSurface> MetalWindowContext::getBackbufferSurface() { + void MetalWindowContext::onSwapBuffers() { + id<CAMetalDrawable> currentDrawable = (id<CAMetalDrawable>)fDrawableHandle; + +- id<MTLCommandBuffer> commandBuffer([*fQueue commandBuffer]); ++ id<MTLCommandBuffer> commandBuffer([*fShared->fQueue commandBuffer]); + commandBuffer.label = @"Present"; + + [commandBuffer presentDrawable:currentDrawable]; +@@ -180,9 +215,9 @@ void MetalWindowContext::activate(bool isActive) { + if (!isActive) { + #if SKGPU_GRAPHITE_METAL_SDK_VERSION >= 230 + if (@available(macOS 11.0, iOS 14.0, *)) { +- if (fPipelineArchive) { ++ if (fShared->fPipelineArchive) { + NSError* error; +- [fPipelineArchive serializeToURL:CacheURL() error:&error]; ++ [fShared->fPipelineArchive serializeToURL:CacheURL() error:&error]; + if (error) { + SkDebugf("Error storing MTLBinaryArchive:\n%s\n", + error.debugDescription.UTF8String); +@@ -188,4 +223,11 @@ void MetalWindowContext::activate(bool isActive) { + } + } + ++SK_API sk_sp<MetalWindowContext::Shared> MetalWindowContext::fGlobalShared; ++ ++GrDirectContext* getMetalSharedGrDirectContext() ++{ ++ return MetalWindowContext::getSharedGrDirectContext(); ++} ++ + } //namespace sk_app diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp -index d07d5a4274..2b36d60076 100644 +index c9db528ca4..634034da5a 100644 --- a/tools/sk_app/VulkanWindowContext.cpp +++ b/tools/sk_app/VulkanWindowContext.cpp -@@ -24,8 +24,10 @@ - #undef CreateSemaphore +@@ -25,9 +25,13 @@ #endif --#define GET_PROC(F) f ## F = (PFN_vk ## F) fGetInstanceProcAddr(fInstance, "vk" #F) --#define GET_DEV_PROC(F) f ## F = (PFN_vk ## F) fGetDeviceProcAddr(fDevice, "vk" #F) -+#define GET_PROC(F) f ## F = (PFN_vk ## F) fGetInstanceProcAddr(fShared->fInstance, "vk" #F) -+#define GET_DEV_PROC(F) f ## F = (PFN_vk ## F) fGetDeviceProcAddr(fShared->fDevice, "vk" #F) -+#define GET_PROC_GLOBAL(F) fGlobalShared->f ## F = (PFN_vk ## F) fGetInstanceProcAddr(fGlobalShared->fInstance, "vk" #F) -+#define GET_DEV_PROC_GLOBAL(F) fGlobalShared->f ## F = (PFN_vk ## F) fGetDeviceProcAddr(fGlobalShared->fDevice, "vk" #F) + #define GET_PROC(F) f ## F = \ +- (PFN_vk ## F) backendContext.fGetProc("vk" #F, fInstance, VK_NULL_HANDLE) ++ (PFN_vk ## F) fGlobalShared->backendContext.fGetProc("vk" #F, fShared->fInstance, VK_NULL_HANDLE) + #define GET_DEV_PROC(F) f ## F = \ +- (PFN_vk ## F) backendContext.fGetProc("vk" #F, VK_NULL_HANDLE, fDevice) ++ (PFN_vk ## F) fGlobalShared->backendContext.fGetProc("vk" #F, VK_NULL_HANDLE, fShared->fDevice) ++#define GET_PROC_GLOBAL(F) fGlobalShared->f ## F = \ ++ (PFN_vk ## F) fGlobalShared->backendContext.fGetProc("vk" #F, fGlobalShared->fInstance, VK_NULL_HANDLE) ++#define GET_DEV_PROC_GLOBAL(F) fGlobalShared->f ## F = \ ++ (PFN_vk ## F) fGlobalShared->backendContext.fGetProc("vk" #F, VK_NULL_HANDLE, fGlobalShared->fDevice) namespace sk_app { -@@ -49,6 +51,14 @@ VulkanWindowContext::VulkanWindowContext(const DisplayParams& params, +@@ -49,31 +53,39 @@ VulkanWindowContext::VulkanWindowContext(const DisplayParams& params, } void VulkanWindowContext::initializeContext() { @@ -30,15 +277,16 @@ index d07d5a4274..2b36d60076 100644 SkASSERT(!fContext); // any config code here (particularly for msaa)? -@@ -63,24 +73,25 @@ void VulkanWindowContext::initializeContext() { - }; - GrVkBackendContext backendContext; - GrVkExtensions extensions; + PFN_vkGetInstanceProcAddr getInstanceProc = fGetInstanceProcAddr; +- GrVkBackendContext backendContext; ++ GrVkBackendContext& backendContext = fGlobalShared->backendContext; + skgpu::VulkanExtensions extensions; - VkPhysicalDeviceFeatures2 features; -- if (!sk_gpu_test::CreateVkBackendContext(getProc, &backendContext, &extensions, &features, -- &fDebugCallback, &fPresentQueueIndex, fCanPresentFn)) { +- if (!sk_gpu_test::CreateVkBackendContext(getInstanceProc, &backendContext, &extensions, +- &features, &fDebugCallback, &fPresentQueueIndex, +- fCanPresentFn)) { - sk_gpu_test::FreeVulkanFeaturesStructs(&features); -+ if (!sk_gpu_test::CreateVkBackendContext(getProc, &backendContext, &extensions, &d->features, ++ if (!sk_gpu_test::CreateVkBackendContext(getInstanceProc, &backendContext, &extensions, &d->features, + &d->fDebugCallback, &d->fPresentQueueIndex, fCanPresentFn)) { + sk_gpu_test::FreeVulkanFeaturesStructs(&d->features); + fGlobalShared.reset(); @@ -66,7 +314,7 @@ index d07d5a4274..2b36d60076 100644 PFN_vkGetPhysicalDeviceProperties localGetPhysicalDeviceProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>( -@@ -88,21 +99,30 @@ void VulkanWindowContext::initializeContext() { +@@ -81,21 +93,30 @@ void VulkanWindowContext::initializeContext() { backendContext.fInstance, VK_NULL_HANDLE)); if (!localGetPhysicalDeviceProperties) { @@ -81,10 +329,10 @@ index d07d5a4274..2b36d60076 100644 + localGetPhysicalDeviceProperties(backendContext.fPhysicalDevice, &d->physDeviceProperties); + uint32_t physDevVersion = d->physDeviceProperties.apiVersion; -- fInterface.reset(new GrVkInterface(backendContext.fGetProc, fInstance, fDevice, -+ d->fInterface.reset(new GrVkInterface(backendContext.fGetProc, d->fInstance, d->fDevice, - backendContext.fInstanceVersion, physDevVersion, - &extensions)); +- fInterface.reset(new skgpu::VulkanInterface(backendContext.fGetProc, fInstance, fDevice, ++ d->fInterface.reset(new skgpu::VulkanInterface(backendContext.fGetProc, d->fInstance, d->fDevice, + backendContext.fInstanceVersion, physDevVersion, + &extensions)); - GET_PROC(DestroyInstance); - if (fDebugCallback != VK_NULL_HANDLE) { @@ -105,7 +353,7 @@ index d07d5a4274..2b36d60076 100644 GET_PROC(DestroySurfaceKHR); GET_PROC(GetPhysicalDeviceSurfaceSupportKHR); GET_PROC(GetPhysicalDeviceSurfaceCapabilitiesKHR); -@@ -110,7 +130,6 @@ void VulkanWindowContext::initializeContext() { +@@ -103,7 +124,6 @@ void VulkanWindowContext::initializeContext() { GET_PROC(GetPhysicalDeviceSurfacePresentModesKHR); GET_DEV_PROC(DeviceWaitIdle); GET_DEV_PROC(QueueWaitIdle); @@ -113,7 +361,7 @@ index d07d5a4274..2b36d60076 100644 GET_DEV_PROC(CreateSwapchainKHR); GET_DEV_PROC(DestroySwapchainKHR); GET_DEV_PROC(GetSwapchainImagesKHR); -@@ -118,46 +137,44 @@ void VulkanWindowContext::initializeContext() { +@@ -111,46 +131,44 @@ void VulkanWindowContext::initializeContext() { GET_DEV_PROC(QueuePresentKHR); GET_DEV_PROC(GetDeviceQueue); @@ -170,7 +418,7 @@ index d07d5a4274..2b36d60076 100644 nullptr); if (VK_SUCCESS != res) { return false; -@@ -165,14 +182,14 @@ bool VulkanWindowContext::createSwapchain(int width, int height, +@@ -158,14 +176,14 @@ bool VulkanWindowContext::createSwapchain(int width, int height, SkAutoMalloc surfaceFormatAlloc(surfaceFormatCount * sizeof(VkSurfaceFormatKHR)); VkSurfaceFormatKHR* surfaceFormats = (VkSurfaceFormatKHR*)surfaceFormatAlloc.get(); @@ -187,7 +435,7 @@ index d07d5a4274..2b36d60076 100644 nullptr); if (VK_SUCCESS != res) { return false; -@@ -180,7 +197,7 @@ bool VulkanWindowContext::createSwapchain(int width, int height, +@@ -173,7 +191,7 @@ bool VulkanWindowContext::createSwapchain(int width, int height, SkAutoMalloc presentModeAlloc(presentModeCount * sizeof(VkPresentModeKHR)); VkPresentModeKHR* presentModes = (VkPresentModeKHR*)presentModeAlloc.get(); @@ -196,7 +444,7 @@ index d07d5a4274..2b36d60076 100644 presentModes); if (VK_SUCCESS != res) { return false; -@@ -293,8 +310,8 @@ bool VulkanWindowContext::createSwapchain(int width, int height, +@@ -286,8 +304,8 @@ bool VulkanWindowContext::createSwapchain(int width, int height, swapchainCreateInfo.imageArrayLayers = 1; swapchainCreateInfo.imageUsage = usageFlags; @@ -207,7 +455,7 @@ index d07d5a4274..2b36d60076 100644 swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT; swapchainCreateInfo.queueFamilyIndexCount = 2; swapchainCreateInfo.pQueueFamilyIndices = queueFamilies; -@@ -310,27 +327,27 @@ bool VulkanWindowContext::createSwapchain(int width, int height, +@@ -303,27 +321,27 @@ bool VulkanWindowContext::createSwapchain(int width, int height, swapchainCreateInfo.clipped = true; swapchainCreateInfo.oldSwapchain = fSwapchain; @@ -240,7 +488,7 @@ index d07d5a4274..2b36d60076 100644 } return true; -@@ -339,10 +356,10 @@ bool VulkanWindowContext::createSwapchain(int width, int height, +@@ -332,10 +350,10 @@ bool VulkanWindowContext::createSwapchain(int width, int height, bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usageFlags, SkColorType colorType, VkSharingMode sharingMode) { @@ -253,7 +501,7 @@ index d07d5a4274..2b36d60076 100644 // set up initial image layouts and create surfaces fImageLayouts = new VkImageLayout[fImageCount]; -@@ -358,7 +375,7 @@ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usage +@@ -351,7 +369,7 @@ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usage info.fFormat = format; info.fImageUsageFlags = usageFlags; info.fLevelCount = 1; @@ -262,7 +510,7 @@ index d07d5a4274..2b36d60076 100644 info.fSharingMode = sharingMode; if (usageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { -@@ -394,8 +411,8 @@ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usage +@@ -387,8 +405,8 @@ bool VulkanWindowContext::createBuffers(VkFormat format, VkImageUsageFlags usage fBackbuffers = new BackbufferInfo[fImageCount + 1]; for (uint32_t i = 0; i < fImageCount + 1; ++i) { fBackbuffers[i].fImageIndex = -1; @@ -273,7 +521,7 @@ index d07d5a4274..2b36d60076 100644 &fBackbuffers[i].fRenderSemaphore)); SkASSERT(result == VK_SUCCESS); } -@@ -408,8 +425,8 @@ void VulkanWindowContext::destroyBuffers() { +@@ -401,8 +419,8 @@ void VulkanWindowContext::destroyBuffers() { if (fBackbuffers) { for (uint32_t i = 0; i < fImageCount + 1; ++i) { fBackbuffers[i].fImageIndex = -1; @@ -284,7 +532,7 @@ index d07d5a4274..2b36d60076 100644 fBackbuffers[i].fRenderSemaphore, nullptr)); } -@@ -434,42 +451,59 @@ VulkanWindowContext::~VulkanWindowContext() { +@@ -427,42 +445,59 @@ VulkanWindowContext::~VulkanWindowContext() { void VulkanWindowContext::destroyContext() { if (this->isValid()) { fQueueWaitIdle(fPresentQueue); @@ -358,7 +606,7 @@ index d07d5a4274..2b36d60076 100644 } VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer() { -@@ -495,35 +529,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() { +@@ -488,35 +523,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() { semaphoreInfo.pNext = nullptr; semaphoreInfo.flags = 0; VkSemaphore semaphore; @@ -400,16 +648,16 @@ index d07d5a4274..2b36d60076 100644 return nullptr; } } -@@ -549,7 +583,7 @@ void VulkanWindowContext::swapBuffers() { +@@ -547,7 +582,7 @@ void VulkanWindowContext::swapBuffers() { GrFlushInfo info; info.fNumSemaphores = 1; info.fSignalSemaphores = &beSemaphore; -- GrBackendSurfaceMutableState presentState(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, fPresentQueueIndex); -+ GrBackendSurfaceMutableState presentState(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, fShared->fPresentQueueIndex); - surface->flush(info, &presentState); - surface->recordingContext()->asDirectContext()->submit(); - -@@ -569,4 +603,6 @@ void VulkanWindowContext::swapBuffers() { +- skgpu::MutableTextureState presentState(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, fPresentQueueIndex); ++ skgpu::MutableTextureState presentState(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, fShared->fPresentQueueIndex); + auto dContext = surface->recordingContext()->asDirectContext(); + dContext->flush(surface, info, &presentState); + dContext->submit(); +@@ -562,4 +597,6 @@ void VulkanWindowContext::swapBuffers() { fQueuePresentKHR(fPresentQueue, &presentInfo); } @@ -417,10 +665,10 @@ index d07d5a4274..2b36d60076 100644 + } //namespace sk_app diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h -index 580dba2733..16f6b3fd51 100644 +index 7e1fdd9af5..946bca7522 100644 --- a/tools/sk_app/VulkanWindowContext.h +++ b/tools/sk_app/VulkanWindowContext.h -@@ -19,18 +19,38 @@ +@@ -16,19 +16,23 @@ #include "tools/gpu/vk/VkTestUtils.h" #include "tools/sk_app/WindowContext.h" @@ -428,42 +676,27 @@ index 580dba2733..16f6b3fd51 100644 + class GrRenderTarget; + namespace skgpu { struct VulkanInterface; } + namespace sk_app { -class VulkanWindowContext : public WindowContext { +class SK_API VulkanWindowContext : public WindowContext { -+ struct Shared; public: ~VulkanWindowContext() override; -+ class SharedGrDirectContext { -+ public: -+ SharedGrDirectContext() {} -+ GrDirectContext* getGrDirectContext() { return shared ? shared->fContext.get() : nullptr; } -+ ~SharedGrDirectContext() { shared.reset(); checkDestroyShared(); } -+ SharedGrDirectContext(SharedGrDirectContext const &) = default; -+ SharedGrDirectContext & operator =(SharedGrDirectContext const &) = default; -+ bool operator!() const { return !shared; } -+ void reset() { shared.reset(); } -+ private: -+ friend class VulkanWindowContext; -+ SharedGrDirectContext(sk_sp<Shared>& sh ) : shared( sh ) {} -+ sk_sp<Shared> shared; -+ }; -+ -+ static SharedGrDirectContext getSharedGrDirectContext() { return SharedGrDirectContext( fGlobalShared ); } ++ static GrDirectContext* getSharedGrDirectContext() { return fGlobalShared ? fGlobalShared->fContext.get() : nullptr; } + sk_sp<SkSurface> getBackbufferSurface() override; - void swapBuffers() override; - bool isValid() override { return fDevice != VK_NULL_HANDLE; } + bool isValid() override { return fSurface != VK_NULL_HANDLE; } void resize(int w, int h) override { this->createSwapchain(w, h, fDisplayParams); -@@ -50,9 +70,15 @@ public: +@@ -50,9 +54,15 @@ public: VulkanWindowContext(const DisplayParams&, CreateVkSurfaceFn, CanPresentFn, - PFN_vkGetInstanceProcAddr, PFN_vkGetDeviceProcAddr); + PFN_vkGetInstanceProcAddr); + static const VkPhysicalDeviceProperties& getPhysDeviceProperties() { + assert( fGlobalShared != nullptr ); @@ -477,9 +710,9 @@ index 580dba2733..16f6b3fd51 100644 struct BackbufferInfo { uint32_t fImageIndex; // image this is associated with -@@ -64,11 +90,6 @@ private: - bool createBuffers(VkFormat format, VkImageUsageFlags, SkColorType colorType, VkSharingMode); +@@ -64,11 +74,6 @@ private: void destroyBuffers(); + void onSwapBuffers() override; - VkInstance fInstance = VK_NULL_HANDLE; - VkPhysicalDevice fPhysicalDevice = VK_NULL_HANDLE; @@ -489,7 +722,7 @@ index 580dba2733..16f6b3fd51 100644 // Create functions CreateVkSurfaceFn fCreateVkSurfaceFn; CanPresentFn fCanPresentFn; -@@ -90,20 +111,44 @@ private: +@@ -88,20 +93,46 @@ private: PFN_vkAcquireNextImageKHR fAcquireNextImageKHR = nullptr; PFN_vkQueuePresentKHR fQueuePresentKHR = nullptr; @@ -512,7 +745,7 @@ index 580dba2733..16f6b3fd51 100644 + VkDevice fDevice = VK_NULL_HANDLE; + VkDebugReportCallbackEXT fDebugCallback = VK_NULL_HANDLE; + - sk_sp<const GrVkInterface> fInterface; + sk_sp<const skgpu::VulkanInterface> fInterface; - VkSurfaceKHR fSurface; - VkSwapchainKHR fSwapchain; @@ -523,6 +756,8 @@ index 580dba2733..16f6b3fd51 100644 + // Store this to make it accessible. + VkPhysicalDeviceProperties physDeviceProperties; + ++ GrVkBackendContext backendContext; ++ uint32_t fGraphicsQueueIndex; VkQueue fGraphicsQueue; uint32_t fPresentQueueIndex; @@ -540,7 +775,7 @@ index 580dba2733..16f6b3fd51 100644 uint32_t fImageCount; diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h -index 0fec5e7366..1d62cea433 100644 +index 65ab8b9aa4..2d222385a3 100644 --- a/tools/sk_app/WindowContext.h +++ b/tools/sk_app/WindowContext.h @@ -10,9 +10,9 @@ @@ -552,10 +787,30 @@ index 0fec5e7366..1d62cea433 100644 -class GrDirectContext; class SkSurface; + #if defined(SK_GRAPHITE) + namespace skgpu::graphite { +diff --git a/tools/sk_app/mac/MetalWindowContext_mac.mm b/tools/sk_app/mac/MetalWindowContext_mac.mm +index 5bea8578fa..f7df061af0 100644 +--- a/tools/sk_app/mac/MetalWindowContext_mac.mm ++++ b/tools/sk_app/mac/MetalWindowContext_mac.mm +@@ -49,10 +49,14 @@ MetalWindowContext_mac::~MetalWindowContext_mac() { + } - namespace sk_app { + bool MetalWindowContext_mac::onInitializeContext() { ++ // Allow creating just the shared context, without an associated window. ++ if(fMainView == nil) ++ return true; ++ + SkASSERT(nil != fMainView); + + fMetalLayer = [CAMetalLayer layer]; +- fMetalLayer.device = fDevice.get(); ++ fMetalLayer.device = fShared->fDevice.get(); + fMetalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; + + // resize ignores the passed values and uses the fMainView directly. diff --git a/tools/sk_app/unix/VulkanWindowContext_unix.cpp b/tools/sk_app/unix/VulkanWindowContext_unix.cpp -index 34f6640c76..5478b75dac 100644 +index 2b31fedc19..0c05fbfc92 100644 --- a/tools/sk_app/unix/VulkanWindowContext_unix.cpp +++ b/tools/sk_app/unix/VulkanWindowContext_unix.cpp @@ -30,7 +30,7 @@ std::unique_ptr<WindowContext> MakeVulkanForXlib(const XlibWindowInfo& info, @@ -580,17 +835,17 @@ index 34f6640c76..5478b75dac 100644 @@ -76,7 +79,7 @@ std::unique_ptr<WindowContext> MakeVulkanForXlib(const XlibWindowInfo& info, }; std::unique_ptr<WindowContext> ctx( - new VulkanWindowContext(displayParams, createVkSurface, canPresent, instProc, devProc)); + new VulkanWindowContext(displayParams, createVkSurface, canPresent, instProc)); - if (!ctx->isValid()) { + if (!ctx->isValid() && createVkSurface != nullptr) { return nullptr; } return ctx; diff --git a/tools/sk_app/win/VulkanWindowContext_win.cpp b/tools/sk_app/win/VulkanWindowContext_win.cpp -index 909c96127b..35e063ae28 100644 +index 976c42556e..c8f6b162bf 100644 --- a/tools/sk_app/win/VulkanWindowContext_win.cpp +++ b/tools/sk_app/win/VulkanWindowContext_win.cpp -@@ -30,7 +30,7 @@ std::unique_ptr<WindowContext> MakeVulkanForWin(HWND hwnd, const DisplayParams& +@@ -29,7 +29,7 @@ std::unique_ptr<WindowContext> MakeVulkanForWin(HWND hwnd, const DisplayParams& return nullptr; } @@ -599,7 +854,7 @@ index 909c96127b..35e063ae28 100644 static PFN_vkCreateWin32SurfaceKHR createWin32SurfaceKHR = nullptr; if (!createWin32SurfaceKHR) { createWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR) -@@ -54,6 +54,9 @@ std::unique_ptr<WindowContext> MakeVulkanForWin(HWND hwnd, const DisplayParams& +@@ -53,6 +53,9 @@ std::unique_ptr<WindowContext> MakeVulkanForWin(HWND hwnd, const DisplayParams& return surface; }; @@ -609,10 +864,10 @@ index 909c96127b..35e063ae28 100644 auto canPresent = [instProc] (VkInstance instance, VkPhysicalDevice physDev, uint32_t queueFamilyIndex) { -@@ -71,7 +74,7 @@ std::unique_ptr<WindowContext> MakeVulkanForWin(HWND hwnd, const DisplayParams& +@@ -70,7 +73,7 @@ std::unique_ptr<WindowContext> MakeVulkanForWin(HWND hwnd, const DisplayParams& std::unique_ptr<WindowContext> ctx( - new VulkanWindowContext(params, createVkSurface, canPresent, instProc, devProc)); + new VulkanWindowContext(params, createVkSurface, canPresent, instProc)); - if (!ctx->isValid()) { + if (!ctx->isValid() && createVkSurface != nullptr) { return nullptr; diff --git a/external/skia/skia_sk_cpu_sse_level_0_by_default.patch.1 b/external/skia/skia_sk_cpu_sse_level_0_by_default.patch.1 deleted file mode 100644 index f2259a318544..000000000000 --- a/external/skia/skia_sk_cpu_sse_level_0_by_default.patch.1 +++ /dev/null @@ -1,15 +0,0 @@ -diff -ur skia.org/include/core/SkTypes.h skia/include/core/SkTypes.h ---- skia.org/include/core/SkTypes.h 2021-01-10 12:37:19.016176437 +0100 -+++ skia/include/core/SkTypes.h 2021-01-10 12:43:29.155312067 +0100 -@@ -153,6 +153,11 @@ - #endif - #endif - -+// So let's initialize SK_CPU_SSE_LEVEL to 0 by default -+#ifndef SK_CPU_SSE_LEVEL -+ #define SK_CPU_SSE_LEVEL 0 -+#endif -+ - // ARM defines - #if defined(__arm__) && (!defined(__APPLE__) || !TARGET_IPHONE_SIMULATOR) - #define SK_CPU_ARM32 diff --git a/external/skia/sort-comparison-assumption.patch.0 b/external/skia/sort-comparison-assumption.patch.0 new file mode 100644 index 000000000000..b23ae0418123 --- /dev/null +++ b/external/skia/sort-comparison-assumption.patch.0 @@ -0,0 +1,16 @@ +--- src/sksl/transform/SkSLFindAndDeclareBuiltinVariables.cpp ++++ src/sksl/transform/SkSLFindAndDeclareBuiltinVariables.cpp +@@ -105,11 +105,11 @@ + } + switch (a->kind()) { + case ProgramElement::Kind::kGlobalVar: +- SkASSERT(GlobalVarBuiltinName(*a) != GlobalVarBuiltinName(*b)); ++ SkASSERT(GlobalVarBuiltinName(*a) != GlobalVarBuiltinName(*b) || a == b); + return GlobalVarBuiltinName(*a) < GlobalVarBuiltinName(*b); + + case ProgramElement::Kind::kInterfaceBlock: +- SkASSERT(InterfaceBlockName(*a) != InterfaceBlockName(*b)); ++ SkASSERT(InterfaceBlockName(*a) != InterfaceBlockName(*b) || a == b); + return InterfaceBlockName(*a) < InterfaceBlockName(*b); + + default: diff --git a/external/skia/source/SkMemory_malloc.cxx b/external/skia/source/SkMemory_malloc.cxx index 9e2da3c20023..d1f0cd3f6b98 100644 --- a/external/skia/source/SkMemory_malloc.cxx +++ b/external/skia/source/SkMemory_malloc.cxx @@ -4,7 +4,7 @@ */ #include "include/core/SkTypes.h" -#include "include/private/SkMalloc.h" +#include "include/private/base/SkMalloc.h" #include <sal/log.hxx> #include <rtl/alloc.h> diff --git a/external/skia/source/skia_opts.cxx b/external/skia/source/skia_opts.cxx index 9bfe04e14459..7c2dace6d5f0 100644 --- a/external/skia/source/skia_opts.cxx +++ b/external/skia/source/skia_opts.cxx @@ -5,6 +5,8 @@ #include <skia_opts.hxx> +#include "include/private/base/SkOnce.h" + #if defined __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" diff --git a/external/skia/source/skia_opts_internal.hxx b/external/skia/source/skia_opts_internal.hxx index 1f46ee72eb4a..0ca6a04351d2 100644 --- a/external/skia/source/skia_opts_internal.hxx +++ b/external/skia/source/skia_opts_internal.hxx @@ -52,15 +52,13 @@ inline void RGB1_to_R(uint8_t dst[], const uint32_t* src, int count) { const uint8_t X = 0xFF; // Used a placeholder. The value of X is irrelevant. __m128i pack = _mm_setr_epi8(0,4,8,12, X,X,X,X,X,X,X,X,X,X,X,X); -// Storing 4 pixels should store 4 bytes, but here it stores 16, so test count >= 16 -// in order to not overrun the output buffer. - while (count >= 16) { + while (count >= 4) { __m128i rgba = _mm_loadu_si128((const __m128i*) src); __m128i rgb = _mm_shuffle_epi8(rgba, pack); // Store 4 pixels. - _mm_storeu_si128((__m128i*) dst, rgb); + *((uint32_t*)dst) = _mm_cvtsi128_si32(rgb); src += 4; dst += 4; diff --git a/external/skia/swap-buffers-rect.patch.1 b/external/skia/swap-buffers-rect.patch.1 index d04ea91c0bc9..7ccfaca3d042 100644 --- a/external/skia/swap-buffers-rect.patch.1 +++ b/external/skia/swap-buffers-rect.patch.1 @@ -1,73 +1,49 @@ -diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp -index 66670c892e..3a6804166f 100644 ---- a/tools/sk_app/VulkanWindowContext.cpp -+++ b/tools/sk_app/VulkanWindowContext.cpp -@@ -553,7 +553,7 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() { - return sk_ref_sp(surface); - } +diff -ur skia.org/tools/sk_app/MetalWindowContext.h skia/tools/sk_app/MetalWindowContext.h +--- skia.org/tools/sk_app/MetalWindowContext.h 2023-07-08 21:49:27.179700423 +0200 ++++ skia/tools/sk_app/MetalWindowContext.h 2023-07-08 21:51:53.416328675 +0200 +@@ -51,7 +51,7 @@ --void VulkanWindowContext::swapBuffers() { -+void VulkanWindowContext::swapBuffers(const SkIRect*) { + static void checkDestroyShared(); - BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex; - SkSurface* surface = fSurfaces[backbuffer->fImageIndex].get(); -diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h -index 07a18a46a9..aa6f95e2a1 100644 ---- a/tools/sk_app/VulkanWindowContext.h -+++ b/tools/sk_app/VulkanWindowContext.h -@@ -48,7 +48,7 @@ public: - static SharedGrDirectContext getSharedGrDirectContext() { return SharedGrDirectContext( fGlobalShared ); } - - sk_sp<SkSurface> getBackbufferSurface() override; -- void swapBuffers() override; -+ void swapBuffers(const SkIRect* rect = nullptr) override; - - bool isValid() override { return fSurface != VK_NULL_HANDLE; } - -diff --git a/tools/sk_app/WindowContext.h b/tools/sk_app/WindowContext.h -index 6920e5ba89..219330a61b 100644 ---- a/tools/sk_app/WindowContext.h -+++ b/tools/sk_app/WindowContext.h -@@ -8,6 +8,7 @@ - #define WindowContext_DEFINED - - #include "include/core/SkRefCnt.h" -+#include "include/core/SkRect.h" - #include "include/core/SkSurfaceProps.h" - #include "include/gpu/GrTypes.h" - #include "include/gpu/GrDirectContext.h" -@@ -29,7 +30,7 @@ public: +- void onSwapBuffers() override; ++ void onSwapBuffers(const SkIRect* rect = nullptr) override; - virtual sk_sp<SkSurface> getBackbufferSurface() = 0; + bool fValid; -- virtual void swapBuffers() = 0; -+ virtual void swapBuffers(const SkIRect* rect = nullptr) = 0; +diff -ur skia.org/tools/sk_app/MetalWindowContext.mm skia/tools/sk_app/MetalWindowContext.mm +--- skia.org/tools/sk_app/MetalWindowContext.mm 2023-07-08 21:49:27.179700423 +0200 ++++ skia/tools/sk_app/MetalWindowContext.mm 2023-07-08 21:52:10.064396318 +0200 +@@ -191,7 +191,7 @@ + return surface; + } - virtual bool isValid() = 0; +-void MetalWindowContext::onSwapBuffers() { ++void MetalWindowContext::onSwapBuffers(const SkIRect*) { + id<CAMetalDrawable> currentDrawable = (id<CAMetalDrawable>)fDrawableHandle; -diff --git a/tools/sk_app/unix/RasterWindowContext_unix.cpp b/tools/sk_app/unix/RasterWindowContext_unix.cpp -index e8ae942308..fc06b40069 100644 ---- a/tools/sk_app/unix/RasterWindowContext_unix.cpp -+++ b/tools/sk_app/unix/RasterWindowContext_unix.cpp -@@ -19,7 +19,7 @@ public: - RasterWindowContext_xlib(Display*, XWindow, int width, int height, const DisplayParams&); - - sk_sp<SkSurface> getBackbufferSurface() override; -- void swapBuffers() override; -+ void swapBuffers(const SkIRect* rect) override; - bool isValid() override { return SkToBool(fWindow); } - void resize(int w, int h) override; + id<MTLCommandBuffer> commandBuffer([*fShared->fQueue commandBuffer]); +diff -ur skia.org/tools/sk_app/unix/RasterWindowContext_unix.cpp skia/tools/sk_app/unix/RasterWindowContext_unix.cpp +--- skia.org/tools/sk_app/unix/RasterWindowContext_unix.cpp 2023-07-08 21:49:27.183700444 +0200 ++++ skia/tools/sk_app/unix/RasterWindowContext_unix.cpp 2023-07-08 21:54:06.840852252 +0200 +@@ -24,7 +24,7 @@ void setDisplayParams(const DisplayParams& params) override; -@@ -60,7 +60,7 @@ void RasterWindowContext_xlib::resize(int w, int h) { + + protected: +- void onSwapBuffers() override; ++ void onSwapBuffers(const SkIRect* rect = nullptr) override; + + sk_sp<SkSurface> fBackbufferSurface; + Display* fDisplay; +@@ -58,7 +58,7 @@ sk_sp<SkSurface> RasterWindowContext_xlib::getBackbufferSurface() { return fBackbufferSurface; } --void RasterWindowContext_xlib::swapBuffers() { -+void RasterWindowContext_xlib::swapBuffers(const SkIRect* rect) { +-void RasterWindowContext_xlib::onSwapBuffers() { ++void RasterWindowContext_xlib::onSwapBuffers(const SkIRect* rect) { SkPixmap pm; if (!fBackbufferSurface->peekPixels(&pm)) { return; -@@ -82,7 +82,9 @@ void RasterWindowContext_xlib::swapBuffers() { +@@ -80,7 +80,9 @@ if (!XInitImage(&image)) { return; } @@ -78,31 +54,54 @@ index e8ae942308..fc06b40069 100644 } } // anonymous namespace -diff --git a/tools/sk_app/win/RasterWindowContext_win.cpp b/tools/sk_app/win/RasterWindowContext_win.cpp -index 49f1f9ed17..f0db1f6f06 100644 ---- a/tools/sk_app/win/RasterWindowContext_win.cpp -+++ b/tools/sk_app/win/RasterWindowContext_win.cpp -@@ -22,7 +22,7 @@ public: - RasterWindowContext_win(HWND, const DisplayParams&); - - sk_sp<SkSurface> getBackbufferSurface() override; -- void swapBuffers() override; -+ void swapBuffers(const SkIRect* rect) override; - bool isValid() override { return SkToBool(fWnd); } - void resize(int w, int h) override; +diff -ur skia.org/tools/sk_app/VulkanWindowContext.cpp skia/tools/sk_app/VulkanWindowContext.cpp +--- skia.org/tools/sk_app/VulkanWindowContext.cpp 2023-07-08 21:49:27.179700423 +0200 ++++ skia/tools/sk_app/VulkanWindowContext.cpp 2023-07-08 21:52:53.676570245 +0200 +@@ -572,7 +572,7 @@ + return sk_ref_sp(surface); + } + +-void VulkanWindowContext::onSwapBuffers() { ++void VulkanWindowContext::onSwapBuffers(const SkIRect*) { + + BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex; + sk_sp<SkSurface> surface = fSurfaces[backbuffer->fImageIndex]; +diff -ur skia.org/tools/sk_app/VulkanWindowContext.h skia/tools/sk_app/VulkanWindowContext.h +--- skia.org/tools/sk_app/VulkanWindowContext.h 2023-07-08 21:49:27.179700423 +0200 ++++ skia/tools/sk_app/VulkanWindowContext.h 2023-07-08 21:52:34.580494658 +0200 +@@ -71,7 +71,7 @@ + bool createSwapchain(int width, int height, const DisplayParams& params); + bool createBuffers(VkFormat format, VkImageUsageFlags, SkColorType colorType, VkSharingMode); + void destroyBuffers(); +- void onSwapBuffers() override; ++ void onSwapBuffers(const SkIRect* rect = nullptr) override; + + // Create functions + CreateVkSurfaceFn fCreateVkSurfaceFn; +diff -ur skia.org/tools/sk_app/win/RasterWindowContext_win.cpp skia/tools/sk_app/win/RasterWindowContext_win.cpp +--- skia.org/tools/sk_app/win/RasterWindowContext_win.cpp 2023-07-08 21:49:27.183700444 +0200 ++++ skia/tools/sk_app/win/RasterWindowContext_win.cpp 2023-07-08 21:55:26.169145828 +0200 +@@ -27,7 +27,7 @@ void setDisplayParams(const DisplayParams& params) override; -@@ -75,13 +75,17 @@ void RasterWindowContext_win::resize(int w, int h) { + + protected: +- void onSwapBuffers() override; ++ void onSwapBuffers(const SkIRect* rect=nullptr) override; + + SkAutoMalloc fSurfaceMemory; + sk_sp<SkSurface> fBackbufferSurface; +@@ -73,13 +73,17 @@ sk_sp<SkSurface> RasterWindowContext_win::getBackbufferSurface() { return fBackbufferSurface; } --void RasterWindowContext_win::swapBuffers() { -+void RasterWindowContext_win::swapBuffers(const SkIRect* rect) { +-void RasterWindowContext_win::onSwapBuffers() { ++void RasterWindowContext_win::onSwapBuffers(const SkIRect* rect) { BITMAPINFO* bmpInfo = reinterpret_cast<BITMAPINFO*>(fSurfaceMemory.get()); HDC dc = GetDC(fWnd); SkPixmap pixmap; fBackbufferSurface->peekPixels(&pixmap); - StretchDIBits(dc, 0, 0, fWidth, fHeight, 0, 0, fWidth, fHeight, pixmap.addr(), bmpInfo, -- DIB_RGB_COLORS, SRCCOPY); +- DIB_RGB_COLORS, SRCCOPY); + SkIRect update = rect ? *rect : SkIRect::MakeWH( fWidth, fHeight ); + // It appears that y-axis handling is broken if it doesn't match the window size. + update = SkIRect::MakeXYWH( update.x(), 0, update.width(), fHeight ); @@ -112,3 +111,45 @@ index 49f1f9ed17..f0db1f6f06 100644 ReleaseDC(fWnd, dc); } +diff -ur skia.org/tools/sk_app/WindowContext.cpp skia/tools/sk_app/WindowContext.cpp +--- skia.org/tools/sk_app/WindowContext.cpp 2023-07-08 21:49:27.179700423 +0200 ++++ skia/tools/sk_app/WindowContext.cpp 2023-07-08 21:56:23.373350669 +0200 +@@ -20,7 +20,7 @@ + + WindowContext::~WindowContext() {} + +-void WindowContext::swapBuffers() { ++void WindowContext::swapBuffers(const SkIRect* rect) { + #if defined(SK_GRAPHITE) + if (fGraphiteContext) { + SkASSERT(fGraphiteRecorder); +@@ -33,7 +33,7 @@ + } + } + #endif +- this->onSwapBuffers(); ++ this->onSwapBuffers(rect); + } + + } //namespace sk_app +diff -ur skia.org/tools/sk_app/WindowContext.h skia/tools/sk_app/WindowContext.h +--- skia.org/tools/sk_app/WindowContext.h 2023-07-08 21:49:27.179700423 +0200 ++++ skia/tools/sk_app/WindowContext.h 2023-07-08 21:51:08.804143750 +0200 +@@ -31,7 +31,7 @@ + + virtual sk_sp<SkSurface> getBackbufferSurface() = 0; + +- void swapBuffers(); ++ void swapBuffers(const SkIRect* rect = nullptr); + + virtual bool isValid() = 0; + +@@ -57,7 +57,7 @@ + protected: + virtual bool isGpuContext() { return true; } + +- virtual void onSwapBuffers() = 0; ++ virtual void onSwapBuffers(const SkIRect* rect = nullptr) = 0; + + sk_sp<GrDirectContext> fContext; + #if defined(SK_GRAPHITE) diff --git a/external/skia/tdf147342.patch.0 b/external/skia/tdf147342.patch.0 new file mode 100644 index 000000000000..3b50038c07ac --- /dev/null +++ b/external/skia/tdf147342.patch.0 @@ -0,0 +1,110 @@ +--- tools/sk_app/mac/WindowContextFactory_mac.h 2022-02-16 06:03:39.000000000 -0500 ++++ tools/sk_app/mac/WindowContextFactory_mac.h 2023-01-25 08:09:00.000000000 -0500 +@@ -19,15 +19,8 @@ + + struct DisplayParams; + +-static inline CGFloat GetBackingScaleFactor(NSView* view) { +- #ifdef SK_BUILD_FOR_IOS +- UIScreen* screen = view.window.screen ?: [UIScreen mainScreen]; +- return screen.nativeScale; +- #else +- NSScreen* screen = view.window.screen ?: [NSScreen mainScreen]; +- return screen.backingScaleFactor; +- #endif +-} ++SK_API CGFloat GetBackingScaleFactor(NSView* view); ++SK_API void ResetBackingScaleFactor(); + + namespace window_context_factory { + +--- tools/sk_app/mac/MetalWindowContext_mac.mm 2021-11-25 10:39:27.000000000 -0500 ++++ tools/sk_app/mac/MetalWindowContext_mac.mm 2023-01-28 14:55:57.000000000 -0500 +@@ -11,6 +11,8 @@ + #import <Cocoa/Cocoa.h> + #import <QuartzCore/CAConstraintLayoutManager.h> + ++#include <sal/log.hxx> ++ + using sk_app::DisplayParams; + using sk_app::window_context_factory::MacWindowInfo; + using sk_app::MetalWindowContext; +@@ -87,6 +89,18 @@ + fMetalLayer.drawableSize = backingSize; + fMetalLayer.contentsScale = backingScaleFactor; + ++ // Related: tdf#147342 Copy layer's colorspace to window's colorspace ++ // This method is now called when the window's backing properties have ++ // changed so copy any colorspace changes. ++ NSColorSpace* cs = fMainView.window.colorSpace; ++ fMetalLayer.colorspace = cs.CGColorSpace; ++ // Related tdf#145988 Reset layer's pixel format to MTLPixelFormatBGRA8Unorm ++ // Skia initally sets the layer's pixel format to be BGRA8888 but macOS ++ // may change the layer's pixel format when a window has moved to a screen ++ // with 30-bit color depth so reset it back to BGRA8888. ++ SAL_WARN_IF(fMetalLayer.pixelFormat != MTLPixelFormatBGRA8Unorm, "vcl.skia.metal", "CAMetalLayer pixel format is " << fMetalLayer.pixelFormat << " but should be " << MTLPixelFormatBGRA8Unorm << " (MTLPixelFormatBGRA8Unorm)"); ++ fMetalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; ++ + fWidth = backingSize.width; + fHeight = backingSize.height; + } +--- /dev/null 2023-01-25 09:20:55.000000000 -0500 ++++ tools/sk_app/mac/WindowContextFactory_mac.mm 2023-01-25 09:21:22.000000000 -0500 +@@ -0,0 +1,57 @@ ++/* ++ * Use of this source code is governed by a BSD-style license that can be ++ * found in the LICENSE file. ++ */ ++ ++#include "tools/sk_app/mac/WindowContextFactory_mac.h" ++ ++namespace sk_app { ++ ++static bool bWindowScaling = false; ++static float fWindowScale = 1.0f; ++ ++CGFloat GetBackingScaleFactor(NSView* view) { ++ #ifdef SK_BUILD_FOR_IOS ++ UIScreen* screen = view.window.screen ?: [UIScreen mainScreen]; ++ return screen.nativeScale; ++ #else ++ // Related: tdf#147342 This should always be an exact copy of the ++ // sal::aqua::getWindowScaling() function in the following file: ++ // vcl/osx/salgdiutils.cxx ++ (void)view; ++ ++ if (!bWindowScaling) ++ { ++ NSArray *aScreens = [NSScreen screens]; ++ if (aScreens) ++ { ++ for (NSScreen *aScreen : aScreens) ++ { ++ float fScale = [aScreen backingScaleFactor]; ++ if (fScale > fWindowScale) ++ fWindowScale = fScale; ++ } ++ bWindowScaling = true; ++ } ++ if( const char* env = getenv("SAL_FORCE_HIDPI_SCALING")) ++ { ++ fWindowScale = atof(env); ++ bWindowScaling = true; ++ } ++ } ++ return fWindowScale; ++ #endif ++} ++ ++void ResetBackingScaleFactor() { ++ #ifndef SK_BUILD_FOR_IOS ++ // Related: tdf#147342 Force recalculation of the window scaling but keep ++ // the previous window scaling as the minimum so that we don't lose the ++ // resolution in cached images if a HiDPI monitor is disconnected and ++ // then reconnected. ++ bWindowScaling = false; ++ GetBackingScaleFactor(nil); ++ #endif ++} ++ ++} // namespace sk_app diff --git a/external/skia/ubsan-missing-typeinfo.patch.1 b/external/skia/ubsan-missing-typeinfo.patch.1 new file mode 100644 index 000000000000..3e88bc0cc491 --- /dev/null +++ b/external/skia/ubsan-missing-typeinfo.patch.1 @@ -0,0 +1,12 @@ +diff -ur skia.org/src/image/SkImage_Base.h skia/src/image/SkImage_Base.h +--- skia.org/src/image/SkImage_Base.h 2023-07-12 10:59:47.006358109 +0200 ++++ skia/src/image/SkImage_Base.h 2023-07-12 11:15:00.028292134 +0200 +@@ -44,7 +44,7 @@ + + namespace skgpu { namespace graphite { class Recorder; } } + +-class SkImage_Base : public SkImage { ++class SK_API SkImage_Base : public SkImage { + public: + ~SkImage_Base() override; + diff --git a/external/skia/ubsan.patch.0 b/external/skia/ubsan.patch.0 deleted file mode 100644 index c249b02f3f14..000000000000 --- a/external/skia/ubsan.patch.0 +++ /dev/null @@ -1,32 +0,0 @@ ---- include/private/GrContext_Base.h -+++ include/private/GrContext_Base.h -@@ -20,7 +20,7 @@ - class GrImageContext; - class GrRecordingContext; - --class GrContext_Base : public SkRefCnt { -+class SK_API GrContext_Base : public SkRefCnt { - public: - ~GrContext_Base() override; - -@@ -32,7 +32,7 @@ - /* - * The 3D API backing this context - */ -- SK_API GrBackendApi backend() const; -+ GrBackendApi backend() const; - - /* - * Retrieve the default GrBackendFormat for a given SkColorType and renderability. -@@ -41,9 +41,9 @@ - * - * The caller should check that the returned format is valid. - */ -- SK_API GrBackendFormat defaultBackendFormat(SkColorType, GrRenderable) const; -+ GrBackendFormat defaultBackendFormat(SkColorType, GrRenderable) const; - -- SK_API GrBackendFormat compressedBackendFormat(SkImage::CompressionType) const; -+ GrBackendFormat compressedBackendFormat(SkImage::CompressionType) const; - - // TODO: When the public version is gone, rename to refThreadSafeProxy and add raw ptr ver. - sk_sp<GrContextThreadSafeProxy> threadSafeProxy(); diff --git a/external/skia/ubsan.patch.1 b/external/skia/ubsan.patch.1 new file mode 100644 index 000000000000..8d422fb428e0 --- /dev/null +++ b/external/skia/ubsan.patch.1 @@ -0,0 +1,42 @@ +diff --git a/include/private/gpu/ganesh/GrContext_Base.h b/include/private/gpu/ganesh/GrContext_Base.h +index 847e76f232..e27d9454f8 100644 +--- a/include/private/gpu/ganesh/GrContext_Base.h ++++ b/include/private/gpu/ganesh/GrContext_Base.h +@@ -20,7 +20,7 @@ class GrDirectContext; + struct GrContextOptions; + class GrBackendFormat; + +-class GrContext_Base : public SkRefCnt { ++class SK_API GrContext_Base : public SkRefCnt { + public: + ~GrContext_Base() override; + +@@ -32,7 +32,7 @@ public: + /* + * The 3D API backing this context + */ +- SK_API GrBackendApi backend() const; ++ GrBackendApi backend() const; + + /* + * Retrieve the default GrBackendFormat for a given SkColorType and renderability. +@@ -41,16 +41,16 @@ public: + * + * The caller should check that the returned format is valid. + */ +- SK_API GrBackendFormat defaultBackendFormat(SkColorType, GrRenderable) const; ++ GrBackendFormat defaultBackendFormat(SkColorType, GrRenderable) const; + +- SK_API GrBackendFormat compressedBackendFormat(SkTextureCompressionType) const; ++ GrBackendFormat compressedBackendFormat(SkTextureCompressionType) const; + + /** + * Gets the maximum supported sample count for a color type. 1 is returned if only non-MSAA + * rendering is supported for the color type. 0 is returned if rendering to this color type + * is not supported at all. + */ +- SK_API int maxSurfaceSampleCountForColorType(SkColorType colorType) const; ++ int maxSurfaceSampleCountForColorType(SkColorType colorType) const; + + // TODO: When the public version is gone, rename to refThreadSafeProxy and add raw ptr ver. + sk_sp<GrContextThreadSafeProxy> threadSafeProxy(); diff --git a/external/skia/vk_mem_alloc.patch.1 b/external/skia/vk_mem_alloc.patch.1 new file mode 100644 index 000000000000..94f2504cbd52 --- /dev/null +++ b/external/skia/vk_mem_alloc.patch.1 @@ -0,0 +1,19639 @@ +diff --git a/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h b/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h +index 1c6212bd47..756175b4e7 100644 +--- a/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h ++++ b/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h +@@ -32,7 +32,7 @@ + #define VULKAN_H_ + #define GR_NEEDED_TO_DEFINE_VULKAN_H + #endif +-#include "vk_mem_alloc.h" ++#include "include/vk_mem_alloc.h" + #ifdef GR_NEEDED_TO_DEFINE_VULKAN_H + #undef VULKAN_H_ + #endif +diff --git a/third_party/vulkanmemoryallocator/include/LICENSE.txt b/third_party/vulkanmemoryallocator/include/LICENSE.txt +new file mode 100644 +index 0000000000..dbfe253391 +--- /dev/null ++++ b/third_party/vulkanmemoryallocator/include/LICENSE.txt +@@ -0,0 +1,19 @@ ++Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. ++ ++Permission is hereby granted, free of charge, to any person obtaining a copy ++of this software and associated documentation files (the "Software"), to deal ++in the Software without restriction, including without limitation the rights ++to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++copies of the Software, and to permit persons to whom the Software is ++furnished to do so, subject to the following conditions: ++ ++The above copyright notice and this permission notice shall be included in ++all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ++THE SOFTWARE. +diff --git a/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h b/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h +new file mode 100644 +index 0000000000..90410b56af +--- /dev/null ++++ b/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h +@@ -0,0 +1,19595 @@ ++//
++// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved.
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to deal
++// in the Software without restriction, including without limitation the rights
++// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++// copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in
++// all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++// THE SOFTWARE.
++//
++
++#ifndef AMD_VULKAN_MEMORY_ALLOCATOR_H
++#define AMD_VULKAN_MEMORY_ALLOCATOR_H
++
++/** \mainpage Vulkan Memory Allocator
++
++<b>Version 3.0.1-development (2022-03-28)</b>
++
++Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. \n
++License: MIT
++
++<b>API documentation divided into groups:</b> [Modules](modules.html)
++
++\section main_table_of_contents Table of contents
++
++- <b>User guide</b>
++ - \subpage quick_start
++ - [Project setup](@ref quick_start_project_setup)
++ - [Initialization](@ref quick_start_initialization)
++ - [Resource allocation](@ref quick_start_resource_allocation)
++ - \subpage choosing_memory_type
++ - [Usage](@ref choosing_memory_type_usage)
++ - [Required and preferred flags](@ref choosing_memory_type_required_preferred_flags)
++ - [Explicit memory types](@ref choosing_memory_type_explicit_memory_types)
++ - [Custom memory pools](@ref choosing_memory_type_custom_memory_pools)
++ - [Dedicated allocations](@ref choosing_memory_type_dedicated_allocations)
++ - \subpage memory_mapping
++ - [Mapping functions](@ref memory_mapping_mapping_functions)
++ - [Persistently mapped memory](@ref memory_mapping_persistently_mapped_memory)
++ - [Cache flush and invalidate](@ref memory_mapping_cache_control)
++ - \subpage staying_within_budget
++ - [Querying for budget](@ref staying_within_budget_querying_for_budget)
++ - [Controlling memory usage](@ref staying_within_budget_controlling_memory_usage)
++ - \subpage resource_aliasing
++ - \subpage custom_memory_pools
++ - [Choosing memory type index](@ref custom_memory_pools_MemTypeIndex)
++ - [Linear allocation algorithm](@ref linear_algorithm)
++ - [Free-at-once](@ref linear_algorithm_free_at_once)
++ - [Stack](@ref linear_algorithm_stack)
++ - [Double stack](@ref linear_algorithm_double_stack)
++ - [Ring buffer](@ref linear_algorithm_ring_buffer)
++ - \subpage defragmentation
++ - \subpage statistics
++ - [Numeric statistics](@ref statistics_numeric_statistics)
++ - [JSON dump](@ref statistics_json_dump)
++ - \subpage allocation_annotation
++ - [Allocation user data](@ref allocation_user_data)
++ - [Allocation names](@ref allocation_names)
++ - \subpage virtual_allocator
++ - \subpage debugging_memory_usage
++ - [Memory initialization](@ref debugging_memory_usage_initialization)
++ - [Margins](@ref debugging_memory_usage_margins)
++ - [Corruption detection](@ref debugging_memory_usage_corruption_detection)
++ - \subpage opengl_interop
++- \subpage usage_patterns
++ - [GPU-only resource](@ref usage_patterns_gpu_only)
++ - [Staging copy for upload](@ref usage_patterns_staging_copy_upload)
++ - [Readback](@ref usage_patterns_readback)
++ - [Advanced data uploading](@ref usage_patterns_advanced_data_uploading)
++ - [Other use cases](@ref usage_patterns_other_use_cases)
++- \subpage configuration
++ - [Pointers to Vulkan functions](@ref config_Vulkan_functions)
++ - [Custom host memory allocator](@ref custom_memory_allocator)
++ - [Device memory allocation callbacks](@ref allocation_callbacks)
++ - [Device heap memory limit](@ref heap_memory_limit)
++- <b>Extension support</b>
++ - \subpage vk_khr_dedicated_allocation
++ - \subpage enabling_buffer_device_address
++ - \subpage vk_ext_memory_priority
++ - \subpage vk_amd_device_coherent_memory
++- \subpage general_considerations
++ - [Thread safety](@ref general_considerations_thread_safety)
++ - [Versioning and compatibility](@ref general_considerations_versioning_and_compatibility)
++ - [Validation layer warnings](@ref general_considerations_validation_layer_warnings)
++ - [Allocation algorithm](@ref general_considerations_allocation_algorithm)
++ - [Features not supported](@ref general_considerations_features_not_supported)
++
++\section main_see_also See also
++
++- [**Product page on GPUOpen**](https://gpuopen.com/gaming-product/vulkan-memory-allocator/)
++- [**Source repository on GitHub**](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
++
++\defgroup group_init Library initialization
++
++\brief API elements related to the initialization and management of the entire library, especially #VmaAllocator object.
++
++\defgroup group_alloc Memory allocation
++
++\brief API elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images.
++Most basic ones being: vmaCreateBuffer(), vmaCreateImage().
++
++\defgroup group_virtual Virtual allocator
++
++\brief API elements related to the mechanism of \ref virtual_allocator - using the core allocation algorithm
++for user-defined purpose without allocating any real GPU memory.
++
++\defgroup group_stats Statistics
++
++\brief API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format.
++See documentation chapter: \ref statistics.
++*/
++
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#ifndef VULKAN_H_
++ #include <vulkan/vulkan.h>
++#endif
++
++// Define this macro to declare maximum supported Vulkan version in format AAABBBCCC,
++// where AAA = major, BBB = minor, CCC = patch.
++// If you want to use version > 1.0, it still needs to be enabled via VmaAllocatorCreateInfo::vulkanApiVersion.
++#if !defined(VMA_VULKAN_VERSION)
++ #if defined(VK_VERSION_1_3)
++ #define VMA_VULKAN_VERSION 1003000
++ #elif defined(VK_VERSION_1_2)
++ #define VMA_VULKAN_VERSION 1002000
++ #elif defined(VK_VERSION_1_1)
++ #define VMA_VULKAN_VERSION 1001000
++ #else
++ #define VMA_VULKAN_VERSION 1000000
++ #endif
++#endif
++
++#if defined(__ANDROID__) && defined(VK_NO_PROTOTYPES) && VMA_STATIC_VULKAN_FUNCTIONS
++ extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
++ extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
++ extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
++ extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
++ extern PFN_vkAllocateMemory vkAllocateMemory;
++ extern PFN_vkFreeMemory vkFreeMemory;
++ extern PFN_vkMapMemory vkMapMemory;
++ extern PFN_vkUnmapMemory vkUnmapMemory;
++ extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
++ extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
++ extern PFN_vkBindBufferMemory vkBindBufferMemory;
++ extern PFN_vkBindImageMemory vkBindImageMemory;
++ extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
++ extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
++ extern PFN_vkCreateBuffer vkCreateBuffer;
++ extern PFN_vkDestroyBuffer vkDestroyBuffer;
++ extern PFN_vkCreateImage vkCreateImage;
++ extern PFN_vkDestroyImage vkDestroyImage;
++ extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
++ #if VMA_VULKAN_VERSION >= 1001000
++ extern PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2;
++ extern PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2;
++ extern PFN_vkBindBufferMemory2 vkBindBufferMemory2;
++ extern PFN_vkBindImageMemory2 vkBindImageMemory2;
++ extern PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2;
++ #endif // #if VMA_VULKAN_VERSION >= 1001000
++#endif // #if defined(__ANDROID__) && VMA_STATIC_VULKAN_FUNCTIONS && VK_NO_PROTOTYPES
++
++#if !defined(VMA_DEDICATED_ALLOCATION)
++ #if VK_KHR_get_memory_requirements2 && VK_KHR_dedicated_allocation
++ #define VMA_DEDICATED_ALLOCATION 1
++ #else
++ #define VMA_DEDICATED_ALLOCATION 0
++ #endif
++#endif
++
++#if !defined(VMA_BIND_MEMORY2)
++ #if VK_KHR_bind_memory2
++ #define VMA_BIND_MEMORY2 1
++ #else
++ #define VMA_BIND_MEMORY2 0
++ #endif
++#endif
++
++#if !defined(VMA_MEMORY_BUDGET)
++ #if VK_EXT_memory_budget && (VK_KHR_get_physical_device_properties2 || VMA_VULKAN_VERSION >= 1001000)
++ #define VMA_MEMORY_BUDGET 1
++ #else
++ #define VMA_MEMORY_BUDGET 0
++ #endif
++#endif
++
++// Defined to 1 when VK_KHR_buffer_device_address device extension or equivalent core Vulkan 1.2 feature is defined in its headers.
++#if !defined(VMA_BUFFER_DEVICE_ADDRESS)
++ #if VK_KHR_buffer_device_address || VMA_VULKAN_VERSION >= 1002000
++ #define VMA_BUFFER_DEVICE_ADDRESS 1
++ #else
++ #define VMA_BUFFER_DEVICE_ADDRESS 0
++ #endif
++#endif
++
++// Defined to 1 when VK_EXT_memory_priority device extension is defined in Vulkan headers.
++#if !defined(VMA_MEMORY_PRIORITY)
++ #if VK_EXT_memory_priority
++ #define VMA_MEMORY_PRIORITY 1
++ #else
++ #define VMA_MEMORY_PRIORITY 0
++ #endif
++#endif
++
++// Defined to 1 when VK_KHR_external_memory device extension is defined in Vulkan headers.
++#if !defined(VMA_EXTERNAL_MEMORY)
++ #if VK_KHR_external_memory
++ #define VMA_EXTERNAL_MEMORY 1
++ #else
++ #define VMA_EXTERNAL_MEMORY 0
++ #endif
++#endif
++
++// Define these macros to decorate all public functions with additional code,
++// before and after returned type, appropriately. This may be useful for
++// exporting the functions when compiling VMA as a separate library. Example:
++// #define VMA_CALL_PRE __declspec(dllexport)
++// #define VMA_CALL_POST __cdecl
++#ifndef VMA_CALL_PRE
++ #define VMA_CALL_PRE
++#endif
++#ifndef VMA_CALL_POST
++ #define VMA_CALL_POST
++#endif
++
++// Define this macro to decorate pointers with an attribute specifying the
++// length of the array they point to if they are not null.
++//
++// The length may be one of
++// - The name of another parameter in the argument list where the pointer is declared
++// - The name of another member in the struct where the pointer is declared
++// - The name of a member of a struct type, meaning the value of that member in
++// the context of the call. For example
++// VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryHeapCount"),
++// this means the number of memory heaps available in the device associated
++// with the VmaAllocator being dealt with.
++#ifndef VMA_LEN_IF_NOT_NULL
++ #define VMA_LEN_IF_NOT_NULL(len)
++#endif
++
++// The VMA_NULLABLE macro is defined to be _Nullable when compiling with Clang.
++// see: https://clang.llvm.org/docs/AttributeReference.html#nullable
++#ifndef VMA_NULLABLE
++ #ifdef __clang__
++ #define VMA_NULLABLE _Nullable
++ #else
++ #define VMA_NULLABLE
++ #endif
++#endif
++
++// The VMA_NOT_NULL macro is defined to be _Nonnull when compiling with Clang.
++// see: https://clang.llvm.org/docs/AttributeReference.html#nonnull
++#ifndef VMA_NOT_NULL
++ #ifdef __clang__
++ #define VMA_NOT_NULL _Nonnull
++ #else
++ #define VMA_NOT_NULL
++ #endif
++#endif
++
++// If non-dispatchable handles are represented as pointers then we can give
++// then nullability annotations
++#ifndef VMA_NOT_NULL_NON_DISPATCHABLE
++ #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
++ #define VMA_NOT_NULL_NON_DISPATCHABLE VMA_NOT_NULL
++ #else
++ #define VMA_NOT_NULL_NON_DISPATCHABLE
++ #endif
++#endif
++
++#ifndef VMA_NULLABLE_NON_DISPATCHABLE
++ #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
++ #define VMA_NULLABLE_NON_DISPATCHABLE VMA_NULLABLE
++ #else
++ #define VMA_NULLABLE_NON_DISPATCHABLE
++ #endif
++#endif
++
++#ifndef VMA_STATS_STRING_ENABLED
++ #define VMA_STATS_STRING_ENABLED 1
++#endif
++
++////////////////////////////////////////////////////////////////////////////////
++////////////////////////////////////////////////////////////////////////////////
++//
++// INTERFACE
++//
++////////////////////////////////////////////////////////////////////////////////
++////////////////////////////////////////////////////////////////////////////////
++
++// Sections for managing code placement in file, only for development purposes e.g. for convenient folding inside an IDE.
++#ifndef _VMA_ENUM_DECLARATIONS
++
++/**
++\addtogroup group_init
++@{
++*/
++
++/// Flags for created #VmaAllocator.
++typedef enum VmaAllocatorCreateFlagBits
++{
++ /** \brief Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized externally by you.
++
++ Using this flag may increase performance because internal mutexes are not used.
++ */
++ VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001,
++ /** \brief Enables usage of VK_KHR_dedicated_allocation extension.
++
++ The flag works only if VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_0`.
++ When it is `VK_API_VERSION_1_1`, the flag is ignored because the extension has been promoted to Vulkan 1.1.
++
++ Using this extension will automatically allocate dedicated blocks of memory for
++ some buffers and images instead of suballocating place for them out of bigger
++ memory blocks (as if you explicitly used #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
++ flag) when it is recommended by the driver. It may improve performance on some
++ GPUs.
++
++ You may set this flag only if you found out that following device extensions are
++ supported, you enabled them while creating Vulkan device passed as
++ VmaAllocatorCreateInfo::device, and you want them to be used internally by this
++ library:
++
++ - VK_KHR_get_memory_requirements2 (device extension)
++ - VK_KHR_dedicated_allocation (device extension)
++
++ When this flag is set, you can experience following warnings reported by Vulkan
++ validation layer. You can ignore them.
++
++ > vkBindBufferMemory(): Binding memory to buffer 0x2d but vkGetBufferMemoryRequirements() has not been called on that buffer.
++ */
++ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = 0x00000002,
++ /**
++ Enables usage of VK_KHR_bind_memory2 extension.
++
++ The flag works only if VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_0`.
++ When it is `VK_API_VERSION_1_1`, the flag is ignored because the extension has been promoted to Vulkan 1.1.
++
++ You may set this flag only if you found out that this device extension is supported,
++ you enabled it while creating Vulkan device passed as VmaAllocatorCreateInfo::device,
++ and you want it to be used internally by this library.
++
++ The extension provides functions `vkBindBufferMemory2KHR` and `vkBindImageMemory2KHR`,
++ which allow to pass a chain of `pNext` structures while binding.
++ This flag is required if you use `pNext` parameter in vmaBindBufferMemory2() or vmaBindImageMemory2().
++ */
++ VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT = 0x00000004,
++ /**
++ Enables usage of VK_EXT_memory_budget extension.
++
++ You may set this flag only if you found out that this device extension is supported,
++ you enabled it while creating Vulkan device passed as VmaAllocatorCreateInfo::device,
++ and you want it to be used internally by this library, along with another instance extension
++ VK_KHR_get_physical_device_properties2, which is required by it (or Vulkan 1.1, where this extension is promoted).
++
++ The extension provides query for current memory usage and budget, which will probably
++ be more accurate than an estimation used by the library otherwise.
++ */
++ VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT = 0x00000008,
++ /**
++ Enables usage of VK_AMD_device_coherent_memory extension.
++
++ You may set this flag only if you:
++
++ - found out that this device extension is supported and enabled it while creating Vulkan device passed as VmaAllocatorCreateInfo::device,
++ - checked that `VkPhysicalDeviceCoherentMemoryFeaturesAMD::deviceCoherentMemory` is true and set it while creating the Vulkan device,
++ - want it to be used internally by this library.
++
++ The extension and accompanying device feature provide access to memory types with
++ `VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD` and `VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD` flags.
++ They are useful mostly for writing breadcrumb markers - a common method for debugging GPU crash/hang/TDR.
++
++ When the extension is not enabled, such memory types are still enumerated, but their usage is illegal.
++ To protect from this error, if you don't create the allocator with this flag, it will refuse to allocate any memory or create a custom pool in such memory type,
++ returning `VK_ERROR_FEATURE_NOT_PRESENT`.
++ */
++ VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT = 0x00000010,
++ /**
++ Enables usage of "buffer device address" feature, which allows you to use function
++ `vkGetBufferDeviceAddress*` to get raw GPU pointer to a buffer and pass it for usage inside a shader.
++
++ You may set this flag only if you:
++
++ 1. (For Vulkan version < 1.2) Found as available and enabled device extension
++ VK_KHR_buffer_device_address.
++ This extension is promoted to core Vulkan 1.2.
++ 2. Found as available and enabled device feature `VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress`.
++
++ When this flag is set, you can create buffers with `VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT` using VMA.
++ The library automatically adds `VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT` to
++ allocated memory blocks wherever it might be needed.
++
++ For more information, see documentation chapter \ref enabling_buffer_device_address.
++ */
++ VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT = 0x00000020,
++ /**
++ Enables usage of VK_EXT_memory_priority extension in the library.
++
++ You may set this flag only if you found available and enabled this device extension,
++ along with `VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority == VK_TRUE`,
++ while creating Vulkan device passed as VmaAllocatorCreateInfo::device.
++
++ When this flag is used, VmaAllocationCreateInfo::priority and VmaPoolCreateInfo::priority
++ are used to set priorities of allocated Vulkan memory. Without it, these variables are ignored.
++
++ A priority must be a floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.
++ Larger values are higher priority. The granularity of the priorities is implementation-dependent.
++ It is automatically passed to every call to `vkAllocateMemory` done by the library using structure `VkMemoryPriorityAllocateInfoEXT`.
++ The value to be used for default priority is 0.5.
++ For more details, see the documentation of the VK_EXT_memory_priority extension.
++ */
++ VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT = 0x00000040,
++
++ VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
++} VmaAllocatorCreateFlagBits;
++/// See #VmaAllocatorCreateFlagBits.
++typedef VkFlags VmaAllocatorCreateFlags;
++
++/** @} */
++
++/**
++\addtogroup group_alloc
++@{
++*/
++
++/// \brief Intended usage of the allocated memory.
++typedef enum VmaMemoryUsage
++{
++ /** No intended memory usage specified.
++ Use other members of VmaAllocationCreateInfo to specify your requirements.
++ */
++ VMA_MEMORY_USAGE_UNKNOWN = 0,
++ /**
++ \deprecated Obsolete, preserved for backward compatibility.
++ Prefers `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`.
++ */
++ VMA_MEMORY_USAGE_GPU_ONLY = 1,
++ /**
++ \deprecated Obsolete, preserved for backward compatibility.
++ Guarantees `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` and `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT`.
++ */
++ VMA_MEMORY_USAGE_CPU_ONLY = 2,
++ /**
++ \deprecated Obsolete, preserved for backward compatibility.
++ Guarantees `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`, prefers `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`.
++ */
++ VMA_MEMORY_USAGE_CPU_TO_GPU = 3,
++ /**
++ \deprecated Obsolete, preserved for backward compatibility.
++ Guarantees `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`, prefers `VK_MEMORY_PROPERTY_HOST_CACHED_BIT`.
++ */
++ VMA_MEMORY_USAGE_GPU_TO_CPU = 4,
++ /**
++ \deprecated Obsolete, preserved for backward compatibility.
++ Prefers not `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`.
++ */
++ VMA_MEMORY_USAGE_CPU_COPY = 5,
++ /**
++ Lazily allocated GPU memory having `VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT`.
++ Exists mostly on mobile platforms. Using it on desktop PC or other GPUs with no such memory type present will fail the allocation.
++
++ Usage: Memory for transient attachment images (color attachments, depth attachments etc.), created with `VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT`.
++
++ Allocations with this usage are always created as dedicated - it implies #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++ */
++ VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED = 6,
++ /**
++ Selects best memory type automatically.
++ This flag is recommended for most common use cases.
++
++ When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),
++ you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
++ in VmaAllocationCreateInfo::flags.
++
++ It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g.
++ vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()
++ and not with generic memory allocation functions.
++ */
++ VMA_MEMORY_USAGE_AUTO = 7,
++ /**
++ Selects best memory type automatically with preference for GPU (device) memory.
++
++ When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),
++ you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
++ in VmaAllocationCreateInfo::flags.
++
++ It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g.
++ vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()
++ and not with generic memory allocation functions.
++ */
++ VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE = 8,
++ /**
++ Selects best memory type automatically with preference for CPU (host) memory.
++
++ When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),
++ you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
++ in VmaAllocationCreateInfo::flags.
++
++ It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g.
++ vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()
++ and not with generic memory allocation functions.
++ */
++ VMA_MEMORY_USAGE_AUTO_PREFER_HOST = 9,
++
++ VMA_MEMORY_USAGE_MAX_ENUM = 0x7FFFFFFF
++} VmaMemoryUsage;
++
++/// Flags to be passed as VmaAllocationCreateInfo::flags.
++typedef enum VmaAllocationCreateFlagBits
++{
++ /** \brief Set this flag if the allocation should have its own memory block.
++
++ Use it for special, big resources, like fullscreen images used as attachments.
++ */
++ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001,
++
++ /** \brief Set this flag to only try to allocate from existing `VkDeviceMemory` blocks and never create new such block.
++
++ If new allocation cannot be placed in any of the existing blocks, allocation
++ fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY` error.
++
++ You should not use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and
++ #VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense.
++ */
++ VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002,
++ /** \brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
++
++ Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData.
++
++ It is valid to use this flag for allocation made from memory type that is not
++ `HOST_VISIBLE`. This flag is then ignored and memory is not mapped. This is
++ useful if you need an allocation that is efficient to use on GPU
++ (`DEVICE_LOCAL`) and still want to map it directly if possible on platforms that
++ support it (e.g. Intel GPU).
++ */
++ VMA_ALLOCATION_CREATE_MAPPED_BIT = 0x00000004,
++ /** \deprecated Preserved for backward compatibility. Consider using vmaSetAllocationName() instead.
++
++ Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a
++ null-terminated string. Instead of copying pointer value, a local copy of the
++ string is made and stored in allocation's `pName`. The string is automatically
++ freed together with the allocation. It is also used in vmaBuildStatsString().
++ */
++ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 0x00000020,
++ /** Allocation will be created from upper stack in a double stack pool.
++
++ This flag is only allowed for custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT flag.
++ */
++ VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 0x00000040,
++ /** Create both buffer/image and allocation, but don't bind them together.
++ It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions.
++ The flag is meaningful only with functions that bind by default: vmaCreateBuffer(), vmaCreateImage().
++ Otherwise it is ignored.
++
++ If you want to make sure the new buffer/image is not tied to the new memory allocation
++ through `VkMemoryDedicatedAllocateInfoKHR` structure in case the allocation ends up in its own memory block,
++ use also flag #VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT.
++ */
++ VMA_ALLOCATION_CREATE_DONT_BIND_BIT = 0x00000080,
++ /** Create allocation only if additional device memory required for it, if any, won't exceed
++ memory budget. Otherwise return `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
++ */
++ VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT = 0x00000100,
++ /** \brief Set this flag if the allocated memory will have aliasing resources.
++
++ Usage of this flag prevents supplying `VkMemoryDedicatedAllocateInfoKHR` when #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is specified.
++ Otherwise created dedicated memory will not be suitable for aliasing resources, resulting in Vulkan Validation Layer errors.
++ */
++ VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT = 0x00000200,
++ /**
++ Requests possibility to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT).
++
++ - If you use #VMA_MEMORY_USAGE_AUTO or other `VMA_MEMORY_USAGE_AUTO*` value,
++ you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect.
++ - If you use other value of #VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are `HOST_VISIBLE`.
++ This includes allocations created in \ref custom_memory_pools.
++
++ Declares that mapped memory will only be written sequentially, e.g. using `memcpy()` or a loop writing number-by-number,
++ never read or accessed randomly, so a memory type can be selected that is uncached and write-combined.
++
++ \warning Violating this declaration may work correctly, but will likely be very slow.
++ Watch out for implicit reads introduced by doing e.g. `pMappedData[i] += x;`
++ Better prepare your data in a local variable and `memcpy()` it to the mapped pointer all at once.
++ */
++ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT = 0x00000400,
++ /**
++ Requests possibility to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT).
++
++ - If you use #VMA_MEMORY_USAGE_AUTO or other `VMA_MEMORY_USAGE_AUTO*` value,
++ you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect.
++ - If you use other value of #VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are `HOST_VISIBLE`.
++ This includes allocations created in \ref custom_memory_pools.
++
++ Declares that mapped memory can be read, written, and accessed in random order,
++ so a `HOST_CACHED` memory type is required.
++ */
++ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT = 0x00000800,
++ /**
++ Together with #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
++ it says that despite request for host access, a not-`HOST_VISIBLE` memory type can be selected
++ if it may improve performance.
++
++ By using this flag, you declare that you will check if the allocation ended up in a `HOST_VISIBLE` memory type
++ (e.g. using vmaGetAllocationMemoryProperties()) and if not, you will create some "staging" buffer and
++ issue an explicit transfer to write/read your data.
++ To prepare for this possibility, don't forget to add appropriate flags like
++ `VK_BUFFER_USAGE_TRANSFER_DST_BIT`, `VK_BUFFER_USAGE_TRANSFER_SRC_BIT` to the parameters of created buffer or image.
++ */
++ VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT = 0x00001000,
++ /** Allocation strategy that chooses smallest possible free range for the allocation
++ to minimize memory usage and fragmentation, possibly at the expense of allocation time.
++ */
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = 0x00010000,
++ /** Allocation strategy that chooses first suitable free range for the allocation -
++ not necessarily in terms of the smallest offset but the one that is easiest and fastest to find
++ to minimize allocation time, possibly at the expense of allocation quality.
++ */
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = 0x00020000,
++ /** Allocation strategy that chooses always the lowest offset in available space.
++ This is not the most efficient strategy but achieves highly packed data.
++ Used internally by defragmentation, not recomended in typical usage.
++ */
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT = 0x00040000,
++ /** Alias to #VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT.
++ */
++ VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT,
++ /** Alias to #VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT.
++ */
++ VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT,
++ /** A bit mask to extract only `STRATEGY` bits from entire set of flags.
++ */
++ VMA_ALLOCATION_CREATE_STRATEGY_MASK =
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT |
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT |
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT,
++
++ VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
++} VmaAllocationCreateFlagBits;
++/// See #VmaAllocationCreateFlagBits.
++typedef VkFlags VmaAllocationCreateFlags;
++
++/// Flags to be passed as VmaPoolCreateInfo::flags.
++typedef enum VmaPoolCreateFlagBits
++{
++ /** \brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored.
++
++ This is an optional optimization flag.
++
++ If you always allocate using vmaCreateBuffer(), vmaCreateImage(),
++ vmaAllocateMemoryForBuffer(), then you don't need to use it because allocator
++ knows exact type of your allocations so it can handle Buffer-Image Granularity
++ in the optimal way.
++
++ If you also allocate using vmaAllocateMemoryForImage() or vmaAllocateMemory(),
++ exact type of such allocations is not known, so allocator must be conservative
++ in handling Buffer-Image Granularity, which can lead to suboptimal allocation
++ (wasted memory). In that case, if you can make sure you always allocate only
++ buffers and linear images or only optimal images out of this pool, use this flag
++ to make allocator disregard Buffer-Image Granularity and so make allocations
++ faster and more optimal.
++ */
++ VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002,
++
++ /** \brief Enables alternative, linear allocation algorithm in this pool.
++
++ Specify this flag to enable linear allocation algorithm, which always creates
++ new allocations after last one and doesn't reuse space from allocations freed in
++ between. It trades memory consumption for simplified algorithm and data
++ structure, which has better performance and uses less memory for metadata.
++
++ By using this flag, you can achieve behavior of free-at-once, stack,
++ ring buffer, and double stack.
++ For details, see documentation chapter \ref linear_algorithm.
++ */
++ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004,
++
++ /** Bit mask to extract only `ALGORITHM` bits from entire set of flags.
++ */
++ VMA_POOL_CREATE_ALGORITHM_MASK =
++ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT,
++
++ VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
++} VmaPoolCreateFlagBits;
++/// Flags to be passed as VmaPoolCreateInfo::flags. See #VmaPoolCreateFlagBits.
++typedef VkFlags VmaPoolCreateFlags;
++
++/// Flags to be passed as VmaDefragmentationInfo::flags.
++typedef enum VmaDefragmentationFlagBits
++{
++ /* \brief Use simple but fast algorithm for defragmentation.
++ May not achieve best results but will require least time to compute and least allocations to copy.
++ */
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT = 0x1,
++ /* \brief Default defragmentation algorithm, applied also when no `ALGORITHM` flag is specified.
++ Offers a balance between defragmentation quality and the amount of allocations and bytes that need to be moved.
++ */
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT = 0x2,
++ /* \brief Perform full defragmentation of memory.
++ Can result in notably more time to compute and allocations to copy, but will achieve best memory packing.
++ */
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT = 0x4,
++ /** \brief Use the most roboust algorithm at the cost of time to compute and number of copies to make.
++ Only available when bufferImageGranularity is greater than 1, since it aims to reduce
++ alignment issues between different types of resources.
++ Otherwise falls back to same behavior as #VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT.
++ */
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT = 0x8,
++
++ /// A bit mask to extract only `ALGORITHM` bits from entire set of flags.
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK =
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT |
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT |
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT |
++ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT,
++
++ VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
++} VmaDefragmentationFlagBits;
++/// See #VmaDefragmentationFlagBits.
++typedef VkFlags VmaDefragmentationFlags;
++
++/// Operation performed on single defragmentation move. See structure #VmaDefragmentationMove.
++typedef enum VmaDefragmentationMoveOperation
++{
++ /// Buffer/image has been recreated at `dstTmpAllocation`, data has been copied, old buffer/image has been destroyed. `srcAllocation` should be changed to point to the new place. This is the default value set by vmaBeginDefragmentationPass().
++ VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY = 0,
++ /// Set this value if you cannot move the allocation. New place reserved at `dstTmpAllocation` will be freed. `srcAllocation` will remain unchanged.
++ VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE = 1,
++ /// Set this value if you decide to abandon the allocation and you destroyed the buffer/image. New place reserved at `dstTmpAllocation` will be freed, along with `srcAllocation`, which will be destroyed.
++ VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY = 2,
++} VmaDefragmentationMoveOperation;
++
++/** @} */
++
++/**
++\addtogroup group_virtual
++@{
++*/
++
++/// Flags to be passed as VmaVirtualBlockCreateInfo::flags.
++typedef enum VmaVirtualBlockCreateFlagBits
++{
++ /** \brief Enables alternative, linear allocation algorithm in this virtual block.
++
++ Specify this flag to enable linear allocation algorithm, which always creates
++ new allocations after last one and doesn't reuse space from allocations freed in
++ between. It trades memory consumption for simplified algorithm and data
++ structure, which has better performance and uses less memory for metadata.
++
++ By using this flag, you can achieve behavior of free-at-once, stack,
++ ring buffer, and double stack.
++ For details, see documentation chapter \ref linear_algorithm.
++ */
++ VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001,
++
++ /** \brief Bit mask to extract only `ALGORITHM` bits from entire set of flags.
++ */
++ VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK =
++ VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT,
++
++ VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
++} VmaVirtualBlockCreateFlagBits;
++/// Flags to be passed as VmaVirtualBlockCreateInfo::flags. See #VmaVirtualBlockCreateFlagBits.
++typedef VkFlags VmaVirtualBlockCreateFlags;
++
++/// Flags to be passed as VmaVirtualAllocationCreateInfo::flags.
++typedef enum VmaVirtualAllocationCreateFlagBits
++{
++ /** \brief Allocation will be created from upper stack in a double stack pool.
++
++ This flag is only allowed for virtual blocks created with #VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT flag.
++ */
++ VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT,
++ /** \brief Allocation strategy that tries to minimize memory usage.
++ */
++ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT,
++ /** \brief Allocation strategy that tries to minimize allocation time.
++ */
++ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT,
++ /** Allocation strategy that chooses always the lowest offset in available space.
++ This is not the most efficient strategy but achieves highly packed data.
++ */
++ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT,
++ /** \brief A bit mask to extract only `STRATEGY` bits from entire set of flags.
++
++ These strategy flags are binary compatible with equivalent flags in #VmaAllocationCreateFlagBits.
++ */
++ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK = VMA_ALLOCATION_CREATE_STRATEGY_MASK,
++
++ VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
++} VmaVirtualAllocationCreateFlagBits;
++/// Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See #VmaVirtualAllocationCreateFlagBits.
++typedef VkFlags VmaVirtualAllocationCreateFlags;
++
++/** @} */
++
++#endif // _VMA_ENUM_DECLARATIONS
++
++#ifndef _VMA_DATA_TYPES_DECLARATIONS
++
++/**
++\addtogroup group_init
++@{ */
++
++/** \struct VmaAllocator
++\brief Represents main object of this library initialized.
++
++Fill structure #VmaAllocatorCreateInfo and call function vmaCreateAllocator() to create it.
++Call function vmaDestroyAllocator() to destroy it.
++
++It is recommended to create just one object of this type per `VkDevice` object,
++right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed.
++*/
++VK_DEFINE_HANDLE(VmaAllocator)
++
++/** @} */
++
++/**
++\addtogroup group_alloc
++@{
++*/
++
++/** \struct VmaPool
++\brief Represents custom memory pool
++
++Fill structure VmaPoolCreateInfo and call function vmaCreatePool() to create it.
++Call function vmaDestroyPool() to destroy it.
++
++For more information see [Custom memory pools](@ref choosing_memory_type_custom_memory_pools).
++*/
++VK_DEFINE_HANDLE(VmaPool)
++
++/** \struct VmaAllocation
++\brief Represents single memory allocation.
++
++It may be either dedicated block of `VkDeviceMemory` or a specific region of a bigger block of this type
++plus unique offset.
++
++There are multiple ways to create such object.
++You need to fill structure VmaAllocationCreateInfo.
++For more information see [Choosing memory type](@ref choosing_memory_type).
++
++Although the library provides convenience functions that create Vulkan buffer or image,
++allocate memory for it and bind them together,
++binding of the allocation to a buffer or an image is out of scope of the allocation itself.
++Allocation object can exist without buffer/image bound,
++binding can be done manually by the user, and destruction of it can be done
++independently of destruction of the allocation.
++
++The object also remembers its size and some other information.
++To retrieve this information, use function vmaGetAllocationInfo() and inspect
++returned structure VmaAllocationInfo.
++*/
++VK_DEFINE_HANDLE(VmaAllocation)
++
++/** \struct VmaDefragmentationContext
++\brief An opaque object that represents started defragmentation process.
++
++Fill structure #VmaDefragmentationInfo and call function vmaBeginDefragmentation() to create it.
++Call function vmaEndDefragmentation() to destroy it.
++*/
++VK_DEFINE_HANDLE(VmaDefragmentationContext)
++
++/** @} */
++
++/**
++\addtogroup group_virtual
++@{
++*/
++
++/** \struct VmaVirtualAllocation
++\brief Represents single memory allocation done inside VmaVirtualBlock.
++
++Use it as a unique identifier to virtual allocation within the single block.
++
++Use value `VK_NULL_HANDLE` to represent a null/invalid allocation.
++*/
++VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaVirtualAllocation);
++
++/** @} */
++
++/**
++\addtogroup group_virtual
++@{
++*/
++
++/** \struct VmaVirtualBlock
++\brief Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory.
++
++Fill in #VmaVirtualBlockCreateInfo structure and use vmaCreateVirtualBlock() to create it. Use vmaDestroyVirtualBlock() to destroy it.
++For more information, see documentation chapter \ref virtual_allocator.
++
++This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally.
++*/
++VK_DEFINE_HANDLE(VmaVirtualBlock)
++
++/** @} */
++
++/**
++\addtogroup group_init
++@{
++*/
++
++/// Callback function called after successful vkAllocateMemory.
++typedef void (VKAPI_PTR* PFN_vmaAllocateDeviceMemoryFunction)(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t memoryType,
++ VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
++ VkDeviceSize size,
++ void* VMA_NULLABLE pUserData);
++
++/// Callback function called before vkFreeMemory.
++typedef void (VKAPI_PTR* PFN_vmaFreeDeviceMemoryFunction)(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t memoryType,
++ VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
++ VkDeviceSize size,
++ void* VMA_NULLABLE pUserData);
++
++/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`.
++
++Provided for informative purpose, e.g. to gather statistics about number of
++allocations or total amount of memory allocated in Vulkan.
++
++Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
++*/
++typedef struct VmaDeviceMemoryCallbacks
++{
++ /// Optional, can be null.
++ PFN_vmaAllocateDeviceMemoryFunction VMA_NULLABLE pfnAllocate;
++ /// Optional, can be null.
++ PFN_vmaFreeDeviceMemoryFunction VMA_NULLABLE pfnFree;
++ /// Optional, can be null.
++ void* VMA_NULLABLE pUserData;
++} VmaDeviceMemoryCallbacks;
++
++/** \brief Pointers to some Vulkan functions - a subset used by the library.
++
++Used in VmaAllocatorCreateInfo::pVulkanFunctions.
++*/
++typedef struct VmaVulkanFunctions
++{
++ /// Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS.
++ PFN_vkGetInstanceProcAddr VMA_NULLABLE vkGetInstanceProcAddr;
++ /// Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS.
++ PFN_vkGetDeviceProcAddr VMA_NULLABLE vkGetDeviceProcAddr;
++ PFN_vkGetPhysicalDeviceProperties VMA_NULLABLE vkGetPhysicalDeviceProperties;
++ PFN_vkGetPhysicalDeviceMemoryProperties VMA_NULLABLE vkGetPhysicalDeviceMemoryProperties;
++ PFN_vkAllocateMemory VMA_NULLABLE vkAllocateMemory;
++ PFN_vkFreeMemory VMA_NULLABLE vkFreeMemory;
++ PFN_vkMapMemory VMA_NULLABLE vkMapMemory;
++ PFN_vkUnmapMemory VMA_NULLABLE vkUnmapMemory;
++ PFN_vkFlushMappedMemoryRanges VMA_NULLABLE vkFlushMappedMemoryRanges;
++ PFN_vkInvalidateMappedMemoryRanges VMA_NULLABLE vkInvalidateMappedMemoryRanges;
++ PFN_vkBindBufferMemory VMA_NULLABLE vkBindBufferMemory;
++ PFN_vkBindImageMemory VMA_NULLABLE vkBindImageMemory;
++ PFN_vkGetBufferMemoryRequirements VMA_NULLABLE vkGetBufferMemoryRequirements;
++ PFN_vkGetImageMemoryRequirements VMA_NULLABLE vkGetImageMemoryRequirements;
++ PFN_vkCreateBuffer VMA_NULLABLE vkCreateBuffer;
++ PFN_vkDestroyBuffer VMA_NULLABLE vkDestroyBuffer;
++ PFN_vkCreateImage VMA_NULLABLE vkCreateImage;
++ PFN_vkDestroyImage VMA_NULLABLE vkDestroyImage;
++ PFN_vkCmdCopyBuffer VMA_NULLABLE vkCmdCopyBuffer;
++#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ /// Fetch "vkGetBufferMemoryRequirements2" on Vulkan >= 1.1, fetch "vkGetBufferMemoryRequirements2KHR" when using VK_KHR_dedicated_allocation extension.
++ PFN_vkGetBufferMemoryRequirements2KHR VMA_NULLABLE vkGetBufferMemoryRequirements2KHR;
++ /// Fetch "vkGetImageMemoryRequirements 2" on Vulkan >= 1.1, fetch "vkGetImageMemoryRequirements2KHR" when using VK_KHR_dedicated_allocation extension.
++ PFN_vkGetImageMemoryRequirements2KHR VMA_NULLABLE vkGetImageMemoryRequirements2KHR;
++#endif
++#if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
++ /// Fetch "vkBindBufferMemory2" on Vulkan >= 1.1, fetch "vkBindBufferMemory2KHR" when using VK_KHR_bind_memory2 extension.
++ PFN_vkBindBufferMemory2KHR VMA_NULLABLE vkBindBufferMemory2KHR;
++ /// Fetch "vkBindImageMemory2" on Vulkan >= 1.1, fetch "vkBindImageMemory2KHR" when using VK_KHR_bind_memory2 extension.
++ PFN_vkBindImageMemory2KHR VMA_NULLABLE vkBindImageMemory2KHR;
++#endif
++#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000
++ PFN_vkGetPhysicalDeviceMemoryProperties2KHR VMA_NULLABLE vkGetPhysicalDeviceMemoryProperties2KHR;
++#endif
++#if VMA_VULKAN_VERSION >= 1003000
++ /// Fetch from "vkGetDeviceBufferMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceBufferMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4.
++ PFN_vkGetDeviceBufferMemoryRequirements VMA_NULLABLE vkGetDeviceBufferMemoryRequirements;
++ /// Fetch from "vkGetDeviceImageMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceImageMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4.
++ PFN_vkGetDeviceImageMemoryRequirements VMA_NULLABLE vkGetDeviceImageMemoryRequirements;
++#endif
++} VmaVulkanFunctions;
++
++/// Description of a Allocator to be created.
++typedef struct VmaAllocatorCreateInfo
++{
++ /// Flags for created allocator. Use #VmaAllocatorCreateFlagBits enum.
++ VmaAllocatorCreateFlags flags;
++ /// Vulkan physical device.
++ /** It must be valid throughout whole lifetime of created allocator. */
++ VkPhysicalDevice VMA_NOT_NULL physicalDevice;
++ /// Vulkan device.
++ /** It must be valid throughout whole lifetime of created allocator. */
++ VkDevice VMA_NOT_NULL device;
++ /// Preferred size of a single `VkDeviceMemory` block to be allocated from large heaps > 1 GiB. Optional.
++ /** Set to 0 to use default, which is currently 256 MiB. */
++ VkDeviceSize preferredLargeHeapBlockSize;
++ /// Custom CPU memory allocation callbacks. Optional.
++ /** Optional, can be null. When specified, will also be used for all CPU-side memory allocations. */
++ const VkAllocationCallbacks* VMA_NULLABLE pAllocationCallbacks;
++ /// Informative callbacks for `vkAllocateMemory`, `vkFreeMemory`. Optional.
++ /** Optional, can be null. */
++ const VmaDeviceMemoryCallbacks* VMA_NULLABLE pDeviceMemoryCallbacks;
++ /** \brief Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap.
++
++ If not NULL, it must be a pointer to an array of
++ `VkPhysicalDeviceMemoryProperties::memoryHeapCount` elements, defining limit on
++ maximum number of bytes that can be allocated out of particular Vulkan memory
++ heap.
++
++ Any of the elements may be equal to `VK_WHOLE_SIZE`, which means no limit on that
++ heap. This is also the default in case of `pHeapSizeLimit` = NULL.
++
++ If there is a limit defined for a heap:
++
++ - If user tries to allocate more memory from that heap using this allocator,
++ the allocation fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
++ - If the limit is smaller than heap size reported in `VkMemoryHeap::size`, the
++ value of this limit will be reported instead when using vmaGetMemoryProperties().
++
++ Warning! Using this feature may not be equivalent to installing a GPU with
++ smaller amount of memory, because graphics driver doesn't necessary fail new
++ allocations with `VK_ERROR_OUT_OF_DEVICE_MEMORY` result when memory capacity is
++ exceeded. It may return success and just silently migrate some device memory
++ blocks to system RAM. This driver behavior can also be controlled using
++ VK_AMD_memory_overallocation_behavior extension.
++ */
++ const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryHeapCount") pHeapSizeLimit;
++
++ /** \brief Pointers to Vulkan functions. Can be null.
++
++ For details see [Pointers to Vulkan functions](@ref config_Vulkan_functions).
++ */
++ const VmaVulkanFunctions* VMA_NULLABLE pVulkanFunctions;
++ /** \brief Handle to Vulkan instance object.
++
++ Starting from version 3.0.0 this member is no longer optional, it must be set!
++ */
++ VkInstance VMA_NOT_NULL instance;
++ /** \brief Optional. The highest version of Vulkan that the application is designed to use.
++
++ It must be a value in the format as created by macro `VK_MAKE_VERSION` or a constant like: `VK_API_VERSION_1_1`, `VK_API_VERSION_1_0`.
++ The patch version number specified is ignored. Only the major and minor versions are considered.
++ It must be less or equal (preferably equal) to value as passed to `vkCreateInstance` as `VkApplicationInfo::apiVersion`.
++ Only versions 1.0, 1.1, 1.2, 1.3 are supported by the current implementation.
++ Leaving it initialized to zero is equivalent to `VK_API_VERSION_1_0`.
++ */
++ uint32_t vulkanApiVersion;
++#if VMA_EXTERNAL_MEMORY
++ /** \brief Either null or a pointer to an array of external memory handle types for each Vulkan memory type.
++
++ If not NULL, it must be a pointer to an array of `VkPhysicalDeviceMemoryProperties::memoryTypeCount`
++ elements, defining external memory handle types of particular Vulkan memory type,
++ to be passed using `VkExportMemoryAllocateInfoKHR`.
++
++ Any of the elements may be equal to 0, which means not to use `VkExportMemoryAllocateInfoKHR` on this memory type.
++ This is also the default in case of `pTypeExternalMemoryHandleTypes` = NULL.
++ */
++ const VkExternalMemoryHandleTypeFlagsKHR* VMA_NULLABLE VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryTypeCount") pTypeExternalMemoryHandleTypes;
++#endif // #if VMA_EXTERNAL_MEMORY
++} VmaAllocatorCreateInfo;
++
++/// Information about existing #VmaAllocator object.
++typedef struct VmaAllocatorInfo
++{
++ /** \brief Handle to Vulkan instance object.
++
++ This is the same value as has been passed through VmaAllocatorCreateInfo::instance.
++ */
++ VkInstance VMA_NOT_NULL instance;
++ /** \brief Handle to Vulkan physical device object.
++
++ This is the same value as has been passed through VmaAllocatorCreateInfo::physicalDevice.
++ */
++ VkPhysicalDevice VMA_NOT_NULL physicalDevice;
++ /** \brief Handle to Vulkan device object.
++
++ This is the same value as has been passed through VmaAllocatorCreateInfo::device.
++ */
++ VkDevice VMA_NOT_NULL device;
++} VmaAllocatorInfo;
++
++/** @} */
++
++/**
++\addtogroup group_stats
++@{
++*/
++
++/** \brief Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total.
++
++These are fast to calculate.
++See functions: vmaGetHeapBudgets(), vmaGetPoolStatistics().
++*/
++typedef struct VmaStatistics
++{
++ /** \brief Number of `VkDeviceMemory` objects - Vulkan memory blocks allocated.
++ */
++ uint32_t blockCount;
++ /** \brief Number of #VmaAllocation objects allocated.
++
++ Dedicated allocations have their own blocks, so each one adds 1 to `allocationCount` as well as `blockCount`.
++ */
++ uint32_t allocationCount;
++ /** \brief Number of bytes allocated in `VkDeviceMemory` blocks.
++
++ \note To avoid confusion, please be aware that what Vulkan calls an "allocation" - a whole `VkDeviceMemory` object
++ (e.g. as in `VkPhysicalDeviceLimits::maxMemoryAllocationCount`) is called a "block" in VMA, while VMA calls
++ "allocation" a #VmaAllocation object that represents a memory region sub-allocated from such block, usually for a single buffer or image.
++ */
++ VkDeviceSize blockBytes;
++ /** \brief Total number of bytes occupied by all #VmaAllocation objects.
++
++ Always less or equal than `blockBytes`.
++ Difference `(blockBytes - allocationBytes)` is the amount of memory allocated from Vulkan
++ but unused by any #VmaAllocation.
++ */
++ VkDeviceSize allocationBytes;
++} VmaStatistics;
++
++/** \brief More detailed statistics than #VmaStatistics.
++
++These are slower to calculate. Use for debugging purposes.
++See functions: vmaCalculateStatistics(), vmaCalculatePoolStatistics().
++
++Previous version of the statistics API provided averages, but they have been removed
++because they can be easily calculated as:
++
++\code
++VkDeviceSize allocationSizeAvg = detailedStats.statistics.allocationBytes / detailedStats.statistics.allocationCount;
++VkDeviceSize unusedBytes = detailedStats.statistics.blockBytes - detailedStats.statistics.allocationBytes;
++VkDeviceSize unusedRangeSizeAvg = unusedBytes / detailedStats.unusedRangeCount;
++\endcode
++*/
++typedef struct VmaDetailedStatistics
++{
++ /// Basic statistics.
++ VmaStatistics statistics;
++ /// Number of free ranges of memory between allocations.
++ uint32_t unusedRangeCount;
++ /// Smallest allocation size. `VK_WHOLE_SIZE` if there are 0 allocations.
++ VkDeviceSize allocationSizeMin;
++ /// Largest allocation size. 0 if there are 0 allocations.
++ VkDeviceSize allocationSizeMax;
++ /// Smallest empty range size. `VK_WHOLE_SIZE` if there are 0 empty ranges.
++ VkDeviceSize unusedRangeSizeMin;
++ /// Largest empty range size. 0 if there are 0 empty ranges.
++ VkDeviceSize unusedRangeSizeMax;
++} VmaDetailedStatistics;
++
++/** \brief General statistics from current state of the Allocator -
++total memory usage across all memory heaps and types.
++
++These are slower to calculate. Use for debugging purposes.
++See function vmaCalculateStatistics().
++*/
++typedef struct VmaTotalStatistics
++{
++ VmaDetailedStatistics memoryType[VK_MAX_MEMORY_TYPES];
++ VmaDetailedStatistics memoryHeap[VK_MAX_MEMORY_HEAPS];
++ VmaDetailedStatistics total;
++} VmaTotalStatistics;
++
++/** \brief Statistics of current memory usage and available budget for a specific memory heap.
++
++These are fast to calculate.
++See function vmaGetHeapBudgets().
++*/
++typedef struct VmaBudget
++{
++ /** \brief Statistics fetched from the library.
++ */
++ VmaStatistics statistics;
++ /** \brief Estimated current memory usage of the program, in bytes.
++
++ Fetched from system using VK_EXT_memory_budget extension if enabled.
++
++ It might be different than `statistics.blockBytes` (usually higher) due to additional implicit objects
++ also occupying the memory, like swapchain, pipelines, descriptor heaps, command buffers, or
++ `VkDeviceMemory` blocks allocated outside of this library, if any.
++ */
++ VkDeviceSize usage;
++ /** \brief Estimated amount of memory available to the program, in bytes.
++
++ Fetched from system using VK_EXT_memory_budget extension if enabled.
++
++ It might be different (most probably smaller) than `VkMemoryHeap::size[heapIndex]` due to factors
++ external to the program, decided by the operating system.
++ Difference `budget - usage` is the amount of additional memory that can probably
++ be allocated without problems. Exceeding the budget may result in various problems.
++ */
++ VkDeviceSize budget;
++} VmaBudget;
++
++/** @} */
++
++/**
++\addtogroup group_alloc
++@{
++*/
++
++/** \brief Parameters of new #VmaAllocation.
++
++To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others.
++*/
++typedef struct VmaAllocationCreateInfo
++{
++ /// Use #VmaAllocationCreateFlagBits enum.
++ VmaAllocationCreateFlags flags;
++ /** \brief Intended usage of memory.
++
++ You can leave #VMA_MEMORY_USAGE_UNKNOWN if you specify memory requirements in other way. \n
++ If `pool` is not null, this member is ignored.
++ */
++ VmaMemoryUsage usage;
++ /** \brief Flags that must be set in a Memory Type chosen for an allocation.
++
++ Leave 0 if you specify memory requirements in other way. \n
++ If `pool` is not null, this member is ignored.*/
++ VkMemoryPropertyFlags requiredFlags;
++ /** \brief Flags that preferably should be set in a memory type chosen for an allocation.
++
++ Set to 0 if no additional flags are preferred. \n
++ If `pool` is not null, this member is ignored. */
++ VkMemoryPropertyFlags preferredFlags;
++ /** \brief Bitmask containing one bit set for every memory type acceptable for this allocation.
++
++ Value 0 is equivalent to `UINT32_MAX` - it means any memory type is accepted if
++ it meets other requirements specified by this structure, with no further
++ restrictions on memory type index. \n
++ If `pool` is not null, this member is ignored.
++ */
++ uint32_t memoryTypeBits;
++ /** \brief Pool that this allocation should be created in.
++
++ Leave `VK_NULL_HANDLE` to allocate from default pool. If not null, members:
++ `usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits` are ignored.
++ */
++ VmaPool VMA_NULLABLE pool;
++ /** \brief Custom general-purpose pointer that will be stored in #VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().
++
++ If #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either
++ null or pointer to a null-terminated string. The string will be then copied to
++ internal buffer, so it doesn't need to be valid after allocation call.
++ */
++ void* VMA_NULLABLE pUserData;
++ /** \brief A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.
++
++ It is used only when #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT flag was used during creation of the #VmaAllocator object
++ and this allocation ends up as dedicated or is explicitly forced as dedicated using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++ Otherwise, it has the priority of a memory block where it is placed and this variable is ignored.
++ */
++ float priority;
++} VmaAllocationCreateInfo;
++
++/// Describes parameter of created #VmaPool.
++typedef struct VmaPoolCreateInfo
++{
++ /** \brief Vulkan memory type index to allocate this pool from.
++ */
++ uint32_t memoryTypeIndex;
++ /** \brief Use combination of #VmaPoolCreateFlagBits.
++ */
++ VmaPoolCreateFlags flags;
++ /** \brief Size of a single `VkDeviceMemory` block to be allocated as part of this pool, in bytes. Optional.
++
++ Specify nonzero to set explicit, constant size of memory blocks used by this
++ pool.
++
++ Leave 0 to use default and let the library manage block sizes automatically.
++ Sizes of particular blocks may vary.
++ In this case, the pool will also support dedicated allocations.
++ */
++ VkDeviceSize blockSize;
++ /** \brief Minimum number of blocks to be always allocated in this pool, even if they stay empty.
++
++ Set to 0 to have no preallocated blocks and allow the pool be completely empty.
++ */
++ size_t minBlockCount;
++ /** \brief Maximum number of blocks that can be allocated in this pool. Optional.
++
++ Set to 0 to use default, which is `SIZE_MAX`, which means no limit.
++
++ Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated
++ throughout whole lifetime of this pool.
++ */
++ size_t maxBlockCount;
++ /** \brief A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations.
++
++ It is used only when #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT flag was used during creation of the #VmaAllocator object.
++ Otherwise, this variable is ignored.
++ */
++ float priority;
++ /** \brief Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
++
++ Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two.
++ It can be useful in cases where alignment returned by Vulkan by functions like `vkGetBufferMemoryRequirements` is not enough,
++ e.g. when doing interop with OpenGL.
++ */
++ VkDeviceSize minAllocationAlignment;
++ /** \brief Additional `pNext` chain to be attached to `VkMemoryAllocateInfo` used for every allocation made by this pool. Optional.
++
++ Optional, can be null. If not null, it must point to a `pNext` chain of structures that can be attached to `VkMemoryAllocateInfo`.
++ It can be useful for special needs such as adding `VkExportMemoryAllocateInfoKHR`.
++ Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool.
++
++ Please note that some structures, e.g. `VkMemoryPriorityAllocateInfoEXT`, `VkMemoryDedicatedAllocateInfoKHR`,
++ can be attached automatically by this library when using other, more convenient of its features.
++ */
++ void* VMA_NULLABLE pMemoryAllocateNext;
++} VmaPoolCreateInfo;
++
++/** @} */
++
++/**
++\addtogroup group_alloc
++@{
++*/
++
++/// Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
++typedef struct VmaAllocationInfo
++{
++ /** \brief Memory type index that this allocation was allocated from.
++
++ It never changes.
++ */
++ uint32_t memoryType;
++ /** \brief Handle to Vulkan memory object.
++
++ Same memory object can be shared by multiple allocations.
++
++ It can change after the allocation is moved during \ref defragmentation.
++ */
++ VkDeviceMemory VMA_NULLABLE_NON_DISPATCHABLE deviceMemory;
++ /** \brief Offset in `VkDeviceMemory` object to the beginning of this allocation, in bytes. `(deviceMemory, offset)` pair is unique to this allocation.
++
++ You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function
++ vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image,
++ not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation
++ and apply this offset automatically.
++
++ It can change after the allocation is moved during \ref defragmentation.
++ */
++ VkDeviceSize offset;
++ /** \brief Size of this allocation, in bytes.
++
++ It never changes.
++
++ \note Allocation size returned in this variable may be greater than the size
++ requested for the resource e.g. as `VkBufferCreateInfo::size`. Whole size of the
++ allocation is accessible for operations on memory e.g. using a pointer after
++ mapping with vmaMapMemory(), but operations on the resource e.g. using
++ `vkCmdCopyBuffer` must be limited to the size of the resource.
++ */
++ VkDeviceSize size;
++ /** \brief Pointer to the beginning of this allocation as mapped data.
++
++ If the allocation hasn't been mapped using vmaMapMemory() and hasn't been
++ created with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value is null.
++
++ It can change after call to vmaMapMemory(), vmaUnmapMemory().
++ It can also change after the allocation is moved during \ref defragmentation.
++ */
++ void* VMA_NULLABLE pMappedData;
++ /** \brief Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().
++
++ It can change after call to vmaSetAllocationUserData() for this allocation.
++ */
++ void* VMA_NULLABLE pUserData;
++ /** \brief Custom allocation name that was set with vmaSetAllocationName().
++
++ It can change after call to vmaSetAllocationName() for this allocation.
++
++ Another way to set custom name is to pass it in VmaAllocationCreateInfo::pUserData with
++ additional flag #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT set [DEPRECATED].
++ */
++ const char* VMA_NULLABLE pName;
++} VmaAllocationInfo;
++
++/** \brief Parameters for defragmentation.
++
++To be used with function vmaBeginDefragmentation().
++*/
++typedef struct VmaDefragmentationInfo
++{
++ /// \brief Use combination of #VmaDefragmentationFlagBits.
++ VmaDefragmentationFlags flags;
++ /** \brief Custom pool to be defragmented.
++
++ If null then default pools will undergo defragmentation process.
++ */
++ VmaPool VMA_NULLABLE pool;
++ /** \brief Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places.
++
++ `0` means no limit.
++ */
++ VkDeviceSize maxBytesPerPass;
++ /** \brief Maximum number of allocations that can be moved during single pass to a different place.
++
++ `0` means no limit.
++ */
++ uint32_t maxAllocationsPerPass;
++} VmaDefragmentationInfo;
++
++/// Single move of an allocation to be done for defragmentation.
++typedef struct VmaDefragmentationMove
++{
++ /// Operation to be performed on the allocation by vmaEndDefragmentationPass(). Default value is #VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it.
++ VmaDefragmentationMoveOperation operation;
++ /// Allocation that should be moved.
++ VmaAllocation VMA_NOT_NULL srcAllocation;
++ /** \brief Temporary allocation pointing to destination memory that will replace `srcAllocation`.
++
++ \warning Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass,
++ to be used for binding new buffer/image to the destination memory using e.g. vmaBindBufferMemory().
++ vmaEndDefragmentationPass() will destroy it and make `srcAllocation` point to this memory.
++ */
++ VmaAllocation VMA_NOT_NULL dstTmpAllocation;
++} VmaDefragmentationMove;
++
++/** \brief Parameters for incremental defragmentation steps.
++
++To be used with function vmaBeginDefragmentationPass().
++*/
++typedef struct VmaDefragmentationPassMoveInfo
++{
++ /// Number of elements in the `pMoves` array.
++ uint32_t moveCount;
++ /** \brief Array of moves to be performed by the user in the current defragmentation pass.
++
++ Pointer to an array of `moveCount` elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().
++
++ For each element, you should:
++
++ 1. Create a new buffer/image in the place pointed by VmaDefragmentationMove::dstMemory + VmaDefragmentationMove::dstOffset.
++ 2. Copy data from the VmaDefragmentationMove::srcAllocation e.g. using `vkCmdCopyBuffer`, `vkCmdCopyImage`.
++ 3. Make sure these commands finished executing on the GPU.
++ 4. Destroy the old buffer/image.
++
++ Only then you can finish defragmentation pass by calling vmaEndDefragmentationPass().
++ After this call, the allocation will point to the new place in memory.
++
++ Alternatively, if you cannot move specific allocation, you can set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE.
++
++ Alternatively, if you decide you want to completely remove the allocation:
++
++ 1. Destroy its buffer/image.
++ 2. Set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY.
++
++ Then, after vmaEndDefragmentationPass() the allocation will be freed.
++ */
++ VmaDefragmentationMove* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(moveCount) pMoves;
++} VmaDefragmentationPassMoveInfo;
++
++/// Statistics returned for defragmentation process in function vmaEndDefragmentation().
++typedef struct VmaDefragmentationStats
++{
++ /// Total number of bytes that have been copied while moving allocations to different places.
++ VkDeviceSize bytesMoved;
++ /// Total number of bytes that have been released to the system by freeing empty `VkDeviceMemory` objects.
++ VkDeviceSize bytesFreed;
++ /// Number of allocations that have been moved to different places.
++ uint32_t allocationsMoved;
++ /// Number of empty `VkDeviceMemory` objects that have been released to the system.
++ uint32_t deviceMemoryBlocksFreed;
++} VmaDefragmentationStats;
++
++/** @} */
++
++/**
++\addtogroup group_virtual
++@{
++*/
++
++/// Parameters of created #VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
++typedef struct VmaVirtualBlockCreateInfo
++{
++ /** \brief Total size of the virtual block.
++
++ Sizes can be expressed in bytes or any units you want as long as you are consistent in using them.
++ For example, if you allocate from some array of structures, 1 can mean single instance of entire structure.
++ */
++ VkDeviceSize size;
++
++ /** \brief Use combination of #VmaVirtualBlockCreateFlagBits.
++ */
++ VmaVirtualBlockCreateFlags flags;
++
++ /** \brief Custom CPU memory allocation callbacks. Optional.
++
++ Optional, can be null. When specified, they will be used for all CPU-side memory allocations.
++ */
++ const VkAllocationCallbacks* VMA_NULLABLE pAllocationCallbacks;
++} VmaVirtualBlockCreateInfo;
++
++/// Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
++typedef struct VmaVirtualAllocationCreateInfo
++{
++ /** \brief Size of the allocation.
++
++ Cannot be zero.
++ */
++ VkDeviceSize size;
++ /** \brief Required alignment of the allocation. Optional.
++
++ Must be power of two. Special value 0 has the same meaning as 1 - means no special alignment is required, so allocation can start at any offset.
++ */
++ VkDeviceSize alignment;
++ /** \brief Use combination of #VmaVirtualAllocationCreateFlagBits.
++ */
++ VmaVirtualAllocationCreateFlags flags;
++ /** \brief Custom pointer to be associated with the allocation. Optional.
++
++ It can be any value and can be used for user-defined purposes. It can be fetched or changed later.
++ */
++ void* VMA_NULLABLE pUserData;
++} VmaVirtualAllocationCreateInfo;
++
++/// Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
++typedef struct VmaVirtualAllocationInfo
++{
++ /** \brief Offset of the allocation.
++
++ Offset at which the allocation was made.
++ */
++ VkDeviceSize offset;
++ /** \brief Size of the allocation.
++
++ Same value as passed in VmaVirtualAllocationCreateInfo::size.
++ */
++ VkDeviceSize size;
++ /** \brief Custom pointer associated with the allocation.
++
++ Same value as passed in VmaVirtualAllocationCreateInfo::pUserData or to vmaSetVirtualAllocationUserData().
++ */
++ void* VMA_NULLABLE pUserData;
++} VmaVirtualAllocationInfo;
++
++/** @} */
++
++#endif // _VMA_DATA_TYPES_DECLARATIONS
++
++#ifndef _VMA_FUNCTION_HEADERS
++
++/**
++\addtogroup group_init
++@{
++*/
++
++/// Creates #VmaAllocator object.
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
++ const VmaAllocatorCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaAllocator VMA_NULLABLE* VMA_NOT_NULL pAllocator);
++
++/// Destroys allocator object.
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
++ VmaAllocator VMA_NULLABLE allocator);
++
++/** \brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc.
++
++It might be useful if you want to keep just the #VmaAllocator handle and fetch other required handles to
++`VkPhysicalDevice`, `VkDevice` etc. every time using this function.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocatorInfo(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocatorInfo* VMA_NOT_NULL pAllocatorInfo);
++
++/**
++PhysicalDeviceProperties are fetched from physicalDevice by the allocator.
++You can access it here, without fetching it again on your own.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkPhysicalDeviceProperties* VMA_NULLABLE* VMA_NOT_NULL ppPhysicalDeviceProperties);
++
++/**
++PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.
++You can access it here, without fetching it again on your own.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkPhysicalDeviceMemoryProperties* VMA_NULLABLE* VMA_NOT_NULL ppPhysicalDeviceMemoryProperties);
++
++/**
++\brief Given Memory Type Index, returns Property Flags of this memory type.
++
++This is just a convenience function. Same information can be obtained using
++vmaGetMemoryProperties().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t memoryTypeIndex,
++ VkMemoryPropertyFlags* VMA_NOT_NULL pFlags);
++
++/** \brief Sets index of the current frame.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t frameIndex);
++
++/** @} */
++
++/**
++\addtogroup group_stats
++@{
++*/
++
++/** \brief Retrieves statistics from current state of the Allocator.
++
++This function is called "calculate" not "get" because it has to traverse all
++internal data structures, so it may be quite slow. Use it for debugging purposes.
++For faster but more brief statistics suitable to be called every frame or every allocation,
++use vmaGetHeapBudgets().
++
++Note that when using allocator from multiple threads, returned information may immediately
++become outdated.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaTotalStatistics* VMA_NOT_NULL pStats);
++
++/** \brief Retrieves information about current memory usage and budget for all memory heaps.
++
++\param allocator
++\param[out] pBudgets Must point to array with number of elements at least equal to number of memory heaps in physical device used.
++
++This function is called "get" not "calculate" because it is very fast, suitable to be called
++every frame or every allocation. For more detailed statistics use vmaCalculateStatistics().
++
++Note that when using allocator from multiple threads, returned information may immediately
++become outdated.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaBudget* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryHeapCount") pBudgets);
++
++/** @} */
++
++/**
++\addtogroup group_alloc
++@{
++*/
++
++/**
++\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
++
++This algorithm tries to find a memory type that:
++
++- Is allowed by memoryTypeBits.
++- Contains all the flags from pAllocationCreateInfo->requiredFlags.
++- Matches intended usage.
++- Has as many flags from pAllocationCreateInfo->preferredFlags as possible.
++
++\return Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result
++from this function or any other allocating function probably means that your
++device doesn't support any memory type with requested features for the specific
++type of resource you want to use it for. Please check parameters of your
++resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t memoryTypeBits,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
++ uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
++
++/**
++\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
++
++It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
++It internally creates a temporary, dummy buffer that never has memory bound.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
++ uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
++
++/**
++\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
++
++It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
++It internally creates a temporary, dummy image that never has memory bound.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
++ uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
++
++/** \brief Allocates Vulkan device memory and creates #VmaPool object.
++
++\param allocator Allocator object.
++\param pCreateInfo Parameters of pool to create.
++\param[out] pPool Handle to created pool.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VmaPoolCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaPool VMA_NULLABLE* VMA_NOT_NULL pPool);
++
++/** \brief Destroys #VmaPool object and frees Vulkan device memory.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaPool VMA_NULLABLE pool);
++
++/** @} */
++
++/**
++\addtogroup group_stats
++@{
++*/
++
++/** \brief Retrieves statistics of existing #VmaPool object.
++
++\param allocator Allocator object.
++\param pool Pool object.
++\param[out] pPoolStats Statistics of specified pool.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStatistics(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaPool VMA_NOT_NULL pool,
++ VmaStatistics* VMA_NOT_NULL pPoolStats);
++
++/** \brief Retrieves detailed statistics of existing #VmaPool object.
++
++\param allocator Allocator object.
++\param pool Pool object.
++\param[out] pPoolStats Statistics of specified pool.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaCalculatePoolStatistics(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaPool VMA_NOT_NULL pool,
++ VmaDetailedStatistics* VMA_NOT_NULL pPoolStats);
++
++/** @} */
++
++/**
++\addtogroup group_alloc
++@{
++*/
++
++/** \brief Checks magic number in margins around all allocations in given memory pool in search for corruptions.
++
++Corruption detection is enabled only when `VMA_DEBUG_DETECT_CORRUPTION` macro is defined to nonzero,
++`VMA_DEBUG_MARGIN` is defined to nonzero and the pool is created in memory type that is
++`HOST_VISIBLE` and `HOST_COHERENT`. For more information, see [Corruption detection](@ref debugging_memory_usage_corruption_detection).
++
++Possible return values:
++
++- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for specified pool.
++- `VK_SUCCESS` - corruption detection has been performed and succeeded.
++- `VK_ERROR_UNKNOWN` - corruption detection has been performed and found memory corruptions around one of the allocations.
++ `VMA_ASSERT` is also fired in that case.
++- Other value: Error returned by Vulkan, e.g. memory mapping failure.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaPool VMA_NOT_NULL pool);
++
++/** \brief Retrieves name of a custom pool.
++
++After the call `ppName` is either null or points to an internally-owned null-terminated string
++containing name of the pool that was previously set. The pointer becomes invalid when the pool is
++destroyed or its name is changed using vmaSetPoolName().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaPool VMA_NOT_NULL pool,
++ const char* VMA_NULLABLE* VMA_NOT_NULL ppName);
++
++/** \brief Sets name of a custom pool.
++
++`pName` can be either null or pointer to a null-terminated string with new name for the pool.
++Function makes internal copy of the string, so it can be changed or freed immediately after this call.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaPool VMA_NOT_NULL pool,
++ const char* VMA_NULLABLE pName);
++
++/** \brief General purpose memory allocation.
++
++\param allocator
++\param pVkMemoryRequirements
++\param pCreateInfo
++\param[out] pAllocation Handle to allocated memory.
++\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
++
++You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().
++
++It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(),
++vmaCreateBuffer(), vmaCreateImage() instead whenever possible.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
++ VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
++
++/** \brief General purpose memory allocation for multiple allocation objects at once.
++
++\param allocator Allocator object.
++\param pVkMemoryRequirements Memory requirements for each allocation.
++\param pCreateInfo Creation parameters for each allocation.
++\param allocationCount Number of allocations to make.
++\param[out] pAllocations Pointer to array that will be filled with handles to created allocations.
++\param[out] pAllocationInfo Optional. Pointer to array that will be filled with parameters of created allocations.
++
++You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().
++
++Word "pages" is just a suggestion to use this function to allocate pieces of memory needed for sparse binding.
++It is just a general purpose allocation function able to make multiple allocations at once.
++It may be internally optimized to be more efficient than calling vmaAllocateMemory() `allocationCount` times.
++
++All allocations are made using same parameters. All of them are created out of the same memory pool and type.
++If any allocation fails, all allocations already made within this function call are also freed, so that when
++returned result is not `VK_SUCCESS`, `pAllocation` array is always entirely filled with `VK_NULL_HANDLE`.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkMemoryRequirements* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pVkMemoryRequirements,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pCreateInfo,
++ size_t allocationCount,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
++ VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
++
++/** \brief Allocates memory suitable for given `VkBuffer`.
++
++\param allocator
++\param buffer
++\param pCreateInfo
++\param[out] pAllocation Handle to allocated memory.
++\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
++
++It only creates #VmaAllocation. To bind the memory to the buffer, use vmaBindBufferMemory().
++
++This is a special-purpose function. In most cases you should use vmaCreateBuffer().
++
++You must free the allocation using vmaFreeMemory() when no longer needed.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
++ VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
++
++/** \brief Allocates memory suitable for given `VkImage`.
++
++\param allocator
++\param image
++\param pCreateInfo
++\param[out] pAllocation Handle to allocated memory.
++\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
++
++It only creates #VmaAllocation. To bind the memory to the buffer, use vmaBindImageMemory().
++
++This is a special-purpose function. In most cases you should use vmaCreateImage().
++
++You must free the allocation using vmaFreeMemory() when no longer needed.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
++ VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
++
++/** \brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
++
++Passing `VK_NULL_HANDLE` as `allocation` is valid. Such function call is just skipped.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VmaAllocation VMA_NULLABLE allocation);
++
++/** \brief Frees memory and destroys multiple allocations.
++
++Word "pages" is just a suggestion to use this function to free pieces of memory used for sparse binding.
++It is just a general purpose function to free memory and destroy allocations made using e.g. vmaAllocateMemory(),
++vmaAllocateMemoryPages() and other functions.
++It may be internally optimized to be more efficient than calling vmaFreeMemory() `allocationCount` times.
++
++Allocations in `pAllocations` array can come from any memory pools and types.
++Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entries are just skipped.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
++ VmaAllocator VMA_NOT_NULL allocator,
++ size_t allocationCount,
++ const VmaAllocation VMA_NULLABLE* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
++
++/** \brief Returns current information about specified allocation.
++
++Current paramteres of given allocation are returned in `pAllocationInfo`.
++
++Although this function doesn't lock any mutex, so it should be quite efficient,
++you should avoid calling it too often.
++You can retrieve same VmaAllocationInfo structure while creating your resource, from function
++vmaCreateBuffer(), vmaCreateImage(). You can remember it if you are sure parameters don't change
++(e.g. due to defragmentation).
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VmaAllocationInfo* VMA_NOT_NULL pAllocationInfo);
++
++/** \brief Sets pUserData in given allocation to new value.
++
++The value of pointer `pUserData` is copied to allocation's `pUserData`.
++It is opaque, so you can use it however you want - e.g.
++as a pointer, ordinal number or some handle to you own data.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ void* VMA_NULLABLE pUserData);
++
++/** \brief Sets pName in given allocation to new value.
++
++`pName` must be either null, or pointer to a null-terminated string. The function
++makes local copy of the string and sets it as allocation's `pName`. String
++passed as pName doesn't need to be valid for whole lifetime of the allocation -
++you can free it after this call. String previously pointed by allocation's
++`pName` is freed from memory.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationName(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ const char* VMA_NULLABLE pName);
++
++/**
++\brief Given an allocation, returns Property Flags of its memory type.
++
++This is just a convenience function. Same information can be obtained using
++vmaGetAllocationInfo() + vmaGetMemoryProperties().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationMemoryProperties(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkMemoryPropertyFlags* VMA_NOT_NULL pFlags);
++
++/** \brief Maps memory represented by given allocation and returns pointer to it.
++
++Maps memory represented by given allocation to make it accessible to CPU code.
++When succeeded, `*ppData` contains pointer to first byte of this memory.
++
++\warning
++If the allocation is part of a bigger `VkDeviceMemory` block, returned pointer is
++correctly offsetted to the beginning of region assigned to this particular allocation.
++Unlike the result of `vkMapMemory`, it points to the allocation, not to the beginning of the whole block.
++You should not add VmaAllocationInfo::offset to it!
++
++Mapping is internally reference-counted and synchronized, so despite raw Vulkan
++function `vkMapMemory()` cannot be used to map same block of `VkDeviceMemory`
++multiple times simultaneously, it is safe to call this function on allocations
++assigned to the same memory block. Actual Vulkan memory will be mapped on first
++mapping and unmapped on last unmapping.
++
++If the function succeeded, you must call vmaUnmapMemory() to unmap the
++allocation when mapping is no longer needed or before freeing the allocation, at
++the latest.
++
++It also safe to call this function multiple times on the same allocation. You
++must call vmaUnmapMemory() same number of times as you called vmaMapMemory().
++
++It is also safe to call this function on allocation created with
++#VMA_ALLOCATION_CREATE_MAPPED_BIT flag. Its memory stays mapped all the time.
++You must still call vmaUnmapMemory() same number of times as you called
++vmaMapMemory(). You must not call vmaUnmapMemory() additional time to free the
++"0-th" mapping made automatically due to #VMA_ALLOCATION_CREATE_MAPPED_BIT flag.
++
++This function fails when used on allocation made in memory type that is not
++`HOST_VISIBLE`.
++
++This function doesn't automatically flush or invalidate caches.
++If the allocation is made from a memory types that is not `HOST_COHERENT`,
++you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ void* VMA_NULLABLE* VMA_NOT_NULL ppData);
++
++/** \brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
++
++For details, see description of vmaMapMemory().
++
++This function doesn't automatically flush or invalidate caches.
++If the allocation is made from a memory types that is not `HOST_COHERENT`,
++you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation);
++
++/** \brief Flushes memory of given allocation.
++
++Calls `vkFlushMappedMemoryRanges()` for memory associated with given range of given allocation.
++It needs to be called after writing to a mapped memory for memory types that are not `HOST_COHERENT`.
++Unmap operation doesn't do that automatically.
++
++- `offset` must be relative to the beginning of allocation.
++- `size` can be `VK_WHOLE_SIZE`. It means all memory from `offset` the the end of given allocation.
++- `offset` and `size` don't have to be aligned.
++ They are internally rounded down/up to multiply of `nonCoherentAtomSize`.
++- If `size` is 0, this call is ignored.
++- If memory type that the `allocation` belongs to is not `HOST_VISIBLE` or it is `HOST_COHERENT`,
++ this call is ignored.
++
++Warning! `offset` and `size` are relative to the contents of given `allocation`.
++If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.
++Do not pass allocation's offset as `offset`!!!
++
++This function returns the `VkResult` from `vkFlushMappedMemoryRanges` if it is
++called, otherwise `VK_SUCCESS`.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocation(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkDeviceSize offset,
++ VkDeviceSize size);
++
++/** \brief Invalidates memory of given allocation.
++
++Calls `vkInvalidateMappedMemoryRanges()` for memory associated with given range of given allocation.
++It needs to be called before reading from a mapped memory for memory types that are not `HOST_COHERENT`.
++Map operation doesn't do that automatically.
++
++- `offset` must be relative to the beginning of allocation.
++- `size` can be `VK_WHOLE_SIZE`. It means all memory from `offset` the the end of given allocation.
++- `offset` and `size` don't have to be aligned.
++ They are internally rounded down/up to multiply of `nonCoherentAtomSize`.
++- If `size` is 0, this call is ignored.
++- If memory type that the `allocation` belongs to is not `HOST_VISIBLE` or it is `HOST_COHERENT`,
++ this call is ignored.
++
++Warning! `offset` and `size` are relative to the contents of given `allocation`.
++If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.
++Do not pass allocation's offset as `offset`!!!
++
++This function returns the `VkResult` from `vkInvalidateMappedMemoryRanges` if
++it is called, otherwise `VK_SUCCESS`.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocation(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkDeviceSize offset,
++ VkDeviceSize size);
++
++/** \brief Flushes memory of given set of allocations.
++
++Calls `vkFlushMappedMemoryRanges()` for memory associated with given ranges of given allocations.
++For more information, see documentation of vmaFlushAllocation().
++
++\param allocator
++\param allocationCount
++\param allocations
++\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all ofsets are zero.
++\param sizes If not null, it must point to an array of sizes of regions to flush in respective allocations. Null means `VK_WHOLE_SIZE` for all allocations.
++
++This function returns the `VkResult` from `vkFlushMappedMemoryRanges` if it is
++called, otherwise `VK_SUCCESS`.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocations(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t allocationCount,
++ const VmaAllocation VMA_NOT_NULL* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
++ const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
++ const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
++
++/** \brief Invalidates memory of given set of allocations.
++
++Calls `vkInvalidateMappedMemoryRanges()` for memory associated with given ranges of given allocations.
++For more information, see documentation of vmaInvalidateAllocation().
++
++\param allocator
++\param allocationCount
++\param allocations
++\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all ofsets are zero.
++\param sizes If not null, it must point to an array of sizes of regions to flush in respective allocations. Null means `VK_WHOLE_SIZE` for all allocations.
++
++This function returns the `VkResult` from `vkInvalidateMappedMemoryRanges` if it is
++called, otherwise `VK_SUCCESS`.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t allocationCount,
++ const VmaAllocation VMA_NOT_NULL* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
++ const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
++ const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
++
++/** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
++
++\param allocator
++\param memoryTypeBits Bit mask, where each bit set means that a memory type with that index should be checked.
++
++Corruption detection is enabled only when `VMA_DEBUG_DETECT_CORRUPTION` macro is defined to nonzero,
++`VMA_DEBUG_MARGIN` is defined to nonzero and only for memory types that are
++`HOST_VISIBLE` and `HOST_COHERENT`. For more information, see [Corruption detection](@ref debugging_memory_usage_corruption_detection).
++
++Possible return values:
++
++- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for any of specified memory types.
++- `VK_SUCCESS` - corruption detection has been performed and succeeded.
++- `VK_ERROR_UNKNOWN` - corruption detection has been performed and found memory corruptions around one of the allocations.
++ `VMA_ASSERT` is also fired in that case.
++- Other value: Error returned by Vulkan, e.g. memory mapping failure.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(
++ VmaAllocator VMA_NOT_NULL allocator,
++ uint32_t memoryTypeBits);
++
++/** \brief Begins defragmentation process.
++
++\param allocator Allocator object.
++\param pInfo Structure filled with parameters of defragmentation.
++\param[out] pContext Context object that must be passed to vmaEndDefragmentation() to finish defragmentation.
++\returns
++- `VK_SUCCESS` if defragmentation can begin.
++- `VK_ERROR_FEATURE_NOT_PRESENT` if defragmentation is not supported.
++
++For more information about defragmentation, see documentation chapter:
++[Defragmentation](@ref defragmentation).
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentation(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VmaDefragmentationInfo* VMA_NOT_NULL pInfo,
++ VmaDefragmentationContext VMA_NULLABLE* VMA_NOT_NULL pContext);
++
++/** \brief Ends defragmentation process.
++
++\param allocator Allocator object.
++\param context Context object that has been created by vmaBeginDefragmentation().
++\param[out] pStats Optional stats for the defragmentation. Can be null.
++
++Use this function to finish defragmentation started by vmaBeginDefragmentation().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaEndDefragmentation(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaDefragmentationContext VMA_NOT_NULL context,
++ VmaDefragmentationStats* VMA_NULLABLE pStats);
++
++/** \brief Starts single defragmentation pass.
++
++\param allocator Allocator object.
++\param context Context object that has been created by vmaBeginDefragmentation().
++\param[out] pPassInfo Computed informations for current pass.
++\returns
++- `VK_SUCCESS` if no more moves are possible. Then you can omit call to vmaEndDefragmentationPass() and simply end whole defragmentation.
++- `VK_INCOMPLETE` if there are pending moves returned in `pPassInfo`. You need to perform them, call vmaEndDefragmentationPass(),
++ and then preferably try another pass with vmaBeginDefragmentationPass().
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentationPass(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaDefragmentationContext VMA_NOT_NULL context,
++ VmaDefragmentationPassMoveInfo* VMA_NOT_NULL pPassInfo);
++
++/** \brief Ends single defragmentation pass.
++
++\param allocator Allocator object.
++\param context Context object that has been created by vmaBeginDefragmentation().
++\param pPassInfo Computed informations for current pass filled by vmaBeginDefragmentationPass() and possibly modified by you.
++
++Returns `VK_SUCCESS` if no more moves are possible or `VK_INCOMPLETE` if more defragmentations are possible.
++
++Ends incremental defragmentation pass and commits all defragmentation moves from `pPassInfo`.
++After this call:
++
++- Allocations at `pPassInfo[i].srcAllocation` that had `pPassInfo[i].operation ==` #VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY
++ (which is the default) will be pointing to the new destination place.
++- Allocation at `pPassInfo[i].srcAllocation` that had `pPassInfo[i].operation ==` #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY
++ will be freed.
++
++If no more moves are possible you can end whole defragmentation.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaEndDefragmentationPass(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaDefragmentationContext VMA_NOT_NULL context,
++ VmaDefragmentationPassMoveInfo* VMA_NOT_NULL pPassInfo);
++
++/** \brief Binds buffer to allocation.
++
++Binds specified buffer to region of memory represented by specified allocation.
++Gets `VkDeviceMemory` handle and offset from the allocation.
++If you want to create a buffer, allocate memory for it and bind them together separately,
++you should use this function for binding instead of standard `vkBindBufferMemory()`,
++because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple
++allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously
++(which is illegal in Vulkan).
++
++It is recommended to use function vmaCreateBuffer() instead of this one.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer);
++
++/** \brief Binds buffer to allocation with additional parameters.
++
++\param allocator
++\param allocation
++\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0.
++\param buffer
++\param pNext A chain of structures to be attached to `VkBindBufferMemoryInfoKHR` structure used internally. Normally it should be null.
++
++This function is similar to vmaBindBufferMemory(), but it provides additional parameters.
++
++If `pNext` is not null, #VmaAllocator object must have been created with #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag
++or with VmaAllocatorCreateInfo::vulkanApiVersion `>= VK_API_VERSION_1_1`. Otherwise the call fails.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkDeviceSize allocationLocalOffset,
++ VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
++ const void* VMA_NULLABLE pNext);
++
++/** \brief Binds image to allocation.
++
++Binds specified image to region of memory represented by specified allocation.
++Gets `VkDeviceMemory` handle and offset from the allocation.
++If you want to create an image, allocate memory for it and bind them together separately,
++you should use this function for binding instead of standard `vkBindImageMemory()`,
++because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple
++allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously
++(which is illegal in Vulkan).
++
++It is recommended to use function vmaCreateImage() instead of this one.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkImage VMA_NOT_NULL_NON_DISPATCHABLE image);
++
++/** \brief Binds image to allocation with additional parameters.
++
++\param allocator
++\param allocation
++\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0.
++\param image
++\param pNext A chain of structures to be attached to `VkBindImageMemoryInfoKHR` structure used internally. Normally it should be null.
++
++This function is similar to vmaBindImageMemory(), but it provides additional parameters.
++
++If `pNext` is not null, #VmaAllocator object must have been created with #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag
++or with VmaAllocatorCreateInfo::vulkanApiVersion `>= VK_API_VERSION_1_1`. Otherwise the call fails.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkDeviceSize allocationLocalOffset,
++ VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
++ const void* VMA_NULLABLE pNext);
++
++/** \brief Creates a new `VkBuffer`, allocates and binds memory for it.
++
++\param allocator
++\param pBufferCreateInfo
++\param pAllocationCreateInfo
++\param[out] pBuffer Buffer that was created.
++\param[out] pAllocation Allocation that was created.
++\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
++
++This function automatically:
++
++-# Creates buffer.
++-# Allocates appropriate memory for it.
++-# Binds the buffer with the memory.
++
++If any of these operations fail, buffer and allocation are not created,
++returned value is negative error code, `*pBuffer` and `*pAllocation` are null.
++
++If the function succeeded, you must destroy both buffer and allocation when you
++no longer need them using either convenience function vmaDestroyBuffer() or
++separately, using `vkDestroyBuffer()` and vmaFreeMemory().
++
++If #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used,
++VK_KHR_dedicated_allocation extension is used internally to query driver whether
++it requires or prefers the new buffer to have dedicated allocation. If yes,
++and if dedicated allocation is possible
++(#VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated
++allocation for this buffer, just like when using
++#VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++
++\note This function creates a new `VkBuffer`. Sub-allocation of parts of one large buffer,
++although recommended as a good practice, is out of scope of this library and could be implemented
++by the user as a higher-level logic on top of VMA.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
++ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
++ VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
++
++/** \brief Creates a buffer with additional minimum alignment.
++
++Similar to vmaCreateBuffer() but provides additional parameter `minAlignment` which allows to specify custom,
++minimum alignment to be used when placing the buffer inside a larger memory block, which may be needed e.g.
++for interop with OpenGL.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
++ VkDeviceSize minAlignment,
++ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
++ VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
++
++/** \brief Creates a new `VkBuffer`, binds already created memory for it.
++
++\param allocator
++\param allocation Allocation that provides memory to be used for binding new buffer to it.
++\param pBufferCreateInfo
++\param[out] pBuffer Buffer that was created.
++
++This function automatically:
++
++-# Creates buffer.
++-# Binds the buffer with the supplied memory.
++
++If any of these operations fail, buffer is not created,
++returned value is negative error code and `*pBuffer` is null.
++
++If the function succeeded, you must destroy the buffer when you
++no longer need it using `vkDestroyBuffer()`. If you want to also destroy the corresponding
++allocation you can use convenience function vmaDestroyBuffer().
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingBuffer(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
++ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer);
++
++/** \brief Destroys Vulkan buffer and frees allocated memory.
++
++This is just a convenience function equivalent to:
++
++\code
++vkDestroyBuffer(device, buffer, allocationCallbacks);
++vmaFreeMemory(allocator, allocation);
++\endcode
++
++It it safe to pass null as buffer and/or allocation.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE buffer,
++ VmaAllocation VMA_NULLABLE allocation);
++
++/// Function similar to vmaCreateBuffer().
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(
++ VmaAllocator VMA_NOT_NULL allocator,
++ const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
++ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
++ VkImage VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pImage,
++ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
++ VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
++
++/// Function similar to vmaCreateAliasingBuffer().
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingImage(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
++ VkImage VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pImage);
++
++/** \brief Destroys Vulkan image and frees allocated memory.
++
++This is just a convenience function equivalent to:
++
++\code
++vkDestroyImage(device, image, allocationCallbacks);
++vmaFreeMemory(allocator, allocation);
++\endcode
++
++It it safe to pass null as image and/or allocation.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VkImage VMA_NULLABLE_NON_DISPATCHABLE image,
++ VmaAllocation VMA_NULLABLE allocation);
++
++/** @} */
++
++/**
++\addtogroup group_virtual
++@{
++*/
++
++/** \brief Creates new #VmaVirtualBlock object.
++
++\param pCreateInfo Parameters for creation.
++\param[out] pVirtualBlock Returned virtual block object or `VMA_NULL` if creation failed.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateVirtualBlock(
++ const VmaVirtualBlockCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaVirtualBlock VMA_NULLABLE* VMA_NOT_NULL pVirtualBlock);
++
++/** \brief Destroys #VmaVirtualBlock object.
++
++Please note that you should consciously handle virtual allocations that could remain unfreed in the block.
++You should either free them individually using vmaVirtualFree() or call vmaClearVirtualBlock()
++if you are sure this is what you want. If you do neither, an assert is called.
++
++If you keep pointers to some additional metadata associated with your virtual allocations in their `pUserData`,
++don't forget to free them.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyVirtualBlock(
++ VmaVirtualBlock VMA_NULLABLE virtualBlock);
++
++/** \brief Returns true of the #VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations.
++*/
++VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaIsVirtualBlockEmpty(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock);
++
++/** \brief Returns information about a specific virtual allocation within a virtual block, like its size and `pUserData` pointer.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetVirtualAllocationInfo(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaVirtualAllocation VMA_NOT_NULL_NON_DISPATCHABLE allocation, VmaVirtualAllocationInfo* VMA_NOT_NULL pVirtualAllocInfo);
++
++/** \brief Allocates new virtual allocation inside given #VmaVirtualBlock.
++
++If the allocation fails due to not enough free space available, `VK_ERROR_OUT_OF_DEVICE_MEMORY` is returned
++(despite the function doesn't ever allocate actual GPU memory).
++`pAllocation` is then set to `VK_NULL_HANDLE` and `pOffset`, if not null, it set to `UINT64_MAX`.
++
++\param virtualBlock Virtual block
++\param pCreateInfo Parameters for the allocation
++\param[out] pAllocation Returned handle of the new allocation
++\param[out] pOffset Returned offset of the new allocation. Optional, can be null.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaVirtualAllocate(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ const VmaVirtualAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaVirtualAllocation VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pAllocation,
++ VkDeviceSize* VMA_NULLABLE pOffset);
++
++/** \brief Frees virtual allocation inside given #VmaVirtualBlock.
++
++It is correct to call this function with `allocation == VK_NULL_HANDLE` - it does nothing.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaVirtualFree(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaVirtualAllocation VMA_NULLABLE_NON_DISPATCHABLE allocation);
++
++/** \brief Frees all virtual allocations inside given #VmaVirtualBlock.
++
++You must either call this function or free each virtual allocation individually with vmaVirtualFree()
++before destroying a virtual block. Otherwise, an assert is called.
++
++If you keep pointer to some additional metadata associated with your virtual allocation in its `pUserData`,
++don't forget to free it as well.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaClearVirtualBlock(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock);
++
++/** \brief Changes custom pointer associated with given virtual allocation.
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaSetVirtualAllocationUserData(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaVirtualAllocation VMA_NOT_NULL_NON_DISPATCHABLE allocation,
++ void* VMA_NULLABLE pUserData);
++
++/** \brief Calculates and returns statistics about virtual allocations and memory usage in given #VmaVirtualBlock.
++
++This function is fast to call. For more detailed statistics, see vmaCalculateVirtualBlockStatistics().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaGetVirtualBlockStatistics(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaStatistics* VMA_NOT_NULL pStats);
++
++/** \brief Calculates and returns detailed statistics about virtual allocations and memory usage in given #VmaVirtualBlock.
++
++This function is slow to call. Use for debugging purposes.
++For less detailed statistics, see vmaGetVirtualBlockStatistics().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaCalculateVirtualBlockStatistics(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaDetailedStatistics* VMA_NOT_NULL pStats);
++
++/** @} */
++
++#if VMA_STATS_STRING_ENABLED
++/**
++\addtogroup group_stats
++@{
++*/
++
++/** \brief Builds and returns a null-terminated string in JSON format with information about given #VmaVirtualBlock.
++\param virtualBlock Virtual block.
++\param[out] ppStatsString Returned string.
++\param detailedMap Pass `VK_FALSE` to only obtain statistics as returned by vmaCalculateVirtualBlockStatistics(). Pass `VK_TRUE` to also obtain full list of allocations and free spaces.
++
++Returned string must be freed using vmaFreeVirtualBlockStatsString().
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaBuildVirtualBlockStatsString(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ char* VMA_NULLABLE* VMA_NOT_NULL ppStatsString,
++ VkBool32 detailedMap);
++
++/// Frees a string returned by vmaBuildVirtualBlockStatsString().
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeVirtualBlockStatsString(
++ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ char* VMA_NULLABLE pStatsString);
++
++/** \brief Builds and returns statistics as a null-terminated string in JSON format.
++\param allocator
++\param[out] ppStatsString Must be freed using vmaFreeStatsString() function.
++\param detailedMap
++*/
++VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
++ VmaAllocator VMA_NOT_NULL allocator,
++ char* VMA_NULLABLE* VMA_NOT_NULL ppStatsString,
++ VkBool32 detailedMap);
++
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
++ VmaAllocator VMA_NOT_NULL allocator,
++ char* VMA_NULLABLE pStatsString);
++
++/** @} */
++
++#endif // VMA_STATS_STRING_ENABLED
++
++#endif // _VMA_FUNCTION_HEADERS
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif // AMD_VULKAN_MEMORY_ALLOCATOR_H
++
++////////////////////////////////////////////////////////////////////////////////
++////////////////////////////////////////////////////////////////////////////////
++//
++// IMPLEMENTATION
++//
++////////////////////////////////////////////////////////////////////////////////
++////////////////////////////////////////////////////////////////////////////////
++
++// For Visual Studio IntelliSense.
++#if defined(__cplusplus) && defined(__INTELLISENSE__)
++#define VMA_IMPLEMENTATION
++#endif
++
++#ifdef VMA_IMPLEMENTATION
++#undef VMA_IMPLEMENTATION
++
++#include <cstdint>
++#include <cstdlib>
++#include <cstring>
++#include <utility>
++#include <type_traits>
++
++#ifdef _MSC_VER
++ #include <intrin.h> // For functions like __popcnt, _BitScanForward etc.
++#endif
++#if __cplusplus >= 202002L || _MSVC_LANG >= 202002L // C++20
++ #include <bit> // For std::popcount
++#endif
++
++/*******************************************************************************
++CONFIGURATION SECTION
++
++Define some of these macros before each #include of this header or change them
++here if you need other then default behavior depending on your environment.
++*/
++#ifndef _VMA_CONFIGURATION
++
++/*
++Define this macro to 1 to make the library fetch pointers to Vulkan functions
++internally, like:
++
++ vulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
++*/
++#if !defined(VMA_STATIC_VULKAN_FUNCTIONS) && !defined(VK_NO_PROTOTYPES)
++ #define VMA_STATIC_VULKAN_FUNCTIONS 1
++#endif
++
++/*
++Define this macro to 1 to make the library fetch pointers to Vulkan functions
++internally, like:
++
++ vulkanFunctions.vkAllocateMemory = (PFN_vkAllocateMemory)vkGetDeviceProcAddr(device, "vkAllocateMemory");
++
++To use this feature in new versions of VMA you now have to pass
++VmaVulkanFunctions::vkGetInstanceProcAddr and vkGetDeviceProcAddr as
++VmaAllocatorCreateInfo::pVulkanFunctions. Other members can be null.
++*/
++#if !defined(VMA_DYNAMIC_VULKAN_FUNCTIONS)
++ #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
++#endif
++
++#ifndef VMA_USE_STL_SHARED_MUTEX
++ // Compiler conforms to C++17.
++ #if __cplusplus >= 201703L
++ #define VMA_USE_STL_SHARED_MUTEX 1
++ // Visual studio defines __cplusplus properly only when passed additional parameter: /Zc:__cplusplus
++ // Otherwise it is always 199711L, despite shared_mutex works since Visual Studio 2015 Update 2.
++ #elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && __cplusplus == 199711L && _MSVC_LANG >= 201703L
++ #define VMA_USE_STL_SHARED_MUTEX 1
++ #else
++ #define VMA_USE_STL_SHARED_MUTEX 0
++ #endif
++#endif
++
++/*
++Define this macro to include custom header files without having to edit this file directly, e.g.:
++
++ // Inside of "my_vma_configuration_user_includes.h":
++
++ #include "my_custom_assert.h" // for MY_CUSTOM_ASSERT
++ #include "my_custom_min.h" // for my_custom_min
++ #include <algorithm>
++ #include <mutex>
++
++ // Inside a different file, which includes "vk_mem_alloc.h":
++
++ #define VMA_CONFIGURATION_USER_INCLUDES_H "my_vma_configuration_user_includes.h"
++ #define VMA_ASSERT(expr) MY_CUSTOM_ASSERT(expr)
++ #define VMA_MIN(v1, v2) (my_custom_min(v1, v2))
++ #include "vk_mem_alloc.h"
++ ...
++
++The following headers are used in this CONFIGURATION section only, so feel free to
++remove them if not needed.
++*/
++#if !defined(VMA_CONFIGURATION_USER_INCLUDES_H)
++ #include <cassert> // for assert
++ #include <algorithm> // for min, max
++ #include <mutex>
++#else
++ #include VMA_CONFIGURATION_USER_INCLUDES_H
++#endif
++
++#ifndef VMA_NULL
++ // Value used as null pointer. Define it to e.g.: nullptr, NULL, 0, (void*)0.
++ #define VMA_NULL nullptr
++#endif
++
++#if defined(__ANDROID_API__) && (__ANDROID_API__ < 16)
++#include <cstdlib>
++static void* vma_aligned_alloc(size_t alignment, size_t size)
++{
++ // alignment must be >= sizeof(void*)
++ if(alignment < sizeof(void*))
++ {
++ alignment = sizeof(void*);
++ }
++
++ return memalign(alignment, size);
++}
++#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
++#include <cstdlib>
++
++#if defined(__APPLE__)
++#include <AvailabilityMacros.h>
++#endif
++
++static void* vma_aligned_alloc(size_t alignment, size_t size)
++{
++ // Unfortunately, aligned_alloc causes VMA to crash due to it returning null pointers. (At least under 11.4)
++ // Therefore, for now disable this specific exception until a proper solution is found.
++ //#if defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16) || defined(__IPHONE_14_0))
++ //#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
++ // // For C++14, usr/include/malloc/_malloc.h declares aligned_alloc()) only
++ // // with the MacOSX11.0 SDK in Xcode 12 (which is what adds
++ // // MAC_OS_X_VERSION_10_16), even though the function is marked
++ // // availabe for 10.15. That is why the preprocessor checks for 10.16 but
++ // // the __builtin_available checks for 10.15.
++ // // People who use C++17 could call aligned_alloc with the 10.15 SDK already.
++ // if (__builtin_available(macOS 10.15, iOS 13, *))
++ // return aligned_alloc(alignment, size);
++ //#endif
++ //#endif
++
++ // alignment must be >= sizeof(void*)
++ if(alignment < sizeof(void*))
++ {
++ alignment = sizeof(void*);
++ }
++
++ void *pointer;
++ if(posix_memalign(&pointer, alignment, size) == 0)
++ return pointer;
++ return VMA_NULL;
++}
++#elif defined(_WIN32)
++static void* vma_aligned_alloc(size_t alignment, size_t size)
++{
++ return _aligned_malloc(size, alignment);
++}
++#else
++static void* vma_aligned_alloc(size_t alignment, size_t size)
++{
++ return aligned_alloc(alignment, size);
++}
++#endif
++
++#if defined(_WIN32)
++static void vma_aligned_free(void* ptr)
++{
++ _aligned_free(ptr);
++}
++#else
++static void vma_aligned_free(void* VMA_NULLABLE ptr)
++{
++ free(ptr);
++}
++#endif
++
++// If your compiler is not compatible with C++11 and definition of
++// aligned_alloc() function is missing, uncommeting following line may help:
++
++//#include <malloc.h>
++
++// Normal assert to check for programmer's errors, especially in Debug configuration.
++#ifndef VMA_ASSERT
++ #ifdef NDEBUG
++ #define VMA_ASSERT(expr)
++ #else
++ #define VMA_ASSERT(expr) assert(expr)
++ #endif
++#endif
++
++// Assert that will be called very often, like inside data structures e.g. operator[].
++// Making it non-empty can make program slow.
++#ifndef VMA_HEAVY_ASSERT
++ #ifdef NDEBUG
++ #define VMA_HEAVY_ASSERT(expr)
++ #else
++ #define VMA_HEAVY_ASSERT(expr) //VMA_ASSERT(expr)
++ #endif
++#endif
++
++#ifndef VMA_ALIGN_OF
++ #define VMA_ALIGN_OF(type) (__alignof(type))
++#endif
++
++#ifndef VMA_SYSTEM_ALIGNED_MALLOC
++ #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) vma_aligned_alloc((alignment), (size))
++#endif
++
++#ifndef VMA_SYSTEM_ALIGNED_FREE
++ // VMA_SYSTEM_FREE is the old name, but might have been defined by the user
++ #if defined(VMA_SYSTEM_FREE)
++ #define VMA_SYSTEM_ALIGNED_FREE(ptr) VMA_SYSTEM_FREE(ptr)
++ #else
++ #define VMA_SYSTEM_ALIGNED_FREE(ptr) vma_aligned_free(ptr)
++ #endif
++#endif
++
++#ifndef VMA_COUNT_BITS_SET
++ // Returns number of bits set to 1 in (v)
++ #define VMA_COUNT_BITS_SET(v) VmaCountBitsSet(v)
++#endif
++
++#ifndef VMA_BITSCAN_LSB
++ // Scans integer for index of first nonzero value from the Least Significant Bit (LSB). If mask is 0 then returns UINT8_MAX
++ #define VMA_BITSCAN_LSB(mask) VmaBitScanLSB(mask)
++#endif
++
++#ifndef VMA_BITSCAN_MSB
++ // Scans integer for index of first nonzero value from the Most Significant Bit (MSB). If mask is 0 then returns UINT8_MAX
++ #define VMA_BITSCAN_MSB(mask) VmaBitScanMSB(mask)
++#endif
++
++#ifndef VMA_MIN
++ #define VMA_MIN(v1, v2) ((std::min)((v1), (v2)))
++#endif
++
++#ifndef VMA_MAX
++ #define VMA_MAX(v1, v2) ((std::max)((v1), (v2)))
++#endif
++
++#ifndef VMA_SWAP
++ #define VMA_SWAP(v1, v2) std::swap((v1), (v2))
++#endif
++
++#ifndef VMA_SORT
++ #define VMA_SORT(beg, end, cmp) std::sort(beg, end, cmp)
++#endif
++
++#ifndef VMA_DEBUG_LOG
++ #define VMA_DEBUG_LOG(format, ...)
++ /*
++ #define VMA_DEBUG_LOG(format, ...) do { \
++ printf(format, __VA_ARGS__); \
++ printf("\n"); \
++ } while(false)
++ */
++#endif
++
++// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.
++#if VMA_STATS_STRING_ENABLED
++ static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num)
++ {
++ snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
++ }
++ static inline void VmaUint64ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint64_t num)
++ {
++ snprintf(outStr, strLen, "%llu", static_cast<unsigned long long>(num));
++ }
++ static inline void VmaPtrToStr(char* VMA_NOT_NULL outStr, size_t strLen, const void* ptr)
++ {
++ snprintf(outStr, strLen, "%p", ptr);
++ }
++#endif
++
++#ifndef VMA_MUTEX
++ class VmaMutex
++ {
++ public:
++ void Lock() { m_Mutex.lock(); }
++ void Unlock() { m_Mutex.unlock(); }
++ bool TryLock() { return m_Mutex.try_lock(); }
++ private:
++ std::mutex m_Mutex;
++ };
++ #define VMA_MUTEX VmaMutex
++#endif
++
++// Read-write mutex, where "read" is shared access, "write" is exclusive access.
++#ifndef VMA_RW_MUTEX
++ #if VMA_USE_STL_SHARED_MUTEX
++ // Use std::shared_mutex from C++17.
++ #include <shared_mutex>
++ class VmaRWMutex
++ {
++ public:
++ void LockRead() { m_Mutex.lock_shared(); }
++ void UnlockRead() { m_Mutex.unlock_shared(); }
++ bool TryLockRead() { return m_Mutex.try_lock_shared(); }
++ void LockWrite() { m_Mutex.lock(); }
++ void UnlockWrite() { m_Mutex.unlock(); }
++ bool TryLockWrite() { return m_Mutex.try_lock(); }
++ private:
++ std::shared_mutex m_Mutex;
++ };
++ #define VMA_RW_MUTEX VmaRWMutex
++ #elif defined(_WIN32) && defined(WINVER) && WINVER >= 0x0600
++ // Use SRWLOCK from WinAPI.
++ // Minimum supported client = Windows Vista, server = Windows Server 2008.
++ class VmaRWMutex
++ {
++ public:
++ VmaRWMutex() { InitializeSRWLock(&m_Lock); }
++ void LockRead() { AcquireSRWLockShared(&m_Lock); }
++ void UnlockRead() { ReleaseSRWLockShared(&m_Lock); }
++ bool TryLockRead() { return TryAcquireSRWLockShared(&m_Lock) != FALSE; }
++ void LockWrite() { AcquireSRWLockExclusive(&m_Lock); }
++ void UnlockWrite() { ReleaseSRWLockExclusive(&m_Lock); }
++ bool TryLockWrite() { return TryAcquireSRWLockExclusive(&m_Lock) != FALSE; }
++ private:
++ SRWLOCK m_Lock;
++ };
++ #define VMA_RW_MUTEX VmaRWMutex
++ #else
++ // Less efficient fallback: Use normal mutex.
++ class VmaRWMutex
++ {
++ public:
++ void LockRead() { m_Mutex.Lock(); }
++ void UnlockRead() { m_Mutex.Unlock(); }
++ bool TryLockRead() { return m_Mutex.TryLock(); }
++ void LockWrite() { m_Mutex.Lock(); }
++ void UnlockWrite() { m_Mutex.Unlock(); }
++ bool TryLockWrite() { return m_Mutex.TryLock(); }
++ private:
++ VMA_MUTEX m_Mutex;
++ };
++ #define VMA_RW_MUTEX VmaRWMutex
++ #endif // #if VMA_USE_STL_SHARED_MUTEX
++#endif // #ifndef VMA_RW_MUTEX
++
++/*
++If providing your own implementation, you need to implement a subset of std::atomic.
++*/
++#ifndef VMA_ATOMIC_UINT32
++ #include <atomic>
++ #define VMA_ATOMIC_UINT32 std::atomic<uint32_t>
++#endif
++
++#ifndef VMA_ATOMIC_UINT64
++ #include <atomic>
++ #define VMA_ATOMIC_UINT64 std::atomic<uint64_t>
++#endif
++
++#ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY
++ /**
++ Every allocation will have its own memory block.
++ Define to 1 for debugging purposes only.
++ */
++ #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)
++#endif
++
++#ifndef VMA_MIN_ALIGNMENT
++ /**
++ Minimum alignment of all allocations, in bytes.
++ Set to more than 1 for debugging purposes. Must be power of two.
++ */
++ #ifdef VMA_DEBUG_ALIGNMENT // Old name
++ #define VMA_MIN_ALIGNMENT VMA_DEBUG_ALIGNMENT
++ #else
++ #define VMA_MIN_ALIGNMENT (1)
++ #endif
++#endif
++
++#ifndef VMA_DEBUG_MARGIN
++ /**
++ Minimum margin after every allocation, in bytes.
++ Set nonzero for debugging purposes only.
++ */
++ #define VMA_DEBUG_MARGIN (0)
++#endif
++
++#ifndef VMA_DEBUG_INITIALIZE_ALLOCATIONS
++ /**
++ Define this macro to 1 to automatically fill new allocations and destroyed
++ allocations with some bit pattern.
++ */
++ #define VMA_DEBUG_INITIALIZE_ALLOCATIONS (0)
++#endif
++
++#ifndef VMA_DEBUG_DETECT_CORRUPTION
++ /**
++ Define this macro to 1 together with non-zero value of VMA_DEBUG_MARGIN to
++ enable writing magic value to the margin after every allocation and
++ validating it, so that memory corruptions (out-of-bounds writes) are detected.
++ */
++ #define VMA_DEBUG_DETECT_CORRUPTION (0)
++#endif
++
++#ifndef VMA_DEBUG_GLOBAL_MUTEX
++ /**
++ Set this to 1 for debugging purposes only, to enable single mutex protecting all
++ entry calls to the library. Can be useful for debugging multithreading issues.
++ */
++ #define VMA_DEBUG_GLOBAL_MUTEX (0)
++#endif
++
++#ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY
++ /**
++ Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity.
++ Set to more than 1 for debugging purposes only. Must be power of two.
++ */
++ #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1)
++#endif
++
++#ifndef VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
++ /*
++ Set this to 1 to make VMA never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount
++ and return error instead of leaving up to Vulkan implementation what to do in such cases.
++ */
++ #define VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT (0)
++#endif
++
++#ifndef VMA_SMALL_HEAP_MAX_SIZE
++ /// Maximum size of a memory heap in Vulkan to consider it "small".
++ #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024)
++#endif
++
++#ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE
++ /// Default size of a block allocated as single VkDeviceMemory from a "large" heap.
++ #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024)
++#endif
++
++/*
++Mapping hysteresis is a logic that launches when vmaMapMemory/vmaUnmapMemory is called
++or a persistently mapped allocation is created and destroyed several times in a row.
++It keeps additional +1 mapping of a device memory block to prevent calling actual
++vkMapMemory/vkUnmapMemory too many times, which may improve performance and help
++tools like RenderDOc.
++*/
++#ifndef VMA_MAPPING_HYSTERESIS_ENABLED
++ #define VMA_MAPPING_HYSTERESIS_ENABLED 1
++#endif
++
++#ifndef VMA_CLASS_NO_COPY
++ #define VMA_CLASS_NO_COPY(className) \
++ private: \
++ className(const className&) = delete; \
++ className& operator=(const className&) = delete;
++#endif
++
++#define VMA_VALIDATE(cond) do { if(!(cond)) { \
++ VMA_ASSERT(0 && "Validation failed: " #cond); \
++ return false; \
++ } } while(false)
++
++/*******************************************************************************
++END OF CONFIGURATION
++*/
++#endif // _VMA_CONFIGURATION
++
++
++static const uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED = 0xDC;
++static const uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;
++// Decimal 2139416166, float NaN, little-endian binary 66 E6 84 7F.
++static const uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;
++
++// Copy of some Vulkan definitions so we don't need to check their existence just to handle few constants.
++static const uint32_t VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY = 0x00000040;
++static const uint32_t VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY = 0x00000080;
++static const uint32_t VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY = 0x00020000;
++static const uint32_t VK_IMAGE_CREATE_DISJOINT_BIT_COPY = 0x00000200;
++static const int32_t VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT_COPY = 1000158000;
++static const uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;
++static const uint32_t VMA_ALLOCATION_TRY_COUNT = 32;
++static const uint32_t VMA_VENDOR_ID_AMD = 4098;
++
++// This one is tricky. Vulkan specification defines this code as available since
++// Vulkan 1.0, but doesn't actually define it in Vulkan SDK earlier than 1.2.131.
++// See pull request #207.
++#define VK_ERROR_UNKNOWN_COPY ((VkResult)-13)
++
++
++#if VMA_STATS_STRING_ENABLED
++// Correspond to values of enum VmaSuballocationType.
++static const char* VMA_SUBALLOCATION_TYPE_NAMES[] =
++{
++ "FREE",
++ "UNKNOWN",
++ "BUFFER",
++ "IMAGE_UNKNOWN",
++ "IMAGE_LINEAR",
++ "IMAGE_OPTIMAL",
++};
++#endif
++
++static VkAllocationCallbacks VmaEmptyAllocationCallbacks =
++ { VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };
++
++
++#ifndef _VMA_ENUM_DECLARATIONS
++
++enum VmaSuballocationType
++{
++ VMA_SUBALLOCATION_TYPE_FREE = 0,
++ VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,
++ VMA_SUBALLOCATION_TYPE_BUFFER = 2,
++ VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,
++ VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,
++ VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,
++ VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
++};
++
++enum VMA_CACHE_OPERATION
++{
++ VMA_CACHE_FLUSH,
++ VMA_CACHE_INVALIDATE
++};
++
++enum class VmaAllocationRequestType
++{
++ Normal,
++ TLSF,
++ // Used by "Linear" algorithm.
++ UpperAddress,
++ EndOf1st,
++ EndOf2nd,
++};
++
++#endif // _VMA_ENUM_DECLARATIONS
++
++#ifndef _VMA_FORWARD_DECLARATIONS
++// Opaque handle used by allocation algorithms to identify single allocation in any conforming way.
++VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaAllocHandle);
++
++struct VmaMutexLock;
++struct VmaMutexLockRead;
++struct VmaMutexLockWrite;
++
++template<typename T>
++struct AtomicTransactionalIncrement;
++
++template<typename T>
++struct VmaStlAllocator;
++
++template<typename T, typename AllocatorT>
++class VmaVector;
++
++template<typename T, typename AllocatorT, size_t N>
++class VmaSmallVector;
++
++template<typename T>
++class VmaPoolAllocator;
++
++template<typename T>
++struct VmaListItem;
++
++template<typename T>
++class VmaRawList;
++
++template<typename T, typename AllocatorT>
++class VmaList;
++
++template<typename ItemTypeTraits>
++class VmaIntrusiveLinkedList;
++
++// Unused in this version
++#if 0
++template<typename T1, typename T2>
++struct VmaPair;
++template<typename FirstT, typename SecondT>
++struct VmaPairFirstLess;
++
++template<typename KeyT, typename ValueT>
++class VmaMap;
++#endif
++
++#if VMA_STATS_STRING_ENABLED
++class VmaStringBuilder;
++class VmaJsonWriter;
++#endif
++
++class VmaDeviceMemoryBlock;
++
++struct VmaDedicatedAllocationListItemTraits;
++class VmaDedicatedAllocationList;
++
++struct VmaSuballocation;
++struct VmaSuballocationOffsetLess;
++struct VmaSuballocationOffsetGreater;
++struct VmaSuballocationItemSizeLess;
++
++typedef VmaList<VmaSuballocation, VmaStlAllocator<VmaSuballocation>> VmaSuballocationList;
++
++struct VmaAllocationRequest;
++
++class VmaBlockMetadata;
++class VmaBlockMetadata_Linear;
++class VmaBlockMetadata_TLSF;
++
++class VmaBlockVector;
++
++struct VmaPoolListItemTraits;
++
++struct VmaCurrentBudgetData;
++
++class VmaAllocationObjectAllocator;
++
++#endif // _VMA_FORWARD_DECLARATIONS
++
++
++#ifndef _VMA_FUNCTIONS
++
++/*
++Returns number of bits set to 1 in (v).
++
++On specific platforms and compilers you can use instrinsics like:
++
++Visual Studio:
++ return __popcnt(v);
++GCC, Clang:
++ return static_cast<uint32_t>(__builtin_popcount(v));
++
++Define macro VMA_COUNT_BITS_SET to provide your optimized implementation.
++But you need to check in runtime whether user's CPU supports these, as some old processors don't.
++*/
++static inline uint32_t VmaCountBitsSet(uint32_t v)
++{
++#if __cplusplus >= 202002L || _MSVC_LANG >= 202002L // C++20
++ return std::popcount(v);
++#else
++ uint32_t c = v - ((v >> 1) & 0x55555555);
++ c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
++ c = ((c >> 4) + c) & 0x0F0F0F0F;
++ c = ((c >> 8) + c) & 0x00FF00FF;
++ c = ((c >> 16) + c) & 0x0000FFFF;
++ return c;
++#endif
++}
++
++static inline uint8_t VmaBitScanLSB(uint64_t mask)
++{
++#if defined(_MSC_VER) && defined(_WIN64)
++ unsigned long pos;
++ if (_BitScanForward64(&pos, mask))
++ return static_cast<uint8_t>(pos);
++ return UINT8_MAX;
++#elif defined __GNUC__ || defined __clang__
++ return static_cast<uint8_t>(__builtin_ffsll(mask)) - 1U;
++#else
++ uint8_t pos = 0;
++ uint64_t bit = 1;
++ do
++ {
++ if (mask & bit)
++ return pos;
++ bit <<= 1;
++ } while (pos++ < 63);
++ return UINT8_MAX;
++#endif
++}
++
++static inline uint8_t VmaBitScanLSB(uint32_t mask)
++{
++#ifdef _MSC_VER
++ unsigned long pos;
++ if (_BitScanForward(&pos, mask))
++ return static_cast<uint8_t>(pos);
++ return UINT8_MAX;
++#elif defined __GNUC__ || defined __clang__
++ return static_cast<uint8_t>(__builtin_ffs(mask)) - 1U;
++#else
++ uint8_t pos = 0;
++ uint32_t bit = 1;
++ do
++ {
++ if (mask & bit)
++ return pos;
++ bit <<= 1;
++ } while (pos++ < 31);
++ return UINT8_MAX;
++#endif
++}
++
++static inline uint8_t VmaBitScanMSB(uint64_t mask)
++{
++#if defined(_MSC_VER) && defined(_WIN64)
++ unsigned long pos;
++ if (_BitScanReverse64(&pos, mask))
++ return static_cast<uint8_t>(pos);
++#elif defined __GNUC__ || defined __clang__
++ if (mask)
++ return 63 - static_cast<uint8_t>(__builtin_clzll(mask));
++#else
++ uint8_t pos = 63;
++ uint64_t bit = 1ULL << 63;
++ do
++ {
++ if (mask & bit)
++ return pos;
++ bit >>= 1;
++ } while (pos-- > 0);
++#endif
++ return UINT8_MAX;
++}
++
++static inline uint8_t VmaBitScanMSB(uint32_t mask)
++{
++#ifdef _MSC_VER
++ unsigned long pos;
++ if (_BitScanReverse(&pos, mask))
++ return static_cast<uint8_t>(pos);
++#elif defined __GNUC__ || defined __clang__
++ if (mask)
++ return 31 - static_cast<uint8_t>(__builtin_clz(mask));
++#else
++ uint8_t pos = 31;
++ uint32_t bit = 1UL << 31;
++ do
++ {
++ if (mask & bit)
++ return pos;
++ bit >>= 1;
++ } while (pos-- > 0);
++#endif
++ return UINT8_MAX;
++}
++
++/*
++Returns true if given number is a power of two.
++T must be unsigned integer number or signed integer but always nonnegative.
++For 0 returns true.
++*/
++template <typename T>
++inline bool VmaIsPow2(T x)
++{
++ return (x & (x - 1)) == 0;
++}
++
++// Aligns given value up to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 16.
++// Use types like uint32_t, uint64_t as T.
++template <typename T>
++static inline T VmaAlignUp(T val, T alignment)
++{
++ VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
++ return (val + alignment - 1) & ~(alignment - 1);
++}
++
++// Aligns given value down to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 8.
++// Use types like uint32_t, uint64_t as T.
++template <typename T>
++static inline T VmaAlignDown(T val, T alignment)
++{
++ VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
++ return val & ~(alignment - 1);
++}
++
++// Division with mathematical rounding to nearest number.
++template <typename T>
++static inline T VmaRoundDiv(T x, T y)
++{
++ return (x + (y / (T)2)) / y;
++}
++
++// Divide by 'y' and round up to nearest integer.
++template <typename T>
++static inline T VmaDivideRoundingUp(T x, T y)
++{
++ return (x + y - (T)1) / y;
++}
++
++// Returns smallest power of 2 greater or equal to v.
++static inline uint32_t VmaNextPow2(uint32_t v)
++{
++ v--;
++ v |= v >> 1;
++ v |= v >> 2;
++ v |= v >> 4;
++ v |= v >> 8;
++ v |= v >> 16;
++ v++;
++ return v;
++}
++
++static inline uint64_t VmaNextPow2(uint64_t v)
++{
++ v--;
++ v |= v >> 1;
++ v |= v >> 2;
++ v |= v >> 4;
++ v |= v >> 8;
++ v |= v >> 16;
++ v |= v >> 32;
++ v++;
++ return v;
++}
++
++// Returns largest power of 2 less or equal to v.
++static inline uint32_t VmaPrevPow2(uint32_t v)
++{
++ v |= v >> 1;
++ v |= v >> 2;
++ v |= v >> 4;
++ v |= v >> 8;
++ v |= v >> 16;
++ v = v ^ (v >> 1);
++ return v;
++}
++
++static inline uint64_t VmaPrevPow2(uint64_t v)
++{
++ v |= v >> 1;
++ v |= v >> 2;
++ v |= v >> 4;
++ v |= v >> 8;
++ v |= v >> 16;
++ v |= v >> 32;
++ v = v ^ (v >> 1);
++ return v;
++}
++
++static inline bool VmaStrIsEmpty(const char* pStr)
++{
++ return pStr == VMA_NULL || *pStr == '\0';
++}
++
++#ifndef VMA_SORT
++template<typename Iterator, typename Compare>
++Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
++{
++ Iterator centerValue = end; --centerValue;
++ Iterator insertIndex = beg;
++ for (Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
++ {
++ if (cmp(*memTypeIndex, *centerValue))
++ {
++ if (insertIndex != memTypeIndex)
++ {
++ VMA_SWAP(*memTypeIndex, *insertIndex);
++ }
++ ++insertIndex;
++ }
++ }
++ if (insertIndex != centerValue)
++ {
++ VMA_SWAP(*insertIndex, *centerValue);
++ }
++ return insertIndex;
++}
++
++template<typename Iterator, typename Compare>
++void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
++{
++ if (beg < end)
++ {
++ Iterator it = VmaQuickSortPartition<Iterator, Compare>(beg, end, cmp);
++ VmaQuickSort<Iterator, Compare>(beg, it, cmp);
++ VmaQuickSort<Iterator, Compare>(it + 1, end, cmp);
++ }
++}
++
++#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
++#endif // VMA_SORT
++
++/*
++Returns true if two memory blocks occupy overlapping pages.
++ResourceA must be in less memory offset than ResourceB.
++
++Algorithm is based on "Vulkan 1.0.39 - A Specification (with all registered Vulkan extensions)"
++chapter 11.6 "Resource Memory Association", paragraph "Buffer-Image Granularity".
++*/
++static inline bool VmaBlocksOnSamePage(
++ VkDeviceSize resourceAOffset,
++ VkDeviceSize resourceASize,
++ VkDeviceSize resourceBOffset,
++ VkDeviceSize pageSize)
++{
++ VMA_ASSERT(resourceAOffset + resourceASize <= resourceBOffset && resourceASize > 0 && pageSize > 0);
++ VkDeviceSize resourceAEnd = resourceAOffset + resourceASize - 1;
++ VkDeviceSize resourceAEndPage = resourceAEnd & ~(pageSize - 1);
++ VkDeviceSize resourceBStart = resourceBOffset;
++ VkDeviceSize resourceBStartPage = resourceBStart & ~(pageSize - 1);
++ return resourceAEndPage == resourceBStartPage;
++}
++
++/*
++Returns true if given suballocation types could conflict and must respect
++VkPhysicalDeviceLimits::bufferImageGranularity. They conflict if one is buffer
++or linear image and another one is optimal image. If type is unknown, behave
++conservatively.
++*/
++static inline bool VmaIsBufferImageGranularityConflict(
++ VmaSuballocationType suballocType1,
++ VmaSuballocationType suballocType2)
++{
++ if (suballocType1 > suballocType2)
++ {
++ VMA_SWAP(suballocType1, suballocType2);
++ }
++
++ switch (suballocType1)
++ {
++ case VMA_SUBALLOCATION_TYPE_FREE:
++ return false;
++ case VMA_SUBALLOCATION_TYPE_UNKNOWN:
++ return true;
++ case VMA_SUBALLOCATION_TYPE_BUFFER:
++ return
++ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
++ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
++ case VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN:
++ return
++ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
++ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR ||
++ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
++ case VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR:
++ return
++ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
++ case VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL:
++ return false;
++ default:
++ VMA_ASSERT(0);
++ return true;
++ }
++}
++
++static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
++{
++#if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
++ uint32_t* pDst = (uint32_t*)((char*)pData + offset);
++ const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
++ for (size_t i = 0; i < numberCount; ++i, ++pDst)
++ {
++ *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
++ }
++#else
++ // no-op
++#endif
++}
++
++static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
++{
++#if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
++ const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
++ const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
++ for (size_t i = 0; i < numberCount; ++i, ++pSrc)
++ {
++ if (*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
++ {
++ return false;
++ }
++ }
++#endif
++ return true;
++}
++
++/*
++Fills structure with parameters of an example buffer to be used for transfers
++during GPU memory defragmentation.
++*/
++static void VmaFillGpuDefragmentationBufferCreateInfo(VkBufferCreateInfo& outBufCreateInfo)
++{
++ memset(&outBufCreateInfo, 0, sizeof(outBufCreateInfo));
++ outBufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
++ outBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++ outBufCreateInfo.size = (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE; // Example size.
++}
++
++
++/*
++Performs binary search and returns iterator to first element that is greater or
++equal to (key), according to comparison (cmp).
++
++Cmp should return true if first argument is less than second argument.
++
++Returned value is the found element, if present in the collection or place where
++new element with value (key) should be inserted.
++*/
++template <typename CmpLess, typename IterT, typename KeyT>
++static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp)
++{
++ size_t down = 0, up = (end - beg);
++ while (down < up)
++ {
++ const size_t mid = down + (up - down) / 2; // Overflow-safe midpoint calculation
++ if (cmp(*(beg + mid), key))
++ {
++ down = mid + 1;
++ }
++ else
++ {
++ up = mid;
++ }
++ }
++ return beg + down;
++}
++
++template<typename CmpLess, typename IterT, typename KeyT>
++IterT VmaBinaryFindSorted(const IterT& beg, const IterT& end, const KeyT& value, const CmpLess& cmp)
++{
++ IterT it = VmaBinaryFindFirstNotLess<CmpLess, IterT, KeyT>(
++ beg, end, value, cmp);
++ if (it == end ||
++ (!cmp(*it, value) && !cmp(value, *it)))
++ {
++ return it;
++ }
++ return end;
++}
++
++/*
++Returns true if all pointers in the array are not-null and unique.
++Warning! O(n^2) complexity. Use only inside VMA_HEAVY_ASSERT.
++T must be pointer type, e.g. VmaAllocation, VmaPool.
++*/
++template<typename T>
++static bool VmaValidatePointerArray(uint32_t count, const T* arr)
++{
++ for (uint32_t i = 0; i < count; ++i)
++ {
++ const T iPtr = arr[i];
++ if (iPtr == VMA_NULL)
++ {
++ return false;
++ }
++ for (uint32_t j = i + 1; j < count; ++j)
++ {
++ if (iPtr == arr[j])
++ {
++ return false;
++ }
++ }
++ }
++ return true;
++}
++
++template<typename MainT, typename NewT>
++static inline void VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct)
++{
++ newStruct->pNext = mainStruct->pNext;
++ mainStruct->pNext = newStruct;
++}
++
++// This is the main algorithm that guides the selection of a memory type best for an allocation -
++// converts usage to required/preferred/not preferred flags.
++static bool FindMemoryPreferences(
++ bool isIntegratedGPU,
++ const VmaAllocationCreateInfo& allocCreateInfo,
++ VkFlags bufImgUsage, // VkBufferCreateInfo::usage or VkImageCreateInfo::usage. UINT32_MAX if unknown.
++ VkMemoryPropertyFlags& outRequiredFlags,
++ VkMemoryPropertyFlags& outPreferredFlags,
++ VkMemoryPropertyFlags& outNotPreferredFlags)
++{
++ outRequiredFlags = allocCreateInfo.requiredFlags;
++ outPreferredFlags = allocCreateInfo.preferredFlags;
++ outNotPreferredFlags = 0;
++
++ switch(allocCreateInfo.usage)
++ {
++ case VMA_MEMORY_USAGE_UNKNOWN:
++ break;
++ case VMA_MEMORY_USAGE_GPU_ONLY:
++ if(!isIntegratedGPU || (outPreferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
++ {
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ }
++ break;
++ case VMA_MEMORY_USAGE_CPU_ONLY:
++ outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
++ break;
++ case VMA_MEMORY_USAGE_CPU_TO_GPU:
++ outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
++ if(!isIntegratedGPU || (outPreferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
++ {
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ }
++ break;
++ case VMA_MEMORY_USAGE_GPU_TO_CPU:
++ outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
++ outPreferredFlags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
++ break;
++ case VMA_MEMORY_USAGE_CPU_COPY:
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ break;
++ case VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED:
++ outRequiredFlags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
++ break;
++ case VMA_MEMORY_USAGE_AUTO:
++ case VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE:
++ case VMA_MEMORY_USAGE_AUTO_PREFER_HOST:
++ {
++ if(bufImgUsage == UINT32_MAX)
++ {
++ VMA_ASSERT(0 && "VMA_MEMORY_USAGE_AUTO* values can only be used with functions like vmaCreateBuffer, vmaCreateImage so that the details of the created resource are known.");
++ return false;
++ }
++ // This relies on values of VK_IMAGE_USAGE_TRANSFER* being the same VK_BUFFER_IMAGE_TRANSFER*.
++ const bool deviceAccess = (bufImgUsage & ~(VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT)) != 0;
++ const bool hostAccessSequentialWrite = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT) != 0;
++ const bool hostAccessRandom = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT) != 0;
++ const bool hostAccessAllowTransferInstead = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT) != 0;
++ const bool preferDevice = allocCreateInfo.usage == VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE;
++ const bool preferHost = allocCreateInfo.usage == VMA_MEMORY_USAGE_AUTO_PREFER_HOST;
++
++ // CPU random access - e.g. a buffer written to or transferred from GPU to read back on CPU.
++ if(hostAccessRandom)
++ {
++ if(!isIntegratedGPU && deviceAccess && hostAccessAllowTransferInstead && !preferHost)
++ {
++ // Nice if it will end up in HOST_VISIBLE, but more importantly prefer DEVICE_LOCAL.
++ // Omitting HOST_VISIBLE here is intentional.
++ // In case there is DEVICE_LOCAL | HOST_VISIBLE | HOST_CACHED, it will pick that one.
++ // Otherwise, this will give same weight to DEVICE_LOCAL as HOST_VISIBLE | HOST_CACHED and select the former if occurs first on the list.
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
++ }
++ else
++ {
++ // Always CPU memory, cached.
++ outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
++ }
++ }
++ // CPU sequential write - may be CPU or host-visible GPU memory, uncached and write-combined.
++ else if(hostAccessSequentialWrite)
++ {
++ // Want uncached and write-combined.
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
++
++ if(!isIntegratedGPU && deviceAccess && hostAccessAllowTransferInstead && !preferHost)
++ {
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
++ }
++ else
++ {
++ outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
++ // Direct GPU access, CPU sequential write (e.g. a dynamic uniform buffer updated every frame)
++ if(deviceAccess)
++ {
++ // Could go to CPU memory or GPU BAR/unified. Up to the user to decide. If no preference, choose GPU memory.
++ if(preferHost)
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ else
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ }
++ // GPU no direct access, CPU sequential write (e.g. an upload buffer to be transferred to the GPU)
++ else
++ {
++ // Could go to CPU memory or GPU BAR/unified. Up to the user to decide. If no preference, choose CPU memory.
++ if(preferDevice)
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ else
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ }
++ }
++ }
++ // No CPU access
++ else
++ {
++ // GPU access, no CPU access (e.g. a color attachment image) - prefer GPU memory
++ if(deviceAccess)
++ {
++ // ...unless there is a clear preference from the user not to do so.
++ if(preferHost)
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ else
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ }
++ // No direct GPU access, no CPU access, just transfers.
++ // It may be staging copy intended for e.g. preserving image for next frame (then better GPU memory) or
++ // a "swap file" copy to free some GPU memory (then better CPU memory).
++ // Up to the user to decide. If no preferece, assume the former and choose GPU memory.
++ if(preferHost)
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ else
++ outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++ }
++ break;
++ }
++ default:
++ VMA_ASSERT(0);
++ }
++
++ // Avoid DEVICE_COHERENT unless explicitly requested.
++ if(((allocCreateInfo.requiredFlags | allocCreateInfo.preferredFlags) &
++ (VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY | VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY)) == 0)
++ {
++ outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY;
++ }
++
++ return true;
++}
++
++////////////////////////////////////////////////////////////////////////////////
++// Memory allocation
++
++static void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t size, size_t alignment)
++{
++ void* result = VMA_NULL;
++ if ((pAllocationCallbacks != VMA_NULL) &&
++ (pAllocationCallbacks->pfnAllocation != VMA_NULL))
++ {
++ result = (*pAllocationCallbacks->pfnAllocation)(
++ pAllocationCallbacks->pUserData,
++ size,
++ alignment,
++ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
++ }
++ else
++ {
++ result = VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);
++ }
++ VMA_ASSERT(result != VMA_NULL && "CPU memory allocation failed.");
++ return result;
++}
++
++static void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr)
++{
++ if ((pAllocationCallbacks != VMA_NULL) &&
++ (pAllocationCallbacks->pfnFree != VMA_NULL))
++ {
++ (*pAllocationCallbacks->pfnFree)(pAllocationCallbacks->pUserData, ptr);
++ }
++ else
++ {
++ VMA_SYSTEM_ALIGNED_FREE(ptr);
++ }
++}
++
++template<typename T>
++static T* VmaAllocate(const VkAllocationCallbacks* pAllocationCallbacks)
++{
++ return (T*)VmaMalloc(pAllocationCallbacks, sizeof(T), VMA_ALIGN_OF(T));
++}
++
++template<typename T>
++static T* VmaAllocateArray(const VkAllocationCallbacks* pAllocationCallbacks, size_t count)
++{
++ return (T*)VmaMalloc(pAllocationCallbacks, sizeof(T) * count, VMA_ALIGN_OF(T));
++}
++
++#define vma_new(allocator, type) new(VmaAllocate<type>(allocator))(type)
++
++#define vma_new_array(allocator, type, count) new(VmaAllocateArray<type>((allocator), (count)))(type)
++
++template<typename T>
++static void vma_delete(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr)
++{
++ ptr->~T();
++ VmaFree(pAllocationCallbacks, ptr);
++}
++
++template<typename T>
++static void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr, size_t count)
++{
++ if (ptr != VMA_NULL)
++ {
++ for (size_t i = count; i--; )
++ {
++ ptr[i].~T();
++ }
++ VmaFree(pAllocationCallbacks, ptr);
++ }
++}
++
++static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char* srcStr)
++{
++ if (srcStr != VMA_NULL)
++ {
++ const size_t len = strlen(srcStr);
++ char* const result = vma_new_array(allocs, char, len + 1);
++ memcpy(result, srcStr, len + 1);
++ return result;
++ }
++ return VMA_NULL;
++}
++
++#if VMA_STATS_STRING_ENABLED
++static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char* srcStr, size_t strLen)
++{
++ if (srcStr != VMA_NULL)
++ {
++ char* const result = vma_new_array(allocs, char, strLen + 1);
++ memcpy(result, srcStr, strLen);
++ result[strLen] = '\0';
++ return result;
++ }
++ return VMA_NULL;
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++static void VmaFreeString(const VkAllocationCallbacks* allocs, char* str)
++{
++ if (str != VMA_NULL)
++ {
++ const size_t len = strlen(str);
++ vma_delete_array(allocs, str, len + 1);
++ }
++}
++
++template<typename CmpLess, typename VectorT>
++size_t VmaVectorInsertSorted(VectorT& vector, const typename VectorT::value_type& value)
++{
++ const size_t indexToInsert = VmaBinaryFindFirstNotLess(
++ vector.data(),
++ vector.data() + vector.size(),
++ value,
++ CmpLess()) - vector.data();
++ VmaVectorInsert(vector, indexToInsert, value);
++ return indexToInsert;
++}
++
++template<typename CmpLess, typename VectorT>
++bool VmaVectorRemoveSorted(VectorT& vector, const typename VectorT::value_type& value)
++{
++ CmpLess comparator;
++ typename VectorT::iterator it = VmaBinaryFindFirstNotLess(
++ vector.begin(),
++ vector.end(),
++ value,
++ comparator);
++ if ((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it))
++ {
++ size_t indexToRemove = it - vector.begin();
++ VmaVectorRemove(vector, indexToRemove);
++ return true;
++ }
++ return false;
++}
++#endif // _VMA_FUNCTIONS
++
++#ifndef _VMA_STATISTICS_FUNCTIONS
++
++static void VmaClearStatistics(VmaStatistics& outStats)
++{
++ outStats.blockCount = 0;
++ outStats.allocationCount = 0;
++ outStats.blockBytes = 0;
++ outStats.allocationBytes = 0;
++}
++
++static void VmaAddStatistics(VmaStatistics& inoutStats, const VmaStatistics& src)
++{
++ inoutStats.blockCount += src.blockCount;
++ inoutStats.allocationCount += src.allocationCount;
++ inoutStats.blockBytes += src.blockBytes;
++ inoutStats.allocationBytes += src.allocationBytes;
++}
++
++static void VmaClearDetailedStatistics(VmaDetailedStatistics& outStats)
++{
++ VmaClearStatistics(outStats.statistics);
++ outStats.unusedRangeCount = 0;
++ outStats.allocationSizeMin = VK_WHOLE_SIZE;
++ outStats.allocationSizeMax = 0;
++ outStats.unusedRangeSizeMin = VK_WHOLE_SIZE;
++ outStats.unusedRangeSizeMax = 0;
++}
++
++static void VmaAddDetailedStatisticsAllocation(VmaDetailedStatistics& inoutStats, VkDeviceSize size)
++{
++ inoutStats.statistics.allocationCount++;
++ inoutStats.statistics.allocationBytes += size;
++ inoutStats.allocationSizeMin = VMA_MIN(inoutStats.allocationSizeMin, size);
++ inoutStats.allocationSizeMax = VMA_MAX(inoutStats.allocationSizeMax, size);
++}
++
++static void VmaAddDetailedStatisticsUnusedRange(VmaDetailedStatistics& inoutStats, VkDeviceSize size)
++{
++ inoutStats.unusedRangeCount++;
++ inoutStats.unusedRangeSizeMin = VMA_MIN(inoutStats.unusedRangeSizeMin, size);
++ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, size);
++}
++
++static void VmaAddDetailedStatistics(VmaDetailedStatistics& inoutStats, const VmaDetailedStatistics& src)
++{
++ VmaAddStatistics(inoutStats.statistics, src.statistics);
++ inoutStats.unusedRangeCount += src.unusedRangeCount;
++ inoutStats.allocationSizeMin = VMA_MIN(inoutStats.allocationSizeMin, src.allocationSizeMin);
++ inoutStats.allocationSizeMax = VMA_MAX(inoutStats.allocationSizeMax, src.allocationSizeMax);
++ inoutStats.unusedRangeSizeMin = VMA_MIN(inoutStats.unusedRangeSizeMin, src.unusedRangeSizeMin);
++ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, src.unusedRangeSizeMax);
++}
++
++#endif // _VMA_STATISTICS_FUNCTIONS
++
++#ifndef _VMA_MUTEX_LOCK
++// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope).
++struct VmaMutexLock
++{
++ VMA_CLASS_NO_COPY(VmaMutexLock)
++public:
++ VmaMutexLock(VMA_MUTEX& mutex, bool useMutex = true) :
++ m_pMutex(useMutex ? &mutex : VMA_NULL)
++ {
++ if (m_pMutex) { m_pMutex->Lock(); }
++ }
++ ~VmaMutexLock() { if (m_pMutex) { m_pMutex->Unlock(); } }
++
++private:
++ VMA_MUTEX* m_pMutex;
++};
++
++// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading.
++struct VmaMutexLockRead
++{
++ VMA_CLASS_NO_COPY(VmaMutexLockRead)
++public:
++ VmaMutexLockRead(VMA_RW_MUTEX& mutex, bool useMutex) :
++ m_pMutex(useMutex ? &mutex : VMA_NULL)
++ {
++ if (m_pMutex) { m_pMutex->LockRead(); }
++ }
++ ~VmaMutexLockRead() { if (m_pMutex) { m_pMutex->UnlockRead(); } }
++
++private:
++ VMA_RW_MUTEX* m_pMutex;
++};
++
++// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing.
++struct VmaMutexLockWrite
++{
++ VMA_CLASS_NO_COPY(VmaMutexLockWrite)
++public:
++ VmaMutexLockWrite(VMA_RW_MUTEX& mutex, bool useMutex)
++ : m_pMutex(useMutex ? &mutex : VMA_NULL)
++ {
++ if (m_pMutex) { m_pMutex->LockWrite(); }
++ }
++ ~VmaMutexLockWrite() { if (m_pMutex) { m_pMutex->UnlockWrite(); } }
++
++private:
++ VMA_RW_MUTEX* m_pMutex;
++};
++
++#if VMA_DEBUG_GLOBAL_MUTEX
++ static VMA_MUTEX gDebugGlobalMutex;
++ #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);
++#else
++ #define VMA_DEBUG_GLOBAL_MUTEX_LOCK
++#endif
++#endif // _VMA_MUTEX_LOCK
++
++#ifndef _VMA_ATOMIC_TRANSACTIONAL_INCREMENT
++// An object that increments given atomic but decrements it back in the destructor unless Commit() is called.
++template<typename T>
++struct AtomicTransactionalIncrement
++{
++public:
++ typedef std::atomic<T> AtomicT;
++
++ ~AtomicTransactionalIncrement()
++ {
++ if(m_Atomic)
++ --(*m_Atomic);
++ }
++
++ void Commit() { m_Atomic = nullptr; }
++ T Increment(AtomicT* atomic)
++ {
++ m_Atomic = atomic;
++ return m_Atomic->fetch_add(1);
++ }
++
++private:
++ AtomicT* m_Atomic = nullptr;
++};
++#endif // _VMA_ATOMIC_TRANSACTIONAL_INCREMENT
++
++#ifndef _VMA_STL_ALLOCATOR
++// STL-compatible allocator.
++template<typename T>
++struct VmaStlAllocator
++{
++ const VkAllocationCallbacks* const m_pCallbacks;
++ typedef T value_type;
++
++ VmaStlAllocator(const VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) {}
++ template<typename U>
++ VmaStlAllocator(const VmaStlAllocator<U>& src) : m_pCallbacks(src.m_pCallbacks) {}
++ VmaStlAllocator(const VmaStlAllocator&) = default;
++ VmaStlAllocator& operator=(const VmaStlAllocator&) = delete;
++
++ T* allocate(size_t n) { return VmaAllocateArray<T>(m_pCallbacks, n); }
++ void deallocate(T* p, size_t n) { VmaFree(m_pCallbacks, p); }
++
++ template<typename U>
++ bool operator==(const VmaStlAllocator<U>& rhs) const
++ {
++ return m_pCallbacks == rhs.m_pCallbacks;
++ }
++ template<typename U>
++ bool operator!=(const VmaStlAllocator<U>& rhs) const
++ {
++ return m_pCallbacks != rhs.m_pCallbacks;
++ }
++};
++#endif // _VMA_STL_ALLOCATOR
++
++#ifndef _VMA_VECTOR
++/* Class with interface compatible with subset of std::vector.
++T must be POD because constructors and destructors are not called and memcpy is
++used for these objects. */
++template<typename T, typename AllocatorT>
++class VmaVector
++{
++public:
++ typedef T value_type;
++ typedef T* iterator;
++ typedef const T* const_iterator;
++
++ VmaVector(const AllocatorT& allocator);
++ VmaVector(size_t count, const AllocatorT& allocator);
++ // This version of the constructor is here for compatibility with pre-C++14 std::vector.
++ // value is unused.
++ VmaVector(size_t count, const T& value, const AllocatorT& allocator) : VmaVector(count, allocator) {}
++ VmaVector(const VmaVector<T, AllocatorT>& src);
++ VmaVector& operator=(const VmaVector& rhs);
++ ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
++
++ bool empty() const { return m_Count == 0; }
++ size_t size() const { return m_Count; }
++ T* data() { return m_pArray; }
++ T& front() { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[0]; }
++ T& back() { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[m_Count - 1]; }
++ const T* data() const { return m_pArray; }
++ const T& front() const { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[0]; }
++ const T& back() const { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[m_Count - 1]; }
++
++ iterator begin() { return m_pArray; }
++ iterator end() { return m_pArray + m_Count; }
++ const_iterator cbegin() const { return m_pArray; }
++ const_iterator cend() const { return m_pArray + m_Count; }
++ const_iterator begin() const { return cbegin(); }
++ const_iterator end() const { return cend(); }
++
++ void pop_front() { VMA_HEAVY_ASSERT(m_Count > 0); remove(0); }
++ void pop_back() { VMA_HEAVY_ASSERT(m_Count > 0); resize(size() - 1); }
++ void push_front(const T& src) { insert(0, src); }
++
++ void push_back(const T& src);
++ void reserve(size_t newCapacity, bool freeMemory = false);
++ void resize(size_t newCount);
++ void clear() { resize(0); }
++ void shrink_to_fit();
++ void insert(size_t index, const T& src);
++ void remove(size_t index);
++
++ T& operator[](size_t index) { VMA_HEAVY_ASSERT(index < m_Count); return m_pArray[index]; }
++ const T& operator[](size_t index) const { VMA_HEAVY_ASSERT(index < m_Count); return m_pArray[index]; }
++
++private:
++ AllocatorT m_Allocator;
++ T* m_pArray;
++ size_t m_Count;
++ size_t m_Capacity;
++};
++
++#ifndef _VMA_VECTOR_FUNCTIONS
++template<typename T, typename AllocatorT>
++VmaVector<T, AllocatorT>::VmaVector(const AllocatorT& allocator)
++ : m_Allocator(allocator),
++ m_pArray(VMA_NULL),
++ m_Count(0),
++ m_Capacity(0) {}
++
++template<typename T, typename AllocatorT>
++VmaVector<T, AllocatorT>::VmaVector(size_t count, const AllocatorT& allocator)
++ : m_Allocator(allocator),
++ m_pArray(count ? (T*)VmaAllocateArray<T>(allocator.m_pCallbacks, count) : VMA_NULL),
++ m_Count(count),
++ m_Capacity(count) {}
++
++template<typename T, typename AllocatorT>
++VmaVector<T, AllocatorT>::VmaVector(const VmaVector& src)
++ : m_Allocator(src.m_Allocator),
++ m_pArray(src.m_Count ? (T*)VmaAllocateArray<T>(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
++ m_Count(src.m_Count),
++ m_Capacity(src.m_Count)
++{
++ if (m_Count != 0)
++ {
++ memcpy(m_pArray, src.m_pArray, m_Count * sizeof(T));
++ }
++}
++
++template<typename T, typename AllocatorT>
++VmaVector<T, AllocatorT>& VmaVector<T, AllocatorT>::operator=(const VmaVector& rhs)
++{
++ if (&rhs != this)
++ {
++ resize(rhs.m_Count);
++ if (m_Count != 0)
++ {
++ memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T));
++ }
++ }
++ return *this;
++}
++
++template<typename T, typename AllocatorT>
++void VmaVector<T, AllocatorT>::push_back(const T& src)
++{
++ const size_t newIndex = size();
++ resize(newIndex + 1);
++ m_pArray[newIndex] = src;
++}
++
++template<typename T, typename AllocatorT>
++void VmaVector<T, AllocatorT>::reserve(size_t newCapacity, bool freeMemory)
++{
++ newCapacity = VMA_MAX(newCapacity, m_Count);
++
++ if ((newCapacity < m_Capacity) && !freeMemory)
++ {
++ newCapacity = m_Capacity;
++ }
++
++ if (newCapacity != m_Capacity)
++ {
++ T* const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator, newCapacity) : VMA_NULL;
++ if (m_Count != 0)
++ {
++ memcpy(newArray, m_pArray, m_Count * sizeof(T));
++ }
++ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
++ m_Capacity = newCapacity;
++ m_pArray = newArray;
++ }
++}
++
++template<typename T, typename AllocatorT>
++void VmaVector<T, AllocatorT>::resize(size_t newCount)
++{
++ size_t newCapacity = m_Capacity;
++ if (newCount > m_Capacity)
++ {
++ newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (size_t)8));
++ }
++
++ if (newCapacity != m_Capacity)
++ {
++ T* const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;
++ const size_t elementsToCopy = VMA_MIN(m_Count, newCount);
++ if (elementsToCopy != 0)
++ {
++ memcpy(newArray, m_pArray, elementsToCopy * sizeof(T));
++ }
++ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
++ m_Capacity = newCapacity;
++ m_pArray = newArray;
++ }
++
++ m_Count = newCount;
++}
++
++template<typename T, typename AllocatorT>
++void VmaVector<T, AllocatorT>::shrink_to_fit()
++{
++ if (m_Capacity > m_Count)
++ {
++ T* newArray = VMA_NULL;
++ if (m_Count > 0)
++ {
++ newArray = VmaAllocateArray<T>(m_Allocator.m_pCallbacks, m_Count);
++ memcpy(newArray, m_pArray, m_Count * sizeof(T));
++ }
++ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
++ m_Capacity = m_Count;
++ m_pArray = newArray;
++ }
++}
++
++template<typename T, typename AllocatorT>
++void VmaVector<T, AllocatorT>::insert(size_t index, const T& src)
++{
++ VMA_HEAVY_ASSERT(index <= m_Count);
++ const size_t oldCount = size();
++ resize(oldCount + 1);
++ if (index < oldCount)
++ {
++ memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * sizeof(T));
++ }
++ m_pArray[index] = src;
++}
++
++template<typename T, typename AllocatorT>
++void VmaVector<T, AllocatorT>::remove(size_t index)
++{
++ VMA_HEAVY_ASSERT(index < m_Count);
++ const size_t oldCount = size();
++ if (index < oldCount - 1)
++ {
++ memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * sizeof(T));
++ }
++ resize(oldCount - 1);
++}
++#endif // _VMA_VECTOR_FUNCTIONS
++
++template<typename T, typename allocatorT>
++static void VmaVectorInsert(VmaVector<T, allocatorT>& vec, size_t index, const T& item)
++{
++ vec.insert(index, item);
++}
++
++template<typename T, typename allocatorT>
++static void VmaVectorRemove(VmaVector<T, allocatorT>& vec, size_t index)
++{
++ vec.remove(index);
++}
++#endif // _VMA_VECTOR
++
++#ifndef _VMA_SMALL_VECTOR
++/*
++This is a vector (a variable-sized array), optimized for the case when the array is small.
++
++It contains some number of elements in-place, which allows it to avoid heap allocation
++when the actual number of elements is below that threshold. This allows normal "small"
++cases to be fast without losing generality for large inputs.
++*/
++template<typename T, typename AllocatorT, size_t N>
++class VmaSmallVector
++{
++public:
++ typedef T value_type;
++ typedef T* iterator;
++
++ VmaSmallVector(const AllocatorT& allocator);
++ VmaSmallVector(size_t count, const AllocatorT& allocator);
++ template<typename SrcT, typename SrcAllocatorT, size_t SrcN>
++ VmaSmallVector(const VmaSmallVector<SrcT, SrcAllocatorT, SrcN>&) = delete;
++ template<typename SrcT, typename SrcAllocatorT, size_t SrcN>
++ VmaSmallVector<T, AllocatorT, N>& operator=(const VmaSmallVector<SrcT, SrcAllocatorT, SrcN>&) = delete;
++ ~VmaSmallVector() = default;
++
++ bool empty() const { return m_Count == 0; }
++ size_t size() const { return m_Count; }
++ T* data() { return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
++ T& front() { VMA_HEAVY_ASSERT(m_Count > 0); return data()[0]; }
++ T& back() { VMA_HEAVY_ASSERT(m_Count > 0); return data()[m_Count - 1]; }
++ const T* data() const { return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
++ const T& front() const { VMA_HEAVY_ASSERT(m_Count > 0); return data()[0]; }
++ const T& back() const { VMA_HEAVY_ASSERT(m_Count > 0); return data()[m_Count - 1]; }
++
++ iterator begin() { return data(); }
++ iterator end() { return data() + m_Count; }
++
++ void pop_front() { VMA_HEAVY_ASSERT(m_Count > 0); remove(0); }
++ void pop_back() { VMA_HEAVY_ASSERT(m_Count > 0); resize(size() - 1); }
++ void push_front(const T& src) { insert(0, src); }
++
++ void push_back(const T& src);
++ void resize(size_t newCount, bool freeMemory = false);
++ void clear(bool freeMemory = false);
++ void insert(size_t index, const T& src);
++ void remove(size_t index);
++
++ T& operator[](size_t index) { VMA_HEAVY_ASSERT(index < m_Count); return data()[index]; }
++ const T& operator[](size_t index) const { VMA_HEAVY_ASSERT(index < m_Count); return data()[index]; }
++
++private:
++ size_t m_Count;
++ T m_StaticArray[N]; // Used when m_Size <= N
++ VmaVector<T, AllocatorT> m_DynamicArray; // Used when m_Size > N
++};
++
++#ifndef _VMA_SMALL_VECTOR_FUNCTIONS
++template<typename T, typename AllocatorT, size_t N>
++VmaSmallVector<T, AllocatorT, N>::VmaSmallVector(const AllocatorT& allocator)
++ : m_Count(0),
++ m_DynamicArray(allocator) {}
++
++template<typename T, typename AllocatorT, size_t N>
++VmaSmallVector<T, AllocatorT, N>::VmaSmallVector(size_t count, const AllocatorT& allocator)
++ : m_Count(count),
++ m_DynamicArray(count > N ? count : 0, allocator) {}
++
++template<typename T, typename AllocatorT, size_t N>
++void VmaSmallVector<T, AllocatorT, N>::push_back(const T& src)
++{
++ const size_t newIndex = size();
++ resize(newIndex + 1);
++ data()[newIndex] = src;
++}
++
++template<typename T, typename AllocatorT, size_t N>
++void VmaSmallVector<T, AllocatorT, N>::resize(size_t newCount, bool freeMemory)
++{
++ if (newCount > N && m_Count > N)
++ {
++ // Any direction, staying in m_DynamicArray
++ m_DynamicArray.resize(newCount);
++ if (freeMemory)
++ {
++ m_DynamicArray.shrink_to_fit();
++ }
++ }
++ else if (newCount > N && m_Count <= N)
++ {
++ // Growing, moving from m_StaticArray to m_DynamicArray
++ m_DynamicArray.resize(newCount);
++ if (m_Count > 0)
++ {
++ memcpy(m_DynamicArray.data(), m_StaticArray, m_Count * sizeof(T));
++ }
++ }
++ else if (newCount <= N && m_Count > N)
++ {
++ // Shrinking, moving from m_DynamicArray to m_StaticArray
++ if (newCount > 0)
++ {
++ memcpy(m_StaticArray, m_DynamicArray.data(), newCount * sizeof(T));
++ }
++ m_DynamicArray.resize(0);
++ if (freeMemory)
++ {
++ m_DynamicArray.shrink_to_fit();
++ }
++ }
++ else
++ {
++ // Any direction, staying in m_StaticArray - nothing to do here
++ }
++ m_Count = newCount;
++}
++
++template<typename T, typename AllocatorT, size_t N>
++void VmaSmallVector<T, AllocatorT, N>::clear(bool freeMemory)
++{
++ m_DynamicArray.clear();
++ if (freeMemory)
++ {
++ m_DynamicArray.shrink_to_fit();
++ }
++ m_Count = 0;
++}
++
++template<typename T, typename AllocatorT, size_t N>
++void VmaSmallVector<T, AllocatorT, N>::insert(size_t index, const T& src)
++{
++ VMA_HEAVY_ASSERT(index <= m_Count);
++ const size_t oldCount = size();
++ resize(oldCount + 1);
++ T* const dataPtr = data();
++ if (index < oldCount)
++ {
++ // I know, this could be more optimal for case where memmove can be memcpy directly from m_StaticArray to m_DynamicArray.
++ memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) * sizeof(T));
++ }
++ dataPtr[index] = src;
++}
++
++template<typename T, typename AllocatorT, size_t N>
++void VmaSmallVector<T, AllocatorT, N>::remove(size_t index)
++{
++ VMA_HEAVY_ASSERT(index < m_Count);
++ const size_t oldCount = size();
++ if (index < oldCount - 1)
++ {
++ // I know, this could be more optimal for case where memmove can be memcpy directly from m_DynamicArray to m_StaticArray.
++ T* const dataPtr = data();
++ memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) * sizeof(T));
++ }
++ resize(oldCount - 1);
++}
++#endif // _VMA_SMALL_VECTOR_FUNCTIONS
++#endif // _VMA_SMALL_VECTOR
++
++#ifndef _VMA_POOL_ALLOCATOR
++/*
++Allocator for objects of type T using a list of arrays (pools) to speed up
++allocation. Number of elements that can be allocated is not bounded because
++allocator can create multiple blocks.
++*/
++template<typename T>
++class VmaPoolAllocator
++{
++ VMA_CLASS_NO_COPY(VmaPoolAllocator)
++public:
++ VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);
++ ~VmaPoolAllocator();
++ template<typename... Types> T* Alloc(Types&&... args);
++ void Free(T* ptr);
++
++private:
++ union Item
++ {
++ uint32_t NextFreeIndex;
++ alignas(T) char Value[sizeof(T)];
++ };
++ struct ItemBlock
++ {
++ Item* pItems;
++ uint32_t Capacity;
++ uint32_t FirstFreeIndex;
++ };
++
++ const VkAllocationCallbacks* m_pAllocationCallbacks;
++ const uint32_t m_FirstBlockCapacity;
++ VmaVector<ItemBlock, VmaStlAllocator<ItemBlock>> m_ItemBlocks;
++
++ ItemBlock& CreateNewBlock();
++};
++
++#ifndef _VMA_POOL_ALLOCATOR_FUNCTIONS
++template<typename T>
++VmaPoolAllocator<T>::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity)
++ : m_pAllocationCallbacks(pAllocationCallbacks),
++ m_FirstBlockCapacity(firstBlockCapacity),
++ m_ItemBlocks(VmaStlAllocator<ItemBlock>(pAllocationCallbacks))
++{
++ VMA_ASSERT(m_FirstBlockCapacity > 1);
++}
++
++template<typename T>
++VmaPoolAllocator<T>::~VmaPoolAllocator()
++{
++ for (size_t i = m_ItemBlocks.size(); i--;)
++ vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);
++ m_ItemBlocks.clear();
++}
++
++template<typename T>
++template<typename... Types> T* VmaPoolAllocator<T>::Alloc(Types&&... args)
++{
++ for (size_t i = m_ItemBlocks.size(); i--; )
++ {
++ ItemBlock& block = m_ItemBlocks[i];
++ // This block has some free items: Use first one.
++ if (block.FirstFreeIndex != UINT32_MAX)
++ {
++ Item* const pItem = &block.pItems[block.FirstFreeIndex];
++ block.FirstFreeIndex = pItem->NextFreeIndex;
++ T* result = (T*)&pItem->Value;
++ new(result)T(std::forward<Types>(args)...); // Explicit constructor call.
++ return result;
++ }
++ }
++
++ // No block has free item: Create new one and use it.
++ ItemBlock& newBlock = CreateNewBlock();
++ Item* const pItem = &newBlock.pItems[0];
++ newBlock.FirstFreeIndex = pItem->NextFreeIndex;
++ T* result = (T*)&pItem->Value;
++ new(result) T(std::forward<Types>(args)...); // Explicit constructor call.
++ return result;
++}
++
++template<typename T>
++void VmaPoolAllocator<T>::Free(T* ptr)
++{
++ // Search all memory blocks to find ptr.
++ for (size_t i = m_ItemBlocks.size(); i--; )
++ {
++ ItemBlock& block = m_ItemBlocks[i];
++
++ // Casting to union.
++ Item* pItemPtr;
++ memcpy(&pItemPtr, &ptr, sizeof(pItemPtr));
++
++ // Check if pItemPtr is in address range of this block.
++ if ((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + block.Capacity))
++ {
++ ptr->~T(); // Explicit destructor call.
++ const uint32_t index = static_cast<uint32_t>(pItemPtr - block.pItems);
++ pItemPtr->NextFreeIndex = block.FirstFreeIndex;
++ block.FirstFreeIndex = index;
++ return;
++ }
++ }
++ VMA_ASSERT(0 && "Pointer doesn't belong to this memory pool.");
++}
++
++template<typename T>
++typename VmaPoolAllocator<T>::ItemBlock& VmaPoolAllocator<T>::CreateNewBlock()
++{
++ const uint32_t newBlockCapacity = m_ItemBlocks.empty() ?
++ m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2;
++
++ const ItemBlock newBlock =
++ {
++ vma_new_array(m_pAllocationCallbacks, Item, newBlockCapacity),
++ newBlockCapacity,
++ 0
++ };
++
++ m_ItemBlocks.push_back(newBlock);
++
++ // Setup singly-linked list of all free items in this block.
++ for (uint32_t i = 0; i < newBlockCapacity - 1; ++i)
++ newBlock.pItems[i].NextFreeIndex = i + 1;
++ newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX;
++ return m_ItemBlocks.back();
++}
++#endif // _VMA_POOL_ALLOCATOR_FUNCTIONS
++#endif // _VMA_POOL_ALLOCATOR
++
++#ifndef _VMA_RAW_LIST
++template<typename T>
++struct VmaListItem
++{
++ VmaListItem* pPrev;
++ VmaListItem* pNext;
++ T Value;
++};
++
++// Doubly linked list.
++template<typename T>
++class VmaRawList
++{
++ VMA_CLASS_NO_COPY(VmaRawList)
++public:
++ typedef VmaListItem<T> ItemType;
++
++ VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks);
++ // Intentionally not calling Clear, because that would be unnecessary
++ // computations to return all items to m_ItemAllocator as free.
++ ~VmaRawList() = default;
++
++ size_t GetCount() const { return m_Count; }
++ bool IsEmpty() const { return m_Count == 0; }
++
++ ItemType* Front() { return m_pFront; }
++ ItemType* Back() { return m_pBack; }
++ const ItemType* Front() const { return m_pFront; }
++ const ItemType* Back() const { return m_pBack; }
++
++ ItemType* PushFront();
++ ItemType* PushBack();
++ ItemType* PushFront(const T& value);
++ ItemType* PushBack(const T& value);
++ void PopFront();
++ void PopBack();
++
++ // Item can be null - it means PushBack.
++ ItemType* InsertBefore(ItemType* pItem);
++ // Item can be null - it means PushFront.
++ ItemType* InsertAfter(ItemType* pItem);
++ ItemType* InsertBefore(ItemType* pItem, const T& value);
++ ItemType* InsertAfter(ItemType* pItem, const T& value);
++
++ void Clear();
++ void Remove(ItemType* pItem);
++
++private:
++ const VkAllocationCallbacks* const m_pAllocationCallbacks;
++ VmaPoolAllocator<ItemType> m_ItemAllocator;
++ ItemType* m_pFront;
++ ItemType* m_pBack;
++ size_t m_Count;
++};
++
++#ifndef _VMA_RAW_LIST_FUNCTIONS
++template<typename T>
++VmaRawList<T>::VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks)
++ : m_pAllocationCallbacks(pAllocationCallbacks),
++ m_ItemAllocator(pAllocationCallbacks, 128),
++ m_pFront(VMA_NULL),
++ m_pBack(VMA_NULL),
++ m_Count(0) {}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::PushFront()
++{
++ ItemType* const pNewItem = m_ItemAllocator.Alloc();
++ pNewItem->pPrev = VMA_NULL;
++ if (IsEmpty())
++ {
++ pNewItem->pNext = VMA_NULL;
++ m_pFront = pNewItem;
++ m_pBack = pNewItem;
++ m_Count = 1;
++ }
++ else
++ {
++ pNewItem->pNext = m_pFront;
++ m_pFront->pPrev = pNewItem;
++ m_pFront = pNewItem;
++ ++m_Count;
++ }
++ return pNewItem;
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::PushBack()
++{
++ ItemType* const pNewItem = m_ItemAllocator.Alloc();
++ pNewItem->pNext = VMA_NULL;
++ if(IsEmpty())
++ {
++ pNewItem->pPrev = VMA_NULL;
++ m_pFront = pNewItem;
++ m_pBack = pNewItem;
++ m_Count = 1;
++ }
++ else
++ {
++ pNewItem->pPrev = m_pBack;
++ m_pBack->pNext = pNewItem;
++ m_pBack = pNewItem;
++ ++m_Count;
++ }
++ return pNewItem;
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::PushFront(const T& value)
++{
++ ItemType* const pNewItem = PushFront();
++ pNewItem->Value = value;
++ return pNewItem;
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::PushBack(const T& value)
++{
++ ItemType* const pNewItem = PushBack();
++ pNewItem->Value = value;
++ return pNewItem;
++}
++
++template<typename T>
++void VmaRawList<T>::PopFront()
++{
++ VMA_HEAVY_ASSERT(m_Count > 0);
++ ItemType* const pFrontItem = m_pFront;
++ ItemType* const pNextItem = pFrontItem->pNext;
++ if (pNextItem != VMA_NULL)
++ {
++ pNextItem->pPrev = VMA_NULL;
++ }
++ m_pFront = pNextItem;
++ m_ItemAllocator.Free(pFrontItem);
++ --m_Count;
++}
++
++template<typename T>
++void VmaRawList<T>::PopBack()
++{
++ VMA_HEAVY_ASSERT(m_Count > 0);
++ ItemType* const pBackItem = m_pBack;
++ ItemType* const pPrevItem = pBackItem->pPrev;
++ if(pPrevItem != VMA_NULL)
++ {
++ pPrevItem->pNext = VMA_NULL;
++ }
++ m_pBack = pPrevItem;
++ m_ItemAllocator.Free(pBackItem);
++ --m_Count;
++}
++
++template<typename T>
++void VmaRawList<T>::Clear()
++{
++ if (IsEmpty() == false)
++ {
++ ItemType* pItem = m_pBack;
++ while (pItem != VMA_NULL)
++ {
++ ItemType* const pPrevItem = pItem->pPrev;
++ m_ItemAllocator.Free(pItem);
++ pItem = pPrevItem;
++ }
++ m_pFront = VMA_NULL;
++ m_pBack = VMA_NULL;
++ m_Count = 0;
++ }
++}
++
++template<typename T>
++void VmaRawList<T>::Remove(ItemType* pItem)
++{
++ VMA_HEAVY_ASSERT(pItem != VMA_NULL);
++ VMA_HEAVY_ASSERT(m_Count > 0);
++
++ if(pItem->pPrev != VMA_NULL)
++ {
++ pItem->pPrev->pNext = pItem->pNext;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_pFront == pItem);
++ m_pFront = pItem->pNext;
++ }
++
++ if(pItem->pNext != VMA_NULL)
++ {
++ pItem->pNext->pPrev = pItem->pPrev;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_pBack == pItem);
++ m_pBack = pItem->pPrev;
++ }
++
++ m_ItemAllocator.Free(pItem);
++ --m_Count;
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem)
++{
++ if(pItem != VMA_NULL)
++ {
++ ItemType* const prevItem = pItem->pPrev;
++ ItemType* const newItem = m_ItemAllocator.Alloc();
++ newItem->pPrev = prevItem;
++ newItem->pNext = pItem;
++ pItem->pPrev = newItem;
++ if(prevItem != VMA_NULL)
++ {
++ prevItem->pNext = newItem;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_pFront == pItem);
++ m_pFront = newItem;
++ }
++ ++m_Count;
++ return newItem;
++ }
++ else
++ return PushBack();
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem)
++{
++ if(pItem != VMA_NULL)
++ {
++ ItemType* const nextItem = pItem->pNext;
++ ItemType* const newItem = m_ItemAllocator.Alloc();
++ newItem->pNext = nextItem;
++ newItem->pPrev = pItem;
++ pItem->pNext = newItem;
++ if(nextItem != VMA_NULL)
++ {
++ nextItem->pPrev = newItem;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_pBack == pItem);
++ m_pBack = newItem;
++ }
++ ++m_Count;
++ return newItem;
++ }
++ else
++ return PushFront();
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem, const T& value)
++{
++ ItemType* const newItem = InsertBefore(pItem);
++ newItem->Value = value;
++ return newItem;
++}
++
++template<typename T>
++VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem, const T& value)
++{
++ ItemType* const newItem = InsertAfter(pItem);
++ newItem->Value = value;
++ return newItem;
++}
++#endif // _VMA_RAW_LIST_FUNCTIONS
++#endif // _VMA_RAW_LIST
++
++#ifndef _VMA_LIST
++template<typename T, typename AllocatorT>
++class VmaList
++{
++ VMA_CLASS_NO_COPY(VmaList)
++public:
++ class reverse_iterator;
++ class const_iterator;
++ class const_reverse_iterator;
++
++ class iterator
++ {
++ friend class const_iterator;
++ friend class VmaList<T, AllocatorT>;
++ public:
++ iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
++ iterator(const reverse_iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
++
++ T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
++ T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
++
++ bool operator==(const iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
++ bool operator!=(const iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
++
++ iterator operator++(int) { iterator result = *this; ++*this; return result; }
++ iterator operator--(int) { iterator result = *this; --*this; return result; }
++
++ iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pNext; return *this; }
++ iterator& operator--();
++
++ private:
++ VmaRawList<T>* m_pList;
++ VmaListItem<T>* m_pItem;
++
++ iterator(VmaRawList<T>* pList, VmaListItem<T>* pItem) : m_pList(pList), m_pItem(pItem) {}
++ };
++ class reverse_iterator
++ {
++ friend class const_reverse_iterator;
++ friend class VmaList<T, AllocatorT>;
++ public:
++ reverse_iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
++ reverse_iterator(const iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
++
++ T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
++ T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
++
++ bool operator==(const reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
++ bool operator!=(const reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
++
++ reverse_iterator operator++(int) { reverse_iterator result = *this; ++* this; return result; }
++ reverse_iterator operator--(int) { reverse_iterator result = *this; --* this; return result; }
++
++ reverse_iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pPrev; return *this; }
++ reverse_iterator& operator--();
++
++ private:
++ VmaRawList<T>* m_pList;
++ VmaListItem<T>* m_pItem;
++
++ reverse_iterator(VmaRawList<T>* pList, VmaListItem<T>* pItem) : m_pList(pList), m_pItem(pItem) {}
++ };
++ class const_iterator
++ {
++ friend class VmaList<T, AllocatorT>;
++ public:
++ const_iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
++ const_iterator(const iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
++ const_iterator(const reverse_iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
++
++ iterator drop_const() { return { const_cast<VmaRawList<T>*>(m_pList), const_cast<VmaListItem<T>*>(m_pItem) }; }
++
++ const T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
++ const T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
++
++ bool operator==(const const_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
++ bool operator!=(const const_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
++
++ const_iterator operator++(int) { const_iterator result = *this; ++* this; return result; }
++ const_iterator operator--(int) { const_iterator result = *this; --* this; return result; }
++
++ const_iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pNext; return *this; }
++ const_iterator& operator--();
++
++ private:
++ const VmaRawList<T>* m_pList;
++ const VmaListItem<T>* m_pItem;
++
++ const_iterator(const VmaRawList<T>* pList, const VmaListItem<T>* pItem) : m_pList(pList), m_pItem(pItem) {}
++ };
++ class const_reverse_iterator
++ {
++ friend class VmaList<T, AllocatorT>;
++ public:
++ const_reverse_iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
++ const_reverse_iterator(const reverse_iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
++ const_reverse_iterator(const iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
++
++ reverse_iterator drop_const() { return { const_cast<VmaRawList<T>*>(m_pList), const_cast<VmaListItem<T>*>(m_pItem) }; }
++
++ const T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
++ const T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
++
++ bool operator==(const const_reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
++ bool operator!=(const const_reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
++
++ const_reverse_iterator operator++(int) { const_reverse_iterator result = *this; ++* this; return result; }
++ const_reverse_iterator operator--(int) { const_reverse_iterator result = *this; --* this; return result; }
++
++ const_reverse_iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pPrev; return *this; }
++ const_reverse_iterator& operator--();
++
++ private:
++ const VmaRawList<T>* m_pList;
++ const VmaListItem<T>* m_pItem;
++
++ const_reverse_iterator(const VmaRawList<T>* pList, const VmaListItem<T>* pItem) : m_pList(pList), m_pItem(pItem) {}
++ };
++
++ VmaList(const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) {}
++
++ bool empty() const { return m_RawList.IsEmpty(); }
++ size_t size() const { return m_RawList.GetCount(); }
++
++ iterator begin() { return iterator(&m_RawList, m_RawList.Front()); }
++ iterator end() { return iterator(&m_RawList, VMA_NULL); }
++
++ const_iterator cbegin() const { return const_iterator(&m_RawList, m_RawList.Front()); }
++ const_iterator cend() const { return const_iterator(&m_RawList, VMA_NULL); }
++
++ const_iterator begin() const { return cbegin(); }
++ const_iterator end() const { return cend(); }
++
++ reverse_iterator rbegin() { return reverse_iterator(&m_RawList, m_RawList.Back()); }
++ reverse_iterator rend() { return reverse_iterator(&m_RawList, VMA_NULL); }
++
++ const_reverse_iterator crbegin() const { return const_reverse_iterator(&m_RawList, m_RawList.Back()); }
++ const_reverse_iterator crend() const { return const_reverse_iterator(&m_RawList, VMA_NULL); }
++
++ const_reverse_iterator rbegin() const { return crbegin(); }
++ const_reverse_iterator rend() const { return crend(); }
++
++ void push_back(const T& value) { m_RawList.PushBack(value); }
++ iterator insert(iterator it, const T& value) { return iterator(&m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }
++
++ void clear() { m_RawList.Clear(); }
++ void erase(iterator it) { m_RawList.Remove(it.m_pItem); }
++
++private:
++ VmaRawList<T> m_RawList;
++};
++
++#ifndef _VMA_LIST_FUNCTIONS
++template<typename T, typename AllocatorT>
++typename VmaList<T, AllocatorT>::iterator& VmaList<T, AllocatorT>::iterator::operator--()
++{
++ if (m_pItem != VMA_NULL)
++ {
++ m_pItem = m_pItem->pPrev;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
++ m_pItem = m_pList->Back();
++ }
++ return *this;
++}
++
++template<typename T, typename AllocatorT>
++typename VmaList<T, AllocatorT>::reverse_iterator& VmaList<T, AllocatorT>::reverse_iterator::operator--()
++{
++ if (m_pItem != VMA_NULL)
++ {
++ m_pItem = m_pItem->pNext;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
++ m_pItem = m_pList->Front();
++ }
++ return *this;
++}
++
++template<typename T, typename AllocatorT>
++typename VmaList<T, AllocatorT>::const_iterator& VmaList<T, AllocatorT>::const_iterator::operator--()
++{
++ if (m_pItem != VMA_NULL)
++ {
++ m_pItem = m_pItem->pPrev;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
++ m_pItem = m_pList->Back();
++ }
++ return *this;
++}
++
++template<typename T, typename AllocatorT>
++typename VmaList<T, AllocatorT>::const_reverse_iterator& VmaList<T, AllocatorT>::const_reverse_iterator::operator--()
++{
++ if (m_pItem != VMA_NULL)
++ {
++ m_pItem = m_pItem->pNext;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
++ m_pItem = m_pList->Back();
++ }
++ return *this;
++}
++#endif // _VMA_LIST_FUNCTIONS
++#endif // _VMA_LIST
++
++#ifndef _VMA_INTRUSIVE_LINKED_LIST
++/*
++Expected interface of ItemTypeTraits:
++struct MyItemTypeTraits
++{
++ typedef MyItem ItemType;
++ static ItemType* GetPrev(const ItemType* item) { return item->myPrevPtr; }
++ static ItemType* GetNext(const ItemType* item) { return item->myNextPtr; }
++ static ItemType*& AccessPrev(ItemType* item) { return item->myPrevPtr; }
++ static ItemType*& AccessNext(ItemType* item) { return item->myNextPtr; }
++};
++*/
++template<typename ItemTypeTraits>
++class VmaIntrusiveLinkedList
++{
++public:
++ typedef typename ItemTypeTraits::ItemType ItemType;
++ static ItemType* GetPrev(const ItemType* item) { return ItemTypeTraits::GetPrev(item); }
++ static ItemType* GetNext(const ItemType* item) { return ItemTypeTraits::GetNext(item); }
++
++ // Movable, not copyable.
++ VmaIntrusiveLinkedList() = default;
++ VmaIntrusiveLinkedList(VmaIntrusiveLinkedList && src);
++ VmaIntrusiveLinkedList(const VmaIntrusiveLinkedList&) = delete;
++ VmaIntrusiveLinkedList& operator=(VmaIntrusiveLinkedList&& src);
++ VmaIntrusiveLinkedList& operator=(const VmaIntrusiveLinkedList&) = delete;
++ ~VmaIntrusiveLinkedList() { VMA_HEAVY_ASSERT(IsEmpty()); }
++
++ size_t GetCount() const { return m_Count; }
++ bool IsEmpty() const { return m_Count == 0; }
++ ItemType* Front() { return m_Front; }
++ ItemType* Back() { return m_Back; }
++ const ItemType* Front() const { return m_Front; }
++ const ItemType* Back() const { return m_Back; }
++
++ void PushBack(ItemType* item);
++ void PushFront(ItemType* item);
++ ItemType* PopBack();
++ ItemType* PopFront();
++
++ // MyItem can be null - it means PushBack.
++ void InsertBefore(ItemType* existingItem, ItemType* newItem);
++ // MyItem can be null - it means PushFront.
++ void InsertAfter(ItemType* existingItem, ItemType* newItem);
++ void Remove(ItemType* item);
++ void RemoveAll();
++
++private:
++ ItemType* m_Front = VMA_NULL;
++ ItemType* m_Back = VMA_NULL;
++ size_t m_Count = 0;
++};
++
++#ifndef _VMA_INTRUSIVE_LINKED_LIST_FUNCTIONS
++template<typename ItemTypeTraits>
++VmaIntrusiveLinkedList<ItemTypeTraits>::VmaIntrusiveLinkedList(VmaIntrusiveLinkedList&& src)
++ : m_Front(src.m_Front), m_Back(src.m_Back), m_Count(src.m_Count)
++{
++ src.m_Front = src.m_Back = VMA_NULL;
++ src.m_Count = 0;
++}
++
++template<typename ItemTypeTraits>
++VmaIntrusiveLinkedList<ItemTypeTraits>& VmaIntrusiveLinkedList<ItemTypeTraits>::operator=(VmaIntrusiveLinkedList&& src)
++{
++ if (&src != this)
++ {
++ VMA_HEAVY_ASSERT(IsEmpty());
++ m_Front = src.m_Front;
++ m_Back = src.m_Back;
++ m_Count = src.m_Count;
++ src.m_Front = src.m_Back = VMA_NULL;
++ src.m_Count = 0;
++ }
++ return *this;
++}
++
++template<typename ItemTypeTraits>
++void VmaIntrusiveLinkedList<ItemTypeTraits>::PushBack(ItemType* item)
++{
++ VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
++ if (IsEmpty())
++ {
++ m_Front = item;
++ m_Back = item;
++ m_Count = 1;
++ }
++ else
++ {
++ ItemTypeTraits::AccessPrev(item) = m_Back;
++ ItemTypeTraits::AccessNext(m_Back) = item;
++ m_Back = item;
++ ++m_Count;
++ }
++}
++
++template<typename ItemTypeTraits>
++void VmaIntrusiveLinkedList<ItemTypeTraits>::PushFront(ItemType* item)
++{
++ VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
++ if (IsEmpty())
++ {
++ m_Front = item;
++ m_Back = item;
++ m_Count = 1;
++ }
++ else
++ {
++ ItemTypeTraits::AccessNext(item) = m_Front;
++ ItemTypeTraits::AccessPrev(m_Front) = item;
++ m_Front = item;
++ ++m_Count;
++ }
++}
++
++template<typename ItemTypeTraits>
++typename VmaIntrusiveLinkedList<ItemTypeTraits>::ItemType* VmaIntrusiveLinkedList<ItemTypeTraits>::PopBack()
++{
++ VMA_HEAVY_ASSERT(m_Count > 0);
++ ItemType* const backItem = m_Back;
++ ItemType* const prevItem = ItemTypeTraits::GetPrev(backItem);
++ if (prevItem != VMA_NULL)
++ {
++ ItemTypeTraits::AccessNext(prevItem) = VMA_NULL;
++ }
++ m_Back = prevItem;
++ --m_Count;
++ ItemTypeTraits::AccessPrev(backItem) = VMA_NULL;
++ ItemTypeTraits::AccessNext(backItem) = VMA_NULL;
++ return backItem;
++}
++
++template<typename ItemTypeTraits>
++typename VmaIntrusiveLinkedList<ItemTypeTraits>::ItemType* VmaIntrusiveLinkedList<ItemTypeTraits>::PopFront()
++{
++ VMA_HEAVY_ASSERT(m_Count > 0);
++ ItemType* const frontItem = m_Front;
++ ItemType* const nextItem = ItemTypeTraits::GetNext(frontItem);
++ if (nextItem != VMA_NULL)
++ {
++ ItemTypeTraits::AccessPrev(nextItem) = VMA_NULL;
++ }
++ m_Front = nextItem;
++ --m_Count;
++ ItemTypeTraits::AccessPrev(frontItem) = VMA_NULL;
++ ItemTypeTraits::AccessNext(frontItem) = VMA_NULL;
++ return frontItem;
++}
++
++template<typename ItemTypeTraits>
++void VmaIntrusiveLinkedList<ItemTypeTraits>::InsertBefore(ItemType* existingItem, ItemType* newItem)
++{
++ VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
++ if (existingItem != VMA_NULL)
++ {
++ ItemType* const prevItem = ItemTypeTraits::GetPrev(existingItem);
++ ItemTypeTraits::AccessPrev(newItem) = prevItem;
++ ItemTypeTraits::AccessNext(newItem) = existingItem;
++ ItemTypeTraits::AccessPrev(existingItem) = newItem;
++ if (prevItem != VMA_NULL)
++ {
++ ItemTypeTraits::AccessNext(prevItem) = newItem;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_Front == existingItem);
++ m_Front = newItem;
++ }
++ ++m_Count;
++ }
++ else
++ PushBack(newItem);
++}
++
++template<typename ItemTypeTraits>
++void VmaIntrusiveLinkedList<ItemTypeTraits>::InsertAfter(ItemType* existingItem, ItemType* newItem)
++{
++ VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
++ if (existingItem != VMA_NULL)
++ {
++ ItemType* const nextItem = ItemTypeTraits::GetNext(existingItem);
++ ItemTypeTraits::AccessNext(newItem) = nextItem;
++ ItemTypeTraits::AccessPrev(newItem) = existingItem;
++ ItemTypeTraits::AccessNext(existingItem) = newItem;
++ if (nextItem != VMA_NULL)
++ {
++ ItemTypeTraits::AccessPrev(nextItem) = newItem;
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_Back == existingItem);
++ m_Back = newItem;
++ }
++ ++m_Count;
++ }
++ else
++ return PushFront(newItem);
++}
++
++template<typename ItemTypeTraits>
++void VmaIntrusiveLinkedList<ItemTypeTraits>::Remove(ItemType* item)
++{
++ VMA_HEAVY_ASSERT(item != VMA_NULL && m_Count > 0);
++ if (ItemTypeTraits::GetPrev(item) != VMA_NULL)
++ {
++ ItemTypeTraits::AccessNext(ItemTypeTraits::AccessPrev(item)) = ItemTypeTraits::GetNext(item);
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_Front == item);
++ m_Front = ItemTypeTraits::GetNext(item);
++ }
++
++ if (ItemTypeTraits::GetNext(item) != VMA_NULL)
++ {
++ ItemTypeTraits::AccessPrev(ItemTypeTraits::AccessNext(item)) = ItemTypeTraits::GetPrev(item);
++ }
++ else
++ {
++ VMA_HEAVY_ASSERT(m_Back == item);
++ m_Back = ItemTypeTraits::GetPrev(item);
++ }
++ ItemTypeTraits::AccessPrev(item) = VMA_NULL;
++ ItemTypeTraits::AccessNext(item) = VMA_NULL;
++ --m_Count;
++}
++
++template<typename ItemTypeTraits>
++void VmaIntrusiveLinkedList<ItemTypeTraits>::RemoveAll()
++{
++ if (!IsEmpty())
++ {
++ ItemType* item = m_Back;
++ while (item != VMA_NULL)
++ {
++ ItemType* const prevItem = ItemTypeTraits::AccessPrev(item);
++ ItemTypeTraits::AccessPrev(item) = VMA_NULL;
++ ItemTypeTraits::AccessNext(item) = VMA_NULL;
++ item = prevItem;
++ }
++ m_Front = VMA_NULL;
++ m_Back = VMA_NULL;
++ m_Count = 0;
++ }
++}
++#endif // _VMA_INTRUSIVE_LINKED_LIST_FUNCTIONS
++#endif // _VMA_INTRUSIVE_LINKED_LIST
++
++// Unused in this version.
++#if 0
++
++#ifndef _VMA_PAIR
++template<typename T1, typename T2>
++struct VmaPair
++{
++ T1 first;
++ T2 second;
++
++ VmaPair() : first(), second() {}
++ VmaPair(const T1& firstSrc, const T2& secondSrc) : first(firstSrc), second(secondSrc) {}
++};
++
++template<typename FirstT, typename SecondT>
++struct VmaPairFirstLess
++{
++ bool operator()(const VmaPair<FirstT, SecondT>& lhs, const VmaPair<FirstT, SecondT>& rhs) const
++ {
++ return lhs.first < rhs.first;
++ }
++ bool operator()(const VmaPair<FirstT, SecondT>& lhs, const FirstT& rhsFirst) const
++ {
++ return lhs.first < rhsFirst;
++ }
++};
++#endif // _VMA_PAIR
++
++#ifndef _VMA_MAP
++/* Class compatible with subset of interface of std::unordered_map.
++KeyT, ValueT must be POD because they will be stored in VmaVector.
++*/
++template<typename KeyT, typename ValueT>
++class VmaMap
++{
++public:
++ typedef VmaPair<KeyT, ValueT> PairType;
++ typedef PairType* iterator;
++
++ VmaMap(const VmaStlAllocator<PairType>& allocator) : m_Vector(allocator) {}
++
++ iterator begin() { return m_Vector.begin(); }
++ iterator end() { return m_Vector.end(); }
++ size_t size() { return m_Vector.size(); }
++
++ void insert(const PairType& pair);
++ iterator find(const KeyT& key);
++ void erase(iterator it);
++
++private:
++ VmaVector< PairType, VmaStlAllocator<PairType>> m_Vector;
++};
++
++#ifndef _VMA_MAP_FUNCTIONS
++template<typename KeyT, typename ValueT>
++void VmaMap<KeyT, ValueT>::insert(const PairType& pair)
++{
++ const size_t indexToInsert = VmaBinaryFindFirstNotLess(
++ m_Vector.data(),
++ m_Vector.data() + m_Vector.size(),
++ pair,
++ VmaPairFirstLess<KeyT, ValueT>()) - m_Vector.data();
++ VmaVectorInsert(m_Vector, indexToInsert, pair);
++}
++
++template<typename KeyT, typename ValueT>
++VmaPair<KeyT, ValueT>* VmaMap<KeyT, ValueT>::find(const KeyT& key)
++{
++ PairType* it = VmaBinaryFindFirstNotLess(
++ m_Vector.data(),
++ m_Vector.data() + m_Vector.size(),
++ key,
++ VmaPairFirstLess<KeyT, ValueT>());
++ if ((it != m_Vector.end()) && (it->first == key))
++ {
++ return it;
++ }
++ else
++ {
++ return m_Vector.end();
++ }
++}
++
++template<typename KeyT, typename ValueT>
++void VmaMap<KeyT, ValueT>::erase(iterator it)
++{
++ VmaVectorRemove(m_Vector, it - m_Vector.begin());
++}
++#endif // _VMA_MAP_FUNCTIONS
++#endif // _VMA_MAP
++
++#endif // #if 0
++
++#if !defined(_VMA_STRING_BUILDER) && VMA_STATS_STRING_ENABLED
++class VmaStringBuilder
++{
++public:
++ VmaStringBuilder(const VkAllocationCallbacks* allocationCallbacks) : m_Data(VmaStlAllocator<char>(allocationCallbacks)) {}
++ ~VmaStringBuilder() = default;
++
++ size_t GetLength() const { return m_Data.size(); }
++ const char* GetData() const { return m_Data.data(); }
++ void AddNewLine() { Add('\n'); }
++ void Add(char ch) { m_Data.push_back(ch); }
++
++ void Add(const char* pStr);
++ void AddNumber(uint32_t num);
++ void AddNumber(uint64_t num);
++ void AddPointer(const void* ptr);
++
++private:
++ VmaVector<char, VmaStlAllocator<char>> m_Data;
++};
++
++#ifndef _VMA_STRING_BUILDER_FUNCTIONS
++void VmaStringBuilder::Add(const char* pStr)
++{
++ const size_t strLen = strlen(pStr);
++ if (strLen > 0)
++ {
++ const size_t oldCount = m_Data.size();
++ m_Data.resize(oldCount + strLen);
++ memcpy(m_Data.data() + oldCount, pStr, strLen);
++ }
++}
++
++void VmaStringBuilder::AddNumber(uint32_t num)
++{
++ char buf[11];
++ buf[10] = '\0';
++ char* p = &buf[10];
++ do
++ {
++ *--p = '0' + (num % 10);
++ num /= 10;
++ } while (num);
++ Add(p);
++}
++
++void VmaStringBuilder::AddNumber(uint64_t num)
++{
++ char buf[21];
++ buf[20] = '\0';
++ char* p = &buf[20];
++ do
++ {
++ *--p = '0' + (num % 10);
++ num /= 10;
++ } while (num);
++ Add(p);
++}
++
++void VmaStringBuilder::AddPointer(const void* ptr)
++{
++ char buf[21];
++ VmaPtrToStr(buf, sizeof(buf), ptr);
++ Add(buf);
++}
++#endif //_VMA_STRING_BUILDER_FUNCTIONS
++#endif // _VMA_STRING_BUILDER
++
++#if !defined(_VMA_JSON_WRITER) && VMA_STATS_STRING_ENABLED
++/*
++Allows to conveniently build a correct JSON document to be written to the
++VmaStringBuilder passed to the constructor.
++*/
++class VmaJsonWriter
++{
++ VMA_CLASS_NO_COPY(VmaJsonWriter)
++public:
++ // sb - string builder to write the document to. Must remain alive for the whole lifetime of this object.
++ VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb);
++ ~VmaJsonWriter();
++
++ // Begins object by writing "{".
++ // Inside an object, you must call pairs of WriteString and a value, e.g.:
++ // j.BeginObject(true); j.WriteString("A"); j.WriteNumber(1); j.WriteString("B"); j.WriteNumber(2); j.EndObject();
++ // Will write: { "A": 1, "B": 2 }
++ void BeginObject(bool singleLine = false);
++ // Ends object by writing "}".
++ void EndObject();
++
++ // Begins array by writing "[".
++ // Inside an array, you can write a sequence of any values.
++ void BeginArray(bool singleLine = false);
++ // Ends array by writing "[".
++ void EndArray();
++
++ // Writes a string value inside "".
++ // pStr can contain any ANSI characters, including '"', new line etc. - they will be properly escaped.
++ void WriteString(const char* pStr);
++
++ // Begins writing a string value.
++ // Call BeginString, ContinueString, ContinueString, ..., EndString instead of
++ // WriteString to conveniently build the string content incrementally, made of
++ // parts including numbers.
++ void BeginString(const char* pStr = VMA_NULL);
++ // Posts next part of an open string.
++ void ContinueString(const char* pStr);
++ // Posts next part of an open string. The number is converted to decimal characters.
++ void ContinueString(uint32_t n);
++ void ContinueString(uint64_t n);
++ void ContinueString_Size(size_t n);
++ // Posts next part of an open string. Pointer value is converted to characters
++ // using "%p" formatting - shown as hexadecimal number, e.g.: 000000081276Ad00
++ void ContinueString_Pointer(const void* ptr);
++ // Ends writing a string value by writing '"'.
++ void EndString(const char* pStr = VMA_NULL);
++
++ // Writes a number value.
++ void WriteNumber(uint32_t n);
++ void WriteNumber(uint64_t n);
++ void WriteSize(size_t n);
++ // Writes a boolean value - false or true.
++ void WriteBool(bool b);
++ // Writes a null value.
++ void WriteNull();
++
++private:
++ enum COLLECTION_TYPE
++ {
++ COLLECTION_TYPE_OBJECT,
++ COLLECTION_TYPE_ARRAY,
++ };
++ struct StackItem
++ {
++ COLLECTION_TYPE type;
++ uint32_t valueCount;
++ bool singleLineMode;
++ };
++
++ static const char* const INDENT;
++
++ VmaStringBuilder& m_SB;
++ VmaVector< StackItem, VmaStlAllocator<StackItem> > m_Stack;
++ bool m_InsideString;
++
++ // Write size_t for less than 64bits
++ void WriteSize(size_t n, std::integral_constant<bool, false>) { m_SB.AddNumber(static_cast<uint32_t>(n)); }
++ // Write size_t for 64bits
++ void WriteSize(size_t n, std::integral_constant<bool, true>) { m_SB.AddNumber(static_cast<uint64_t>(n)); }
++
++ void BeginValue(bool isString);
++ void WriteIndent(bool oneLess = false);
++};
++const char* const VmaJsonWriter::INDENT = " ";
++
++#ifndef _VMA_JSON_WRITER_FUNCTIONS
++VmaJsonWriter::VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb)
++ : m_SB(sb),
++ m_Stack(VmaStlAllocator<StackItem>(pAllocationCallbacks)),
++ m_InsideString(false) {}
++
++VmaJsonWriter::~VmaJsonWriter()
++{
++ VMA_ASSERT(!m_InsideString);
++ VMA_ASSERT(m_Stack.empty());
++}
++
++void VmaJsonWriter::BeginObject(bool singleLine)
++{
++ VMA_ASSERT(!m_InsideString);
++
++ BeginValue(false);
++ m_SB.Add('{');
++
++ StackItem item;
++ item.type = COLLECTION_TYPE_OBJECT;
++ item.valueCount = 0;
++ item.singleLineMode = singleLine;
++ m_Stack.push_back(item);
++}
++
++void VmaJsonWriter::EndObject()
++{
++ VMA_ASSERT(!m_InsideString);
++
++ WriteIndent(true);
++ m_SB.Add('}');
++
++ VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_OBJECT);
++ m_Stack.pop_back();
++}
++
++void VmaJsonWriter::BeginArray(bool singleLine)
++{
++ VMA_ASSERT(!m_InsideString);
++
++ BeginValue(false);
++ m_SB.Add('[');
++
++ StackItem item;
++ item.type = COLLECTION_TYPE_ARRAY;
++ item.valueCount = 0;
++ item.singleLineMode = singleLine;
++ m_Stack.push_back(item);
++}
++
++void VmaJsonWriter::EndArray()
++{
++ VMA_ASSERT(!m_InsideString);
++
++ WriteIndent(true);
++ m_SB.Add(']');
++
++ VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_ARRAY);
++ m_Stack.pop_back();
++}
++
++void VmaJsonWriter::WriteString(const char* pStr)
++{
++ BeginString(pStr);
++ EndString();
++}
++
++void VmaJsonWriter::BeginString(const char* pStr)
++{
++ VMA_ASSERT(!m_InsideString);
++
++ BeginValue(true);
++ m_SB.Add('"');
++ m_InsideString = true;
++ if (pStr != VMA_NULL && pStr[0] != '\0')
++ {
++ ContinueString(pStr);
++ }
++}
++
++void VmaJsonWriter::ContinueString(const char* pStr)
++{
++ VMA_ASSERT(m_InsideString);
++
++ const size_t strLen = strlen(pStr);
++ for (size_t i = 0; i < strLen; ++i)
++ {
++ char ch = pStr[i];
++ if (ch == '\\')
++ {
++ m_SB.Add("\\\\");
++ }
++ else if (ch == '"')
++ {
++ m_SB.Add("\\\"");
++ }
++ else if (ch >= 32)
++ {
++ m_SB.Add(ch);
++ }
++ else switch (ch)
++ {
++ case '\b':
++ m_SB.Add("\\b");
++ break;
++ case '\f':
++ m_SB.Add("\\f");
++ break;
++ case '\n':
++ m_SB.Add("\\n");
++ break;
++ case '\r':
++ m_SB.Add("\\r");
++ break;
++ case '\t':
++ m_SB.Add("\\t");
++ break;
++ default:
++ VMA_ASSERT(0 && "Character not currently supported.");
++ break;
++ }
++ }
++}
++
++void VmaJsonWriter::ContinueString(uint32_t n)
++{
++ VMA_ASSERT(m_InsideString);
++ m_SB.AddNumber(n);
++}
++
++void VmaJsonWriter::ContinueString(uint64_t n)
++{
++ VMA_ASSERT(m_InsideString);
++ m_SB.AddNumber(n);
++}
++
++void VmaJsonWriter::ContinueString_Size(size_t n)
++{
++ VMA_ASSERT(m_InsideString);
++ // Fix for AppleClang incorrect type casting
++ // TODO: Change to if constexpr when C++17 used as minimal standard
++ WriteSize(n, std::is_same<size_t, uint64_t>{});
++}
++
++void VmaJsonWriter::ContinueString_Pointer(const void* ptr)
++{
++ VMA_ASSERT(m_InsideString);
++ m_SB.AddPointer(ptr);
++}
++
++void VmaJsonWriter::EndString(const char* pStr)
++{
++ VMA_ASSERT(m_InsideString);
++ if (pStr != VMA_NULL && pStr[0] != '\0')
++ {
++ ContinueString(pStr);
++ }
++ m_SB.Add('"');
++ m_InsideString = false;
++}
++
++void VmaJsonWriter::WriteNumber(uint32_t n)
++{
++ VMA_ASSERT(!m_InsideString);
++ BeginValue(false);
++ m_SB.AddNumber(n);
++}
++
++void VmaJsonWriter::WriteNumber(uint64_t n)
++{
++ VMA_ASSERT(!m_InsideString);
++ BeginValue(false);
++ m_SB.AddNumber(n);
++}
++
++void VmaJsonWriter::WriteSize(size_t n)
++{
++ VMA_ASSERT(!m_InsideString);
++ BeginValue(false);
++ // Fix for AppleClang incorrect type casting
++ // TODO: Change to if constexpr when C++17 used as minimal standard
++ WriteSize(n, std::is_same<size_t, uint64_t>{});
++}
++
++void VmaJsonWriter::WriteBool(bool b)
++{
++ VMA_ASSERT(!m_InsideString);
++ BeginValue(false);
++ m_SB.Add(b ? "true" : "false");
++}
++
++void VmaJsonWriter::WriteNull()
++{
++ VMA_ASSERT(!m_InsideString);
++ BeginValue(false);
++ m_SB.Add("null");
++}
++
++void VmaJsonWriter::BeginValue(bool isString)
++{
++ if (!m_Stack.empty())
++ {
++ StackItem& currItem = m_Stack.back();
++ if (currItem.type == COLLECTION_TYPE_OBJECT &&
++ currItem.valueCount % 2 == 0)
++ {
++ VMA_ASSERT(isString);
++ }
++
++ if (currItem.type == COLLECTION_TYPE_OBJECT &&
++ currItem.valueCount % 2 != 0)
++ {
++ m_SB.Add(": ");
++ }
++ else if (currItem.valueCount > 0)
++ {
++ m_SB.Add(", ");
++ WriteIndent();
++ }
++ else
++ {
++ WriteIndent();
++ }
++ ++currItem.valueCount;
++ }
++}
++
++void VmaJsonWriter::WriteIndent(bool oneLess)
++{
++ if (!m_Stack.empty() && !m_Stack.back().singleLineMode)
++ {
++ m_SB.AddNewLine();
++
++ size_t count = m_Stack.size();
++ if (count > 0 && oneLess)
++ {
++ --count;
++ }
++ for (size_t i = 0; i < count; ++i)
++ {
++ m_SB.Add(INDENT);
++ }
++ }
++}
++#endif // _VMA_JSON_WRITER_FUNCTIONS
++
++static void VmaPrintDetailedStatistics(VmaJsonWriter& json, const VmaDetailedStatistics& stat)
++{
++ json.BeginObject();
++
++ json.WriteString("BlockCount");
++ json.WriteNumber(stat.statistics.blockCount);
++ json.WriteString("BlockBytes");
++ json.WriteNumber(stat.statistics.blockBytes);
++ json.WriteString("AllocationCount");
++ json.WriteNumber(stat.statistics.allocationCount);
++ json.WriteString("AllocationBytes");
++ json.WriteNumber(stat.statistics.allocationBytes);
++ json.WriteString("UnusedRangeCount");
++ json.WriteNumber(stat.unusedRangeCount);
++
++ if (stat.statistics.allocationCount > 1)
++ {
++ json.WriteString("AllocationSizeMin");
++ json.WriteNumber(stat.allocationSizeMin);
++ json.WriteString("AllocationSizeMax");
++ json.WriteNumber(stat.allocationSizeMax);
++ }
++ if (stat.unusedRangeCount > 1)
++ {
++ json.WriteString("UnusedRangeSizeMin");
++ json.WriteNumber(stat.unusedRangeSizeMin);
++ json.WriteString("UnusedRangeSizeMax");
++ json.WriteNumber(stat.unusedRangeSizeMax);
++ }
++ json.EndObject();
++}
++#endif // _VMA_JSON_WRITER
++
++#ifndef _VMA_MAPPING_HYSTERESIS
++
++class VmaMappingHysteresis
++{
++ VMA_CLASS_NO_COPY(VmaMappingHysteresis)
++public:
++ VmaMappingHysteresis() = default;
++
++ uint32_t GetExtraMapping() const { return m_ExtraMapping; }
++
++ // Call when Map was called.
++ // Returns true if switched to extra +1 mapping reference count.
++ bool PostMap()
++ {
++#if VMA_MAPPING_HYSTERESIS_ENABLED
++ if(m_ExtraMapping == 0)
++ {
++ ++m_MajorCounter;
++ if(m_MajorCounter >= COUNTER_MIN_EXTRA_MAPPING)
++ {
++ m_ExtraMapping = 1;
++ m_MajorCounter = 0;
++ m_MinorCounter = 0;
++ return true;
++ }
++ }
++ else // m_ExtraMapping == 1
++ PostMinorCounter();
++#endif // #if VMA_MAPPING_HYSTERESIS_ENABLED
++ return false;
++ }
++
++ // Call when Unmap was called.
++ void PostUnmap()
++ {
++#if VMA_MAPPING_HYSTERESIS_ENABLED
++ if(m_ExtraMapping == 0)
++ ++m_MajorCounter;
++ else // m_ExtraMapping == 1
++ PostMinorCounter();
++#endif // #if VMA_MAPPING_HYSTERESIS_ENABLED
++ }
++
++ // Call when allocation was made from the memory block.
++ void PostAlloc()
++ {
++#if VMA_MAPPING_HYSTERESIS_ENABLED
++ if(m_ExtraMapping == 1)
++ ++m_MajorCounter;
++ else // m_ExtraMapping == 0
++ PostMinorCounter();
++#endif // #if VMA_MAPPING_HYSTERESIS_ENABLED
++ }
++
++ // Call when allocation was freed from the memory block.
++ // Returns true if switched to extra -1 mapping reference count.
++ bool PostFree()
++ {
++#if VMA_MAPPING_HYSTERESIS_ENABLED
++ if(m_ExtraMapping == 1)
++ {
++ ++m_MajorCounter;
++ if(m_MajorCounter >= COUNTER_MIN_EXTRA_MAPPING &&
++ m_MajorCounter > m_MinorCounter + 1)
++ {
++ m_ExtraMapping = 0;
++ m_MajorCounter = 0;
++ m_MinorCounter = 0;
++ return true;
++ }
++ }
++ else // m_ExtraMapping == 0
++ PostMinorCounter();
++#endif // #if VMA_MAPPING_HYSTERESIS_ENABLED
++ return false;
++ }
++
++private:
++ static const int32_t COUNTER_MIN_EXTRA_MAPPING = 7;
++
++ uint32_t m_MinorCounter = 0;
++ uint32_t m_MajorCounter = 0;
++ uint32_t m_ExtraMapping = 0; // 0 or 1.
++
++ void PostMinorCounter()
++ {
++ if(m_MinorCounter < m_MajorCounter)
++ {
++ ++m_MinorCounter;
++ }
++ else if(m_MajorCounter > 0)
++ {
++ --m_MajorCounter;
++ --m_MinorCounter;
++ }
++ }
++};
++
++#endif // _VMA_MAPPING_HYSTERESIS
++
++#ifndef _VMA_DEVICE_MEMORY_BLOCK
++/*
++Represents a single block of device memory (`VkDeviceMemory`) with all the
++data about its regions (aka suballocations, #VmaAllocation), assigned and free.
++
++Thread-safety:
++- Access to m_pMetadata must be externally synchronized.
++- Map, Unmap, Bind* are synchronized internally.
++*/
++class VmaDeviceMemoryBlock
++{
++ VMA_CLASS_NO_COPY(VmaDeviceMemoryBlock)
++public:
++ VmaBlockMetadata* m_pMetadata;
++
++ VmaDeviceMemoryBlock(VmaAllocator hAllocator);
++ ~VmaDeviceMemoryBlock();
++
++ // Always call after construction.
++ void Init(
++ VmaAllocator hAllocator,
++ VmaPool hParentPool,
++ uint32_t newMemoryTypeIndex,
++ VkDeviceMemory newMemory,
++ VkDeviceSize newSize,
++ uint32_t id,
++ uint32_t algorithm,
++ VkDeviceSize bufferImageGranularity);
++ // Always call before destruction.
++ void Destroy(VmaAllocator allocator);
++
++ VmaPool GetParentPool() const { return m_hParentPool; }
++ VkDeviceMemory GetDeviceMemory() const { return m_hMemory; }
++ uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; }
++ uint32_t GetId() const { return m_Id; }
++ void* GetMappedData() const { return m_pMappedData; }
++ uint32_t GetMapRefCount() const { return m_MapCount; }
++
++ // Call when allocation/free was made from m_pMetadata.
++ // Used for m_MappingHysteresis.
++ void PostAlloc() { m_MappingHysteresis.PostAlloc(); }
++ void PostFree(VmaAllocator hAllocator);
++
++ // Validates all data structures inside this object. If not valid, returns false.
++ bool Validate() const;
++ VkResult CheckCorruption(VmaAllocator hAllocator);
++
++ // ppData can be null.
++ VkResult Map(VmaAllocator hAllocator, uint32_t count, void** ppData);
++ void Unmap(VmaAllocator hAllocator, uint32_t count);
++
++ VkResult WriteMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
++ VkResult ValidateMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
++
++ VkResult BindBufferMemory(
++ const VmaAllocator hAllocator,
++ const VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkBuffer hBuffer,
++ const void* pNext);
++ VkResult BindImageMemory(
++ const VmaAllocator hAllocator,
++ const VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkImage hImage,
++ const void* pNext);
++
++private:
++ VmaPool m_hParentPool; // VK_NULL_HANDLE if not belongs to custom pool.
++ uint32_t m_MemoryTypeIndex;
++ uint32_t m_Id;
++ VkDeviceMemory m_hMemory;
++
++ /*
++ Protects access to m_hMemory so it is not used by multiple threads simultaneously, e.g. vkMapMemory, vkBindBufferMemory.
++ Also protects m_MapCount, m_pMappedData.
++ Allocations, deallocations, any change in m_pMetadata is protected by parent's VmaBlockVector::m_Mutex.
++ */
++ VMA_MUTEX m_MapAndBindMutex;
++ VmaMappingHysteresis m_MappingHysteresis;
++ uint32_t m_MapCount;
++ void* m_pMappedData;
++};
++#endif // _VMA_DEVICE_MEMORY_BLOCK
++
++#ifndef _VMA_ALLOCATION_T
++struct VmaAllocation_T
++{
++ friend struct VmaDedicatedAllocationListItemTraits;
++
++ enum FLAGS
++ {
++ FLAG_PERSISTENT_MAP = 0x01,
++ FLAG_MAPPING_ALLOWED = 0x02,
++ };
++
++public:
++ enum ALLOCATION_TYPE
++ {
++ ALLOCATION_TYPE_NONE,
++ ALLOCATION_TYPE_BLOCK,
++ ALLOCATION_TYPE_DEDICATED,
++ };
++
++ // This struct is allocated using VmaPoolAllocator.
++ VmaAllocation_T(bool mappingAllowed);
++ ~VmaAllocation_T();
++
++ void InitBlockAllocation(
++ VmaDeviceMemoryBlock* block,
++ VmaAllocHandle allocHandle,
++ VkDeviceSize alignment,
++ VkDeviceSize size,
++ uint32_t memoryTypeIndex,
++ VmaSuballocationType suballocationType,
++ bool mapped);
++ // pMappedData not null means allocation is created with MAPPED flag.
++ void InitDedicatedAllocation(
++ VmaPool hParentPool,
++ uint32_t memoryTypeIndex,
++ VkDeviceMemory hMemory,
++ VmaSuballocationType suballocationType,
++ void* pMappedData,
++ VkDeviceSize size);
++
++ ALLOCATION_TYPE GetType() const { return (ALLOCATION_TYPE)m_Type; }
++ VkDeviceSize GetAlignment() const { return m_Alignment; }
++ VkDeviceSize GetSize() const { return m_Size; }
++ void* GetUserData() const { return m_pUserData; }
++ const char* GetName() const { return m_pName; }
++ VmaSuballocationType GetSuballocationType() const { return (VmaSuballocationType)m_SuballocationType; }
++
++ VmaDeviceMemoryBlock* GetBlock() const { VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK); return m_BlockAllocation.m_Block; }
++ uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; }
++ bool IsPersistentMap() const { return (m_Flags & FLAG_PERSISTENT_MAP) != 0; }
++ bool IsMappingAllowed() const { return (m_Flags & FLAG_MAPPING_ALLOWED) != 0; }
++
++ void SetUserData(VmaAllocator hAllocator, void* pUserData) { m_pUserData = pUserData; }
++ void SetName(VmaAllocator hAllocator, const char* pName);
++ void FreeName(VmaAllocator hAllocator);
++ uint8_t SwapBlockAllocation(VmaAllocator hAllocator, VmaAllocation allocation);
++ VmaAllocHandle GetAllocHandle() const;
++ VkDeviceSize GetOffset() const;
++ VmaPool GetParentPool() const;
++ VkDeviceMemory GetMemory() const;
++ void* GetMappedData() const;
++
++ void BlockAllocMap();
++ void BlockAllocUnmap();
++ VkResult DedicatedAllocMap(VmaAllocator hAllocator, void** ppData);
++ void DedicatedAllocUnmap(VmaAllocator hAllocator);
++
++#if VMA_STATS_STRING_ENABLED
++ uint32_t GetBufferImageUsage() const { return m_BufferImageUsage; }
++
++ void InitBufferImageUsage(uint32_t bufferImageUsage);
++ void PrintParameters(class VmaJsonWriter& json) const;
++#endif
++
++private:
++ // Allocation out of VmaDeviceMemoryBlock.
++ struct BlockAllocation
++ {
++ VmaDeviceMemoryBlock* m_Block;
++ VmaAllocHandle m_AllocHandle;
++ };
++ // Allocation for an object that has its own private VkDeviceMemory.
++ struct DedicatedAllocation
++ {
++ VmaPool m_hParentPool; // VK_NULL_HANDLE if not belongs to custom pool.
++ VkDeviceMemory m_hMemory;
++ void* m_pMappedData; // Not null means memory is mapped.
++ VmaAllocation_T* m_Prev;
++ VmaAllocation_T* m_Next;
++ };
++ union
++ {
++ // Allocation out of VmaDeviceMemoryBlock.
++ BlockAllocation m_BlockAllocation;
++ // Allocation for an object that has its own private VkDeviceMemory.
++ DedicatedAllocation m_DedicatedAllocation;
++ };
++
++ VkDeviceSize m_Alignment;
++ VkDeviceSize m_Size;
++ void* m_pUserData;
++ char* m_pName;
++ uint32_t m_MemoryTypeIndex;
++ uint8_t m_Type; // ALLOCATION_TYPE
++ uint8_t m_SuballocationType; // VmaSuballocationType
++ // Reference counter for vmaMapMemory()/vmaUnmapMemory().
++ uint8_t m_MapCount;
++ uint8_t m_Flags; // enum FLAGS
++#if VMA_STATS_STRING_ENABLED
++ uint32_t m_BufferImageUsage; // 0 if unknown.
++#endif
++};
++#endif // _VMA_ALLOCATION_T
++
++#ifndef _VMA_DEDICATED_ALLOCATION_LIST_ITEM_TRAITS
++struct VmaDedicatedAllocationListItemTraits
++{
++ typedef VmaAllocation_T ItemType;
++
++ static ItemType* GetPrev(const ItemType* item)
++ {
++ VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
++ return item->m_DedicatedAllocation.m_Prev;
++ }
++ static ItemType* GetNext(const ItemType* item)
++ {
++ VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
++ return item->m_DedicatedAllocation.m_Next;
++ }
++ static ItemType*& AccessPrev(ItemType* item)
++ {
++ VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
++ return item->m_DedicatedAllocation.m_Prev;
++ }
++ static ItemType*& AccessNext(ItemType* item)
++ {
++ VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
++ return item->m_DedicatedAllocation.m_Next;
++ }
++};
++#endif // _VMA_DEDICATED_ALLOCATION_LIST_ITEM_TRAITS
++
++#ifndef _VMA_DEDICATED_ALLOCATION_LIST
++/*
++Stores linked list of VmaAllocation_T objects.
++Thread-safe, synchronized internally.
++*/
++class VmaDedicatedAllocationList
++{
++public:
++ VmaDedicatedAllocationList() {}
++ ~VmaDedicatedAllocationList();
++
++ void Init(bool useMutex) { m_UseMutex = useMutex; }
++ bool Validate();
++
++ void AddDetailedStatistics(VmaDetailedStatistics& inoutStats);
++ void AddStatistics(VmaStatistics& inoutStats);
++#if VMA_STATS_STRING_ENABLED
++ // Writes JSON array with the list of allocations.
++ void BuildStatsString(VmaJsonWriter& json);
++#endif
++
++ bool IsEmpty();
++ void Register(VmaAllocation alloc);
++ void Unregister(VmaAllocation alloc);
++
++private:
++ typedef VmaIntrusiveLinkedList<VmaDedicatedAllocationListItemTraits> DedicatedAllocationLinkedList;
++
++ bool m_UseMutex = true;
++ VMA_RW_MUTEX m_Mutex;
++ DedicatedAllocationLinkedList m_AllocationList;
++};
++
++#ifndef _VMA_DEDICATED_ALLOCATION_LIST_FUNCTIONS
++
++VmaDedicatedAllocationList::~VmaDedicatedAllocationList()
++{
++ VMA_HEAVY_ASSERT(Validate());
++
++ if (!m_AllocationList.IsEmpty())
++ {
++ VMA_ASSERT(false && "Unfreed dedicated allocations found!");
++ }
++}
++
++bool VmaDedicatedAllocationList::Validate()
++{
++ const size_t declaredCount = m_AllocationList.GetCount();
++ size_t actualCount = 0;
++ VmaMutexLockRead lock(m_Mutex, m_UseMutex);
++ for (VmaAllocation alloc = m_AllocationList.Front();
++ alloc != VMA_NULL; alloc = m_AllocationList.GetNext(alloc))
++ {
++ ++actualCount;
++ }
++ VMA_VALIDATE(actualCount == declaredCount);
++
++ return true;
++}
++
++void VmaDedicatedAllocationList::AddDetailedStatistics(VmaDetailedStatistics& inoutStats)
++{
++ for(auto* item = m_AllocationList.Front(); item != nullptr; item = DedicatedAllocationLinkedList::GetNext(item))
++ {
++ const VkDeviceSize size = item->GetSize();
++ inoutStats.statistics.blockCount++;
++ inoutStats.statistics.blockBytes += size;
++ VmaAddDetailedStatisticsAllocation(inoutStats, item->GetSize());
++ }
++}
++
++void VmaDedicatedAllocationList::AddStatistics(VmaStatistics& inoutStats)
++{
++ VmaMutexLockRead lock(m_Mutex, m_UseMutex);
++
++ const uint32_t allocCount = (uint32_t)m_AllocationList.GetCount();
++ inoutStats.blockCount += allocCount;
++ inoutStats.allocationCount += allocCount;
++
++ for(auto* item = m_AllocationList.Front(); item != nullptr; item = DedicatedAllocationLinkedList::GetNext(item))
++ {
++ const VkDeviceSize size = item->GetSize();
++ inoutStats.blockBytes += size;
++ inoutStats.allocationBytes += size;
++ }
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaDedicatedAllocationList::BuildStatsString(VmaJsonWriter& json)
++{
++ VmaMutexLockRead lock(m_Mutex, m_UseMutex);
++ json.BeginArray();
++ for (VmaAllocation alloc = m_AllocationList.Front();
++ alloc != VMA_NULL; alloc = m_AllocationList.GetNext(alloc))
++ {
++ json.BeginObject(true);
++ alloc->PrintParameters(json);
++ json.EndObject();
++ }
++ json.EndArray();
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++bool VmaDedicatedAllocationList::IsEmpty()
++{
++ VmaMutexLockRead lock(m_Mutex, m_UseMutex);
++ return m_AllocationList.IsEmpty();
++}
++
++void VmaDedicatedAllocationList::Register(VmaAllocation alloc)
++{
++ VmaMutexLockWrite lock(m_Mutex, m_UseMutex);
++ m_AllocationList.PushBack(alloc);
++}
++
++void VmaDedicatedAllocationList::Unregister(VmaAllocation alloc)
++{
++ VmaMutexLockWrite lock(m_Mutex, m_UseMutex);
++ m_AllocationList.Remove(alloc);
++}
++#endif // _VMA_DEDICATED_ALLOCATION_LIST_FUNCTIONS
++#endif // _VMA_DEDICATED_ALLOCATION_LIST
++
++#ifndef _VMA_SUBALLOCATION
++/*
++Represents a region of VmaDeviceMemoryBlock that is either assigned and returned as
++allocated memory block or free.
++*/
++struct VmaSuballocation
++{
++ VkDeviceSize offset;
++ VkDeviceSize size;
++ void* userData;
++ VmaSuballocationType type;
++};
++
++// Comparator for offsets.
++struct VmaSuballocationOffsetLess
++{
++ bool operator()(const VmaSuballocation& lhs, const VmaSuballocation& rhs) const
++ {
++ return lhs.offset < rhs.offset;
++ }
++};
++
++struct VmaSuballocationOffsetGreater
++{
++ bool operator()(const VmaSuballocation& lhs, const VmaSuballocation& rhs) const
++ {
++ return lhs.offset > rhs.offset;
++ }
++};
++
++struct VmaSuballocationItemSizeLess
++{
++ bool operator()(const VmaSuballocationList::iterator lhs,
++ const VmaSuballocationList::iterator rhs) const
++ {
++ return lhs->size < rhs->size;
++ }
++
++ bool operator()(const VmaSuballocationList::iterator lhs,
++ VkDeviceSize rhsSize) const
++ {
++ return lhs->size < rhsSize;
++ }
++};
++#endif // _VMA_SUBALLOCATION
++
++#ifndef _VMA_ALLOCATION_REQUEST
++/*
++Parameters of planned allocation inside a VmaDeviceMemoryBlock.
++item points to a FREE suballocation.
++*/
++struct VmaAllocationRequest
++{
++ VmaAllocHandle allocHandle;
++ VkDeviceSize size;
++ VmaSuballocationList::iterator item;
++ void* customData;
++ uint64_t algorithmData;
++ VmaAllocationRequestType type;
++};
++#endif // _VMA_ALLOCATION_REQUEST
++
++#ifndef _VMA_BLOCK_METADATA
++/*
++Data structure used for bookkeeping of allocations and unused ranges of memory
++in a single VkDeviceMemory block.
++*/
++class VmaBlockMetadata
++{
++public:
++ // pAllocationCallbacks, if not null, must be owned externally - alive and unchanged for the whole lifetime of this object.
++ VmaBlockMetadata(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual);
++ virtual ~VmaBlockMetadata() = default;
++
++ virtual void Init(VkDeviceSize size) { m_Size = size; }
++ bool IsVirtual() const { return m_IsVirtual; }
++ VkDeviceSize GetSize() const { return m_Size; }
++
++ // Validates all data structures inside this object. If not valid, returns false.
++ virtual bool Validate() const = 0;
++ virtual size_t GetAllocationCount() const = 0;
++ virtual size_t GetFreeRegionsCount() const = 0;
++ virtual VkDeviceSize GetSumFreeSize() const = 0;
++ // Returns true if this block is empty - contains only single free suballocation.
++ virtual bool IsEmpty() const = 0;
++ virtual void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) = 0;
++ virtual VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const = 0;
++ virtual void* GetAllocationUserData(VmaAllocHandle allocHandle) const = 0;
++
++ virtual VmaAllocHandle GetAllocationListBegin() const = 0;
++ virtual VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const = 0;
++ virtual VkDeviceSize GetNextFreeRegionSize(VmaAllocHandle alloc) const = 0;
++
++ // Shouldn't modify blockCount.
++ virtual void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const = 0;
++ virtual void AddStatistics(VmaStatistics& inoutStats) const = 0;
++
++#if VMA_STATS_STRING_ENABLED
++ virtual void PrintDetailedMap(class VmaJsonWriter& json) const = 0;
++#endif
++
++ // Tries to find a place for suballocation with given parameters inside this block.
++ // If succeeded, fills pAllocationRequest and returns true.
++ // If failed, returns false.
++ virtual bool CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ // Always one of VMA_ALLOCATION_CREATE_STRATEGY_* or VMA_ALLOCATION_INTERNAL_STRATEGY_* flags.
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest) = 0;
++
++ virtual VkResult CheckCorruption(const void* pBlockData) = 0;
++
++ // Makes actual allocation based on request. Request must already be checked and valid.
++ virtual void Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData) = 0;
++
++ // Frees suballocation assigned to given memory region.
++ virtual void Free(VmaAllocHandle allocHandle) = 0;
++
++ // Frees all allocations.
++ // Careful! Don't call it if there are VmaAllocation objects owned by userData of cleared allocations!
++ virtual void Clear() = 0;
++
++ virtual void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) = 0;
++ virtual void DebugLogAllAllocations() const = 0;
++
++protected:
++ const VkAllocationCallbacks* GetAllocationCallbacks() const { return m_pAllocationCallbacks; }
++ VkDeviceSize GetBufferImageGranularity() const { return m_BufferImageGranularity; }
++ VkDeviceSize GetDebugMargin() const { return IsVirtual() ? 0 : VMA_DEBUG_MARGIN; }
++
++ void DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size, void* userData) const;
++#if VMA_STATS_STRING_ENABLED
++ // mapRefCount == UINT32_MAX means unspecified.
++ void PrintDetailedMap_Begin(class VmaJsonWriter& json,
++ VkDeviceSize unusedBytes,
++ size_t allocationCount,
++ size_t unusedRangeCount) const;
++ void PrintDetailedMap_Allocation(class VmaJsonWriter& json,
++ VkDeviceSize offset, VkDeviceSize size, void* userData) const;
++ void PrintDetailedMap_UnusedRange(class VmaJsonWriter& json,
++ VkDeviceSize offset,
++ VkDeviceSize size) const;
++ void PrintDetailedMap_End(class VmaJsonWriter& json) const;
++#endif
++
++private:
++ VkDeviceSize m_Size;
++ const VkAllocationCallbacks* m_pAllocationCallbacks;
++ const VkDeviceSize m_BufferImageGranularity;
++ const bool m_IsVirtual;
++};
++
++#ifndef _VMA_BLOCK_METADATA_FUNCTIONS
++VmaBlockMetadata::VmaBlockMetadata(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual)
++ : m_Size(0),
++ m_pAllocationCallbacks(pAllocationCallbacks),
++ m_BufferImageGranularity(bufferImageGranularity),
++ m_IsVirtual(isVirtual) {}
++
++void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size, void* userData) const
++{
++ if (IsVirtual())
++ {
++ VMA_DEBUG_LOG("UNFREED VIRTUAL ALLOCATION; Offset: %llu; Size: %llu; UserData: %p", offset, size, userData);
++ }
++ else
++ {
++ VMA_ASSERT(userData != VMA_NULL);
++ VmaAllocation allocation = reinterpret_cast<VmaAllocation>(userData);
++
++ userData = allocation->GetUserData();
++ const char* name = allocation->GetName();
++
++#if VMA_STATS_STRING_ENABLED
++ VMA_DEBUG_LOG("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %p; Name: %s; Type: %s; Usage: %u",
++ offset, size, userData, name ? name : "vma_empty",
++ VMA_SUBALLOCATION_TYPE_NAMES[allocation->GetSuballocationType()],
++ allocation->GetBufferImageUsage());
++#else
++ VMA_DEBUG_LOG("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %p; Name: %s; Type: %u",
++ offset, size, userData, name ? name : "vma_empty",
++ (uint32_t)allocation->GetSuballocationType());
++#endif // VMA_STATS_STRING_ENABLED
++ }
++
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockMetadata::PrintDetailedMap_Begin(class VmaJsonWriter& json,
++ VkDeviceSize unusedBytes, size_t allocationCount, size_t unusedRangeCount) const
++{
++ json.WriteString("TotalBytes");
++ json.WriteNumber(GetSize());
++
++ json.WriteString("UnusedBytes");
++ json.WriteSize(unusedBytes);
++
++ json.WriteString("Allocations");
++ json.WriteSize(allocationCount);
++
++ json.WriteString("UnusedRanges");
++ json.WriteSize(unusedRangeCount);
++
++ json.WriteString("Suballocations");
++ json.BeginArray();
++}
++
++void VmaBlockMetadata::PrintDetailedMap_Allocation(class VmaJsonWriter& json,
++ VkDeviceSize offset, VkDeviceSize size, void* userData) const
++{
++ json.BeginObject(true);
++
++ json.WriteString("Offset");
++ json.WriteNumber(offset);
++
++ if (IsVirtual())
++ {
++ json.WriteString("Size");
++ json.WriteNumber(size);
++ if (userData)
++ {
++ json.WriteString("CustomData");
++ json.BeginString();
++ json.ContinueString_Pointer(userData);
++ json.EndString();
++ }
++ }
++ else
++ {
++ ((VmaAllocation)userData)->PrintParameters(json);
++ }
++
++ json.EndObject();
++}
++
++void VmaBlockMetadata::PrintDetailedMap_UnusedRange(class VmaJsonWriter& json,
++ VkDeviceSize offset, VkDeviceSize size) const
++{
++ json.BeginObject(true);
++
++ json.WriteString("Offset");
++ json.WriteNumber(offset);
++
++ json.WriteString("Type");
++ json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[VMA_SUBALLOCATION_TYPE_FREE]);
++
++ json.WriteString("Size");
++ json.WriteNumber(size);
++
++ json.EndObject();
++}
++
++void VmaBlockMetadata::PrintDetailedMap_End(class VmaJsonWriter& json) const
++{
++ json.EndArray();
++}
++#endif // VMA_STATS_STRING_ENABLED
++#endif // _VMA_BLOCK_METADATA_FUNCTIONS
++#endif // _VMA_BLOCK_METADATA
++
++#ifndef _VMA_BLOCK_BUFFER_IMAGE_GRANULARITY
++// Before deleting object of this class remember to call 'Destroy()'
++class VmaBlockBufferImageGranularity final
++{
++public:
++ struct ValidationContext
++ {
++ const VkAllocationCallbacks* allocCallbacks;
++ uint16_t* pageAllocs;
++ };
++
++ VmaBlockBufferImageGranularity(VkDeviceSize bufferImageGranularity);
++ ~VmaBlockBufferImageGranularity();
++
++ bool IsEnabled() const { return m_BufferImageGranularity > MAX_LOW_BUFFER_IMAGE_GRANULARITY; }
++
++ void Init(const VkAllocationCallbacks* pAllocationCallbacks, VkDeviceSize size);
++ // Before destroying object you must call free it's memory
++ void Destroy(const VkAllocationCallbacks* pAllocationCallbacks);
++
++ void RoundupAllocRequest(VmaSuballocationType allocType,
++ VkDeviceSize& inOutAllocSize,
++ VkDeviceSize& inOutAllocAlignment) const;
++
++ bool CheckConflictAndAlignUp(VkDeviceSize& inOutAllocOffset,
++ VkDeviceSize allocSize,
++ VkDeviceSize blockOffset,
++ VkDeviceSize blockSize,
++ VmaSuballocationType allocType) const;
++
++ void AllocPages(uint8_t allocType, VkDeviceSize offset, VkDeviceSize size);
++ void FreePages(VkDeviceSize offset, VkDeviceSize size);
++ void Clear();
++
++ ValidationContext StartValidation(const VkAllocationCallbacks* pAllocationCallbacks,
++ bool isVirutal) const;
++ bool Validate(ValidationContext& ctx, VkDeviceSize offset, VkDeviceSize size) const;
++ bool FinishValidation(ValidationContext& ctx) const;
++
++private:
++ static const uint16_t MAX_LOW_BUFFER_IMAGE_GRANULARITY = 256;
++
++ struct RegionInfo
++ {
++ uint8_t allocType;
++ uint16_t allocCount;
++ };
++
++ VkDeviceSize m_BufferImageGranularity;
++ uint32_t m_RegionCount;
++ RegionInfo* m_RegionInfo;
++
++ uint32_t GetStartPage(VkDeviceSize offset) const { return OffsetToPageIndex(offset & ~(m_BufferImageGranularity - 1)); }
++ uint32_t GetEndPage(VkDeviceSize offset, VkDeviceSize size) const { return OffsetToPageIndex((offset + size - 1) & ~(m_BufferImageGranularity - 1)); }
++
++ uint32_t OffsetToPageIndex(VkDeviceSize offset) const;
++ void AllocPage(RegionInfo& page, uint8_t allocType);
++};
++
++#ifndef _VMA_BLOCK_BUFFER_IMAGE_GRANULARITY_FUNCTIONS
++VmaBlockBufferImageGranularity::VmaBlockBufferImageGranularity(VkDeviceSize bufferImageGranularity)
++ : m_BufferImageGranularity(bufferImageGranularity),
++ m_RegionCount(0),
++ m_RegionInfo(VMA_NULL) {}
++
++VmaBlockBufferImageGranularity::~VmaBlockBufferImageGranularity()
++{
++ VMA_ASSERT(m_RegionInfo == VMA_NULL && "Free not called before destroying object!");
++}
++
++void VmaBlockBufferImageGranularity::Init(const VkAllocationCallbacks* pAllocationCallbacks, VkDeviceSize size)
++{
++ if (IsEnabled())
++ {
++ m_RegionCount = static_cast<uint32_t>(VmaDivideRoundingUp(size, m_BufferImageGranularity));
++ m_RegionInfo = vma_new_array(pAllocationCallbacks, RegionInfo, m_RegionCount);
++ memset(m_RegionInfo, 0, m_RegionCount * sizeof(RegionInfo));
++ }
++}
++
++void VmaBlockBufferImageGranularity::Destroy(const VkAllocationCallbacks* pAllocationCallbacks)
++{
++ if (m_RegionInfo)
++ {
++ vma_delete_array(pAllocationCallbacks, m_RegionInfo, m_RegionCount);
++ m_RegionInfo = VMA_NULL;
++ }
++}
++
++void VmaBlockBufferImageGranularity::RoundupAllocRequest(VmaSuballocationType allocType,
++ VkDeviceSize& inOutAllocSize,
++ VkDeviceSize& inOutAllocAlignment) const
++{
++ if (m_BufferImageGranularity > 1 &&
++ m_BufferImageGranularity <= MAX_LOW_BUFFER_IMAGE_GRANULARITY)
++ {
++ if (allocType == VMA_SUBALLOCATION_TYPE_UNKNOWN ||
++ allocType == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
++ allocType == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL)
++ {
++ inOutAllocAlignment = VMA_MAX(inOutAllocAlignment, m_BufferImageGranularity);
++ inOutAllocSize = VmaAlignUp(inOutAllocSize, m_BufferImageGranularity);
++ }
++ }
++}
++
++bool VmaBlockBufferImageGranularity::CheckConflictAndAlignUp(VkDeviceSize& inOutAllocOffset,
++ VkDeviceSize allocSize,
++ VkDeviceSize blockOffset,
++ VkDeviceSize blockSize,
++ VmaSuballocationType allocType) const
++{
++ if (IsEnabled())
++ {
++ uint32_t startPage = GetStartPage(inOutAllocOffset);
++ if (m_RegionInfo[startPage].allocCount > 0 &&
++ VmaIsBufferImageGranularityConflict(static_cast<VmaSuballocationType>(m_RegionInfo[startPage].allocType), allocType))
++ {
++ inOutAllocOffset = VmaAlignUp(inOutAllocOffset, m_BufferImageGranularity);
++ if (blockSize < allocSize + inOutAllocOffset - blockOffset)
++ return true;
++ ++startPage;
++ }
++ uint32_t endPage = GetEndPage(inOutAllocOffset, allocSize);
++ if (endPage != startPage &&
++ m_RegionInfo[endPage].allocCount > 0 &&
++ VmaIsBufferImageGranularityConflict(static_cast<VmaSuballocationType>(m_RegionInfo[endPage].allocType), allocType))
++ {
++ return true;
++ }
++ }
++ return false;
++}
++
++void VmaBlockBufferImageGranularity::AllocPages(uint8_t allocType, VkDeviceSize offset, VkDeviceSize size)
++{
++ if (IsEnabled())
++ {
++ uint32_t startPage = GetStartPage(offset);
++ AllocPage(m_RegionInfo[startPage], allocType);
++
++ uint32_t endPage = GetEndPage(offset, size);
++ if (startPage != endPage)
++ AllocPage(m_RegionInfo[endPage], allocType);
++ }
++}
++
++void VmaBlockBufferImageGranularity::FreePages(VkDeviceSize offset, VkDeviceSize size)
++{
++ if (IsEnabled())
++ {
++ uint32_t startPage = GetStartPage(offset);
++ --m_RegionInfo[startPage].allocCount;
++ if (m_RegionInfo[startPage].allocCount == 0)
++ m_RegionInfo[startPage].allocType = VMA_SUBALLOCATION_TYPE_FREE;
++ uint32_t endPage = GetEndPage(offset, size);
++ if (startPage != endPage)
++ {
++ --m_RegionInfo[endPage].allocCount;
++ if (m_RegionInfo[endPage].allocCount == 0)
++ m_RegionInfo[endPage].allocType = VMA_SUBALLOCATION_TYPE_FREE;
++ }
++ }
++}
++
++void VmaBlockBufferImageGranularity::Clear()
++{
++ if (m_RegionInfo)
++ memset(m_RegionInfo, 0, m_RegionCount * sizeof(RegionInfo));
++}
++
++VmaBlockBufferImageGranularity::ValidationContext VmaBlockBufferImageGranularity::StartValidation(
++ const VkAllocationCallbacks* pAllocationCallbacks, bool isVirutal) const
++{
++ ValidationContext ctx{ pAllocationCallbacks, VMA_NULL };
++ if (!isVirutal && IsEnabled())
++ {
++ ctx.pageAllocs = vma_new_array(pAllocationCallbacks, uint16_t, m_RegionCount);
++ memset(ctx.pageAllocs, 0, m_RegionCount * sizeof(uint16_t));
++ }
++ return ctx;
++}
++
++bool VmaBlockBufferImageGranularity::Validate(ValidationContext& ctx,
++ VkDeviceSize offset, VkDeviceSize size) const
++{
++ if (IsEnabled())
++ {
++ uint32_t start = GetStartPage(offset);
++ ++ctx.pageAllocs[start];
++ VMA_VALIDATE(m_RegionInfo[start].allocCount > 0);
++
++ uint32_t end = GetEndPage(offset, size);
++ if (start != end)
++ {
++ ++ctx.pageAllocs[end];
++ VMA_VALIDATE(m_RegionInfo[end].allocCount > 0);
++ }
++ }
++ return true;
++}
++
++bool VmaBlockBufferImageGranularity::FinishValidation(ValidationContext& ctx) const
++{
++ // Check proper page structure
++ if (IsEnabled())
++ {
++ VMA_ASSERT(ctx.pageAllocs != VMA_NULL && "Validation context not initialized!");
++
++ for (uint32_t page = 0; page < m_RegionCount; ++page)
++ {
++ VMA_VALIDATE(ctx.pageAllocs[page] == m_RegionInfo[page].allocCount);
++ }
++ vma_delete_array(ctx.allocCallbacks, ctx.pageAllocs, m_RegionCount);
++ ctx.pageAllocs = VMA_NULL;
++ }
++ return true;
++}
++
++uint32_t VmaBlockBufferImageGranularity::OffsetToPageIndex(VkDeviceSize offset) const
++{
++ return static_cast<uint32_t>(offset >> VMA_BITSCAN_MSB(m_BufferImageGranularity));
++}
++
++void VmaBlockBufferImageGranularity::AllocPage(RegionInfo& page, uint8_t allocType)
++{
++ // When current alloc type is free then it can be overriden by new type
++ if (page.allocCount == 0 || (page.allocCount > 0 && page.allocType == VMA_SUBALLOCATION_TYPE_FREE))
++ page.allocType = allocType;
++
++ ++page.allocCount;
++}
++#endif // _VMA_BLOCK_BUFFER_IMAGE_GRANULARITY_FUNCTIONS
++#endif // _VMA_BLOCK_BUFFER_IMAGE_GRANULARITY
++
++#if 0
++#ifndef _VMA_BLOCK_METADATA_GENERIC
++class VmaBlockMetadata_Generic : public VmaBlockMetadata
++{
++ friend class VmaDefragmentationAlgorithm_Generic;
++ friend class VmaDefragmentationAlgorithm_Fast;
++ VMA_CLASS_NO_COPY(VmaBlockMetadata_Generic)
++public:
++ VmaBlockMetadata_Generic(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual);
++ virtual ~VmaBlockMetadata_Generic() = default;
++
++ size_t GetAllocationCount() const override { return m_Suballocations.size() - m_FreeCount; }
++ VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; }
++ bool IsEmpty() const override { return (m_Suballocations.size() == 1) && (m_FreeCount == 1); }
++ void Free(VmaAllocHandle allocHandle) override { FreeSuballocation(FindAtOffset((VkDeviceSize)allocHandle - 1)); }
++ VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; };
++
++ void Init(VkDeviceSize size) override;
++ bool Validate() const override;
++
++ void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override;
++ void AddStatistics(VmaStatistics& inoutStats) const override;
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const override;
++#endif
++
++ bool CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest) override;
++
++ VkResult CheckCorruption(const void* pBlockData) override;
++
++ void Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData) override;
++
++ void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override;
++ void* GetAllocationUserData(VmaAllocHandle allocHandle) const override;
++ VmaAllocHandle GetAllocationListBegin() const override;
++ VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override;
++ void Clear() override;
++ void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override;
++ void DebugLogAllAllocations() const override;
++
++private:
++ uint32_t m_FreeCount;
++ VkDeviceSize m_SumFreeSize;
++ VmaSuballocationList m_Suballocations;
++ // Suballocations that are free. Sorted by size, ascending.
++ VmaVector<VmaSuballocationList::iterator, VmaStlAllocator<VmaSuballocationList::iterator>> m_FreeSuballocationsBySize;
++
++ VkDeviceSize AlignAllocationSize(VkDeviceSize size) const { return IsVirtual() ? size : VmaAlignUp(size, (VkDeviceSize)16); }
++
++ VmaSuballocationList::iterator FindAtOffset(VkDeviceSize offset) const;
++ bool ValidateFreeSuballocationList() const;
++
++ // Checks if requested suballocation with given parameters can be placed in given pFreeSuballocItem.
++ // If yes, fills pOffset and returns true. If no, returns false.
++ bool CheckAllocation(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ VmaSuballocationList::const_iterator suballocItem,
++ VmaAllocHandle* pAllocHandle) const;
++
++ // Given free suballocation, it merges it with following one, which must also be free.
++ void MergeFreeWithNext(VmaSuballocationList::iterator item);
++ // Releases given suballocation, making it free.
++ // Merges it with adjacent free suballocations if applicable.
++ // Returns iterator to new free suballocation at this place.
++ VmaSuballocationList::iterator FreeSuballocation(VmaSuballocationList::iterator suballocItem);
++ // Given free suballocation, it inserts it into sorted list of
++ // m_FreeSuballocationsBySize if it is suitable.
++ void RegisterFreeSuballocation(VmaSuballocationList::iterator item);
++ // Given free suballocation, it removes it from sorted list of
++ // m_FreeSuballocationsBySize if it is suitable.
++ void UnregisterFreeSuballocation(VmaSuballocationList::iterator item);
++};
++
++#ifndef _VMA_BLOCK_METADATA_GENERIC_FUNCTIONS
++VmaBlockMetadata_Generic::VmaBlockMetadata_Generic(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual)
++ : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual),
++ m_FreeCount(0),
++ m_SumFreeSize(0),
++ m_Suballocations(VmaStlAllocator<VmaSuballocation>(pAllocationCallbacks)),
++ m_FreeSuballocationsBySize(VmaStlAllocator<VmaSuballocationList::iterator>(pAllocationCallbacks)) {}
++
++void VmaBlockMetadata_Generic::Init(VkDeviceSize size)
++{
++ VmaBlockMetadata::Init(size);
++
++ m_FreeCount = 1;
++ m_SumFreeSize = size;
++
++ VmaSuballocation suballoc = {};
++ suballoc.offset = 0;
++ suballoc.size = size;
++ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
++
++ m_Suballocations.push_back(suballoc);
++ m_FreeSuballocationsBySize.push_back(m_Suballocations.begin());
++}
++
++bool VmaBlockMetadata_Generic::Validate() const
++{
++ VMA_VALIDATE(!m_Suballocations.empty());
++
++ // Expected offset of new suballocation as calculated from previous ones.
++ VkDeviceSize calculatedOffset = 0;
++ // Expected number of free suballocations as calculated from traversing their list.
++ uint32_t calculatedFreeCount = 0;
++ // Expected sum size of free suballocations as calculated from traversing their list.
++ VkDeviceSize calculatedSumFreeSize = 0;
++ // Expected number of free suballocations that should be registered in
++ // m_FreeSuballocationsBySize calculated from traversing their list.
++ size_t freeSuballocationsToRegister = 0;
++ // True if previous visited suballocation was free.
++ bool prevFree = false;
++
++ const VkDeviceSize debugMargin = GetDebugMargin();
++
++ for (const auto& subAlloc : m_Suballocations)
++ {
++ // Actual offset of this suballocation doesn't match expected one.
++ VMA_VALIDATE(subAlloc.offset == calculatedOffset);
++
++ const bool currFree = (subAlloc.type == VMA_SUBALLOCATION_TYPE_FREE);
++ // Two adjacent free suballocations are invalid. They should be merged.
++ VMA_VALIDATE(!prevFree || !currFree);
++
++ VmaAllocation alloc = (VmaAllocation)subAlloc.userData;
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE));
++ }
++
++ if (currFree)
++ {
++ calculatedSumFreeSize += subAlloc.size;
++ ++calculatedFreeCount;
++ ++freeSuballocationsToRegister;
++
++ // Margin required between allocations - every free space must be at least that large.
++ VMA_VALIDATE(subAlloc.size >= debugMargin);
++ }
++ else
++ {
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == subAlloc.offset + 1);
++ VMA_VALIDATE(alloc->GetSize() == subAlloc.size);
++ }
++
++ // Margin required between allocations - previous allocation must be free.
++ VMA_VALIDATE(debugMargin == 0 || prevFree);
++ }
++
++ calculatedOffset += subAlloc.size;
++ prevFree = currFree;
++ }
++
++ // Number of free suballocations registered in m_FreeSuballocationsBySize doesn't
++ // match expected one.
++ VMA_VALIDATE(m_FreeSuballocationsBySize.size() == freeSuballocationsToRegister);
++
++ VkDeviceSize lastSize = 0;
++ for (size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i)
++ {
++ VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i];
++
++ // Only free suballocations can be registered in m_FreeSuballocationsBySize.
++ VMA_VALIDATE(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE);
++ // They must be sorted by size ascending.
++ VMA_VALIDATE(suballocItem->size >= lastSize);
++
++ lastSize = suballocItem->size;
++ }
++
++ // Check if totals match calculated values.
++ VMA_VALIDATE(ValidateFreeSuballocationList());
++ VMA_VALIDATE(calculatedOffset == GetSize());
++ VMA_VALIDATE(calculatedSumFreeSize == m_SumFreeSize);
++ VMA_VALIDATE(calculatedFreeCount == m_FreeCount);
++
++ return true;
++}
++
++void VmaBlockMetadata_Generic::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const
++{
++ const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
++ inoutStats.statistics.blockCount++;
++ inoutStats.statistics.blockBytes += GetSize();
++
++ for (const auto& suballoc : m_Suballocations)
++ {
++ if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
++ VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size);
++ else
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, suballoc.size);
++ }
++}
++
++void VmaBlockMetadata_Generic::AddStatistics(VmaStatistics& inoutStats) const
++{
++ inoutStats.blockCount++;
++ inoutStats.allocationCount += (uint32_t)m_Suballocations.size() - m_FreeCount;
++ inoutStats.blockBytes += GetSize();
++ inoutStats.allocationBytes += GetSize() - m_SumFreeSize;
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockMetadata_Generic::PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const
++{
++ PrintDetailedMap_Begin(json,
++ m_SumFreeSize, // unusedBytes
++ m_Suballocations.size() - (size_t)m_FreeCount, // allocationCount
++ m_FreeCount, // unusedRangeCount
++ mapRefCount);
++
++ for (const auto& suballoc : m_Suballocations)
++ {
++ if (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ PrintDetailedMap_UnusedRange(json, suballoc.offset, suballoc.size);
++ }
++ else
++ {
++ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.userData);
++ }
++ }
++
++ PrintDetailedMap_End(json);
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++bool VmaBlockMetadata_Generic::CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ VMA_ASSERT(allocSize > 0);
++ VMA_ASSERT(!upperAddress);
++ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
++ VMA_ASSERT(pAllocationRequest != VMA_NULL);
++ VMA_HEAVY_ASSERT(Validate());
++
++ allocSize = AlignAllocationSize(allocSize);
++
++ pAllocationRequest->type = VmaAllocationRequestType::Normal;
++ pAllocationRequest->size = allocSize;
++
++ const VkDeviceSize debugMargin = GetDebugMargin();
++
++ // There is not enough total free space in this block to fulfill the request: Early return.
++ if (m_SumFreeSize < allocSize + debugMargin)
++ {
++ return false;
++ }
++
++ // New algorithm, efficiently searching freeSuballocationsBySize.
++ const size_t freeSuballocCount = m_FreeSuballocationsBySize.size();
++ if (freeSuballocCount > 0)
++ {
++ if (strategy == 0 ||
++ strategy == VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT)
++ {
++ // Find first free suballocation with size not less than allocSize + debugMargin.
++ VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess(
++ m_FreeSuballocationsBySize.data(),
++ m_FreeSuballocationsBySize.data() + freeSuballocCount,
++ allocSize + debugMargin,
++ VmaSuballocationItemSizeLess());
++ size_t index = it - m_FreeSuballocationsBySize.data();
++ for (; index < freeSuballocCount; ++index)
++ {
++ if (CheckAllocation(
++ allocSize,
++ allocAlignment,
++ allocType,
++ m_FreeSuballocationsBySize[index],
++ &pAllocationRequest->allocHandle))
++ {
++ pAllocationRequest->item = m_FreeSuballocationsBySize[index];
++ return true;
++ }
++ }
++ }
++ else if (strategy == VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET)
++ {
++ for (VmaSuballocationList::iterator it = m_Suballocations.begin();
++ it != m_Suballocations.end();
++ ++it)
++ {
++ if (it->type == VMA_SUBALLOCATION_TYPE_FREE && CheckAllocation(
++ allocSize,
++ allocAlignment,
++ allocType,
++ it,
++ &pAllocationRequest->allocHandle))
++ {
++ pAllocationRequest->item = it;
++ return true;
++ }
++ }
++ }
++ else
++ {
++ VMA_ASSERT(strategy & (VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT | VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT ));
++ // Search staring from biggest suballocations.
++ for (size_t index = freeSuballocCount; index--; )
++ {
++ if (CheckAllocation(
++ allocSize,
++ allocAlignment,
++ allocType,
++ m_FreeSuballocationsBySize[index],
++ &pAllocationRequest->allocHandle))
++ {
++ pAllocationRequest->item = m_FreeSuballocationsBySize[index];
++ return true;
++ }
++ }
++ }
++ }
++
++ return false;
++}
++
++VkResult VmaBlockMetadata_Generic::CheckCorruption(const void* pBlockData)
++{
++ for (auto& suballoc : m_Suballocations)
++ {
++ if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ if (!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
++ {
++ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
++ return VK_ERROR_UNKNOWN_COPY;
++ }
++ }
++ }
++
++ return VK_SUCCESS;
++}
++
++void VmaBlockMetadata_Generic::Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData)
++{
++ VMA_ASSERT(request.type == VmaAllocationRequestType::Normal);
++ VMA_ASSERT(request.item != m_Suballocations.end());
++ VmaSuballocation& suballoc = *request.item;
++ // Given suballocation is a free block.
++ VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ // Given offset is inside this suballocation.
++ VMA_ASSERT((VkDeviceSize)request.allocHandle - 1 >= suballoc.offset);
++ const VkDeviceSize paddingBegin = (VkDeviceSize)request.allocHandle - suballoc.offset - 1;
++ VMA_ASSERT(suballoc.size >= paddingBegin + request.size);
++ const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - request.size;
++
++ // Unregister this free suballocation from m_FreeSuballocationsBySize and update
++ // it to become used.
++ UnregisterFreeSuballocation(request.item);
++
++ suballoc.offset = (VkDeviceSize)request.allocHandle - 1;
++ suballoc.size = request.size;
++ suballoc.type = type;
++ suballoc.userData = userData;
++
++ // If there are any free bytes remaining at the end, insert new free suballocation after current one.
++ if (paddingEnd)
++ {
++ VmaSuballocation paddingSuballoc = {};
++ paddingSuballoc.offset = suballoc.offset + suballoc.size;
++ paddingSuballoc.size = paddingEnd;
++ paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
++ VmaSuballocationList::iterator next = request.item;
++ ++next;
++ const VmaSuballocationList::iterator paddingEndItem =
++ m_Suballocations.insert(next, paddingSuballoc);
++ RegisterFreeSuballocation(paddingEndItem);
++ }
++
++ // If there are any free bytes remaining at the beginning, insert new free suballocation before current one.
++ if (paddingBegin)
++ {
++ VmaSuballocation paddingSuballoc = {};
++ paddingSuballoc.offset = suballoc.offset - paddingBegin;
++ paddingSuballoc.size = paddingBegin;
++ paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
++ const VmaSuballocationList::iterator paddingBeginItem =
++ m_Suballocations.insert(request.item, paddingSuballoc);
++ RegisterFreeSuballocation(paddingBeginItem);
++ }
++
++ // Update totals.
++ m_FreeCount = m_FreeCount - 1;
++ if (paddingBegin > 0)
++ {
++ ++m_FreeCount;
++ }
++ if (paddingEnd > 0)
++ {
++ ++m_FreeCount;
++ }
++ m_SumFreeSize -= request.size;
++}
++
++void VmaBlockMetadata_Generic::GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo)
++{
++ outInfo.offset = (VkDeviceSize)allocHandle - 1;
++ const VmaSuballocation& suballoc = *FindAtOffset(outInfo.offset);
++ outInfo.size = suballoc.size;
++ outInfo.pUserData = suballoc.userData;
++}
++
++void* VmaBlockMetadata_Generic::GetAllocationUserData(VmaAllocHandle allocHandle) const
++{
++ return FindAtOffset((VkDeviceSize)allocHandle - 1)->userData;
++}
++
++VmaAllocHandle VmaBlockMetadata_Generic::GetAllocationListBegin() const
++{
++ if (IsEmpty())
++ return VK_NULL_HANDLE;
++
++ for (const auto& suballoc : m_Suballocations)
++ {
++ if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
++ return (VmaAllocHandle)(suballoc.offset + 1);
++ }
++ VMA_ASSERT(false && "Should contain at least 1 allocation!");
++ return VK_NULL_HANDLE;
++}
++
++VmaAllocHandle VmaBlockMetadata_Generic::GetNextAllocation(VmaAllocHandle prevAlloc) const
++{
++ VmaSuballocationList::const_iterator prev = FindAtOffset((VkDeviceSize)prevAlloc - 1);
++
++ for (VmaSuballocationList::const_iterator it = ++prev; it != m_Suballocations.end(); ++it)
++ {
++ if (it->type != VMA_SUBALLOCATION_TYPE_FREE)
++ return (VmaAllocHandle)(it->offset + 1);
++ }
++ return VK_NULL_HANDLE;
++}
++
++void VmaBlockMetadata_Generic::Clear()
++{
++ const VkDeviceSize size = GetSize();
++
++ VMA_ASSERT(IsVirtual());
++ m_FreeCount = 1;
++ m_SumFreeSize = size;
++ m_Suballocations.clear();
++ m_FreeSuballocationsBySize.clear();
++
++ VmaSuballocation suballoc = {};
++ suballoc.offset = 0;
++ suballoc.size = size;
++ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
++ m_Suballocations.push_back(suballoc);
++
++ m_FreeSuballocationsBySize.push_back(m_Suballocations.begin());
++}
++
++void VmaBlockMetadata_Generic::SetAllocationUserData(VmaAllocHandle allocHandle, void* userData)
++{
++ VmaSuballocation& suballoc = *FindAtOffset((VkDeviceSize)allocHandle - 1);
++ suballoc.userData = userData;
++}
++
++void VmaBlockMetadata_Generic::DebugLogAllAllocations() const
++{
++ for (const auto& suballoc : m_Suballocations)
++ {
++ if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
++ DebugLogAllocation(suballoc.offset, suballoc.size, suballoc.userData);
++ }
++}
++
++VmaSuballocationList::iterator VmaBlockMetadata_Generic::FindAtOffset(VkDeviceSize offset) const
++{
++ VMA_HEAVY_ASSERT(!m_Suballocations.empty());
++ const VkDeviceSize last = m_Suballocations.rbegin()->offset;
++ if (last == offset)
++ return m_Suballocations.rbegin().drop_const();
++ const VkDeviceSize first = m_Suballocations.begin()->offset;
++ if (first == offset)
++ return m_Suballocations.begin().drop_const();
++
++ const size_t suballocCount = m_Suballocations.size();
++ const VkDeviceSize step = (last - first + m_Suballocations.begin()->size) / suballocCount;
++ auto findSuballocation = [&](auto begin, auto end) -> VmaSuballocationList::iterator
++ {
++ for (auto suballocItem = begin;
++ suballocItem != end;
++ ++suballocItem)
++ {
++ if (suballocItem->offset == offset)
++ return suballocItem.drop_const();
++ }
++ VMA_ASSERT(false && "Not found!");
++ return m_Suballocations.end().drop_const();
++ };
++ // If requested offset is closer to the end of range, search from the end
++ if (offset - first > suballocCount * step / 2)
++ {
++ return findSuballocation(m_Suballocations.rbegin(), m_Suballocations.rend());
++ }
++ return findSuballocation(m_Suballocations.begin(), m_Suballocations.end());
++}
++
++bool VmaBlockMetadata_Generic::ValidateFreeSuballocationList() const
++{
++ VkDeviceSize lastSize = 0;
++ for (size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i)
++ {
++ const VmaSuballocationList::iterator it = m_FreeSuballocationsBySize[i];
++
++ VMA_VALIDATE(it->type == VMA_SUBALLOCATION_TYPE_FREE);
++ VMA_VALIDATE(it->size >= lastSize);
++ lastSize = it->size;
++ }
++ return true;
++}
++
++bool VmaBlockMetadata_Generic::CheckAllocation(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ VmaSuballocationList::const_iterator suballocItem,
++ VmaAllocHandle* pAllocHandle) const
++{
++ VMA_ASSERT(allocSize > 0);
++ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
++ VMA_ASSERT(suballocItem != m_Suballocations.cend());
++ VMA_ASSERT(pAllocHandle != VMA_NULL);
++
++ const VkDeviceSize debugMargin = GetDebugMargin();
++ const VkDeviceSize bufferImageGranularity = GetBufferImageGranularity();
++
++ const VmaSuballocation& suballoc = *suballocItem;
++ VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ // Size of this suballocation is too small for this request: Early return.
++ if (suballoc.size < allocSize)
++ {
++ return false;
++ }
++
++ // Start from offset equal to beginning of this suballocation.
++ VkDeviceSize offset = suballoc.offset + (suballocItem == m_Suballocations.cbegin() ? 0 : GetDebugMargin());
++
++ // Apply debugMargin from the end of previous alloc.
++ if (debugMargin > 0)
++ {
++ offset += debugMargin;
++ }
++
++ // Apply alignment.
++ offset = VmaAlignUp(offset, allocAlignment);
++
++ // Check previous suballocations for BufferImageGranularity conflicts.
++ // Make bigger alignment if necessary.
++ if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
++ {
++ bool bufferImageGranularityConflict = false;
++ VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
++ while (prevSuballocItem != m_Suballocations.cbegin())
++ {
++ --prevSuballocItem;
++ const VmaSuballocation& prevSuballoc = *prevSuballocItem;
++ if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, offset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
++ {
++ bufferImageGranularityConflict = true;
++ break;
++ }
++ }
++ else
++ // Already on previous page.
++ break;
++ }
++ if (bufferImageGranularityConflict)
++ {
++ offset = VmaAlignUp(offset, bufferImageGranularity);
++ }
++ }
++
++ // Calculate padding at the beginning based on current offset.
++ const VkDeviceSize paddingBegin = offset - suballoc.offset;
++
++ // Fail if requested size plus margin after is bigger than size of this suballocation.
++ if (paddingBegin + allocSize + debugMargin > suballoc.size)
++ {
++ return false;
++ }
++
++ // Check next suballocations for BufferImageGranularity conflicts.
++ // If conflict exists, allocation cannot be made here.
++ if (allocSize % bufferImageGranularity || offset % bufferImageGranularity)
++ {
++ VmaSuballocationList::const_iterator nextSuballocItem = suballocItem;
++ ++nextSuballocItem;
++ while (nextSuballocItem != m_Suballocations.cend())
++ {
++ const VmaSuballocation& nextSuballoc = *nextSuballocItem;
++ if (VmaBlocksOnSamePage(offset, allocSize, nextSuballoc.offset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
++ {
++ return false;
++ }
++ }
++ else
++ {
++ // Already on next page.
++ break;
++ }
++ ++nextSuballocItem;
++ }
++ }
++
++ *pAllocHandle = (VmaAllocHandle)(offset + 1);
++ // All tests passed: Success. pAllocHandle is already filled.
++ return true;
++}
++
++void VmaBlockMetadata_Generic::MergeFreeWithNext(VmaSuballocationList::iterator item)
++{
++ VMA_ASSERT(item != m_Suballocations.end());
++ VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ VmaSuballocationList::iterator nextItem = item;
++ ++nextItem;
++ VMA_ASSERT(nextItem != m_Suballocations.end());
++ VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ item->size += nextItem->size;
++ --m_FreeCount;
++ m_Suballocations.erase(nextItem);
++}
++
++VmaSuballocationList::iterator VmaBlockMetadata_Generic::FreeSuballocation(VmaSuballocationList::iterator suballocItem)
++{
++ // Change this suballocation to be marked as free.
++ VmaSuballocation& suballoc = *suballocItem;
++ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
++ suballoc.userData = VMA_NULL;
++
++ // Update totals.
++ ++m_FreeCount;
++ m_SumFreeSize += suballoc.size;
++
++ // Merge with previous and/or next suballocation if it's also free.
++ bool mergeWithNext = false;
++ bool mergeWithPrev = false;
++
++ VmaSuballocationList::iterator nextItem = suballocItem;
++ ++nextItem;
++ if ((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE))
++ {
++ mergeWithNext = true;
++ }
++
++ VmaSuballocationList::iterator prevItem = suballocItem;
++ if (suballocItem != m_Suballocations.begin())
++ {
++ --prevItem;
++ if (prevItem->type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ mergeWithPrev = true;
++ }
++ }
++
++ if (mergeWithNext)
++ {
++ UnregisterFreeSuballocation(nextItem);
++ MergeFreeWithNext(suballocItem);
++ }
++
++ if (mergeWithPrev)
++ {
++ UnregisterFreeSuballocation(prevItem);
++ MergeFreeWithNext(prevItem);
++ RegisterFreeSuballocation(prevItem);
++ return prevItem;
++ }
++ else
++ {
++ RegisterFreeSuballocation(suballocItem);
++ return suballocItem;
++ }
++}
++
++void VmaBlockMetadata_Generic::RegisterFreeSuballocation(VmaSuballocationList::iterator item)
++{
++ VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
++ VMA_ASSERT(item->size > 0);
++
++ // You may want to enable this validation at the beginning or at the end of
++ // this function, depending on what do you want to check.
++ VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
++
++ if (m_FreeSuballocationsBySize.empty())
++ {
++ m_FreeSuballocationsBySize.push_back(item);
++ }
++ else
++ {
++ VmaVectorInsertSorted<VmaSuballocationItemSizeLess>(m_FreeSuballocationsBySize, item);
++ }
++
++ //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
++}
++
++void VmaBlockMetadata_Generic::UnregisterFreeSuballocation(VmaSuballocationList::iterator item)
++{
++ VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
++ VMA_ASSERT(item->size > 0);
++
++ // You may want to enable this validation at the beginning or at the end of
++ // this function, depending on what do you want to check.
++ VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
++
++ VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess(
++ m_FreeSuballocationsBySize.data(),
++ m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(),
++ item,
++ VmaSuballocationItemSizeLess());
++ for (size_t index = it - m_FreeSuballocationsBySize.data();
++ index < m_FreeSuballocationsBySize.size();
++ ++index)
++ {
++ if (m_FreeSuballocationsBySize[index] == item)
++ {
++ VmaVectorRemove(m_FreeSuballocationsBySize, index);
++ return;
++ }
++ VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found.");
++ }
++ VMA_ASSERT(0 && "Not found.");
++
++ //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
++}
++#endif // _VMA_BLOCK_METADATA_GENERIC_FUNCTIONS
++#endif // _VMA_BLOCK_METADATA_GENERIC
++#endif // #if 0
++
++#ifndef _VMA_BLOCK_METADATA_LINEAR
++/*
++Allocations and their references in internal data structure look like this:
++
++if(m_2ndVectorMode == SECOND_VECTOR_EMPTY):
++
++ 0 +-------+
++ | |
++ | |
++ | |
++ +-------+
++ | Alloc | 1st[m_1stNullItemsBeginCount]
++ +-------+
++ | Alloc | 1st[m_1stNullItemsBeginCount + 1]
++ +-------+
++ | ... |
++ +-------+
++ | Alloc | 1st[1st.size() - 1]
++ +-------+
++ | |
++ | |
++ | |
++GetSize() +-------+
++
++if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER):
++
++ 0 +-------+
++ | Alloc | 2nd[0]
++ +-------+
++ | Alloc | 2nd[1]
++ +-------+
++ | ... |
++ +-------+
++ | Alloc | 2nd[2nd.size() - 1]
++ +-------+
++ | |
++ | |
++ | |
++ +-------+
++ | Alloc | 1st[m_1stNullItemsBeginCount]
++ +-------+
++ | Alloc | 1st[m_1stNullItemsBeginCount + 1]
++ +-------+
++ | ... |
++ +-------+
++ | Alloc | 1st[1st.size() - 1]
++ +-------+
++ | |
++GetSize() +-------+
++
++if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK):
++
++ 0 +-------+
++ | |
++ | |
++ | |
++ +-------+
++ | Alloc | 1st[m_1stNullItemsBeginCount]
++ +-------+
++ | Alloc | 1st[m_1stNullItemsBeginCount + 1]
++ +-------+
++ | ... |
++ +-------+
++ | Alloc | 1st[1st.size() - 1]
++ +-------+
++ | |
++ | |
++ | |
++ +-------+
++ | Alloc | 2nd[2nd.size() - 1]
++ +-------+
++ | ... |
++ +-------+
++ | Alloc | 2nd[1]
++ +-------+
++ | Alloc | 2nd[0]
++GetSize() +-------+
++
++*/
++class VmaBlockMetadata_Linear : public VmaBlockMetadata
++{
++ VMA_CLASS_NO_COPY(VmaBlockMetadata_Linear)
++public:
++ VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual);
++ virtual ~VmaBlockMetadata_Linear() = default;
++
++ VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; }
++ bool IsEmpty() const override { return GetAllocationCount() == 0; }
++ VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; };
++
++ void Init(VkDeviceSize size) override;
++ bool Validate() const override;
++ size_t GetAllocationCount() const override;
++ size_t GetFreeRegionsCount() const override;
++
++ void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override;
++ void AddStatistics(VmaStatistics& inoutStats) const override;
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMap(class VmaJsonWriter& json) const override;
++#endif
++
++ bool CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest) override;
++
++ VkResult CheckCorruption(const void* pBlockData) override;
++
++ void Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData) override;
++
++ void Free(VmaAllocHandle allocHandle) override;
++ void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override;
++ void* GetAllocationUserData(VmaAllocHandle allocHandle) const override;
++ VmaAllocHandle GetAllocationListBegin() const override;
++ VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override;
++ VkDeviceSize GetNextFreeRegionSize(VmaAllocHandle alloc) const override;
++ void Clear() override;
++ void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override;
++ void DebugLogAllAllocations() const override;
++
++private:
++ /*
++ There are two suballocation vectors, used in ping-pong way.
++ The one with index m_1stVectorIndex is called 1st.
++ The one with index (m_1stVectorIndex ^ 1) is called 2nd.
++ 2nd can be non-empty only when 1st is not empty.
++ When 2nd is not empty, m_2ndVectorMode indicates its mode of operation.
++ */
++ typedef VmaVector<VmaSuballocation, VmaStlAllocator<VmaSuballocation>> SuballocationVectorType;
++
++ enum SECOND_VECTOR_MODE
++ {
++ SECOND_VECTOR_EMPTY,
++ /*
++ Suballocations in 2nd vector are created later than the ones in 1st, but they
++ all have smaller offset.
++ */
++ SECOND_VECTOR_RING_BUFFER,
++ /*
++ Suballocations in 2nd vector are upper side of double stack.
++ They all have offsets higher than those in 1st vector.
++ Top of this stack means smaller offsets, but higher indices in this vector.
++ */
++ SECOND_VECTOR_DOUBLE_STACK,
++ };
++
++ VkDeviceSize m_SumFreeSize;
++ SuballocationVectorType m_Suballocations0, m_Suballocations1;
++ uint32_t m_1stVectorIndex;
++ SECOND_VECTOR_MODE m_2ndVectorMode;
++ // Number of items in 1st vector with hAllocation = null at the beginning.
++ size_t m_1stNullItemsBeginCount;
++ // Number of other items in 1st vector with hAllocation = null somewhere in the middle.
++ size_t m_1stNullItemsMiddleCount;
++ // Number of items in 2nd vector with hAllocation = null.
++ size_t m_2ndNullItemsCount;
++
++ SuballocationVectorType& AccessSuballocations1st() { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
++ SuballocationVectorType& AccessSuballocations2nd() { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
++ const SuballocationVectorType& AccessSuballocations1st() const { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
++ const SuballocationVectorType& AccessSuballocations2nd() const { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
++
++ VmaSuballocation& FindSuballocation(VkDeviceSize offset) const;
++ bool ShouldCompact1st() const;
++ void CleanupAfterFree();
++
++ bool CreateAllocationRequest_LowerAddress(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest);
++ bool CreateAllocationRequest_UpperAddress(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest);
++};
++
++#ifndef _VMA_BLOCK_METADATA_LINEAR_FUNCTIONS
++VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual)
++ : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual),
++ m_SumFreeSize(0),
++ m_Suballocations0(VmaStlAllocator<VmaSuballocation>(pAllocationCallbacks)),
++ m_Suballocations1(VmaStlAllocator<VmaSuballocation>(pAllocationCallbacks)),
++ m_1stVectorIndex(0),
++ m_2ndVectorMode(SECOND_VECTOR_EMPTY),
++ m_1stNullItemsBeginCount(0),
++ m_1stNullItemsMiddleCount(0),
++ m_2ndNullItemsCount(0) {}
++
++void VmaBlockMetadata_Linear::Init(VkDeviceSize size)
++{
++ VmaBlockMetadata::Init(size);
++ m_SumFreeSize = size;
++}
++
++bool VmaBlockMetadata_Linear::Validate() const
++{
++ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++
++ VMA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY));
++ VMA_VALIDATE(!suballocations1st.empty() ||
++ suballocations2nd.empty() ||
++ m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER);
++
++ if (!suballocations1st.empty())
++ {
++ // Null item at the beginning should be accounted into m_1stNullItemsBeginCount.
++ VMA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].type != VMA_SUBALLOCATION_TYPE_FREE);
++ // Null item at the end should be just pop_back().
++ VMA_VALIDATE(suballocations1st.back().type != VMA_SUBALLOCATION_TYPE_FREE);
++ }
++ if (!suballocations2nd.empty())
++ {
++ // Null item at the end should be just pop_back().
++ VMA_VALIDATE(suballocations2nd.back().type != VMA_SUBALLOCATION_TYPE_FREE);
++ }
++
++ VMA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size());
++ VMA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size());
++
++ VkDeviceSize sumUsedSize = 0;
++ const size_t suballoc1stCount = suballocations1st.size();
++ const VkDeviceSize debugMargin = GetDebugMargin();
++ VkDeviceSize offset = 0;
++
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ const size_t suballoc2ndCount = suballocations2nd.size();
++ size_t nullItem2ndCount = 0;
++ for (size_t i = 0; i < suballoc2ndCount; ++i)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[i];
++ const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ VmaAllocation const alloc = (VmaAllocation)suballoc.userData;
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE));
++ }
++ VMA_VALIDATE(suballoc.offset >= offset);
++
++ if (!currFree)
++ {
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1);
++ VMA_VALIDATE(alloc->GetSize() == suballoc.size);
++ }
++ sumUsedSize += suballoc.size;
++ }
++ else
++ {
++ ++nullItem2ndCount;
++ }
++
++ offset = suballoc.offset + suballoc.size + debugMargin;
++ }
++
++ VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
++ }
++
++ for (size_t i = 0; i < m_1stNullItemsBeginCount; ++i)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[i];
++ VMA_VALIDATE(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE &&
++ suballoc.userData == VMA_NULL);
++ }
++
++ size_t nullItem1stCount = m_1stNullItemsBeginCount;
++
++ for (size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[i];
++ const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ VmaAllocation const alloc = (VmaAllocation)suballoc.userData;
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE));
++ }
++ VMA_VALIDATE(suballoc.offset >= offset);
++ VMA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree);
++
++ if (!currFree)
++ {
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1);
++ VMA_VALIDATE(alloc->GetSize() == suballoc.size);
++ }
++ sumUsedSize += suballoc.size;
++ }
++ else
++ {
++ ++nullItem1stCount;
++ }
++
++ offset = suballoc.offset + suballoc.size + debugMargin;
++ }
++ VMA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount);
++
++ if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ const size_t suballoc2ndCount = suballocations2nd.size();
++ size_t nullItem2ndCount = 0;
++ for (size_t i = suballoc2ndCount; i--; )
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[i];
++ const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
++
++ VmaAllocation const alloc = (VmaAllocation)suballoc.userData;
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE));
++ }
++ VMA_VALIDATE(suballoc.offset >= offset);
++
++ if (!currFree)
++ {
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1);
++ VMA_VALIDATE(alloc->GetSize() == suballoc.size);
++ }
++ sumUsedSize += suballoc.size;
++ }
++ else
++ {
++ ++nullItem2ndCount;
++ }
++
++ offset = suballoc.offset + suballoc.size + debugMargin;
++ }
++
++ VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
++ }
++
++ VMA_VALIDATE(offset <= GetSize());
++ VMA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize);
++
++ return true;
++}
++
++size_t VmaBlockMetadata_Linear::GetAllocationCount() const
++{
++ return AccessSuballocations1st().size() - m_1stNullItemsBeginCount - m_1stNullItemsMiddleCount +
++ AccessSuballocations2nd().size() - m_2ndNullItemsCount;
++}
++
++size_t VmaBlockMetadata_Linear::GetFreeRegionsCount() const
++{
++ // Function only used for defragmentation, which is disabled for this algorithm
++ VMA_ASSERT(0);
++ return SIZE_MAX;
++}
++
++void VmaBlockMetadata_Linear::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const
++{
++ const VkDeviceSize size = GetSize();
++ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ const size_t suballoc1stCount = suballocations1st.size();
++ const size_t suballoc2ndCount = suballocations2nd.size();
++
++ inoutStats.statistics.blockCount++;
++ inoutStats.statistics.blockBytes += size;
++
++ VkDeviceSize lastOffset = 0;
++
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
++ size_t nextAlloc2ndIndex = 0;
++ while (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // Find next non-null allocation or move nextAllocIndex to the end.
++ while (nextAlloc2ndIndex < suballoc2ndCount &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex < suballoc2ndCount)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize);
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size);
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
++ if (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize);
++ }
++
++ // End of loop.
++ lastOffset = freeSpace2ndTo1stEnd;
++ }
++ }
++ }
++
++ size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
++ const VkDeviceSize freeSpace1stTo2ndEnd =
++ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
++ while (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ // Find next non-null allocation or move nextAllocIndex to the end.
++ while (nextAlloc1stIndex < suballoc1stCount &&
++ suballocations1st[nextAlloc1stIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc1stIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc1stIndex < suballoc1stCount)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize);
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size);
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc1stIndex;
++ }
++ // We are at the end.
++ else
++ {
++ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
++ if (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize);
++ }
++
++ // End of loop.
++ lastOffset = freeSpace1stTo2ndEnd;
++ }
++ }
++
++ if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
++ while (lastOffset < size)
++ {
++ // Find next non-null allocation or move nextAllocIndex to the end.
++ while (nextAlloc2ndIndex != SIZE_MAX &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ --nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex != SIZE_MAX)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize);
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size);
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ --nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ // There is free space from lastOffset to size.
++ if (lastOffset < size)
++ {
++ const VkDeviceSize unusedRangeSize = size - lastOffset;
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize);
++ }
++
++ // End of loop.
++ lastOffset = size;
++ }
++ }
++ }
++}
++
++void VmaBlockMetadata_Linear::AddStatistics(VmaStatistics& inoutStats) const
++{
++ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ const VkDeviceSize size = GetSize();
++ const size_t suballoc1stCount = suballocations1st.size();
++ const size_t suballoc2ndCount = suballocations2nd.size();
++
++ inoutStats.blockCount++;
++ inoutStats.blockBytes += size;
++ inoutStats.allocationBytes += size - m_SumFreeSize;
++
++ VkDeviceSize lastOffset = 0;
++
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
++ size_t nextAlloc2ndIndex = m_1stNullItemsBeginCount;
++ while (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
++ while (nextAlloc2ndIndex < suballoc2ndCount &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex < suballoc2ndCount)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ ++inoutStats.allocationCount;
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
++ const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
++ }
++
++ // End of loop.
++ lastOffset = freeSpace2ndTo1stEnd;
++ }
++ }
++ }
++
++ size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
++ const VkDeviceSize freeSpace1stTo2ndEnd =
++ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
++ while (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ // Find next non-null allocation or move nextAllocIndex to the end.
++ while (nextAlloc1stIndex < suballoc1stCount &&
++ suballocations1st[nextAlloc1stIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc1stIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc1stIndex < suballoc1stCount)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ ++inoutStats.allocationCount;
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc1stIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
++ const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
++ }
++
++ // End of loop.
++ lastOffset = freeSpace1stTo2ndEnd;
++ }
++ }
++
++ if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
++ while (lastOffset < size)
++ {
++ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
++ while (nextAlloc2ndIndex != SIZE_MAX &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ --nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex != SIZE_MAX)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ ++inoutStats.allocationCount;
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ --nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < size)
++ {
++ // There is free space from lastOffset to size.
++ const VkDeviceSize unusedRangeSize = size - lastOffset;
++ }
++
++ // End of loop.
++ lastOffset = size;
++ }
++ }
++ }
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockMetadata_Linear::PrintDetailedMap(class VmaJsonWriter& json) const
++{
++ const VkDeviceSize size = GetSize();
++ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ const size_t suballoc1stCount = suballocations1st.size();
++ const size_t suballoc2ndCount = suballocations2nd.size();
++
++ // FIRST PASS
++
++ size_t unusedRangeCount = 0;
++ VkDeviceSize usedBytes = 0;
++
++ VkDeviceSize lastOffset = 0;
++
++ size_t alloc2ndCount = 0;
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
++ size_t nextAlloc2ndIndex = 0;
++ while (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
++ while (nextAlloc2ndIndex < suballoc2ndCount &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex < suballoc2ndCount)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ ++unusedRangeCount;
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ ++alloc2ndCount;
++ usedBytes += suballoc.size;
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
++ ++unusedRangeCount;
++ }
++
++ // End of loop.
++ lastOffset = freeSpace2ndTo1stEnd;
++ }
++ }
++ }
++
++ size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
++ size_t alloc1stCount = 0;
++ const VkDeviceSize freeSpace1stTo2ndEnd =
++ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
++ while (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ // Find next non-null allocation or move nextAllocIndex to the end.
++ while (nextAlloc1stIndex < suballoc1stCount &&
++ suballocations1st[nextAlloc1stIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc1stIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc1stIndex < suballoc1stCount)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ ++unusedRangeCount;
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ ++alloc1stCount;
++ usedBytes += suballoc.size;
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc1stIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < size)
++ {
++ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
++ ++unusedRangeCount;
++ }
++
++ // End of loop.
++ lastOffset = freeSpace1stTo2ndEnd;
++ }
++ }
++
++ if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
++ while (lastOffset < size)
++ {
++ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
++ while (nextAlloc2ndIndex != SIZE_MAX &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ --nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex != SIZE_MAX)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ ++unusedRangeCount;
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ ++alloc2ndCount;
++ usedBytes += suballoc.size;
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ --nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < size)
++ {
++ // There is free space from lastOffset to size.
++ ++unusedRangeCount;
++ }
++
++ // End of loop.
++ lastOffset = size;
++ }
++ }
++ }
++
++ const VkDeviceSize unusedBytes = size - usedBytes;
++ PrintDetailedMap_Begin(json, unusedBytes, alloc1stCount + alloc2ndCount, unusedRangeCount);
++
++ // SECOND PASS
++ lastOffset = 0;
++
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
++ size_t nextAlloc2ndIndex = 0;
++ while (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
++ while (nextAlloc2ndIndex < suballoc2ndCount &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex < suballoc2ndCount)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.userData);
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < freeSpace2ndTo1stEnd)
++ {
++ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
++ const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
++ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
++ }
++
++ // End of loop.
++ lastOffset = freeSpace2ndTo1stEnd;
++ }
++ }
++ }
++
++ nextAlloc1stIndex = m_1stNullItemsBeginCount;
++ while (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ // Find next non-null allocation or move nextAllocIndex to the end.
++ while (nextAlloc1stIndex < suballoc1stCount &&
++ suballocations1st[nextAlloc1stIndex].userData == VMA_NULL)
++ {
++ ++nextAlloc1stIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc1stIndex < suballoc1stCount)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.userData);
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ ++nextAlloc1stIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < freeSpace1stTo2ndEnd)
++ {
++ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
++ const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
++ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
++ }
++
++ // End of loop.
++ lastOffset = freeSpace1stTo2ndEnd;
++ }
++ }
++
++ if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
++ while (lastOffset < size)
++ {
++ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
++ while (nextAlloc2ndIndex != SIZE_MAX &&
++ suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL)
++ {
++ --nextAlloc2ndIndex;
++ }
++
++ // Found non-null allocation.
++ if (nextAlloc2ndIndex != SIZE_MAX)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
++
++ // 1. Process free space before this allocation.
++ if (lastOffset < suballoc.offset)
++ {
++ // There is free space from lastOffset to suballoc.offset.
++ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
++ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
++ }
++
++ // 2. Process this allocation.
++ // There is allocation with suballoc.offset, suballoc.size.
++ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.userData);
++
++ // 3. Prepare for next iteration.
++ lastOffset = suballoc.offset + suballoc.size;
++ --nextAlloc2ndIndex;
++ }
++ // We are at the end.
++ else
++ {
++ if (lastOffset < size)
++ {
++ // There is free space from lastOffset to size.
++ const VkDeviceSize unusedRangeSize = size - lastOffset;
++ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
++ }
++
++ // End of loop.
++ lastOffset = size;
++ }
++ }
++ }
++
++ PrintDetailedMap_End(json);
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++bool VmaBlockMetadata_Linear::CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ VMA_ASSERT(allocSize > 0);
++ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
++ VMA_ASSERT(pAllocationRequest != VMA_NULL);
++ VMA_HEAVY_ASSERT(Validate());
++ pAllocationRequest->size = allocSize;
++ return upperAddress ?
++ CreateAllocationRequest_UpperAddress(
++ allocSize, allocAlignment, allocType, strategy, pAllocationRequest) :
++ CreateAllocationRequest_LowerAddress(
++ allocSize, allocAlignment, allocType, strategy, pAllocationRequest);
++}
++
++VkResult VmaBlockMetadata_Linear::CheckCorruption(const void* pBlockData)
++{
++ VMA_ASSERT(!IsVirtual());
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ for (size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
++ {
++ const VmaSuballocation& suballoc = suballocations1st[i];
++ if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ if (!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
++ {
++ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
++ return VK_ERROR_UNKNOWN_COPY;
++ }
++ }
++ }
++
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ for (size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
++ {
++ const VmaSuballocation& suballoc = suballocations2nd[i];
++ if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ if (!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
++ {
++ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
++ return VK_ERROR_UNKNOWN_COPY;
++ }
++ }
++ }
++
++ return VK_SUCCESS;
++}
++
++void VmaBlockMetadata_Linear::Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData)
++{
++ const VkDeviceSize offset = (VkDeviceSize)request.allocHandle - 1;
++ const VmaSuballocation newSuballoc = { offset, request.size, userData, type };
++
++ switch (request.type)
++ {
++ case VmaAllocationRequestType::UpperAddress:
++ {
++ VMA_ASSERT(m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER &&
++ "CRITICAL ERROR: Trying to use linear allocator as double stack while it was already used as ring buffer.");
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ suballocations2nd.push_back(newSuballoc);
++ m_2ndVectorMode = SECOND_VECTOR_DOUBLE_STACK;
++ }
++ break;
++ case VmaAllocationRequestType::EndOf1st:
++ {
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++
++ VMA_ASSERT(suballocations1st.empty() ||
++ offset >= suballocations1st.back().offset + suballocations1st.back().size);
++ // Check if it fits before the end of the block.
++ VMA_ASSERT(offset + request.size <= GetSize());
++
++ suballocations1st.push_back(newSuballoc);
++ }
++ break;
++ case VmaAllocationRequestType::EndOf2nd:
++ {
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ // New allocation at the end of 2-part ring buffer, so before first allocation from 1st vector.
++ VMA_ASSERT(!suballocations1st.empty() &&
++ offset + request.size <= suballocations1st[m_1stNullItemsBeginCount].offset);
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++
++ switch (m_2ndVectorMode)
++ {
++ case SECOND_VECTOR_EMPTY:
++ // First allocation from second part ring buffer.
++ VMA_ASSERT(suballocations2nd.empty());
++ m_2ndVectorMode = SECOND_VECTOR_RING_BUFFER;
++ break;
++ case SECOND_VECTOR_RING_BUFFER:
++ // 2-part ring buffer is already started.
++ VMA_ASSERT(!suballocations2nd.empty());
++ break;
++ case SECOND_VECTOR_DOUBLE_STACK:
++ VMA_ASSERT(0 && "CRITICAL ERROR: Trying to use linear allocator as ring buffer while it was already used as double stack.");
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++
++ suballocations2nd.push_back(newSuballoc);
++ }
++ break;
++ default:
++ VMA_ASSERT(0 && "CRITICAL INTERNAL ERROR.");
++ }
++
++ m_SumFreeSize -= newSuballoc.size;
++}
++
++void VmaBlockMetadata_Linear::Free(VmaAllocHandle allocHandle)
++{
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ VkDeviceSize offset = (VkDeviceSize)allocHandle - 1;
++
++ if (!suballocations1st.empty())
++ {
++ // First allocation: Mark it as next empty at the beginning.
++ VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
++ if (firstSuballoc.offset == offset)
++ {
++ firstSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
++ firstSuballoc.userData = VMA_NULL;
++ m_SumFreeSize += firstSuballoc.size;
++ ++m_1stNullItemsBeginCount;
++ CleanupAfterFree();
++ return;
++ }
++ }
++
++ // Last allocation in 2-part ring buffer or top of upper stack (same logic).
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ||
++ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ VmaSuballocation& lastSuballoc = suballocations2nd.back();
++ if (lastSuballoc.offset == offset)
++ {
++ m_SumFreeSize += lastSuballoc.size;
++ suballocations2nd.pop_back();
++ CleanupAfterFree();
++ return;
++ }
++ }
++ // Last allocation in 1st vector.
++ else if (m_2ndVectorMode == SECOND_VECTOR_EMPTY)
++ {
++ VmaSuballocation& lastSuballoc = suballocations1st.back();
++ if (lastSuballoc.offset == offset)
++ {
++ m_SumFreeSize += lastSuballoc.size;
++ suballocations1st.pop_back();
++ CleanupAfterFree();
++ return;
++ }
++ }
++
++ VmaSuballocation refSuballoc;
++ refSuballoc.offset = offset;
++ // Rest of members stays uninitialized intentionally for better performance.
++
++ // Item from the middle of 1st vector.
++ {
++ const SuballocationVectorType::iterator it = VmaBinaryFindSorted(
++ suballocations1st.begin() + m_1stNullItemsBeginCount,
++ suballocations1st.end(),
++ refSuballoc,
++ VmaSuballocationOffsetLess());
++ if (it != suballocations1st.end())
++ {
++ it->type = VMA_SUBALLOCATION_TYPE_FREE;
++ it->userData = VMA_NULL;
++ ++m_1stNullItemsMiddleCount;
++ m_SumFreeSize += it->size;
++ CleanupAfterFree();
++ return;
++ }
++ }
++
++ if (m_2ndVectorMode != SECOND_VECTOR_EMPTY)
++ {
++ // Item from the middle of 2nd vector.
++ const SuballocationVectorType::iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ?
++ VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetLess()) :
++ VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetGreater());
++ if (it != suballocations2nd.end())
++ {
++ it->type = VMA_SUBALLOCATION_TYPE_FREE;
++ it->userData = VMA_NULL;
++ ++m_2ndNullItemsCount;
++ m_SumFreeSize += it->size;
++ CleanupAfterFree();
++ return;
++ }
++ }
++
++ VMA_ASSERT(0 && "Allocation to free not found in linear allocator!");
++}
++
++void VmaBlockMetadata_Linear::GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo)
++{
++ outInfo.offset = (VkDeviceSize)allocHandle - 1;
++ VmaSuballocation& suballoc = FindSuballocation(outInfo.offset);
++ outInfo.size = suballoc.size;
++ outInfo.pUserData = suballoc.userData;
++}
++
++void* VmaBlockMetadata_Linear::GetAllocationUserData(VmaAllocHandle allocHandle) const
++{
++ return FindSuballocation((VkDeviceSize)allocHandle - 1).userData;
++}
++
++VmaAllocHandle VmaBlockMetadata_Linear::GetAllocationListBegin() const
++{
++ // Function only used for defragmentation, which is disabled for this algorithm
++ VMA_ASSERT(0);
++ return VK_NULL_HANDLE;
++}
++
++VmaAllocHandle VmaBlockMetadata_Linear::GetNextAllocation(VmaAllocHandle prevAlloc) const
++{
++ // Function only used for defragmentation, which is disabled for this algorithm
++ VMA_ASSERT(0);
++ return VK_NULL_HANDLE;
++}
++
++VkDeviceSize VmaBlockMetadata_Linear::GetNextFreeRegionSize(VmaAllocHandle alloc) const
++{
++ // Function only used for defragmentation, which is disabled for this algorithm
++ VMA_ASSERT(0);
++ return 0;
++}
++
++void VmaBlockMetadata_Linear::Clear()
++{
++ m_SumFreeSize = GetSize();
++ m_Suballocations0.clear();
++ m_Suballocations1.clear();
++ // Leaving m_1stVectorIndex unchanged - it doesn't matter.
++ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
++ m_1stNullItemsBeginCount = 0;
++ m_1stNullItemsMiddleCount = 0;
++ m_2ndNullItemsCount = 0;
++}
++
++void VmaBlockMetadata_Linear::SetAllocationUserData(VmaAllocHandle allocHandle, void* userData)
++{
++ VmaSuballocation& suballoc = FindSuballocation((VkDeviceSize)allocHandle - 1);
++ suballoc.userData = userData;
++}
++
++void VmaBlockMetadata_Linear::DebugLogAllAllocations() const
++{
++ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ for (auto it = suballocations1st.begin() + m_1stNullItemsBeginCount; it != suballocations1st.end(); ++it)
++ if (it->type != VMA_SUBALLOCATION_TYPE_FREE)
++ DebugLogAllocation(it->offset, it->size, it->userData);
++
++ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++ for (auto it = suballocations2nd.begin(); it != suballocations2nd.end(); ++it)
++ if (it->type != VMA_SUBALLOCATION_TYPE_FREE)
++ DebugLogAllocation(it->offset, it->size, it->userData);
++}
++
++VmaSuballocation& VmaBlockMetadata_Linear::FindSuballocation(VkDeviceSize offset) const
++{
++ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++
++ VmaSuballocation refSuballoc;
++ refSuballoc.offset = offset;
++ // Rest of members stays uninitialized intentionally for better performance.
++
++ // Item from the 1st vector.
++ {
++ SuballocationVectorType::const_iterator it = VmaBinaryFindSorted(
++ suballocations1st.begin() + m_1stNullItemsBeginCount,
++ suballocations1st.end(),
++ refSuballoc,
++ VmaSuballocationOffsetLess());
++ if (it != suballocations1st.end())
++ {
++ return const_cast<VmaSuballocation&>(*it);
++ }
++ }
++
++ if (m_2ndVectorMode != SECOND_VECTOR_EMPTY)
++ {
++ // Rest of members stays uninitialized intentionally for better performance.
++ SuballocationVectorType::const_iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ?
++ VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetLess()) :
++ VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetGreater());
++ if (it != suballocations2nd.end())
++ {
++ return const_cast<VmaSuballocation&>(*it);
++ }
++ }
++
++ VMA_ASSERT(0 && "Allocation not found in linear allocator!");
++ return const_cast<VmaSuballocation&>(suballocations1st.back()); // Should never occur.
++}
++
++bool VmaBlockMetadata_Linear::ShouldCompact1st() const
++{
++ const size_t nullItemCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
++ const size_t suballocCount = AccessSuballocations1st().size();
++ return suballocCount > 32 && nullItemCount * 2 >= (suballocCount - nullItemCount) * 3;
++}
++
++void VmaBlockMetadata_Linear::CleanupAfterFree()
++{
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++
++ if (IsEmpty())
++ {
++ suballocations1st.clear();
++ suballocations2nd.clear();
++ m_1stNullItemsBeginCount = 0;
++ m_1stNullItemsMiddleCount = 0;
++ m_2ndNullItemsCount = 0;
++ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
++ }
++ else
++ {
++ const size_t suballoc1stCount = suballocations1st.size();
++ const size_t nullItem1stCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
++ VMA_ASSERT(nullItem1stCount <= suballoc1stCount);
++
++ // Find more null items at the beginning of 1st vector.
++ while (m_1stNullItemsBeginCount < suballoc1stCount &&
++ suballocations1st[m_1stNullItemsBeginCount].type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ ++m_1stNullItemsBeginCount;
++ --m_1stNullItemsMiddleCount;
++ }
++
++ // Find more null items at the end of 1st vector.
++ while (m_1stNullItemsMiddleCount > 0 &&
++ suballocations1st.back().type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ --m_1stNullItemsMiddleCount;
++ suballocations1st.pop_back();
++ }
++
++ // Find more null items at the end of 2nd vector.
++ while (m_2ndNullItemsCount > 0 &&
++ suballocations2nd.back().type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ --m_2ndNullItemsCount;
++ suballocations2nd.pop_back();
++ }
++
++ // Find more null items at the beginning of 2nd vector.
++ while (m_2ndNullItemsCount > 0 &&
++ suballocations2nd[0].type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ --m_2ndNullItemsCount;
++ VmaVectorRemove(suballocations2nd, 0);
++ }
++
++ if (ShouldCompact1st())
++ {
++ const size_t nonNullItemCount = suballoc1stCount - nullItem1stCount;
++ size_t srcIndex = m_1stNullItemsBeginCount;
++ for (size_t dstIndex = 0; dstIndex < nonNullItemCount; ++dstIndex)
++ {
++ while (suballocations1st[srcIndex].type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ ++srcIndex;
++ }
++ if (dstIndex != srcIndex)
++ {
++ suballocations1st[dstIndex] = suballocations1st[srcIndex];
++ }
++ ++srcIndex;
++ }
++ suballocations1st.resize(nonNullItemCount);
++ m_1stNullItemsBeginCount = 0;
++ m_1stNullItemsMiddleCount = 0;
++ }
++
++ // 2nd vector became empty.
++ if (suballocations2nd.empty())
++ {
++ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
++ }
++
++ // 1st vector became empty.
++ if (suballocations1st.size() - m_1stNullItemsBeginCount == 0)
++ {
++ suballocations1st.clear();
++ m_1stNullItemsBeginCount = 0;
++
++ if (!suballocations2nd.empty() && m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ // Swap 1st with 2nd. Now 2nd is empty.
++ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
++ m_1stNullItemsMiddleCount = m_2ndNullItemsCount;
++ while (m_1stNullItemsBeginCount < suballocations2nd.size() &&
++ suballocations2nd[m_1stNullItemsBeginCount].type == VMA_SUBALLOCATION_TYPE_FREE)
++ {
++ ++m_1stNullItemsBeginCount;
++ --m_1stNullItemsMiddleCount;
++ }
++ m_2ndNullItemsCount = 0;
++ m_1stVectorIndex ^= 1;
++ }
++ }
++ }
++
++ VMA_HEAVY_ASSERT(Validate());
++}
++
++bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ const VkDeviceSize blockSize = GetSize();
++ const VkDeviceSize debugMargin = GetDebugMargin();
++ const VkDeviceSize bufferImageGranularity = GetBufferImageGranularity();
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++
++ if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ // Try to allocate at the end of 1st vector.
++
++ VkDeviceSize resultBaseOffset = 0;
++ if (!suballocations1st.empty())
++ {
++ const VmaSuballocation& lastSuballoc = suballocations1st.back();
++ resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + debugMargin;
++ }
++
++ // Start from offset equal to beginning of free space.
++ VkDeviceSize resultOffset = resultBaseOffset;
++
++ // Apply alignment.
++ resultOffset = VmaAlignUp(resultOffset, allocAlignment);
++
++ // Check previous suballocations for BufferImageGranularity conflicts.
++ // Make bigger alignment if necessary.
++ if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations1st.empty())
++ {
++ bool bufferImageGranularityConflict = false;
++ for (size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
++ {
++ const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
++ if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
++ {
++ bufferImageGranularityConflict = true;
++ break;
++ }
++ }
++ else
++ // Already on previous page.
++ break;
++ }
++ if (bufferImageGranularityConflict)
++ {
++ resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
++ }
++ }
++
++ const VkDeviceSize freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ?
++ suballocations2nd.back().offset : blockSize;
++
++ // There is enough free space at the end after alignment.
++ if (resultOffset + allocSize + debugMargin <= freeSpaceEnd)
++ {
++ // Check next suballocations for BufferImageGranularity conflicts.
++ // If conflict exists, allocation cannot be made here.
++ if ((allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) && m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
++ {
++ for (size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
++ {
++ const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
++ if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
++ {
++ return false;
++ }
++ }
++ else
++ {
++ // Already on previous page.
++ break;
++ }
++ }
++ }
++
++ // All tests passed: Success.
++ pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1);
++ // pAllocationRequest->item, customData unused.
++ pAllocationRequest->type = VmaAllocationRequestType::EndOf1st;
++ return true;
++ }
++ }
++
++ // Wrap-around to end of 2nd vector. Try to allocate there, watching for the
++ // beginning of 1st vector as the end of free space.
++ if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ VMA_ASSERT(!suballocations1st.empty());
++
++ VkDeviceSize resultBaseOffset = 0;
++ if (!suballocations2nd.empty())
++ {
++ const VmaSuballocation& lastSuballoc = suballocations2nd.back();
++ resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + debugMargin;
++ }
++
++ // Start from offset equal to beginning of free space.
++ VkDeviceSize resultOffset = resultBaseOffset;
++
++ // Apply alignment.
++ resultOffset = VmaAlignUp(resultOffset, allocAlignment);
++
++ // Check previous suballocations for BufferImageGranularity conflicts.
++ // Make bigger alignment if necessary.
++ if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty())
++ {
++ bool bufferImageGranularityConflict = false;
++ for (size_t prevSuballocIndex = suballocations2nd.size(); prevSuballocIndex--; )
++ {
++ const VmaSuballocation& prevSuballoc = suballocations2nd[prevSuballocIndex];
++ if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
++ {
++ bufferImageGranularityConflict = true;
++ break;
++ }
++ }
++ else
++ // Already on previous page.
++ break;
++ }
++ if (bufferImageGranularityConflict)
++ {
++ resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
++ }
++ }
++
++ size_t index1st = m_1stNullItemsBeginCount;
++
++ // There is enough free space at the end after alignment.
++ if ((index1st == suballocations1st.size() && resultOffset + allocSize + debugMargin <= blockSize) ||
++ (index1st < suballocations1st.size() && resultOffset + allocSize + debugMargin <= suballocations1st[index1st].offset))
++ {
++ // Check next suballocations for BufferImageGranularity conflicts.
++ // If conflict exists, allocation cannot be made here.
++ if (allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity)
++ {
++ for (size_t nextSuballocIndex = index1st;
++ nextSuballocIndex < suballocations1st.size();
++ nextSuballocIndex++)
++ {
++ const VmaSuballocation& nextSuballoc = suballocations1st[nextSuballocIndex];
++ if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
++ {
++ return false;
++ }
++ }
++ else
++ {
++ // Already on next page.
++ break;
++ }
++ }
++ }
++
++ // All tests passed: Success.
++ pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1);
++ pAllocationRequest->type = VmaAllocationRequestType::EndOf2nd;
++ // pAllocationRequest->item, customData unused.
++ return true;
++ }
++ }
++
++ return false;
++}
++
++bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ const VkDeviceSize blockSize = GetSize();
++ const VkDeviceSize bufferImageGranularity = GetBufferImageGranularity();
++ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
++ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
++
++ if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
++ {
++ VMA_ASSERT(0 && "Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer.");
++ return false;
++ }
++
++ // Try to allocate before 2nd.back(), or end of block if 2nd.empty().
++ if (allocSize > blockSize)
++ {
++ return false;
++ }
++ VkDeviceSize resultBaseOffset = blockSize - allocSize;
++ if (!suballocations2nd.empty())
++ {
++ const VmaSuballocation& lastSuballoc = suballocations2nd.back();
++ resultBaseOffset = lastSuballoc.offset - allocSize;
++ if (allocSize > lastSuballoc.offset)
++ {
++ return false;
++ }
++ }
++
++ // Start from offset equal to end of free space.
++ VkDeviceSize resultOffset = resultBaseOffset;
++
++ const VkDeviceSize debugMargin = GetDebugMargin();
++
++ // Apply debugMargin at the end.
++ if (debugMargin > 0)
++ {
++ if (resultOffset < debugMargin)
++ {
++ return false;
++ }
++ resultOffset -= debugMargin;
++ }
++
++ // Apply alignment.
++ resultOffset = VmaAlignDown(resultOffset, allocAlignment);
++
++ // Check next suballocations from 2nd for BufferImageGranularity conflicts.
++ // Make bigger alignment if necessary.
++ if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty())
++ {
++ bool bufferImageGranularityConflict = false;
++ for (size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
++ {
++ const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
++ if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(nextSuballoc.type, allocType))
++ {
++ bufferImageGranularityConflict = true;
++ break;
++ }
++ }
++ else
++ // Already on previous page.
++ break;
++ }
++ if (bufferImageGranularityConflict)
++ {
++ resultOffset = VmaAlignDown(resultOffset, bufferImageGranularity);
++ }
++ }
++
++ // There is enough free space.
++ const VkDeviceSize endOf1st = !suballocations1st.empty() ?
++ suballocations1st.back().offset + suballocations1st.back().size :
++ 0;
++ if (endOf1st + debugMargin <= resultOffset)
++ {
++ // Check previous suballocations for BufferImageGranularity conflicts.
++ // If conflict exists, allocation cannot be made here.
++ if (bufferImageGranularity > 1)
++ {
++ for (size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
++ {
++ const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
++ if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
++ {
++ if (VmaIsBufferImageGranularityConflict(allocType, prevSuballoc.type))
++ {
++ return false;
++ }
++ }
++ else
++ {
++ // Already on next page.
++ break;
++ }
++ }
++ }
++
++ // All tests passed: Success.
++ pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1);
++ // pAllocationRequest->item unused.
++ pAllocationRequest->type = VmaAllocationRequestType::UpperAddress;
++ return true;
++ }
++
++ return false;
++}
++#endif // _VMA_BLOCK_METADATA_LINEAR_FUNCTIONS
++#endif // _VMA_BLOCK_METADATA_LINEAR
++
++#if 0
++#ifndef _VMA_BLOCK_METADATA_BUDDY
++/*
++- GetSize() is the original size of allocated memory block.
++- m_UsableSize is this size aligned down to a power of two.
++ All allocations and calculations happen relative to m_UsableSize.
++- GetUnusableSize() is the difference between them.
++ It is reported as separate, unused range, not available for allocations.
++
++Node at level 0 has size = m_UsableSize.
++Each next level contains nodes with size 2 times smaller than current level.
++m_LevelCount is the maximum number of levels to use in the current object.
++*/
++class VmaBlockMetadata_Buddy : public VmaBlockMetadata
++{
++ VMA_CLASS_NO_COPY(VmaBlockMetadata_Buddy)
++public:
++ VmaBlockMetadata_Buddy(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual);
++ virtual ~VmaBlockMetadata_Buddy();
++
++ size_t GetAllocationCount() const override { return m_AllocationCount; }
++ VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize + GetUnusableSize(); }
++ bool IsEmpty() const override { return m_Root->type == Node::TYPE_FREE; }
++ VkResult CheckCorruption(const void* pBlockData) override { return VK_ERROR_FEATURE_NOT_PRESENT; }
++ VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; };
++ void DebugLogAllAllocations() const override { DebugLogAllAllocationNode(m_Root, 0); }
++
++ void Init(VkDeviceSize size) override;
++ bool Validate() const override;
++
++ void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override;
++ void AddStatistics(VmaStatistics& inoutStats) const override;
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const override;
++#endif
++
++ bool CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest) override;
++
++ void Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData) override;
++
++ void Free(VmaAllocHandle allocHandle) override;
++ void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override;
++ void* GetAllocationUserData(VmaAllocHandle allocHandle) const override;
++ VmaAllocHandle GetAllocationListBegin() const override;
++ VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override;
++ void Clear() override;
++ void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override;
++
++private:
++ static const size_t MAX_LEVELS = 48;
++
++ struct ValidationContext
++ {
++ size_t calculatedAllocationCount = 0;
++ size_t calculatedFreeCount = 0;
++ VkDeviceSize calculatedSumFreeSize = 0;
++ };
++ struct Node
++ {
++ VkDeviceSize offset;
++ enum TYPE
++ {
++ TYPE_FREE,
++ TYPE_ALLOCATION,
++ TYPE_SPLIT,
++ TYPE_COUNT
++ } type;
++ Node* parent;
++ Node* buddy;
++
++ union
++ {
++ struct
++ {
++ Node* prev;
++ Node* next;
++ } free;
++ struct
++ {
++ void* userData;
++ } allocation;
++ struct
++ {
++ Node* leftChild;
++ } split;
++ };
++ };
++
++ // Size of the memory block aligned down to a power of two.
++ VkDeviceSize m_UsableSize;
++ uint32_t m_LevelCount;
++ VmaPoolAllocator<Node> m_NodeAllocator;
++ Node* m_Root;
++ struct
++ {
++ Node* front;
++ Node* back;
++ } m_FreeList[MAX_LEVELS];
++
++ // Number of nodes in the tree with type == TYPE_ALLOCATION.
++ size_t m_AllocationCount;
++ // Number of nodes in the tree with type == TYPE_FREE.
++ size_t m_FreeCount;
++ // Doesn't include space wasted due to internal fragmentation - allocation sizes are just aligned up to node sizes.
++ // Doesn't include unusable size.
++ VkDeviceSize m_SumFreeSize;
++
++ VkDeviceSize GetUnusableSize() const { return GetSize() - m_UsableSize; }
++ VkDeviceSize LevelToNodeSize(uint32_t level) const { return m_UsableSize >> level; }
++
++ VkDeviceSize AlignAllocationSize(VkDeviceSize size) const
++ {
++ if (!IsVirtual())
++ {
++ size = VmaAlignUp(size, (VkDeviceSize)16);
++ }
++ return VmaNextPow2(size);
++ }
++ Node* FindAllocationNode(VkDeviceSize offset, uint32_t& outLevel) const;
++ void DeleteNodeChildren(Node* node);
++ bool ValidateNode(ValidationContext& ctx, const Node* parent, const Node* curr, uint32_t level, VkDeviceSize levelNodeSize) const;
++ uint32_t AllocSizeToLevel(VkDeviceSize allocSize) const;
++ void AddNodeToDetailedStatistics(VmaDetailedStatistics& inoutStats, const Node* node, VkDeviceSize levelNodeSize) const;
++ // Adds node to the front of FreeList at given level.
++ // node->type must be FREE.
++ // node->free.prev, next can be undefined.
++ void AddToFreeListFront(uint32_t level, Node* node);
++ // Removes node from FreeList at given level.
++ // node->type must be FREE.
++ // node->free.prev, next stay untouched.
++ void RemoveFromFreeList(uint32_t level, Node* node);
++ void DebugLogAllAllocationNode(Node* node, uint32_t level) const;
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMapNode(class VmaJsonWriter& json, const Node* node, VkDeviceSize levelNodeSize) const;
++#endif
++};
++
++#ifndef _VMA_BLOCK_METADATA_BUDDY_FUNCTIONS
++VmaBlockMetadata_Buddy::VmaBlockMetadata_Buddy(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual)
++ : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual),
++ m_NodeAllocator(pAllocationCallbacks, 32), // firstBlockCapacity
++ m_Root(VMA_NULL),
++ m_AllocationCount(0),
++ m_FreeCount(1),
++ m_SumFreeSize(0)
++{
++ memset(m_FreeList, 0, sizeof(m_FreeList));
++}
++
++VmaBlockMetadata_Buddy::~VmaBlockMetadata_Buddy()
++{
++ DeleteNodeChildren(m_Root);
++ m_NodeAllocator.Free(m_Root);
++}
++
++void VmaBlockMetadata_Buddy::Init(VkDeviceSize size)
++{
++ VmaBlockMetadata::Init(size);
++
++ m_UsableSize = VmaPrevPow2(size);
++ m_SumFreeSize = m_UsableSize;
++
++ // Calculate m_LevelCount.
++ const VkDeviceSize minNodeSize = IsVirtual() ? 1 : 16;
++ m_LevelCount = 1;
++ while (m_LevelCount < MAX_LEVELS &&
++ LevelToNodeSize(m_LevelCount) >= minNodeSize)
++ {
++ ++m_LevelCount;
++ }
++
++ Node* rootNode = m_NodeAllocator.Alloc();
++ rootNode->offset = 0;
++ rootNode->type = Node::TYPE_FREE;
++ rootNode->parent = VMA_NULL;
++ rootNode->buddy = VMA_NULL;
++
++ m_Root = rootNode;
++ AddToFreeListFront(0, rootNode);
++}
++
++bool VmaBlockMetadata_Buddy::Validate() const
++{
++ // Validate tree.
++ ValidationContext ctx;
++ if (!ValidateNode(ctx, VMA_NULL, m_Root, 0, LevelToNodeSize(0)))
++ {
++ VMA_VALIDATE(false && "ValidateNode failed.");
++ }
++ VMA_VALIDATE(m_AllocationCount == ctx.calculatedAllocationCount);
++ VMA_VALIDATE(m_SumFreeSize == ctx.calculatedSumFreeSize);
++
++ // Validate free node lists.
++ for (uint32_t level = 0; level < m_LevelCount; ++level)
++ {
++ VMA_VALIDATE(m_FreeList[level].front == VMA_NULL ||
++ m_FreeList[level].front->free.prev == VMA_NULL);
++
++ for (Node* node = m_FreeList[level].front;
++ node != VMA_NULL;
++ node = node->free.next)
++ {
++ VMA_VALIDATE(node->type == Node::TYPE_FREE);
++
++ if (node->free.next == VMA_NULL)
++ {
++ VMA_VALIDATE(m_FreeList[level].back == node);
++ }
++ else
++ {
++ VMA_VALIDATE(node->free.next->free.prev == node);
++ }
++ }
++ }
++
++ // Validate that free lists ar higher levels are empty.
++ for (uint32_t level = m_LevelCount; level < MAX_LEVELS; ++level)
++ {
++ VMA_VALIDATE(m_FreeList[level].front == VMA_NULL && m_FreeList[level].back == VMA_NULL);
++ }
++
++ return true;
++}
++
++void VmaBlockMetadata_Buddy::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const
++{
++ inoutStats.statistics.blockCount++;
++ inoutStats.statistics.blockBytes += GetSize();
++
++ AddNodeToDetailedStatistics(inoutStats, m_Root, LevelToNodeSize(0));
++
++ const VkDeviceSize unusableSize = GetUnusableSize();
++ if (unusableSize > 0)
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, unusableSize);
++}
++
++void VmaBlockMetadata_Buddy::AddStatistics(VmaStatistics& inoutStats) const
++{
++ inoutStats.blockCount++;
++ inoutStats.allocationCount += (uint32_t)m_AllocationCount;
++ inoutStats.blockBytes += GetSize();
++ inoutStats.allocationBytes += GetSize() - m_SumFreeSize;
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockMetadata_Buddy::PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const
++{
++ VmaDetailedStatistics stats;
++ VmaClearDetailedStatistics(stats);
++ AddDetailedStatistics(stats);
++
++ PrintDetailedMap_Begin(
++ json,
++ stats.statistics.blockBytes - stats.statistics.allocationBytes,
++ stats.statistics.allocationCount,
++ stats.unusedRangeCount,
++ mapRefCount);
++
++ PrintDetailedMapNode(json, m_Root, LevelToNodeSize(0));
++
++ const VkDeviceSize unusableSize = GetUnusableSize();
++ if (unusableSize > 0)
++ {
++ PrintDetailedMap_UnusedRange(json,
++ m_UsableSize, // offset
++ unusableSize); // size
++ }
++
++ PrintDetailedMap_End(json);
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ VMA_ASSERT(!upperAddress && "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
++
++ allocSize = AlignAllocationSize(allocSize);
++
++ // Simple way to respect bufferImageGranularity. May be optimized some day.
++ // Whenever it might be an OPTIMAL image...
++ if (allocType == VMA_SUBALLOCATION_TYPE_UNKNOWN ||
++ allocType == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
++ allocType == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL)
++ {
++ allocAlignment = VMA_MAX(allocAlignment, GetBufferImageGranularity());
++ allocSize = VmaAlignUp(allocSize, GetBufferImageGranularity());
++ }
++
++ if (allocSize > m_UsableSize)
++ {
++ return false;
++ }
++
++ const uint32_t targetLevel = AllocSizeToLevel(allocSize);
++ for (uint32_t level = targetLevel; level--; )
++ {
++ for (Node* freeNode = m_FreeList[level].front;
++ freeNode != VMA_NULL;
++ freeNode = freeNode->free.next)
++ {
++ if (freeNode->offset % allocAlignment == 0)
++ {
++ pAllocationRequest->type = VmaAllocationRequestType::Normal;
++ pAllocationRequest->allocHandle = (VmaAllocHandle)(freeNode->offset + 1);
++ pAllocationRequest->size = allocSize;
++ pAllocationRequest->customData = (void*)(uintptr_t)level;
++ return true;
++ }
++ }
++ }
++
++ return false;
++}
++
++void VmaBlockMetadata_Buddy::Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData)
++{
++ VMA_ASSERT(request.type == VmaAllocationRequestType::Normal);
++
++ const uint32_t targetLevel = AllocSizeToLevel(request.size);
++ uint32_t currLevel = (uint32_t)(uintptr_t)request.customData;
++
++ Node* currNode = m_FreeList[currLevel].front;
++ VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
++ const VkDeviceSize offset = (VkDeviceSize)request.allocHandle - 1;
++ while (currNode->offset != offset)
++ {
++ currNode = currNode->free.next;
++ VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
++ }
++
++ // Go down, splitting free nodes.
++ while (currLevel < targetLevel)
++ {
++ // currNode is already first free node at currLevel.
++ // Remove it from list of free nodes at this currLevel.
++ RemoveFromFreeList(currLevel, currNode);
++
++ const uint32_t childrenLevel = currLevel + 1;
++
++ // Create two free sub-nodes.
++ Node* leftChild = m_NodeAllocator.Alloc();
++ Node* rightChild = m_NodeAllocator.Alloc();
++
++ leftChild->offset = currNode->offset;
++ leftChild->type = Node::TYPE_FREE;
++ leftChild->parent = currNode;
++ leftChild->buddy = rightChild;
++
++ rightChild->offset = currNode->offset + LevelToNodeSize(childrenLevel);
++ rightChild->type = Node::TYPE_FREE;
++ rightChild->parent = currNode;
++ rightChild->buddy = leftChild;
++
++ // Convert current currNode to split type.
++ currNode->type = Node::TYPE_SPLIT;
++ currNode->split.leftChild = leftChild;
++
++ // Add child nodes to free list. Order is important!
++ AddToFreeListFront(childrenLevel, rightChild);
++ AddToFreeListFront(childrenLevel, leftChild);
++
++ ++m_FreeCount;
++ ++currLevel;
++ currNode = m_FreeList[currLevel].front;
++
++ /*
++ We can be sure that currNode, as left child of node previously split,
++ also fulfills the alignment requirement.
++ */
++ }
++
++ // Remove from free list.
++ VMA_ASSERT(currLevel == targetLevel &&
++ currNode != VMA_NULL &&
++ currNode->type == Node::TYPE_FREE);
++ RemoveFromFreeList(currLevel, currNode);
++
++ // Convert to allocation node.
++ currNode->type = Node::TYPE_ALLOCATION;
++ currNode->allocation.userData = userData;
++
++ ++m_AllocationCount;
++ --m_FreeCount;
++ m_SumFreeSize -= request.size;
++}
++
++void VmaBlockMetadata_Buddy::GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo)
++{
++ uint32_t level = 0;
++ outInfo.offset = (VkDeviceSize)allocHandle - 1;
++ const Node* const node = FindAllocationNode(outInfo.offset, level);
++ outInfo.size = LevelToNodeSize(level);
++ outInfo.pUserData = node->allocation.userData;
++}
++
++void* VmaBlockMetadata_Buddy::GetAllocationUserData(VmaAllocHandle allocHandle) const
++{
++ uint32_t level = 0;
++ const Node* const node = FindAllocationNode((VkDeviceSize)allocHandle - 1, level);
++ return node->allocation.userData;
++}
++
++VmaAllocHandle VmaBlockMetadata_Buddy::GetAllocationListBegin() const
++{
++ // Function only used for defragmentation, which is disabled for this algorithm
++ return VK_NULL_HANDLE;
++}
++
++VmaAllocHandle VmaBlockMetadata_Buddy::GetNextAllocation(VmaAllocHandle prevAlloc) const
++{
++ // Function only used for defragmentation, which is disabled for this algorithm
++ return VK_NULL_HANDLE;
++}
++
++void VmaBlockMetadata_Buddy::DeleteNodeChildren(Node* node)
++{
++ if (node->type == Node::TYPE_SPLIT)
++ {
++ DeleteNodeChildren(node->split.leftChild->buddy);
++ DeleteNodeChildren(node->split.leftChild);
++ const VkAllocationCallbacks* allocationCallbacks = GetAllocationCallbacks();
++ m_NodeAllocator.Free(node->split.leftChild->buddy);
++ m_NodeAllocator.Free(node->split.leftChild);
++ }
++}
++
++void VmaBlockMetadata_Buddy::Clear()
++{
++ DeleteNodeChildren(m_Root);
++ m_Root->type = Node::TYPE_FREE;
++ m_AllocationCount = 0;
++ m_FreeCount = 1;
++ m_SumFreeSize = m_UsableSize;
++}
++
++void VmaBlockMetadata_Buddy::SetAllocationUserData(VmaAllocHandle allocHandle, void* userData)
++{
++ uint32_t level = 0;
++ Node* const node = FindAllocationNode((VkDeviceSize)allocHandle - 1, level);
++ node->allocation.userData = userData;
++}
++
++VmaBlockMetadata_Buddy::Node* VmaBlockMetadata_Buddy::FindAllocationNode(VkDeviceSize offset, uint32_t& outLevel) const
++{
++ Node* node = m_Root;
++ VkDeviceSize nodeOffset = 0;
++ outLevel = 0;
++ VkDeviceSize levelNodeSize = LevelToNodeSize(0);
++ while (node->type == Node::TYPE_SPLIT)
++ {
++ const VkDeviceSize nextLevelNodeSize = levelNodeSize >> 1;
++ if (offset < nodeOffset + nextLevelNodeSize)
++ {
++ node = node->split.leftChild;
++ }
++ else
++ {
++ node = node->split.leftChild->buddy;
++ nodeOffset += nextLevelNodeSize;
++ }
++ ++outLevel;
++ levelNodeSize = nextLevelNodeSize;
++ }
++
++ VMA_ASSERT(node != VMA_NULL && node->type == Node::TYPE_ALLOCATION);
++ return node;
++}
++
++bool VmaBlockMetadata_Buddy::ValidateNode(ValidationContext& ctx, const Node* parent, const Node* curr, uint32_t level, VkDeviceSize levelNodeSize) const
++{
++ VMA_VALIDATE(level < m_LevelCount);
++ VMA_VALIDATE(curr->parent == parent);
++ VMA_VALIDATE((curr->buddy == VMA_NULL) == (parent == VMA_NULL));
++ VMA_VALIDATE(curr->buddy == VMA_NULL || curr->buddy->buddy == curr);
++ switch (curr->type)
++ {
++ case Node::TYPE_FREE:
++ // curr->free.prev, next are validated separately.
++ ctx.calculatedSumFreeSize += levelNodeSize;
++ ++ctx.calculatedFreeCount;
++ break;
++ case Node::TYPE_ALLOCATION:
++ ++ctx.calculatedAllocationCount;
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(curr->allocation.userData != VMA_NULL);
++ }
++ break;
++ case Node::TYPE_SPLIT:
++ {
++ const uint32_t childrenLevel = level + 1;
++ const VkDeviceSize childrenLevelNodeSize = levelNodeSize >> 1;
++ const Node* const leftChild = curr->split.leftChild;
++ VMA_VALIDATE(leftChild != VMA_NULL);
++ VMA_VALIDATE(leftChild->offset == curr->offset);
++ if (!ValidateNode(ctx, curr, leftChild, childrenLevel, childrenLevelNodeSize))
++ {
++ VMA_VALIDATE(false && "ValidateNode for left child failed.");
++ }
++ const Node* const rightChild = leftChild->buddy;
++ VMA_VALIDATE(rightChild->offset == curr->offset + childrenLevelNodeSize);
++ if (!ValidateNode(ctx, curr, rightChild, childrenLevel, childrenLevelNodeSize))
++ {
++ VMA_VALIDATE(false && "ValidateNode for right child failed.");
++ }
++ }
++ break;
++ default:
++ return false;
++ }
++
++ return true;
++}
++
++uint32_t VmaBlockMetadata_Buddy::AllocSizeToLevel(VkDeviceSize allocSize) const
++{
++ // I know this could be optimized somehow e.g. by using std::log2p1 from C++20.
++ uint32_t level = 0;
++ VkDeviceSize currLevelNodeSize = m_UsableSize;
++ VkDeviceSize nextLevelNodeSize = currLevelNodeSize >> 1;
++ while (allocSize <= nextLevelNodeSize && level + 1 < m_LevelCount)
++ {
++ ++level;
++ currLevelNodeSize >>= 1;
++ nextLevelNodeSize >>= 1;
++ }
++ return level;
++}
++
++void VmaBlockMetadata_Buddy::Free(VmaAllocHandle allocHandle)
++{
++ uint32_t level = 0;
++ Node* node = FindAllocationNode((VkDeviceSize)allocHandle - 1, level);
++
++ ++m_FreeCount;
++ --m_AllocationCount;
++ m_SumFreeSize += LevelToNodeSize(level);
++
++ node->type = Node::TYPE_FREE;
++
++ // Join free nodes if possible.
++ while (level > 0 && node->buddy->type == Node::TYPE_FREE)
++ {
++ RemoveFromFreeList(level, node->buddy);
++ Node* const parent = node->parent;
++
++ m_NodeAllocator.Free(node->buddy);
++ m_NodeAllocator.Free(node);
++ parent->type = Node::TYPE_FREE;
++
++ node = parent;
++ --level;
++ --m_FreeCount;
++ }
++
++ AddToFreeListFront(level, node);
++}
++
++void VmaBlockMetadata_Buddy::AddNodeToDetailedStatistics(VmaDetailedStatistics& inoutStats, const Node* node, VkDeviceSize levelNodeSize) const
++{
++ switch (node->type)
++ {
++ case Node::TYPE_FREE:
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, levelNodeSize);
++ break;
++ case Node::TYPE_ALLOCATION:
++ VmaAddDetailedStatisticsAllocation(inoutStats, levelNodeSize);
++ break;
++ case Node::TYPE_SPLIT:
++ {
++ const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
++ const Node* const leftChild = node->split.leftChild;
++ AddNodeToDetailedStatistics(inoutStats, leftChild, childrenNodeSize);
++ const Node* const rightChild = leftChild->buddy;
++ AddNodeToDetailedStatistics(inoutStats, rightChild, childrenNodeSize);
++ }
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++}
++
++void VmaBlockMetadata_Buddy::AddToFreeListFront(uint32_t level, Node* node)
++{
++ VMA_ASSERT(node->type == Node::TYPE_FREE);
++
++ // List is empty.
++ Node* const frontNode = m_FreeList[level].front;
++ if (frontNode == VMA_NULL)
++ {
++ VMA_ASSERT(m_FreeList[level].back == VMA_NULL);
++ node->free.prev = node->free.next = VMA_NULL;
++ m_FreeList[level].front = m_FreeList[level].back = node;
++ }
++ else
++ {
++ VMA_ASSERT(frontNode->free.prev == VMA_NULL);
++ node->free.prev = VMA_NULL;
++ node->free.next = frontNode;
++ frontNode->free.prev = node;
++ m_FreeList[level].front = node;
++ }
++}
++
++void VmaBlockMetadata_Buddy::RemoveFromFreeList(uint32_t level, Node* node)
++{
++ VMA_ASSERT(m_FreeList[level].front != VMA_NULL);
++
++ // It is at the front.
++ if (node->free.prev == VMA_NULL)
++ {
++ VMA_ASSERT(m_FreeList[level].front == node);
++ m_FreeList[level].front = node->free.next;
++ }
++ else
++ {
++ Node* const prevFreeNode = node->free.prev;
++ VMA_ASSERT(prevFreeNode->free.next == node);
++ prevFreeNode->free.next = node->free.next;
++ }
++
++ // It is at the back.
++ if (node->free.next == VMA_NULL)
++ {
++ VMA_ASSERT(m_FreeList[level].back == node);
++ m_FreeList[level].back = node->free.prev;
++ }
++ else
++ {
++ Node* const nextFreeNode = node->free.next;
++ VMA_ASSERT(nextFreeNode->free.prev == node);
++ nextFreeNode->free.prev = node->free.prev;
++ }
++}
++
++void VmaBlockMetadata_Buddy::DebugLogAllAllocationNode(Node* node, uint32_t level) const
++{
++ switch (node->type)
++ {
++ case Node::TYPE_FREE:
++ break;
++ case Node::TYPE_ALLOCATION:
++ DebugLogAllocation(node->offset, LevelToNodeSize(level), node->allocation.userData);
++ break;
++ case Node::TYPE_SPLIT:
++ {
++ ++level;
++ DebugLogAllAllocationNode(node->split.leftChild, level);
++ DebugLogAllAllocationNode(node->split.leftChild->buddy, level);
++ }
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockMetadata_Buddy::PrintDetailedMapNode(class VmaJsonWriter& json, const Node* node, VkDeviceSize levelNodeSize) const
++{
++ switch (node->type)
++ {
++ case Node::TYPE_FREE:
++ PrintDetailedMap_UnusedRange(json, node->offset, levelNodeSize);
++ break;
++ case Node::TYPE_ALLOCATION:
++ PrintDetailedMap_Allocation(json, node->offset, levelNodeSize, node->allocation.userData);
++ break;
++ case Node::TYPE_SPLIT:
++ {
++ const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
++ const Node* const leftChild = node->split.leftChild;
++ PrintDetailedMapNode(json, leftChild, childrenNodeSize);
++ const Node* const rightChild = leftChild->buddy;
++ PrintDetailedMapNode(json, rightChild, childrenNodeSize);
++ }
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++}
++#endif // VMA_STATS_STRING_ENABLED
++#endif // _VMA_BLOCK_METADATA_BUDDY_FUNCTIONS
++#endif // _VMA_BLOCK_METADATA_BUDDY
++#endif // #if 0
++
++#ifndef _VMA_BLOCK_METADATA_TLSF
++// To not search current larger region if first allocation won't succeed and skip to smaller range
++// use with VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT as strategy in CreateAllocationRequest().
++// When fragmentation and reusal of previous blocks doesn't matter then use with
++// VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT for fastest alloc time possible.
++class VmaBlockMetadata_TLSF : public VmaBlockMetadata
++{
++ VMA_CLASS_NO_COPY(VmaBlockMetadata_TLSF)
++public:
++ VmaBlockMetadata_TLSF(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual);
++ virtual ~VmaBlockMetadata_TLSF();
++
++ size_t GetAllocationCount() const override { return m_AllocCount; }
++ size_t GetFreeRegionsCount() const override { return m_BlocksFreeCount + 1; }
++ VkDeviceSize GetSumFreeSize() const override { return m_BlocksFreeSize + m_NullBlock->size; }
++ bool IsEmpty() const override { return m_NullBlock->offset == 0; }
++ VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return ((Block*)allocHandle)->offset; };
++
++ void Init(VkDeviceSize size) override;
++ bool Validate() const override;
++
++ void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override;
++ void AddStatistics(VmaStatistics& inoutStats) const override;
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMap(class VmaJsonWriter& json) const override;
++#endif
++
++ bool CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest) override;
++
++ VkResult CheckCorruption(const void* pBlockData) override;
++ void Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData) override;
++
++ void Free(VmaAllocHandle allocHandle) override;
++ void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override;
++ void* GetAllocationUserData(VmaAllocHandle allocHandle) const override;
++ VmaAllocHandle GetAllocationListBegin() const override;
++ VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override;
++ VkDeviceSize GetNextFreeRegionSize(VmaAllocHandle alloc) const override;
++ void Clear() override;
++ void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override;
++ void DebugLogAllAllocations() const override;
++
++private:
++ // According to original paper it should be preferable 4 or 5:
++ // M. Masmano, I. Ripoll, A. Crespo, and J. Real "TLSF: a New Dynamic Memory Allocator for Real-Time Systems"
++ // http://www.gii.upv.es/tlsf/files/ecrts04_tlsf.pdf
++ static const uint8_t SECOND_LEVEL_INDEX = 5;
++ static const uint16_t SMALL_BUFFER_SIZE = 256;
++ static const uint32_t INITIAL_BLOCK_ALLOC_COUNT = 16;
++ static const uint8_t MEMORY_CLASS_SHIFT = 7;
++ static const uint8_t MAX_MEMORY_CLASSES = 65 - MEMORY_CLASS_SHIFT;
++
++ class Block
++ {
++ public:
++ VkDeviceSize offset;
++ VkDeviceSize size;
++ Block* prevPhysical;
++ Block* nextPhysical;
++
++ void MarkFree() { prevFree = VMA_NULL; }
++ void MarkTaken() { prevFree = this; }
++ bool IsFree() const { return prevFree != this; }
++ void*& UserData() { VMA_HEAVY_ASSERT(!IsFree()); return userData; }
++ Block*& PrevFree() { return prevFree; }
++ Block*& NextFree() { VMA_HEAVY_ASSERT(IsFree()); return nextFree; }
++
++ private:
++ Block* prevFree; // Address of the same block here indicates that block is taken
++ union
++ {
++ Block* nextFree;
++ void* userData;
++ };
++ };
++
++ size_t m_AllocCount;
++ // Total number of free blocks besides null block
++ size_t m_BlocksFreeCount;
++ // Total size of free blocks excluding null block
++ VkDeviceSize m_BlocksFreeSize;
++ uint32_t m_IsFreeBitmap;
++ uint8_t m_MemoryClasses;
++ uint32_t m_InnerIsFreeBitmap[MAX_MEMORY_CLASSES];
++ uint32_t m_ListsCount;
++ /*
++ * 0: 0-3 lists for small buffers
++ * 1+: 0-(2^SLI-1) lists for normal buffers
++ */
++ Block** m_FreeList;
++ VmaPoolAllocator<Block> m_BlockAllocator;
++ Block* m_NullBlock;
++ VmaBlockBufferImageGranularity m_GranularityHandler;
++
++ uint8_t SizeToMemoryClass(VkDeviceSize size) const;
++ uint16_t SizeToSecondIndex(VkDeviceSize size, uint8_t memoryClass) const;
++ uint32_t GetListIndex(uint8_t memoryClass, uint16_t secondIndex) const;
++ uint32_t GetListIndex(VkDeviceSize size) const;
++
++ void RemoveFreeBlock(Block* block);
++ void InsertFreeBlock(Block* block);
++ void MergeBlock(Block* block, Block* prev);
++
++ Block* FindFreeBlock(VkDeviceSize size, uint32_t& listIndex) const;
++ bool CheckBlock(
++ Block& block,
++ uint32_t listIndex,
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ VmaAllocationRequest* pAllocationRequest);
++};
++
++#ifndef _VMA_BLOCK_METADATA_TLSF_FUNCTIONS
++VmaBlockMetadata_TLSF::VmaBlockMetadata_TLSF(const VkAllocationCallbacks* pAllocationCallbacks,
++ VkDeviceSize bufferImageGranularity, bool isVirtual)
++ : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual),
++ m_AllocCount(0),
++ m_BlocksFreeCount(0),
++ m_BlocksFreeSize(0),
++ m_IsFreeBitmap(0),
++ m_MemoryClasses(0),
++ m_ListsCount(0),
++ m_FreeList(VMA_NULL),
++ m_BlockAllocator(pAllocationCallbacks, INITIAL_BLOCK_ALLOC_COUNT),
++ m_NullBlock(VMA_NULL),
++ m_GranularityHandler(bufferImageGranularity) {}
++
++VmaBlockMetadata_TLSF::~VmaBlockMetadata_TLSF()
++{
++ if (m_FreeList)
++ vma_delete_array(GetAllocationCallbacks(), m_FreeList, m_ListsCount);
++ m_GranularityHandler.Destroy(GetAllocationCallbacks());
++}
++
++void VmaBlockMetadata_TLSF::Init(VkDeviceSize size)
++{
++ VmaBlockMetadata::Init(size);
++
++ if (!IsVirtual())
++ m_GranularityHandler.Init(GetAllocationCallbacks(), size);
++
++ m_NullBlock = m_BlockAllocator.Alloc();
++ m_NullBlock->size = size;
++ m_NullBlock->offset = 0;
++ m_NullBlock->prevPhysical = VMA_NULL;
++ m_NullBlock->nextPhysical = VMA_NULL;
++ m_NullBlock->MarkFree();
++ m_NullBlock->NextFree() = VMA_NULL;
++ m_NullBlock->PrevFree() = VMA_NULL;
++ uint8_t memoryClass = SizeToMemoryClass(size);
++ uint16_t sli = SizeToSecondIndex(size, memoryClass);
++ m_ListsCount = (memoryClass == 0 ? 0 : (memoryClass - 1) * (1UL << SECOND_LEVEL_INDEX) + sli) + 1;
++ if (IsVirtual())
++ m_ListsCount += 1UL << SECOND_LEVEL_INDEX;
++ else
++ m_ListsCount += 4;
++
++ m_MemoryClasses = memoryClass + 2;
++ memset(m_InnerIsFreeBitmap, 0, MAX_MEMORY_CLASSES * sizeof(uint32_t));
++
++ m_FreeList = vma_new_array(GetAllocationCallbacks(), Block*, m_ListsCount);
++ memset(m_FreeList, 0, m_ListsCount * sizeof(Block*));
++}
++
++bool VmaBlockMetadata_TLSF::Validate() const
++{
++ VMA_VALIDATE(GetSumFreeSize() <= GetSize());
++
++ VkDeviceSize calculatedSize = m_NullBlock->size;
++ VkDeviceSize calculatedFreeSize = m_NullBlock->size;
++ size_t allocCount = 0;
++ size_t freeCount = 0;
++
++ // Check integrity of free lists
++ for (uint32_t list = 0; list < m_ListsCount; ++list)
++ {
++ Block* block = m_FreeList[list];
++ if (block != VMA_NULL)
++ {
++ VMA_VALIDATE(block->IsFree());
++ VMA_VALIDATE(block->PrevFree() == VMA_NULL);
++ while (block->NextFree())
++ {
++ VMA_VALIDATE(block->NextFree()->IsFree());
++ VMA_VALIDATE(block->NextFree()->PrevFree() == block);
++ block = block->NextFree();
++ }
++ }
++ }
++
++ VkDeviceSize nextOffset = m_NullBlock->offset;
++ auto validateCtx = m_GranularityHandler.StartValidation(GetAllocationCallbacks(), IsVirtual());
++
++ VMA_VALIDATE(m_NullBlock->nextPhysical == VMA_NULL);
++ if (m_NullBlock->prevPhysical)
++ {
++ VMA_VALIDATE(m_NullBlock->prevPhysical->nextPhysical == m_NullBlock);
++ }
++ // Check all blocks
++ for (Block* prev = m_NullBlock->prevPhysical; prev != VMA_NULL; prev = prev->prevPhysical)
++ {
++ VMA_VALIDATE(prev->offset + prev->size == nextOffset);
++ nextOffset = prev->offset;
++ calculatedSize += prev->size;
++
++ uint32_t listIndex = GetListIndex(prev->size);
++ if (prev->IsFree())
++ {
++ ++freeCount;
++ // Check if free block belongs to free list
++ Block* freeBlock = m_FreeList[listIndex];
++ VMA_VALIDATE(freeBlock != VMA_NULL);
++
++ bool found = false;
++ do
++ {
++ if (freeBlock == prev)
++ found = true;
++
++ freeBlock = freeBlock->NextFree();
++ } while (!found && freeBlock != VMA_NULL);
++
++ VMA_VALIDATE(found);
++ calculatedFreeSize += prev->size;
++ }
++ else
++ {
++ ++allocCount;
++ // Check if taken block is not on a free list
++ Block* freeBlock = m_FreeList[listIndex];
++ while (freeBlock)
++ {
++ VMA_VALIDATE(freeBlock != prev);
++ freeBlock = freeBlock->NextFree();
++ }
++
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(m_GranularityHandler.Validate(validateCtx, prev->offset, prev->size));
++ }
++ }
++
++ if (prev->prevPhysical)
++ {
++ VMA_VALIDATE(prev->prevPhysical->nextPhysical == prev);
++ }
++ }
++
++ if (!IsVirtual())
++ {
++ VMA_VALIDATE(m_GranularityHandler.FinishValidation(validateCtx));
++ }
++
++ VMA_VALIDATE(nextOffset == 0);
++ VMA_VALIDATE(calculatedSize == GetSize());
++ VMA_VALIDATE(calculatedFreeSize == GetSumFreeSize());
++ VMA_VALIDATE(allocCount == m_AllocCount);
++ VMA_VALIDATE(freeCount == m_BlocksFreeCount);
++
++ return true;
++}
++
++void VmaBlockMetadata_TLSF::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const
++{
++ inoutStats.statistics.blockCount++;
++ inoutStats.statistics.blockBytes += GetSize();
++ if (m_NullBlock->size > 0)
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, m_NullBlock->size);
++
++ for (Block* block = m_NullBlock->prevPhysical; block != VMA_NULL; block = block->prevPhysical)
++ {
++ if (block->IsFree())
++ VmaAddDetailedStatisticsUnusedRange(inoutStats, block->size);
++ else
++ VmaAddDetailedStatisticsAllocation(inoutStats, block->size);
++ }
++}
++
++void VmaBlockMetadata_TLSF::AddStatistics(VmaStatistics& inoutStats) const
++{
++ inoutStats.blockCount++;
++ inoutStats.allocationCount += (uint32_t)m_AllocCount;
++ inoutStats.blockBytes += GetSize();
++ inoutStats.allocationBytes += GetSize() - GetSumFreeSize();
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockMetadata_TLSF::PrintDetailedMap(class VmaJsonWriter& json) const
++{
++ size_t blockCount = m_AllocCount + m_BlocksFreeCount;
++ VmaStlAllocator<Block*> allocator(GetAllocationCallbacks());
++ VmaVector<Block*, VmaStlAllocator<Block*>> blockList(blockCount, allocator);
++
++ size_t i = blockCount;
++ for (Block* block = m_NullBlock->prevPhysical; block != VMA_NULL; block = block->prevPhysical)
++ {
++ blockList[--i] = block;
++ }
++ VMA_ASSERT(i == 0);
++
++ VmaDetailedStatistics stats;
++ VmaClearDetailedStatistics(stats);
++ AddDetailedStatistics(stats);
++
++ PrintDetailedMap_Begin(json,
++ stats.statistics.blockBytes - stats.statistics.allocationBytes,
++ stats.statistics.allocationCount,
++ stats.unusedRangeCount);
++
++ for (; i < blockCount; ++i)
++ {
++ Block* block = blockList[i];
++ if (block->IsFree())
++ PrintDetailedMap_UnusedRange(json, block->offset, block->size);
++ else
++ PrintDetailedMap_Allocation(json, block->offset, block->size, block->UserData());
++ }
++ if (m_NullBlock->size > 0)
++ PrintDetailedMap_UnusedRange(json, m_NullBlock->offset, m_NullBlock->size);
++
++ PrintDetailedMap_End(json);
++}
++#endif
++
++bool VmaBlockMetadata_TLSF::CreateAllocationRequest(
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ bool upperAddress,
++ VmaSuballocationType allocType,
++ uint32_t strategy,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ VMA_ASSERT(allocSize > 0 && "Cannot allocate empty block!");
++ VMA_ASSERT(!upperAddress && "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
++
++ // For small granularity round up
++ if (!IsVirtual())
++ m_GranularityHandler.RoundupAllocRequest(allocType, allocSize, allocAlignment);
++
++ allocSize += GetDebugMargin();
++ // Quick check for too small pool
++ if (allocSize > GetSumFreeSize())
++ return false;
++
++ // If no free blocks in pool then check only null block
++ if (m_BlocksFreeCount == 0)
++ return CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, allocType, pAllocationRequest);
++
++ // Round up to the next block
++ VkDeviceSize sizeForNextList = allocSize;
++ VkDeviceSize smallSizeStep = SMALL_BUFFER_SIZE / (IsVirtual() ? 1 << SECOND_LEVEL_INDEX : 4);
++ if (allocSize > SMALL_BUFFER_SIZE)
++ {
++ sizeForNextList += (1ULL << (VMA_BITSCAN_MSB(allocSize) - SECOND_LEVEL_INDEX));
++ }
++ else if (allocSize > SMALL_BUFFER_SIZE - smallSizeStep)
++ sizeForNextList = SMALL_BUFFER_SIZE + 1;
++ else
++ sizeForNextList += smallSizeStep;
++
++ uint32_t nextListIndex = 0;
++ uint32_t prevListIndex = 0;
++ Block* nextListBlock = VMA_NULL;
++ Block* prevListBlock = VMA_NULL;
++
++ // Check blocks according to strategies
++ if (strategy & VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT)
++ {
++ // Quick check for larger block first
++ nextListBlock = FindFreeBlock(sizeForNextList, nextListIndex);
++ if (nextListBlock != VMA_NULL && CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++
++ // If not fitted then null block
++ if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++
++ // Null block failed, search larger bucket
++ while (nextListBlock)
++ {
++ if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ nextListBlock = nextListBlock->NextFree();
++ }
++
++ // Failed again, check best fit bucket
++ prevListBlock = FindFreeBlock(allocSize, prevListIndex);
++ while (prevListBlock)
++ {
++ if (CheckBlock(*prevListBlock, prevListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ prevListBlock = prevListBlock->NextFree();
++ }
++ }
++ else if (strategy & VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT)
++ {
++ // Check best fit bucket
++ prevListBlock = FindFreeBlock(allocSize, prevListIndex);
++ while (prevListBlock)
++ {
++ if (CheckBlock(*prevListBlock, prevListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ prevListBlock = prevListBlock->NextFree();
++ }
++
++ // If failed check null block
++ if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++
++ // Check larger bucket
++ nextListBlock = FindFreeBlock(sizeForNextList, nextListIndex);
++ while (nextListBlock)
++ {
++ if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ nextListBlock = nextListBlock->NextFree();
++ }
++ }
++ else if (strategy & VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT )
++ {
++ // Perform search from the start
++ VmaStlAllocator<Block*> allocator(GetAllocationCallbacks());
++ VmaVector<Block*, VmaStlAllocator<Block*>> blockList(m_BlocksFreeCount, allocator);
++
++ size_t i = m_BlocksFreeCount;
++ for (Block* block = m_NullBlock->prevPhysical; block != VMA_NULL; block = block->prevPhysical)
++ {
++ if (block->IsFree() && block->size >= allocSize)
++ blockList[--i] = block;
++ }
++
++ for (; i < m_BlocksFreeCount; ++i)
++ {
++ Block& block = *blockList[i];
++ if (CheckBlock(block, GetListIndex(block.size), allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ }
++
++ // If failed check null block
++ if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++
++ // Whole range searched, no more memory
++ return false;
++ }
++ else
++ {
++ // Check larger bucket
++ nextListBlock = FindFreeBlock(sizeForNextList, nextListIndex);
++ while (nextListBlock)
++ {
++ if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ nextListBlock = nextListBlock->NextFree();
++ }
++
++ // If failed check null block
++ if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++
++ // Check best fit bucket
++ prevListBlock = FindFreeBlock(allocSize, prevListIndex);
++ while (prevListBlock)
++ {
++ if (CheckBlock(*prevListBlock, prevListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ prevListBlock = prevListBlock->NextFree();
++ }
++ }
++
++ // Worst case, full search has to be done
++ while (++nextListIndex < m_ListsCount)
++ {
++ nextListBlock = m_FreeList[nextListIndex];
++ while (nextListBlock)
++ {
++ if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, allocType, pAllocationRequest))
++ return true;
++ nextListBlock = nextListBlock->NextFree();
++ }
++ }
++
++ // No more memory sadly
++ return false;
++}
++
++VkResult VmaBlockMetadata_TLSF::CheckCorruption(const void* pBlockData)
++{
++ for (Block* block = m_NullBlock->prevPhysical; block != VMA_NULL; block = block->prevPhysical)
++ {
++ if (!block->IsFree())
++ {
++ if (!VmaValidateMagicValue(pBlockData, block->offset + block->size))
++ {
++ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
++ return VK_ERROR_UNKNOWN_COPY;
++ }
++ }
++ }
++
++ return VK_SUCCESS;
++}
++
++void VmaBlockMetadata_TLSF::Alloc(
++ const VmaAllocationRequest& request,
++ VmaSuballocationType type,
++ void* userData)
++{
++ VMA_ASSERT(request.type == VmaAllocationRequestType::TLSF);
++
++ // Get block and pop it from the free list
++ Block* currentBlock = (Block*)request.allocHandle;
++ VkDeviceSize offset = request.algorithmData;
++ VMA_ASSERT(currentBlock != VMA_NULL);
++ VMA_ASSERT(currentBlock->offset <= offset);
++
++ if (currentBlock != m_NullBlock)
++ RemoveFreeBlock(currentBlock);
++
++ VkDeviceSize debugMargin = GetDebugMargin();
++ VkDeviceSize misssingAlignment = offset - currentBlock->offset;
++
++ // Append missing alignment to prev block or create new one
++ if (misssingAlignment)
++ {
++ Block* prevBlock = currentBlock->prevPhysical;
++ VMA_ASSERT(prevBlock != VMA_NULL && "There should be no missing alignment at offset 0!");
++
++ if (prevBlock->IsFree() && prevBlock->size != debugMargin)
++ {
++ uint32_t oldList = GetListIndex(prevBlock->size);
++ prevBlock->size += misssingAlignment;
++ // Check if new size crosses list bucket
++ if (oldList != GetListIndex(prevBlock->size))
++ {
++ prevBlock->size -= misssingAlignment;
++ RemoveFreeBlock(prevBlock);
++ prevBlock->size += misssingAlignment;
++ InsertFreeBlock(prevBlock);
++ }
++ else
++ m_BlocksFreeSize += misssingAlignment;
++ }
++ else
++ {
++ Block* newBlock = m_BlockAllocator.Alloc();
++ currentBlock->prevPhysical = newBlock;
++ prevBlock->nextPhysical = newBlock;
++ newBlock->prevPhysical = prevBlock;
++ newBlock->nextPhysical = currentBlock;
++ newBlock->size = misssingAlignment;
++ newBlock->offset = currentBlock->offset;
++ newBlock->MarkTaken();
++
++ InsertFreeBlock(newBlock);
++ }
++
++ currentBlock->size -= misssingAlignment;
++ currentBlock->offset += misssingAlignment;
++ }
++
++ VkDeviceSize size = request.size + debugMargin;
++ if (currentBlock->size == size)
++ {
++ if (currentBlock == m_NullBlock)
++ {
++ // Setup new null block
++ m_NullBlock = m_BlockAllocator.Alloc();
++ m_NullBlock->size = 0;
++ m_NullBlock->offset = currentBlock->offset + size;
++ m_NullBlock->prevPhysical = currentBlock;
++ m_NullBlock->nextPhysical = VMA_NULL;
++ m_NullBlock->MarkFree();
++ m_NullBlock->PrevFree() = VMA_NULL;
++ m_NullBlock->NextFree() = VMA_NULL;
++ currentBlock->nextPhysical = m_NullBlock;
++ currentBlock->MarkTaken();
++ }
++ }
++ else
++ {
++ VMA_ASSERT(currentBlock->size > size && "Proper block already found, shouldn't find smaller one!");
++
++ // Create new free block
++ Block* newBlock = m_BlockAllocator.Alloc();
++ newBlock->size = currentBlock->size - size;
++ newBlock->offset = currentBlock->offset + size;
++ newBlock->prevPhysical = currentBlock;
++ newBlock->nextPhysical = currentBlock->nextPhysical;
++ currentBlock->nextPhysical = newBlock;
++ currentBlock->size = size;
++
++ if (currentBlock == m_NullBlock)
++ {
++ m_NullBlock = newBlock;
++ m_NullBlock->MarkFree();
++ m_NullBlock->NextFree() = VMA_NULL;
++ m_NullBlock->PrevFree() = VMA_NULL;
++ currentBlock->MarkTaken();
++ }
++ else
++ {
++ newBlock->nextPhysical->prevPhysical = newBlock;
++ newBlock->MarkTaken();
++ InsertFreeBlock(newBlock);
++ }
++ }
++ currentBlock->UserData() = userData;
++
++ if (debugMargin > 0)
++ {
++ currentBlock->size -= debugMargin;
++ Block* newBlock = m_BlockAllocator.Alloc();
++ newBlock->size = debugMargin;
++ newBlock->offset = currentBlock->offset + currentBlock->size;
++ newBlock->prevPhysical = currentBlock;
++ newBlock->nextPhysical = currentBlock->nextPhysical;
++ newBlock->MarkTaken();
++ currentBlock->nextPhysical->prevPhysical = newBlock;
++ currentBlock->nextPhysical = newBlock;
++ InsertFreeBlock(newBlock);
++ }
++
++ if (!IsVirtual())
++ m_GranularityHandler.AllocPages((uint8_t)(uintptr_t)request.customData,
++ currentBlock->offset, currentBlock->size);
++ ++m_AllocCount;
++}
++
++void VmaBlockMetadata_TLSF::Free(VmaAllocHandle allocHandle)
++{
++ Block* block = (Block*)allocHandle;
++ Block* next = block->nextPhysical;
++ VMA_ASSERT(!block->IsFree() && "Block is already free!");
++
++ if (!IsVirtual())
++ m_GranularityHandler.FreePages(block->offset, block->size);
++ --m_AllocCount;
++
++ VkDeviceSize debugMargin = GetDebugMargin();
++ if (debugMargin > 0)
++ {
++ RemoveFreeBlock(next);
++ MergeBlock(next, block);
++ block = next;
++ next = next->nextPhysical;
++ }
++
++ // Try merging
++ Block* prev = block->prevPhysical;
++ if (prev != VMA_NULL && prev->IsFree() && prev->size != debugMargin)
++ {
++ RemoveFreeBlock(prev);
++ MergeBlock(block, prev);
++ }
++
++ if (!next->IsFree())
++ InsertFreeBlock(block);
++ else if (next == m_NullBlock)
++ MergeBlock(m_NullBlock, block);
++ else
++ {
++ RemoveFreeBlock(next);
++ MergeBlock(next, block);
++ InsertFreeBlock(next);
++ }
++}
++
++void VmaBlockMetadata_TLSF::GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo)
++{
++ Block* block = (Block*)allocHandle;
++ VMA_ASSERT(!block->IsFree() && "Cannot get allocation info for free block!");
++ outInfo.offset = block->offset;
++ outInfo.size = block->size;
++ outInfo.pUserData = block->UserData();
++}
++
++void* VmaBlockMetadata_TLSF::GetAllocationUserData(VmaAllocHandle allocHandle) const
++{
++ Block* block = (Block*)allocHandle;
++ VMA_ASSERT(!block->IsFree() && "Cannot get user data for free block!");
++ return block->UserData();
++}
++
++VmaAllocHandle VmaBlockMetadata_TLSF::GetAllocationListBegin() const
++{
++ if (m_AllocCount == 0)
++ return VK_NULL_HANDLE;
++
++ for (Block* block = m_NullBlock->prevPhysical; block; block = block->prevPhysical)
++ {
++ if (!block->IsFree())
++ return (VmaAllocHandle)block;
++ }
++ VMA_ASSERT(false && "If m_AllocCount > 0 then should find any allocation!");
++ return VK_NULL_HANDLE;
++}
++
++VmaAllocHandle VmaBlockMetadata_TLSF::GetNextAllocation(VmaAllocHandle prevAlloc) const
++{
++ Block* startBlock = (Block*)prevAlloc;
++ VMA_ASSERT(!startBlock->IsFree() && "Incorrect block!");
++
++ for (Block* block = startBlock->prevPhysical; block; block = block->prevPhysical)
++ {
++ if (!block->IsFree())
++ return (VmaAllocHandle)block;
++ }
++ return VK_NULL_HANDLE;
++}
++
++VkDeviceSize VmaBlockMetadata_TLSF::GetNextFreeRegionSize(VmaAllocHandle alloc) const
++{
++ Block* block = (Block*)alloc;
++ VMA_ASSERT(!block->IsFree() && "Incorrect block!");
++
++ if (block->prevPhysical)
++ return block->prevPhysical->IsFree() ? block->prevPhysical->size : 0;
++ return 0;
++}
++
++void VmaBlockMetadata_TLSF::Clear()
++{
++ m_AllocCount = 0;
++ m_BlocksFreeCount = 0;
++ m_BlocksFreeSize = 0;
++ m_IsFreeBitmap = 0;
++ m_NullBlock->offset = 0;
++ m_NullBlock->size = GetSize();
++ Block* block = m_NullBlock->prevPhysical;
++ m_NullBlock->prevPhysical = VMA_NULL;
++ while (block)
++ {
++ Block* prev = block->prevPhysical;
++ m_BlockAllocator.Free(block);
++ block = prev;
++ }
++ memset(m_FreeList, 0, m_ListsCount * sizeof(Block*));
++ memset(m_InnerIsFreeBitmap, 0, m_MemoryClasses * sizeof(uint32_t));
++ m_GranularityHandler.Clear();
++}
++
++void VmaBlockMetadata_TLSF::SetAllocationUserData(VmaAllocHandle allocHandle, void* userData)
++{
++ Block* block = (Block*)allocHandle;
++ VMA_ASSERT(!block->IsFree() && "Trying to set user data for not allocated block!");
++ block->UserData() = userData;
++}
++
++void VmaBlockMetadata_TLSF::DebugLogAllAllocations() const
++{
++ for (Block* block = m_NullBlock->prevPhysical; block != VMA_NULL; block = block->prevPhysical)
++ if (!block->IsFree())
++ DebugLogAllocation(block->offset, block->size, block->UserData());
++}
++
++uint8_t VmaBlockMetadata_TLSF::SizeToMemoryClass(VkDeviceSize size) const
++{
++ if (size > SMALL_BUFFER_SIZE)
++ return VMA_BITSCAN_MSB(size) - MEMORY_CLASS_SHIFT;
++ return 0;
++}
++
++uint16_t VmaBlockMetadata_TLSF::SizeToSecondIndex(VkDeviceSize size, uint8_t memoryClass) const
++{
++ if (memoryClass == 0)
++ {
++ if (IsVirtual())
++ return static_cast<uint16_t>((size - 1) / 8);
++ else
++ return static_cast<uint16_t>((size - 1) / 64);
++ }
++ return static_cast<uint16_t>((size >> (memoryClass + MEMORY_CLASS_SHIFT - SECOND_LEVEL_INDEX)) ^ (1U << SECOND_LEVEL_INDEX));
++}
++
++uint32_t VmaBlockMetadata_TLSF::GetListIndex(uint8_t memoryClass, uint16_t secondIndex) const
++{
++ if (memoryClass == 0)
++ return secondIndex;
++
++ const uint32_t index = static_cast<uint32_t>(memoryClass - 1) * (1 << SECOND_LEVEL_INDEX) + secondIndex;
++ if (IsVirtual())
++ return index + (1 << SECOND_LEVEL_INDEX);
++ else
++ return index + 4;
++}
++
++uint32_t VmaBlockMetadata_TLSF::GetListIndex(VkDeviceSize size) const
++{
++ uint8_t memoryClass = SizeToMemoryClass(size);
++ return GetListIndex(memoryClass, SizeToSecondIndex(size, memoryClass));
++}
++
++void VmaBlockMetadata_TLSF::RemoveFreeBlock(Block* block)
++{
++ VMA_ASSERT(block != m_NullBlock);
++ VMA_ASSERT(block->IsFree());
++
++ if (block->NextFree() != VMA_NULL)
++ block->NextFree()->PrevFree() = block->PrevFree();
++ if (block->PrevFree() != VMA_NULL)
++ block->PrevFree()->NextFree() = block->NextFree();
++ else
++ {
++ uint8_t memClass = SizeToMemoryClass(block->size);
++ uint16_t secondIndex = SizeToSecondIndex(block->size, memClass);
++ uint32_t index = GetListIndex(memClass, secondIndex);
++ VMA_ASSERT(m_FreeList[index] == block);
++ m_FreeList[index] = block->NextFree();
++ if (block->NextFree() == VMA_NULL)
++ {
++ m_InnerIsFreeBitmap[memClass] &= ~(1U << secondIndex);
++ if (m_InnerIsFreeBitmap[memClass] == 0)
++ m_IsFreeBitmap &= ~(1UL << memClass);
++ }
++ }
++ block->MarkTaken();
++ block->UserData() = VMA_NULL;
++ --m_BlocksFreeCount;
++ m_BlocksFreeSize -= block->size;
++}
++
++void VmaBlockMetadata_TLSF::InsertFreeBlock(Block* block)
++{
++ VMA_ASSERT(block != m_NullBlock);
++ VMA_ASSERT(!block->IsFree() && "Cannot insert block twice!");
++
++ uint8_t memClass = SizeToMemoryClass(block->size);
++ uint16_t secondIndex = SizeToSecondIndex(block->size, memClass);
++ uint32_t index = GetListIndex(memClass, secondIndex);
++ VMA_ASSERT(index < m_ListsCount);
++ block->PrevFree() = VMA_NULL;
++ block->NextFree() = m_FreeList[index];
++ m_FreeList[index] = block;
++ if (block->NextFree() != VMA_NULL)
++ block->NextFree()->PrevFree() = block;
++ else
++ {
++ m_InnerIsFreeBitmap[memClass] |= 1U << secondIndex;
++ m_IsFreeBitmap |= 1UL << memClass;
++ }
++ ++m_BlocksFreeCount;
++ m_BlocksFreeSize += block->size;
++}
++
++void VmaBlockMetadata_TLSF::MergeBlock(Block* block, Block* prev)
++{
++ VMA_ASSERT(block->prevPhysical == prev && "Cannot merge seperate physical regions!");
++ VMA_ASSERT(!prev->IsFree() && "Cannot merge block that belongs to free list!");
++
++ block->offset = prev->offset;
++ block->size += prev->size;
++ block->prevPhysical = prev->prevPhysical;
++ if (block->prevPhysical)
++ block->prevPhysical->nextPhysical = block;
++ m_BlockAllocator.Free(prev);
++}
++
++VmaBlockMetadata_TLSF::Block* VmaBlockMetadata_TLSF::FindFreeBlock(VkDeviceSize size, uint32_t& listIndex) const
++{
++ uint8_t memoryClass = SizeToMemoryClass(size);
++ uint32_t innerFreeMap = m_InnerIsFreeBitmap[memoryClass] & (~0U << SizeToSecondIndex(size, memoryClass));
++ if (!innerFreeMap)
++ {
++ // Check higher levels for avaiable blocks
++ uint32_t freeMap = m_IsFreeBitmap & (~0UL << (memoryClass + 1));
++ if (!freeMap)
++ return VMA_NULL; // No more memory avaible
++
++ // Find lowest free region
++ memoryClass = VMA_BITSCAN_LSB(freeMap);
++ innerFreeMap = m_InnerIsFreeBitmap[memoryClass];
++ VMA_ASSERT(innerFreeMap != 0);
++ }
++ // Find lowest free subregion
++ listIndex = GetListIndex(memoryClass, VMA_BITSCAN_LSB(innerFreeMap));
++ VMA_ASSERT(m_FreeList[listIndex]);
++ return m_FreeList[listIndex];
++}
++
++bool VmaBlockMetadata_TLSF::CheckBlock(
++ Block& block,
++ uint32_t listIndex,
++ VkDeviceSize allocSize,
++ VkDeviceSize allocAlignment,
++ VmaSuballocationType allocType,
++ VmaAllocationRequest* pAllocationRequest)
++{
++ VMA_ASSERT(block.IsFree() && "Block is already taken!");
++
++ VkDeviceSize alignedOffset = VmaAlignUp(block.offset, allocAlignment);
++ if (block.size < allocSize + alignedOffset - block.offset)
++ return false;
++
++ // Check for granularity conflicts
++ if (!IsVirtual() &&
++ m_GranularityHandler.CheckConflictAndAlignUp(alignedOffset, allocSize, block.offset, block.size, allocType))
++ return false;
++
++ // Alloc successful
++ pAllocationRequest->type = VmaAllocationRequestType::TLSF;
++ pAllocationRequest->allocHandle = (VmaAllocHandle)█
++ pAllocationRequest->size = allocSize - GetDebugMargin();
++ pAllocationRequest->customData = (void*)allocType;
++ pAllocationRequest->algorithmData = alignedOffset;
++
++ // Place block at the start of list if it's normal block
++ if (listIndex != m_ListsCount && block.PrevFree())
++ {
++ block.PrevFree()->NextFree() = block.NextFree();
++ if (block.NextFree())
++ block.NextFree()->PrevFree() = block.PrevFree();
++ block.PrevFree() = VMA_NULL;
++ block.NextFree() = m_FreeList[listIndex];
++ m_FreeList[listIndex] = █
++ if (block.NextFree())
++ block.NextFree()->PrevFree() = █
++ }
++
++ return true;
++}
++#endif // _VMA_BLOCK_METADATA_TLSF_FUNCTIONS
++#endif // _VMA_BLOCK_METADATA_TLSF
++
++#ifndef _VMA_BLOCK_VECTOR
++/*
++Sequence of VmaDeviceMemoryBlock. Represents memory blocks allocated for a specific
++Vulkan memory type.
++
++Synchronized internally with a mutex.
++*/
++class VmaBlockVector
++{
++ friend struct VmaDefragmentationContext_T;
++ VMA_CLASS_NO_COPY(VmaBlockVector)
++public:
++ VmaBlockVector(
++ VmaAllocator hAllocator,
++ VmaPool hParentPool,
++ uint32_t memoryTypeIndex,
++ VkDeviceSize preferredBlockSize,
++ size_t minBlockCount,
++ size_t maxBlockCount,
++ VkDeviceSize bufferImageGranularity,
++ bool explicitBlockSize,
++ uint32_t algorithm,
++ float priority,
++ VkDeviceSize minAllocationAlignment,
++ void* pMemoryAllocateNext);
++ ~VmaBlockVector();
++
++ VmaAllocator GetAllocator() const { return m_hAllocator; }
++ VmaPool GetParentPool() const { return m_hParentPool; }
++ bool IsCustomPool() const { return m_hParentPool != VMA_NULL; }
++ uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; }
++ VkDeviceSize GetPreferredBlockSize() const { return m_PreferredBlockSize; }
++ VkDeviceSize GetBufferImageGranularity() const { return m_BufferImageGranularity; }
++ uint32_t GetAlgorithm() const { return m_Algorithm; }
++ bool HasExplicitBlockSize() const { return m_ExplicitBlockSize; }
++ float GetPriority() const { return m_Priority; }
++ const void* GetAllocationNextPtr() const { return m_pMemoryAllocateNext; }
++ // To be used only while the m_Mutex is locked. Used during defragmentation.
++ size_t GetBlockCount() const { return m_Blocks.size(); }
++ // To be used only while the m_Mutex is locked. Used during defragmentation.
++ VmaDeviceMemoryBlock* GetBlock(size_t index) const { return m_Blocks[index]; }
++ VMA_RW_MUTEX &GetMutex() { return m_Mutex; }
++
++ VkResult CreateMinBlocks();
++ void AddStatistics(VmaStatistics& inoutStats);
++ void AddDetailedStatistics(VmaDetailedStatistics& inoutStats);
++ bool IsEmpty();
++ bool IsCorruptionDetectionEnabled() const;
++
++ VkResult Allocate(
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ const VmaAllocationCreateInfo& createInfo,
++ VmaSuballocationType suballocType,
++ size_t allocationCount,
++ VmaAllocation* pAllocations);
++
++ void Free(const VmaAllocation hAllocation);
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMap(class VmaJsonWriter& json);
++#endif
++
++ VkResult CheckCorruption();
++
++private:
++ const VmaAllocator m_hAllocator;
++ const VmaPool m_hParentPool;
++ const uint32_t m_MemoryTypeIndex;
++ const VkDeviceSize m_PreferredBlockSize;
++ const size_t m_MinBlockCount;
++ const size_t m_MaxBlockCount;
++ const VkDeviceSize m_BufferImageGranularity;
++ const bool m_ExplicitBlockSize;
++ const uint32_t m_Algorithm;
++ const float m_Priority;
++ const VkDeviceSize m_MinAllocationAlignment;
++
++ void* const m_pMemoryAllocateNext;
++ VMA_RW_MUTEX m_Mutex;
++ // Incrementally sorted by sumFreeSize, ascending.
++ VmaVector<VmaDeviceMemoryBlock*, VmaStlAllocator<VmaDeviceMemoryBlock*>> m_Blocks;
++ uint32_t m_NextBlockId;
++ bool m_IncrementalSort = true;
++
++ void SetIncrementalSort(bool val) { m_IncrementalSort = val; }
++
++ VkDeviceSize CalcMaxBlockSize() const;
++ // Finds and removes given block from vector.
++ void Remove(VmaDeviceMemoryBlock* pBlock);
++ // Performs single step in sorting m_Blocks. They may not be fully sorted
++ // after this call.
++ void IncrementallySortBlocks();
++ void SortByFreeSize();
++
++ VkResult AllocatePage(
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ const VmaAllocationCreateInfo& createInfo,
++ VmaSuballocationType suballocType,
++ VmaAllocation* pAllocation);
++
++ VkResult AllocateFromBlock(
++ VmaDeviceMemoryBlock* pBlock,
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ VmaAllocationCreateFlags allocFlags,
++ void* pUserData,
++ VmaSuballocationType suballocType,
++ uint32_t strategy,
++ VmaAllocation* pAllocation);
++
++ VkResult CommitAllocationRequest(
++ VmaAllocationRequest& allocRequest,
++ VmaDeviceMemoryBlock* pBlock,
++ VkDeviceSize alignment,
++ VmaAllocationCreateFlags allocFlags,
++ void* pUserData,
++ VmaSuballocationType suballocType,
++ VmaAllocation* pAllocation);
++
++ VkResult CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex);
++ bool HasEmptyBlock();
++};
++#endif // _VMA_BLOCK_VECTOR
++
++#ifndef _VMA_DEFRAGMENTATION_CONTEXT
++struct VmaDefragmentationContext_T
++{
++ VMA_CLASS_NO_COPY(VmaDefragmentationContext_T)
++public:
++ VmaDefragmentationContext_T(
++ VmaAllocator hAllocator,
++ const VmaDefragmentationInfo& info);
++ ~VmaDefragmentationContext_T();
++
++ void GetStats(VmaDefragmentationStats& outStats) { outStats = m_GlobalStats; }
++
++ VkResult DefragmentPassBegin(VmaDefragmentationPassMoveInfo& moveInfo);
++ VkResult DefragmentPassEnd(VmaDefragmentationPassMoveInfo& moveInfo);
++
++private:
++ // Max number of allocations to ignore due to size constraints before ending single pass
++ static const uint8_t MAX_ALLOCS_TO_IGNORE = 16;
++ enum class CounterStatus { Pass, Ignore, End };
++
++ struct FragmentedBlock
++ {
++ uint32_t data;
++ VmaDeviceMemoryBlock* block;
++ };
++ struct StateBalanced
++ {
++ VkDeviceSize avgFreeSize = 0;
++ VkDeviceSize avgAllocSize = UINT64_MAX;
++ };
++ struct StateExtensive
++ {
++ enum class Operation : uint8_t
++ {
++ FindFreeBlockBuffer, FindFreeBlockTexture, FindFreeBlockAll,
++ MoveBuffers, MoveTextures, MoveAll,
++ Cleanup, Done
++ };
++
++ Operation operation = Operation::FindFreeBlockTexture;
++ size_t firstFreeBlock = SIZE_MAX;
++ };
++ struct MoveAllocationData
++ {
++ VkDeviceSize size;
++ VkDeviceSize alignment;
++ VmaSuballocationType type;
++ VmaAllocationCreateFlags flags;
++ VmaDefragmentationMove move = {};
++ };
++
++ const VkDeviceSize m_MaxPassBytes;
++ const uint32_t m_MaxPassAllocations;
++
++ VmaStlAllocator<VmaDefragmentationMove> m_MoveAllocator;
++ VmaVector<VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove>> m_Moves;
++
++ uint8_t m_IgnoredAllocs = 0;
++ uint32_t m_Algorithm;
++ uint32_t m_BlockVectorCount;
++ VmaBlockVector* m_PoolBlockVector;
++ VmaBlockVector** m_pBlockVectors;
++ size_t m_ImmovableBlockCount = 0;
++ VmaDefragmentationStats m_GlobalStats = { 0 };
++ VmaDefragmentationStats m_PassStats = { 0 };
++ void* m_AlgorithmState = VMA_NULL;
++
++ static MoveAllocationData GetMoveData(VmaAllocHandle handle, VmaBlockMetadata* metadata);
++ CounterStatus CheckCounters(VkDeviceSize bytes);
++ bool IncrementCounters(VkDeviceSize bytes);
++ bool ReallocWithinBlock(VmaBlockVector& vector, VmaDeviceMemoryBlock* block);
++ bool AllocInOtherBlock(size_t start, size_t end, MoveAllocationData& data, VmaBlockVector& vector);
++
++ bool ComputeDefragmentation(VmaBlockVector& vector, size_t index);
++ bool ComputeDefragmentation_Fast(VmaBlockVector& vector);
++ bool ComputeDefragmentation_Balanced(VmaBlockVector& vector, size_t index, bool update);
++ bool ComputeDefragmentation_Full(VmaBlockVector& vector);
++ bool ComputeDefragmentation_Extensive(VmaBlockVector& vector, size_t index);
++
++ void UpdateVectorStatistics(VmaBlockVector& vector, StateBalanced& state);
++ bool MoveDataToFreeBlocks(VmaSuballocationType currentType,
++ VmaBlockVector& vector, size_t firstFreeBlock,
++ bool& texturePresent, bool& bufferPresent, bool& otherPresent);
++};
++#endif // _VMA_DEFRAGMENTATION_CONTEXT
++
++#ifndef _VMA_POOL_T
++struct VmaPool_T
++{
++ friend struct VmaPoolListItemTraits;
++ VMA_CLASS_NO_COPY(VmaPool_T)
++public:
++ VmaBlockVector m_BlockVector;
++ VmaDedicatedAllocationList m_DedicatedAllocations;
++
++ VmaPool_T(
++ VmaAllocator hAllocator,
++ const VmaPoolCreateInfo& createInfo,
++ VkDeviceSize preferredBlockSize);
++ ~VmaPool_T();
++
++ uint32_t GetId() const { return m_Id; }
++ void SetId(uint32_t id) { VMA_ASSERT(m_Id == 0); m_Id = id; }
++
++ const char* GetName() const { return m_Name; }
++ void SetName(const char* pName);
++
++#if VMA_STATS_STRING_ENABLED
++ //void PrintDetailedMap(class VmaStringBuilder& sb);
++#endif
++
++private:
++ uint32_t m_Id;
++ char* m_Name;
++ VmaPool_T* m_PrevPool = VMA_NULL;
++ VmaPool_T* m_NextPool = VMA_NULL;
++};
++
++struct VmaPoolListItemTraits
++{
++ typedef VmaPool_T ItemType;
++
++ static ItemType* GetPrev(const ItemType* item) { return item->m_PrevPool; }
++ static ItemType* GetNext(const ItemType* item) { return item->m_NextPool; }
++ static ItemType*& AccessPrev(ItemType* item) { return item->m_PrevPool; }
++ static ItemType*& AccessNext(ItemType* item) { return item->m_NextPool; }
++};
++#endif // _VMA_POOL_T
++
++#ifndef _VMA_CURRENT_BUDGET_DATA
++struct VmaCurrentBudgetData
++{
++ VMA_ATOMIC_UINT32 m_BlockCount[VK_MAX_MEMORY_HEAPS];
++ VMA_ATOMIC_UINT32 m_AllocationCount[VK_MAX_MEMORY_HEAPS];
++ VMA_ATOMIC_UINT64 m_BlockBytes[VK_MAX_MEMORY_HEAPS];
++ VMA_ATOMIC_UINT64 m_AllocationBytes[VK_MAX_MEMORY_HEAPS];
++
++#if VMA_MEMORY_BUDGET
++ VMA_ATOMIC_UINT32 m_OperationsSinceBudgetFetch;
++ VMA_RW_MUTEX m_BudgetMutex;
++ uint64_t m_VulkanUsage[VK_MAX_MEMORY_HEAPS];
++ uint64_t m_VulkanBudget[VK_MAX_MEMORY_HEAPS];
++ uint64_t m_BlockBytesAtBudgetFetch[VK_MAX_MEMORY_HEAPS];
++#endif // VMA_MEMORY_BUDGET
++
++ VmaCurrentBudgetData();
++
++ void AddAllocation(uint32_t heapIndex, VkDeviceSize allocationSize);
++ void RemoveAllocation(uint32_t heapIndex, VkDeviceSize allocationSize);
++};
++
++#ifndef _VMA_CURRENT_BUDGET_DATA_FUNCTIONS
++VmaCurrentBudgetData::VmaCurrentBudgetData()
++{
++ for (uint32_t heapIndex = 0; heapIndex < VK_MAX_MEMORY_HEAPS; ++heapIndex)
++ {
++ m_BlockCount[heapIndex] = 0;
++ m_AllocationCount[heapIndex] = 0;
++ m_BlockBytes[heapIndex] = 0;
++ m_AllocationBytes[heapIndex] = 0;
++#if VMA_MEMORY_BUDGET
++ m_VulkanUsage[heapIndex] = 0;
++ m_VulkanBudget[heapIndex] = 0;
++ m_BlockBytesAtBudgetFetch[heapIndex] = 0;
++#endif
++ }
++
++#if VMA_MEMORY_BUDGET
++ m_OperationsSinceBudgetFetch = 0;
++#endif
++}
++
++void VmaCurrentBudgetData::AddAllocation(uint32_t heapIndex, VkDeviceSize allocationSize)
++{
++ m_AllocationBytes[heapIndex] += allocationSize;
++ ++m_AllocationCount[heapIndex];
++#if VMA_MEMORY_BUDGET
++ ++m_OperationsSinceBudgetFetch;
++#endif
++}
++
++void VmaCurrentBudgetData::RemoveAllocation(uint32_t heapIndex, VkDeviceSize allocationSize)
++{
++ VMA_ASSERT(m_AllocationBytes[heapIndex] >= allocationSize);
++ m_AllocationBytes[heapIndex] -= allocationSize;
++ VMA_ASSERT(m_AllocationCount[heapIndex] > 0);
++ --m_AllocationCount[heapIndex];
++#if VMA_MEMORY_BUDGET
++ ++m_OperationsSinceBudgetFetch;
++#endif
++}
++#endif // _VMA_CURRENT_BUDGET_DATA_FUNCTIONS
++#endif // _VMA_CURRENT_BUDGET_DATA
++
++#ifndef _VMA_ALLOCATION_OBJECT_ALLOCATOR
++/*
++Thread-safe wrapper over VmaPoolAllocator free list, for allocation of VmaAllocation_T objects.
++*/
++class VmaAllocationObjectAllocator
++{
++ VMA_CLASS_NO_COPY(VmaAllocationObjectAllocator)
++public:
++ VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks)
++ : m_Allocator(pAllocationCallbacks, 1024) {}
++
++ template<typename... Types> VmaAllocation Allocate(Types&&... args);
++ void Free(VmaAllocation hAlloc);
++
++private:
++ VMA_MUTEX m_Mutex;
++ VmaPoolAllocator<VmaAllocation_T> m_Allocator;
++};
++
++template<typename... Types>
++VmaAllocation VmaAllocationObjectAllocator::Allocate(Types&&... args)
++{
++ VmaMutexLock mutexLock(m_Mutex);
++ return m_Allocator.Alloc<Types...>(std::forward<Types>(args)...);
++}
++
++void VmaAllocationObjectAllocator::Free(VmaAllocation hAlloc)
++{
++ VmaMutexLock mutexLock(m_Mutex);
++ m_Allocator.Free(hAlloc);
++}
++#endif // _VMA_ALLOCATION_OBJECT_ALLOCATOR
++
++#ifndef _VMA_VIRTUAL_BLOCK_T
++struct VmaVirtualBlock_T
++{
++ VMA_CLASS_NO_COPY(VmaVirtualBlock_T)
++public:
++ const bool m_AllocationCallbacksSpecified;
++ const VkAllocationCallbacks m_AllocationCallbacks;
++
++ VmaVirtualBlock_T(const VmaVirtualBlockCreateInfo& createInfo);
++ ~VmaVirtualBlock_T();
++
++ VkResult Init() { return VK_SUCCESS; }
++ bool IsEmpty() const { return m_Metadata->IsEmpty(); }
++ void Free(VmaVirtualAllocation allocation) { m_Metadata->Free((VmaAllocHandle)allocation); }
++ void SetAllocationUserData(VmaVirtualAllocation allocation, void* userData) { m_Metadata->SetAllocationUserData((VmaAllocHandle)allocation, userData); }
++ void Clear() { m_Metadata->Clear(); }
++
++ const VkAllocationCallbacks* GetAllocationCallbacks() const;
++ void GetAllocationInfo(VmaVirtualAllocation allocation, VmaVirtualAllocationInfo& outInfo);
++ VkResult Allocate(const VmaVirtualAllocationCreateInfo& createInfo, VmaVirtualAllocation& outAllocation,
++ VkDeviceSize* outOffset);
++ void GetStatistics(VmaStatistics& outStats) const;
++ void CalculateDetailedStatistics(VmaDetailedStatistics& outStats) const;
++#if VMA_STATS_STRING_ENABLED
++ void BuildStatsString(bool detailedMap, VmaStringBuilder& sb) const;
++#endif
++
++private:
++ VmaBlockMetadata* m_Metadata;
++};
++
++#ifndef _VMA_VIRTUAL_BLOCK_T_FUNCTIONS
++VmaVirtualBlock_T::VmaVirtualBlock_T(const VmaVirtualBlockCreateInfo& createInfo)
++ : m_AllocationCallbacksSpecified(createInfo.pAllocationCallbacks != VMA_NULL),
++ m_AllocationCallbacks(createInfo.pAllocationCallbacks != VMA_NULL ? *createInfo.pAllocationCallbacks : VmaEmptyAllocationCallbacks)
++{
++ const uint32_t algorithm = createInfo.flags & VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK;
++ switch (algorithm)
++ {
++ default:
++ VMA_ASSERT(0);
++ case 0:
++ m_Metadata = vma_new(GetAllocationCallbacks(), VmaBlockMetadata_TLSF)(VK_NULL_HANDLE, 1, true);
++ break;
++ case VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT:
++ m_Metadata = vma_new(GetAllocationCallbacks(), VmaBlockMetadata_Linear)(VK_NULL_HANDLE, 1, true);
++ break;
++ }
++
++ m_Metadata->Init(createInfo.size);
++}
++
++VmaVirtualBlock_T::~VmaVirtualBlock_T()
++{
++ // Define macro VMA_DEBUG_LOG to receive the list of the unfreed allocations
++ if (!m_Metadata->IsEmpty())
++ m_Metadata->DebugLogAllAllocations();
++ // This is the most important assert in the entire library.
++ // Hitting it means you have some memory leak - unreleased virtual allocations.
++ VMA_ASSERT(m_Metadata->IsEmpty() && "Some virtual allocations were not freed before destruction of this virtual block!");
++
++ vma_delete(GetAllocationCallbacks(), m_Metadata);
++}
++
++const VkAllocationCallbacks* VmaVirtualBlock_T::GetAllocationCallbacks() const
++{
++ return m_AllocationCallbacksSpecified ? &m_AllocationCallbacks : VMA_NULL;
++}
++
++void VmaVirtualBlock_T::GetAllocationInfo(VmaVirtualAllocation allocation, VmaVirtualAllocationInfo& outInfo)
++{
++ m_Metadata->GetAllocationInfo((VmaAllocHandle)allocation, outInfo);
++}
++
++VkResult VmaVirtualBlock_T::Allocate(const VmaVirtualAllocationCreateInfo& createInfo, VmaVirtualAllocation& outAllocation,
++ VkDeviceSize* outOffset)
++{
++ VmaAllocationRequest request = {};
++ if (m_Metadata->CreateAllocationRequest(
++ createInfo.size, // allocSize
++ VMA_MAX(createInfo.alignment, (VkDeviceSize)1), // allocAlignment
++ (createInfo.flags & VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0, // upperAddress
++ VMA_SUBALLOCATION_TYPE_UNKNOWN, // allocType - unimportant
++ createInfo.flags & VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK, // strategy
++ &request))
++ {
++ m_Metadata->Alloc(request,
++ VMA_SUBALLOCATION_TYPE_UNKNOWN, // type - unimportant
++ createInfo.pUserData);
++ outAllocation = (VmaVirtualAllocation)request.allocHandle;
++ if(outOffset)
++ *outOffset = m_Metadata->GetAllocationOffset(request.allocHandle);
++ return VK_SUCCESS;
++ }
++ outAllocation = (VmaVirtualAllocation)VK_NULL_HANDLE;
++ if (outOffset)
++ *outOffset = UINT64_MAX;
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++}
++
++void VmaVirtualBlock_T::GetStatistics(VmaStatistics& outStats) const
++{
++ VmaClearStatistics(outStats);
++ m_Metadata->AddStatistics(outStats);
++}
++
++void VmaVirtualBlock_T::CalculateDetailedStatistics(VmaDetailedStatistics& outStats) const
++{
++ VmaClearDetailedStatistics(outStats);
++ m_Metadata->AddDetailedStatistics(outStats);
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaVirtualBlock_T::BuildStatsString(bool detailedMap, VmaStringBuilder& sb) const
++{
++ VmaJsonWriter json(GetAllocationCallbacks(), sb);
++ json.BeginObject();
++
++ VmaDetailedStatistics stats;
++ CalculateDetailedStatistics(stats);
++
++ json.WriteString("Stats");
++ VmaPrintDetailedStatistics(json, stats);
++
++ if (detailedMap)
++ {
++ json.WriteString("Details");
++ json.BeginObject();
++ m_Metadata->PrintDetailedMap(json);
++ json.EndObject();
++ }
++
++ json.EndObject();
++}
++#endif // VMA_STATS_STRING_ENABLED
++#endif // _VMA_VIRTUAL_BLOCK_T_FUNCTIONS
++#endif // _VMA_VIRTUAL_BLOCK_T
++
++
++// Main allocator object.
++struct VmaAllocator_T
++{
++ VMA_CLASS_NO_COPY(VmaAllocator_T)
++public:
++ bool m_UseMutex;
++ uint32_t m_VulkanApiVersion;
++ bool m_UseKhrDedicatedAllocation; // Can be set only if m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0).
++ bool m_UseKhrBindMemory2; // Can be set only if m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0).
++ bool m_UseExtMemoryBudget;
++ bool m_UseAmdDeviceCoherentMemory;
++ bool m_UseKhrBufferDeviceAddress;
++ bool m_UseExtMemoryPriority;
++ VkDevice m_hDevice;
++ VkInstance m_hInstance;
++ bool m_AllocationCallbacksSpecified;
++ VkAllocationCallbacks m_AllocationCallbacks;
++ VmaDeviceMemoryCallbacks m_DeviceMemoryCallbacks;
++ VmaAllocationObjectAllocator m_AllocationObjectAllocator;
++
++ // Each bit (1 << i) is set if HeapSizeLimit is enabled for that heap, so cannot allocate more than the heap size.
++ uint32_t m_HeapSizeLimitMask;
++
++ VkPhysicalDeviceProperties m_PhysicalDeviceProperties;
++ VkPhysicalDeviceMemoryProperties m_MemProps;
++
++ // Default pools.
++ VmaBlockVector* m_pBlockVectors[VK_MAX_MEMORY_TYPES];
++ VmaDedicatedAllocationList m_DedicatedAllocations[VK_MAX_MEMORY_TYPES];
++
++ VmaCurrentBudgetData m_Budget;
++ VMA_ATOMIC_UINT32 m_DeviceMemoryCount; // Total number of VkDeviceMemory objects.
++
++ VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo);
++ VkResult Init(const VmaAllocatorCreateInfo* pCreateInfo);
++ ~VmaAllocator_T();
++
++ const VkAllocationCallbacks* GetAllocationCallbacks() const
++ {
++ return m_AllocationCallbacksSpecified ? &m_AllocationCallbacks : VMA_NULL;
++ }
++ const VmaVulkanFunctions& GetVulkanFunctions() const
++ {
++ return m_VulkanFunctions;
++ }
++
++ VkPhysicalDevice GetPhysicalDevice() const { return m_PhysicalDevice; }
++
++ VkDeviceSize GetBufferImageGranularity() const
++ {
++ return VMA_MAX(
++ static_cast<VkDeviceSize>(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY),
++ m_PhysicalDeviceProperties.limits.bufferImageGranularity);
++ }
++
++ uint32_t GetMemoryHeapCount() const { return m_MemProps.memoryHeapCount; }
++ uint32_t GetMemoryTypeCount() const { return m_MemProps.memoryTypeCount; }
++
++ uint32_t MemoryTypeIndexToHeapIndex(uint32_t memTypeIndex) const
++ {
++ VMA_ASSERT(memTypeIndex < m_MemProps.memoryTypeCount);
++ return m_MemProps.memoryTypes[memTypeIndex].heapIndex;
++ }
++ // True when specific memory type is HOST_VISIBLE but not HOST_COHERENT.
++ bool IsMemoryTypeNonCoherent(uint32_t memTypeIndex) const
++ {
++ return (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) ==
++ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
++ }
++ // Minimum alignment for all allocations in specific memory type.
++ VkDeviceSize GetMemoryTypeMinAlignment(uint32_t memTypeIndex) const
++ {
++ return IsMemoryTypeNonCoherent(memTypeIndex) ?
++ VMA_MAX((VkDeviceSize)VMA_MIN_ALIGNMENT, m_PhysicalDeviceProperties.limits.nonCoherentAtomSize) :
++ (VkDeviceSize)VMA_MIN_ALIGNMENT;
++ }
++
++ bool IsIntegratedGpu() const
++ {
++ return m_PhysicalDeviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
++ }
++
++ uint32_t GetGlobalMemoryTypeBits() const { return m_GlobalMemoryTypeBits; }
++
++ void GetBufferMemoryRequirements(
++ VkBuffer hBuffer,
++ VkMemoryRequirements& memReq,
++ bool& requiresDedicatedAllocation,
++ bool& prefersDedicatedAllocation) const;
++ void GetImageMemoryRequirements(
++ VkImage hImage,
++ VkMemoryRequirements& memReq,
++ bool& requiresDedicatedAllocation,
++ bool& prefersDedicatedAllocation) const;
++ VkResult FindMemoryTypeIndex(
++ uint32_t memoryTypeBits,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ VkFlags bufImgUsage, // VkBufferCreateInfo::usage or VkImageCreateInfo::usage. UINT32_MAX if unknown.
++ uint32_t* pMemoryTypeIndex) const;
++
++ // Main allocation function.
++ VkResult AllocateMemory(
++ const VkMemoryRequirements& vkMemReq,
++ bool requiresDedicatedAllocation,
++ bool prefersDedicatedAllocation,
++ VkBuffer dedicatedBuffer,
++ VkImage dedicatedImage,
++ VkFlags dedicatedBufferImageUsage, // UINT32_MAX if unknown.
++ const VmaAllocationCreateInfo& createInfo,
++ VmaSuballocationType suballocType,
++ size_t allocationCount,
++ VmaAllocation* pAllocations);
++
++ // Main deallocation function.
++ void FreeMemory(
++ size_t allocationCount,
++ const VmaAllocation* pAllocations);
++
++ void CalculateStatistics(VmaTotalStatistics* pStats);
++
++ void GetHeapBudgets(
++ VmaBudget* outBudgets, uint32_t firstHeap, uint32_t heapCount);
++
++#if VMA_STATS_STRING_ENABLED
++ void PrintDetailedMap(class VmaJsonWriter& json);
++#endif
++
++ void GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo);
++
++ VkResult CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool);
++ void DestroyPool(VmaPool pool);
++ void GetPoolStatistics(VmaPool pool, VmaStatistics* pPoolStats);
++ void CalculatePoolStatistics(VmaPool pool, VmaDetailedStatistics* pPoolStats);
++
++ void SetCurrentFrameIndex(uint32_t frameIndex);
++ uint32_t GetCurrentFrameIndex() const { return m_CurrentFrameIndex.load(); }
++
++ VkResult CheckPoolCorruption(VmaPool hPool);
++ VkResult CheckCorruption(uint32_t memoryTypeBits);
++
++ // Call to Vulkan function vkAllocateMemory with accompanying bookkeeping.
++ VkResult AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory);
++ // Call to Vulkan function vkFreeMemory with accompanying bookkeeping.
++ void FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory);
++ // Call to Vulkan function vkBindBufferMemory or vkBindBufferMemory2KHR.
++ VkResult BindVulkanBuffer(
++ VkDeviceMemory memory,
++ VkDeviceSize memoryOffset,
++ VkBuffer buffer,
++ const void* pNext);
++ // Call to Vulkan function vkBindImageMemory or vkBindImageMemory2KHR.
++ VkResult BindVulkanImage(
++ VkDeviceMemory memory,
++ VkDeviceSize memoryOffset,
++ VkImage image,
++ const void* pNext);
++
++ VkResult Map(VmaAllocation hAllocation, void** ppData);
++ void Unmap(VmaAllocation hAllocation);
++
++ VkResult BindBufferMemory(
++ VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkBuffer hBuffer,
++ const void* pNext);
++ VkResult BindImageMemory(
++ VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkImage hImage,
++ const void* pNext);
++
++ VkResult FlushOrInvalidateAllocation(
++ VmaAllocation hAllocation,
++ VkDeviceSize offset, VkDeviceSize size,
++ VMA_CACHE_OPERATION op);
++ VkResult FlushOrInvalidateAllocations(
++ uint32_t allocationCount,
++ const VmaAllocation* allocations,
++ const VkDeviceSize* offsets, const VkDeviceSize* sizes,
++ VMA_CACHE_OPERATION op);
++
++ void FillAllocation(const VmaAllocation hAllocation, uint8_t pattern);
++
++ /*
++ Returns bit mask of memory types that can support defragmentation on GPU as
++ they support creation of required buffer for copy operations.
++ */
++ uint32_t GetGpuDefragmentationMemoryTypeBits();
++
++#if VMA_EXTERNAL_MEMORY
++ VkExternalMemoryHandleTypeFlagsKHR GetExternalMemoryHandleTypeFlags(uint32_t memTypeIndex) const
++ {
++ return m_TypeExternalMemoryHandleTypes[memTypeIndex];
++ }
++#endif // #if VMA_EXTERNAL_MEMORY
++
++private:
++ VkDeviceSize m_PreferredLargeHeapBlockSize;
++
++ VkPhysicalDevice m_PhysicalDevice;
++ VMA_ATOMIC_UINT32 m_CurrentFrameIndex;
++ VMA_ATOMIC_UINT32 m_GpuDefragmentationMemoryTypeBits; // UINT32_MAX means uninitialized.
++#if VMA_EXTERNAL_MEMORY
++ VkExternalMemoryHandleTypeFlagsKHR m_TypeExternalMemoryHandleTypes[VK_MAX_MEMORY_TYPES];
++#endif // #if VMA_EXTERNAL_MEMORY
++
++ VMA_RW_MUTEX m_PoolsMutex;
++ typedef VmaIntrusiveLinkedList<VmaPoolListItemTraits> PoolList;
++ // Protected by m_PoolsMutex.
++ PoolList m_Pools;
++ uint32_t m_NextPoolId;
++
++ VmaVulkanFunctions m_VulkanFunctions;
++
++ // Global bit mask AND-ed with any memoryTypeBits to disallow certain memory types.
++ uint32_t m_GlobalMemoryTypeBits;
++
++ void ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions);
++
++#if VMA_STATIC_VULKAN_FUNCTIONS == 1
++ void ImportVulkanFunctions_Static();
++#endif
++
++ void ImportVulkanFunctions_Custom(const VmaVulkanFunctions* pVulkanFunctions);
++
++#if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
++ void ImportVulkanFunctions_Dynamic();
++#endif
++
++ void ValidateVulkanFunctions();
++
++ VkDeviceSize CalcPreferredBlockSize(uint32_t memTypeIndex);
++
++ VkResult AllocateMemoryOfType(
++ VmaPool pool,
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ bool dedicatedPreferred,
++ VkBuffer dedicatedBuffer,
++ VkImage dedicatedImage,
++ VkFlags dedicatedBufferImageUsage,
++ const VmaAllocationCreateInfo& createInfo,
++ uint32_t memTypeIndex,
++ VmaSuballocationType suballocType,
++ VmaDedicatedAllocationList& dedicatedAllocations,
++ VmaBlockVector& blockVector,
++ size_t allocationCount,
++ VmaAllocation* pAllocations);
++
++ // Helper function only to be used inside AllocateDedicatedMemory.
++ VkResult AllocateDedicatedMemoryPage(
++ VmaPool pool,
++ VkDeviceSize size,
++ VmaSuballocationType suballocType,
++ uint32_t memTypeIndex,
++ const VkMemoryAllocateInfo& allocInfo,
++ bool map,
++ bool isUserDataString,
++ bool isMappingAllowed,
++ void* pUserData,
++ VmaAllocation* pAllocation);
++
++ // Allocates and registers new VkDeviceMemory specifically for dedicated allocations.
++ VkResult AllocateDedicatedMemory(
++ VmaPool pool,
++ VkDeviceSize size,
++ VmaSuballocationType suballocType,
++ VmaDedicatedAllocationList& dedicatedAllocations,
++ uint32_t memTypeIndex,
++ bool map,
++ bool isUserDataString,
++ bool isMappingAllowed,
++ bool canAliasMemory,
++ void* pUserData,
++ float priority,
++ VkBuffer dedicatedBuffer,
++ VkImage dedicatedImage,
++ VkFlags dedicatedBufferImageUsage,
++ size_t allocationCount,
++ VmaAllocation* pAllocations,
++ const void* pNextChain = nullptr);
++
++ void FreeDedicatedMemory(const VmaAllocation allocation);
++
++ VkResult CalcMemTypeParams(
++ VmaAllocationCreateInfo& outCreateInfo,
++ uint32_t memTypeIndex,
++ VkDeviceSize size,
++ size_t allocationCount);
++ VkResult CalcAllocationParams(
++ VmaAllocationCreateInfo& outCreateInfo,
++ bool dedicatedRequired,
++ bool dedicatedPreferred);
++
++ /*
++ Calculates and returns bit mask of memory types that can support defragmentation
++ on GPU as they support creation of required buffer for copy operations.
++ */
++ uint32_t CalculateGpuDefragmentationMemoryTypeBits() const;
++ uint32_t CalculateGlobalMemoryTypeBits() const;
++
++ bool GetFlushOrInvalidateRange(
++ VmaAllocation allocation,
++ VkDeviceSize offset, VkDeviceSize size,
++ VkMappedMemoryRange& outRange) const;
++
++#if VMA_MEMORY_BUDGET
++ void UpdateVulkanBudget();
++#endif // #if VMA_MEMORY_BUDGET
++};
++
++
++#ifndef _VMA_MEMORY_FUNCTIONS
++static void* VmaMalloc(VmaAllocator hAllocator, size_t size, size_t alignment)
++{
++ return VmaMalloc(&hAllocator->m_AllocationCallbacks, size, alignment);
++}
++
++static void VmaFree(VmaAllocator hAllocator, void* ptr)
++{
++ VmaFree(&hAllocator->m_AllocationCallbacks, ptr);
++}
++
++template<typename T>
++static T* VmaAllocate(VmaAllocator hAllocator)
++{
++ return (T*)VmaMalloc(hAllocator, sizeof(T), VMA_ALIGN_OF(T));
++}
++
++template<typename T>
++static T* VmaAllocateArray(VmaAllocator hAllocator, size_t count)
++{
++ return (T*)VmaMalloc(hAllocator, sizeof(T) * count, VMA_ALIGN_OF(T));
++}
++
++template<typename T>
++static void vma_delete(VmaAllocator hAllocator, T* ptr)
++{
++ if(ptr != VMA_NULL)
++ {
++ ptr->~T();
++ VmaFree(hAllocator, ptr);
++ }
++}
++
++template<typename T>
++static void vma_delete_array(VmaAllocator hAllocator, T* ptr, size_t count)
++{
++ if(ptr != VMA_NULL)
++ {
++ for(size_t i = count; i--; )
++ ptr[i].~T();
++ VmaFree(hAllocator, ptr);
++ }
++}
++#endif // _VMA_MEMORY_FUNCTIONS
++
++#ifndef _VMA_DEVICE_MEMORY_BLOCK_FUNCTIONS
++VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator hAllocator)
++ : m_pMetadata(VMA_NULL),
++ m_MemoryTypeIndex(UINT32_MAX),
++ m_Id(0),
++ m_hMemory(VK_NULL_HANDLE),
++ m_MapCount(0),
++ m_pMappedData(VMA_NULL) {}
++
++VmaDeviceMemoryBlock::~VmaDeviceMemoryBlock()
++{
++ VMA_ASSERT(m_MapCount == 0 && "VkDeviceMemory block is being destroyed while it is still mapped.");
++ VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
++}
++
++void VmaDeviceMemoryBlock::Init(
++ VmaAllocator hAllocator,
++ VmaPool hParentPool,
++ uint32_t newMemoryTypeIndex,
++ VkDeviceMemory newMemory,
++ VkDeviceSize newSize,
++ uint32_t id,
++ uint32_t algorithm,
++ VkDeviceSize bufferImageGranularity)
++{
++ VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
++
++ m_hParentPool = hParentPool;
++ m_MemoryTypeIndex = newMemoryTypeIndex;
++ m_Id = id;
++ m_hMemory = newMemory;
++
++ switch (algorithm)
++ {
++ case VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT:
++ m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Linear)(hAllocator->GetAllocationCallbacks(),
++ bufferImageGranularity, false); // isVirtual
++ break;
++ default:
++ VMA_ASSERT(0);
++ // Fall-through.
++ case 0:
++ m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_TLSF)(hAllocator->GetAllocationCallbacks(),
++ bufferImageGranularity, false); // isVirtual
++ }
++ m_pMetadata->Init(newSize);
++}
++
++void VmaDeviceMemoryBlock::Destroy(VmaAllocator allocator)
++{
++ // Define macro VMA_DEBUG_LOG to receive the list of the unfreed allocations
++ if (!m_pMetadata->IsEmpty())
++ m_pMetadata->DebugLogAllAllocations();
++ // This is the most important assert in the entire library.
++ // Hitting it means you have some memory leak - unreleased VmaAllocation objects.
++ VMA_ASSERT(m_pMetadata->IsEmpty() && "Some allocations were not freed before destruction of this memory block!");
++
++ VMA_ASSERT(m_hMemory != VK_NULL_HANDLE);
++ allocator->FreeVulkanMemory(m_MemoryTypeIndex, m_pMetadata->GetSize(), m_hMemory);
++ m_hMemory = VK_NULL_HANDLE;
++
++ vma_delete(allocator, m_pMetadata);
++ m_pMetadata = VMA_NULL;
++}
++
++void VmaDeviceMemoryBlock::PostFree(VmaAllocator hAllocator)
++{
++ if(m_MappingHysteresis.PostFree())
++ {
++ VMA_ASSERT(m_MappingHysteresis.GetExtraMapping() == 0);
++ if (m_MapCount == 0)
++ {
++ m_pMappedData = VMA_NULL;
++ (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
++ }
++ }
++}
++
++bool VmaDeviceMemoryBlock::Validate() const
++{
++ VMA_VALIDATE((m_hMemory != VK_NULL_HANDLE) &&
++ (m_pMetadata->GetSize() != 0));
++
++ return m_pMetadata->Validate();
++}
++
++VkResult VmaDeviceMemoryBlock::CheckCorruption(VmaAllocator hAllocator)
++{
++ void* pData = nullptr;
++ VkResult res = Map(hAllocator, 1, &pData);
++ if (res != VK_SUCCESS)
++ {
++ return res;
++ }
++
++ res = m_pMetadata->CheckCorruption(pData);
++
++ Unmap(hAllocator, 1);
++
++ return res;
++}
++
++VkResult VmaDeviceMemoryBlock::Map(VmaAllocator hAllocator, uint32_t count, void** ppData)
++{
++ if (count == 0)
++ {
++ return VK_SUCCESS;
++ }
++
++ VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
++ const uint32_t oldTotalMapCount = m_MapCount + m_MappingHysteresis.GetExtraMapping();
++ m_MappingHysteresis.PostMap();
++ if (oldTotalMapCount != 0)
++ {
++ m_MapCount += count;
++ VMA_ASSERT(m_pMappedData != VMA_NULL);
++ if (ppData != VMA_NULL)
++ {
++ *ppData = m_pMappedData;
++ }
++ return VK_SUCCESS;
++ }
++ else
++ {
++ VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
++ hAllocator->m_hDevice,
++ m_hMemory,
++ 0, // offset
++ VK_WHOLE_SIZE,
++ 0, // flags
++ &m_pMappedData);
++ if (result == VK_SUCCESS)
++ {
++ if (ppData != VMA_NULL)
++ {
++ *ppData = m_pMappedData;
++ }
++ m_MapCount = count;
++ }
++ return result;
++ }
++}
++
++void VmaDeviceMemoryBlock::Unmap(VmaAllocator hAllocator, uint32_t count)
++{
++ if (count == 0)
++ {
++ return;
++ }
++
++ VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
++ if (m_MapCount >= count)
++ {
++ m_MapCount -= count;
++ const uint32_t totalMapCount = m_MapCount + m_MappingHysteresis.GetExtraMapping();
++ if (totalMapCount == 0)
++ {
++ m_pMappedData = VMA_NULL;
++ (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
++ }
++ m_MappingHysteresis.PostUnmap();
++ }
++ else
++ {
++ VMA_ASSERT(0 && "VkDeviceMemory block is being unmapped while it was not previously mapped.");
++ }
++}
++
++VkResult VmaDeviceMemoryBlock::WriteMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
++{
++ VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
++
++ void* pData;
++ VkResult res = Map(hAllocator, 1, &pData);
++ if (res != VK_SUCCESS)
++ {
++ return res;
++ }
++
++ VmaWriteMagicValue(pData, allocOffset + allocSize);
++
++ Unmap(hAllocator, 1);
++ return VK_SUCCESS;
++}
++
++VkResult VmaDeviceMemoryBlock::ValidateMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
++{
++ VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
++
++ void* pData;
++ VkResult res = Map(hAllocator, 1, &pData);
++ if (res != VK_SUCCESS)
++ {
++ return res;
++ }
++
++ if (!VmaValidateMagicValue(pData, allocOffset + allocSize))
++ {
++ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER FREED ALLOCATION!");
++ }
++
++ Unmap(hAllocator, 1);
++ return VK_SUCCESS;
++}
++
++VkResult VmaDeviceMemoryBlock::BindBufferMemory(
++ const VmaAllocator hAllocator,
++ const VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkBuffer hBuffer,
++ const void* pNext)
++{
++ VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
++ hAllocation->GetBlock() == this);
++ VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
++ "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
++ const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
++ // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads.
++ VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
++ return hAllocator->BindVulkanBuffer(m_hMemory, memoryOffset, hBuffer, pNext);
++}
++
++VkResult VmaDeviceMemoryBlock::BindImageMemory(
++ const VmaAllocator hAllocator,
++ const VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkImage hImage,
++ const void* pNext)
++{
++ VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
++ hAllocation->GetBlock() == this);
++ VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
++ "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
++ const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
++ // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads.
++ VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
++ return hAllocator->BindVulkanImage(m_hMemory, memoryOffset, hImage, pNext);
++}
++#endif // _VMA_DEVICE_MEMORY_BLOCK_FUNCTIONS
++
++#ifndef _VMA_ALLOCATION_T_FUNCTIONS
++VmaAllocation_T::VmaAllocation_T(bool mappingAllowed)
++ : m_Alignment{ 1 },
++ m_Size{ 0 },
++ m_pUserData{ VMA_NULL },
++ m_pName{ VMA_NULL },
++ m_MemoryTypeIndex{ 0 },
++ m_Type{ (uint8_t)ALLOCATION_TYPE_NONE },
++ m_SuballocationType{ (uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN },
++ m_MapCount{ 0 },
++ m_Flags{ 0 }
++{
++ if(mappingAllowed)
++ m_Flags |= (uint8_t)FLAG_MAPPING_ALLOWED;
++
++#if VMA_STATS_STRING_ENABLED
++ m_BufferImageUsage = 0;
++#endif
++}
++
++VmaAllocation_T::~VmaAllocation_T()
++{
++ VMA_ASSERT(m_MapCount == 0 && "Allocation was not unmapped before destruction.");
++
++ // Check if owned string was freed.
++ VMA_ASSERT(m_pName == VMA_NULL);
++}
++
++void VmaAllocation_T::InitBlockAllocation(
++ VmaDeviceMemoryBlock* block,
++ VmaAllocHandle allocHandle,
++ VkDeviceSize alignment,
++ VkDeviceSize size,
++ uint32_t memoryTypeIndex,
++ VmaSuballocationType suballocationType,
++ bool mapped)
++{
++ VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
++ VMA_ASSERT(block != VMA_NULL);
++ m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
++ m_Alignment = alignment;
++ m_Size = size;
++ m_MemoryTypeIndex = memoryTypeIndex;
++ if(mapped)
++ {
++ VMA_ASSERT(IsMappingAllowed() && "Mapping is not allowed on this allocation! Please use one of the new VMA_ALLOCATION_CREATE_HOST_ACCESS_* flags when creating it.");
++ m_Flags |= (uint8_t)FLAG_PERSISTENT_MAP;
++ }
++ m_SuballocationType = (uint8_t)suballocationType;
++ m_BlockAllocation.m_Block = block;
++ m_BlockAllocation.m_AllocHandle = allocHandle;
++}
++
++void VmaAllocation_T::InitDedicatedAllocation(
++ VmaPool hParentPool,
++ uint32_t memoryTypeIndex,
++ VkDeviceMemory hMemory,
++ VmaSuballocationType suballocationType,
++ void* pMappedData,
++ VkDeviceSize size)
++{
++ VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
++ VMA_ASSERT(hMemory != VK_NULL_HANDLE);
++ m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED;
++ m_Alignment = 0;
++ m_Size = size;
++ m_MemoryTypeIndex = memoryTypeIndex;
++ m_SuballocationType = (uint8_t)suballocationType;
++ if(pMappedData != VMA_NULL)
++ {
++ VMA_ASSERT(IsMappingAllowed() && "Mapping is not allowed on this allocation! Please use one of the new VMA_ALLOCATION_CREATE_HOST_ACCESS_* flags when creating it.");
++ m_Flags |= (uint8_t)FLAG_PERSISTENT_MAP;
++ }
++ m_DedicatedAllocation.m_hParentPool = hParentPool;
++ m_DedicatedAllocation.m_hMemory = hMemory;
++ m_DedicatedAllocation.m_pMappedData = pMappedData;
++ m_DedicatedAllocation.m_Prev = VMA_NULL;
++ m_DedicatedAllocation.m_Next = VMA_NULL;
++}
++
++void VmaAllocation_T::SetName(VmaAllocator hAllocator, const char* pName)
++{
++ VMA_ASSERT(pName == VMA_NULL || pName != m_pName);
++
++ FreeName(hAllocator);
++
++ if (pName != VMA_NULL)
++ m_pName = VmaCreateStringCopy(hAllocator->GetAllocationCallbacks(), pName);
++}
++
++uint8_t VmaAllocation_T::SwapBlockAllocation(VmaAllocator hAllocator, VmaAllocation allocation)
++{
++ VMA_ASSERT(allocation != VMA_NULL);
++ VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
++ VMA_ASSERT(allocation->m_Type == ALLOCATION_TYPE_BLOCK);
++
++ if (m_MapCount != 0)
++ m_BlockAllocation.m_Block->Unmap(hAllocator, m_MapCount);
++
++ m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, allocation);
++ VMA_SWAP(m_BlockAllocation, allocation->m_BlockAllocation);
++ m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, this);
++
++#if VMA_STATS_STRING_ENABLED
++ VMA_SWAP(m_BufferImageUsage, allocation->m_BufferImageUsage);
++#endif
++ return m_MapCount;
++}
++
++VmaAllocHandle VmaAllocation_T::GetAllocHandle() const
++{
++ switch (m_Type)
++ {
++ case ALLOCATION_TYPE_BLOCK:
++ return m_BlockAllocation.m_AllocHandle;
++ case ALLOCATION_TYPE_DEDICATED:
++ return VK_NULL_HANDLE;
++ default:
++ VMA_ASSERT(0);
++ return VK_NULL_HANDLE;
++ }
++}
++
++VkDeviceSize VmaAllocation_T::GetOffset() const
++{
++ switch (m_Type)
++ {
++ case ALLOCATION_TYPE_BLOCK:
++ return m_BlockAllocation.m_Block->m_pMetadata->GetAllocationOffset(m_BlockAllocation.m_AllocHandle);
++ case ALLOCATION_TYPE_DEDICATED:
++ return 0;
++ default:
++ VMA_ASSERT(0);
++ return 0;
++ }
++}
++
++VmaPool VmaAllocation_T::GetParentPool() const
++{
++ switch (m_Type)
++ {
++ case ALLOCATION_TYPE_BLOCK:
++ return m_BlockAllocation.m_Block->GetParentPool();
++ case ALLOCATION_TYPE_DEDICATED:
++ return m_DedicatedAllocation.m_hParentPool;
++ default:
++ VMA_ASSERT(0);
++ return VK_NULL_HANDLE;
++ }
++}
++
++VkDeviceMemory VmaAllocation_T::GetMemory() const
++{
++ switch (m_Type)
++ {
++ case ALLOCATION_TYPE_BLOCK:
++ return m_BlockAllocation.m_Block->GetDeviceMemory();
++ case ALLOCATION_TYPE_DEDICATED:
++ return m_DedicatedAllocation.m_hMemory;
++ default:
++ VMA_ASSERT(0);
++ return VK_NULL_HANDLE;
++ }
++}
++
++void* VmaAllocation_T::GetMappedData() const
++{
++ switch (m_Type)
++ {
++ case ALLOCATION_TYPE_BLOCK:
++ if (m_MapCount != 0 || IsPersistentMap())
++ {
++ void* pBlockData = m_BlockAllocation.m_Block->GetMappedData();
++ VMA_ASSERT(pBlockData != VMA_NULL);
++ return (char*)pBlockData + GetOffset();
++ }
++ else
++ {
++ return VMA_NULL;
++ }
++ break;
++ case ALLOCATION_TYPE_DEDICATED:
++ VMA_ASSERT((m_DedicatedAllocation.m_pMappedData != VMA_NULL) == (m_MapCount != 0 || IsPersistentMap()));
++ return m_DedicatedAllocation.m_pMappedData;
++ default:
++ VMA_ASSERT(0);
++ return VMA_NULL;
++ }
++}
++
++void VmaAllocation_T::BlockAllocMap()
++{
++ VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
++ VMA_ASSERT(IsMappingAllowed() && "Mapping is not allowed on this allocation! Please use one of the new VMA_ALLOCATION_CREATE_HOST_ACCESS_* flags when creating it.");
++
++ if (m_MapCount < 0xFF)
++ {
++ ++m_MapCount;
++ }
++ else
++ {
++ VMA_ASSERT(0 && "Allocation mapped too many times simultaneously.");
++ }
++}
++
++void VmaAllocation_T::BlockAllocUnmap()
++{
++ VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
++
++ if (m_MapCount > 0)
++ {
++ --m_MapCount;
++ }
++ else
++ {
++ VMA_ASSERT(0 && "Unmapping allocation not previously mapped.");
++ }
++}
++
++VkResult VmaAllocation_T::DedicatedAllocMap(VmaAllocator hAllocator, void** ppData)
++{
++ VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
++ VMA_ASSERT(IsMappingAllowed() && "Mapping is not allowed on this allocation! Please use one of the new VMA_ALLOCATION_CREATE_HOST_ACCESS_* flags when creating it.");
++
++ if (m_MapCount != 0 || IsPersistentMap())
++ {
++ if (m_MapCount < 0xFF)
++ {
++ VMA_ASSERT(m_DedicatedAllocation.m_pMappedData != VMA_NULL);
++ *ppData = m_DedicatedAllocation.m_pMappedData;
++ ++m_MapCount;
++ return VK_SUCCESS;
++ }
++ else
++ {
++ VMA_ASSERT(0 && "Dedicated allocation mapped too many times simultaneously.");
++ return VK_ERROR_MEMORY_MAP_FAILED;
++ }
++ }
++ else
++ {
++ VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
++ hAllocator->m_hDevice,
++ m_DedicatedAllocation.m_hMemory,
++ 0, // offset
++ VK_WHOLE_SIZE,
++ 0, // flags
++ ppData);
++ if (result == VK_SUCCESS)
++ {
++ m_DedicatedAllocation.m_pMappedData = *ppData;
++ m_MapCount = 1;
++ }
++ return result;
++ }
++}
++
++void VmaAllocation_T::DedicatedAllocUnmap(VmaAllocator hAllocator)
++{
++ VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
++
++ if (m_MapCount > 0)
++ {
++ --m_MapCount;
++ if (m_MapCount == 0 && !IsPersistentMap())
++ {
++ m_DedicatedAllocation.m_pMappedData = VMA_NULL;
++ (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(
++ hAllocator->m_hDevice,
++ m_DedicatedAllocation.m_hMemory);
++ }
++ }
++ else
++ {
++ VMA_ASSERT(0 && "Unmapping dedicated allocation not previously mapped.");
++ }
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaAllocation_T::InitBufferImageUsage(uint32_t bufferImageUsage)
++{
++ VMA_ASSERT(m_BufferImageUsage == 0);
++ m_BufferImageUsage = bufferImageUsage;
++}
++
++void VmaAllocation_T::PrintParameters(class VmaJsonWriter& json) const
++{
++ json.WriteString("Type");
++ json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[m_SuballocationType]);
++
++ json.WriteString("Size");
++ json.WriteNumber(m_Size);
++ json.WriteString("Usage");
++ json.WriteNumber(m_BufferImageUsage);
++
++ if (m_pUserData != VMA_NULL)
++ {
++ json.WriteString("CustomData");
++ json.BeginString();
++ json.ContinueString_Pointer(m_pUserData);
++ json.EndString();
++ }
++ if (m_pName != VMA_NULL)
++ {
++ json.WriteString("Name");
++ json.WriteString(m_pName);
++ }
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++void VmaAllocation_T::FreeName(VmaAllocator hAllocator)
++{
++ if(m_pName)
++ {
++ VmaFreeString(hAllocator->GetAllocationCallbacks(), m_pName);
++ m_pName = VMA_NULL;
++ }
++}
++#endif // _VMA_ALLOCATION_T_FUNCTIONS
++
++#ifndef _VMA_BLOCK_VECTOR_FUNCTIONS
++VmaBlockVector::VmaBlockVector(
++ VmaAllocator hAllocator,
++ VmaPool hParentPool,
++ uint32_t memoryTypeIndex,
++ VkDeviceSize preferredBlockSize,
++ size_t minBlockCount,
++ size_t maxBlockCount,
++ VkDeviceSize bufferImageGranularity,
++ bool explicitBlockSize,
++ uint32_t algorithm,
++ float priority,
++ VkDeviceSize minAllocationAlignment,
++ void* pMemoryAllocateNext)
++ : m_hAllocator(hAllocator),
++ m_hParentPool(hParentPool),
++ m_MemoryTypeIndex(memoryTypeIndex),
++ m_PreferredBlockSize(preferredBlockSize),
++ m_MinBlockCount(minBlockCount),
++ m_MaxBlockCount(maxBlockCount),
++ m_BufferImageGranularity(bufferImageGranularity),
++ m_ExplicitBlockSize(explicitBlockSize),
++ m_Algorithm(algorithm),
++ m_Priority(priority),
++ m_MinAllocationAlignment(minAllocationAlignment),
++ m_pMemoryAllocateNext(pMemoryAllocateNext),
++ m_Blocks(VmaStlAllocator<VmaDeviceMemoryBlock*>(hAllocator->GetAllocationCallbacks())),
++ m_NextBlockId(0) {}
++
++VmaBlockVector::~VmaBlockVector()
++{
++ for (size_t i = m_Blocks.size(); i--; )
++ {
++ m_Blocks[i]->Destroy(m_hAllocator);
++ vma_delete(m_hAllocator, m_Blocks[i]);
++ }
++}
++
++VkResult VmaBlockVector::CreateMinBlocks()
++{
++ for (size_t i = 0; i < m_MinBlockCount; ++i)
++ {
++ VkResult res = CreateBlock(m_PreferredBlockSize, VMA_NULL);
++ if (res != VK_SUCCESS)
++ {
++ return res;
++ }
++ }
++ return VK_SUCCESS;
++}
++
++void VmaBlockVector::AddStatistics(VmaStatistics& inoutStats)
++{
++ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
++
++ const size_t blockCount = m_Blocks.size();
++ for (uint32_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
++ {
++ const VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
++ VMA_ASSERT(pBlock);
++ VMA_HEAVY_ASSERT(pBlock->Validate());
++ pBlock->m_pMetadata->AddStatistics(inoutStats);
++ }
++}
++
++void VmaBlockVector::AddDetailedStatistics(VmaDetailedStatistics& inoutStats)
++{
++ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
++
++ const size_t blockCount = m_Blocks.size();
++ for (uint32_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
++ {
++ const VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
++ VMA_ASSERT(pBlock);
++ VMA_HEAVY_ASSERT(pBlock->Validate());
++ pBlock->m_pMetadata->AddDetailedStatistics(inoutStats);
++ }
++}
++
++bool VmaBlockVector::IsEmpty()
++{
++ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
++ return m_Blocks.empty();
++}
++
++bool VmaBlockVector::IsCorruptionDetectionEnabled() const
++{
++ const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
++ return (VMA_DEBUG_DETECT_CORRUPTION != 0) &&
++ (VMA_DEBUG_MARGIN > 0) &&
++ (m_Algorithm == 0 || m_Algorithm == VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT) &&
++ (m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & requiredMemFlags) == requiredMemFlags;
++}
++
++VkResult VmaBlockVector::Allocate(
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ const VmaAllocationCreateInfo& createInfo,
++ VmaSuballocationType suballocType,
++ size_t allocationCount,
++ VmaAllocation* pAllocations)
++{
++ size_t allocIndex;
++ VkResult res = VK_SUCCESS;
++
++ alignment = VMA_MAX(alignment, m_MinAllocationAlignment);
++
++ if (IsCorruptionDetectionEnabled())
++ {
++ size = VmaAlignUp<VkDeviceSize>(size, sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
++ alignment = VmaAlignUp<VkDeviceSize>(alignment, sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
++ }
++
++ {
++ VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
++ for (allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
++ {
++ res = AllocatePage(
++ size,
++ alignment,
++ createInfo,
++ suballocType,
++ pAllocations + allocIndex);
++ if (res != VK_SUCCESS)
++ {
++ break;
++ }
++ }
++ }
++
++ if (res != VK_SUCCESS)
++ {
++ // Free all already created allocations.
++ while (allocIndex--)
++ Free(pAllocations[allocIndex]);
++ memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
++ }
++
++ return res;
++}
++
++VkResult VmaBlockVector::AllocatePage(
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ const VmaAllocationCreateInfo& createInfo,
++ VmaSuballocationType suballocType,
++ VmaAllocation* pAllocation)
++{
++ const bool isUpperAddress = (createInfo.flags & VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0;
++
++ VkDeviceSize freeMemory;
++ {
++ const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
++ VmaBudget heapBudget = {};
++ m_hAllocator->GetHeapBudgets(&heapBudget, heapIndex, 1);
++ freeMemory = (heapBudget.usage < heapBudget.budget) ? (heapBudget.budget - heapBudget.usage) : 0;
++ }
++
++ const bool canFallbackToDedicated = !HasExplicitBlockSize() &&
++ (createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0;
++ const bool canCreateNewBlock =
++ ((createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0) &&
++ (m_Blocks.size() < m_MaxBlockCount) &&
++ (freeMemory >= size || !canFallbackToDedicated);
++ uint32_t strategy = createInfo.flags & VMA_ALLOCATION_CREATE_STRATEGY_MASK;
++
++ // Upper address can only be used with linear allocator and within single memory block.
++ if (isUpperAddress &&
++ (m_Algorithm != VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT || m_MaxBlockCount > 1))
++ {
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++
++ // Early reject: requested allocation size is larger that maximum block size for this block vector.
++ if (size + VMA_DEBUG_MARGIN > m_PreferredBlockSize)
++ {
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ }
++
++ // 1. Search existing allocations. Try to allocate.
++ if (m_Algorithm == VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT)
++ {
++ // Use only last block.
++ if (!m_Blocks.empty())
++ {
++ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks.back();
++ VMA_ASSERT(pCurrBlock);
++ VkResult res = AllocateFromBlock(
++ pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation);
++ if (res == VK_SUCCESS)
++ {
++ VMA_DEBUG_LOG(" Returned from last block #%u", pCurrBlock->GetId());
++ IncrementallySortBlocks();
++ return VK_SUCCESS;
++ }
++ }
++ }
++ else
++ {
++ if (strategy != VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT) // MIN_MEMORY or default
++ {
++ const bool isHostVisible =
++ (m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0;
++ if(isHostVisible)
++ {
++ const bool isMappingAllowed = (createInfo.flags &
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0;
++ /*
++ For non-mappable allocations, check blocks that are not mapped first.
++ For mappable allocations, check blocks that are already mapped first.
++ This way, having many blocks, we will separate mappable and non-mappable allocations,
++ hopefully limiting the number of blocks that are mapped, which will help tools like RenderDoc.
++ */
++ for(size_t mappingI = 0; mappingI < 2; ++mappingI)
++ {
++ // Forward order in m_Blocks - prefer blocks with smallest amount of free space.
++ for (size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
++ {
++ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
++ VMA_ASSERT(pCurrBlock);
++ const bool isBlockMapped = pCurrBlock->GetMappedData() != VMA_NULL;
++ if((mappingI == 0) == (isMappingAllowed == isBlockMapped))
++ {
++ VkResult res = AllocateFromBlock(
++ pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation);
++ if (res == VK_SUCCESS)
++ {
++ VMA_DEBUG_LOG(" Returned from existing block #%u", pCurrBlock->GetId());
++ IncrementallySortBlocks();
++ return VK_SUCCESS;
++ }
++ }
++ }
++ }
++ }
++ else
++ {
++ // Forward order in m_Blocks - prefer blocks with smallest amount of free space.
++ for (size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
++ {
++ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
++ VMA_ASSERT(pCurrBlock);
++ VkResult res = AllocateFromBlock(
++ pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation);
++ if (res == VK_SUCCESS)
++ {
++ VMA_DEBUG_LOG(" Returned from existing block #%u", pCurrBlock->GetId());
++ IncrementallySortBlocks();
++ return VK_SUCCESS;
++ }
++ }
++ }
++ }
++ else // VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT
++ {
++ // Backward order in m_Blocks - prefer blocks with largest amount of free space.
++ for (size_t blockIndex = m_Blocks.size(); blockIndex--; )
++ {
++ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
++ VMA_ASSERT(pCurrBlock);
++ VkResult res = AllocateFromBlock(pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation);
++ if (res == VK_SUCCESS)
++ {
++ VMA_DEBUG_LOG(" Returned from existing block #%u", pCurrBlock->GetId());
++ IncrementallySortBlocks();
++ return VK_SUCCESS;
++ }
++ }
++ }
++ }
++
++ // 2. Try to create new block.
++ if (canCreateNewBlock)
++ {
++ // Calculate optimal size for new block.
++ VkDeviceSize newBlockSize = m_PreferredBlockSize;
++ uint32_t newBlockSizeShift = 0;
++ const uint32_t NEW_BLOCK_SIZE_SHIFT_MAX = 3;
++
++ if (!m_ExplicitBlockSize)
++ {
++ // Allocate 1/8, 1/4, 1/2 as first blocks.
++ const VkDeviceSize maxExistingBlockSize = CalcMaxBlockSize();
++ for (uint32_t i = 0; i < NEW_BLOCK_SIZE_SHIFT_MAX; ++i)
++ {
++ const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
++ if (smallerNewBlockSize > maxExistingBlockSize && smallerNewBlockSize >= size * 2)
++ {
++ newBlockSize = smallerNewBlockSize;
++ ++newBlockSizeShift;
++ }
++ else
++ {
++ break;
++ }
++ }
++ }
++
++ size_t newBlockIndex = 0;
++ VkResult res = (newBlockSize <= freeMemory || !canFallbackToDedicated) ?
++ CreateBlock(newBlockSize, &newBlockIndex) : VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ // Allocation of this size failed? Try 1/2, 1/4, 1/8 of m_PreferredBlockSize.
++ if (!m_ExplicitBlockSize)
++ {
++ while (res < 0 && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX)
++ {
++ const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
++ if (smallerNewBlockSize >= size)
++ {
++ newBlockSize = smallerNewBlockSize;
++ ++newBlockSizeShift;
++ res = (newBlockSize <= freeMemory || !canFallbackToDedicated) ?
++ CreateBlock(newBlockSize, &newBlockIndex) : VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ }
++ else
++ {
++ break;
++ }
++ }
++ }
++
++ if (res == VK_SUCCESS)
++ {
++ VmaDeviceMemoryBlock* const pBlock = m_Blocks[newBlockIndex];
++ VMA_ASSERT(pBlock->m_pMetadata->GetSize() >= size);
++
++ res = AllocateFromBlock(
++ pBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation);
++ if (res == VK_SUCCESS)
++ {
++ VMA_DEBUG_LOG(" Created new block #%u Size=%llu", pBlock->GetId(), newBlockSize);
++ IncrementallySortBlocks();
++ return VK_SUCCESS;
++ }
++ else
++ {
++ // Allocation from new block failed, possibly due to VMA_DEBUG_MARGIN or alignment.
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ }
++ }
++ }
++
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++}
++
++void VmaBlockVector::Free(const VmaAllocation hAllocation)
++{
++ VmaDeviceMemoryBlock* pBlockToDelete = VMA_NULL;
++
++ bool budgetExceeded = false;
++ {
++ const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
++ VmaBudget heapBudget = {};
++ m_hAllocator->GetHeapBudgets(&heapBudget, heapIndex, 1);
++ budgetExceeded = heapBudget.usage >= heapBudget.budget;
++ }
++
++ // Scope for lock.
++ {
++ VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
++
++ VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
++
++ if (IsCorruptionDetectionEnabled())
++ {
++ VkResult res = pBlock->ValidateMagicValueAfterAllocation(m_hAllocator, hAllocation->GetOffset(), hAllocation->GetSize());
++ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to validate magic value.");
++ }
++
++ if (hAllocation->IsPersistentMap())
++ {
++ pBlock->Unmap(m_hAllocator, 1);
++ }
++
++ const bool hadEmptyBlockBeforeFree = HasEmptyBlock();
++ pBlock->m_pMetadata->Free(hAllocation->GetAllocHandle());
++ pBlock->PostFree(m_hAllocator);
++ VMA_HEAVY_ASSERT(pBlock->Validate());
++
++ VMA_DEBUG_LOG(" Freed from MemoryTypeIndex=%u", m_MemoryTypeIndex);
++
++ const bool canDeleteBlock = m_Blocks.size() > m_MinBlockCount;
++ // pBlock became empty after this deallocation.
++ if (pBlock->m_pMetadata->IsEmpty())
++ {
++ // Already had empty block. We don't want to have two, so delete this one.
++ if ((hadEmptyBlockBeforeFree || budgetExceeded) && canDeleteBlock)
++ {
++ pBlockToDelete = pBlock;
++ Remove(pBlock);
++ }
++ // else: We now have one empty block - leave it. A hysteresis to avoid allocating whole block back and forth.
++ }
++ // pBlock didn't become empty, but we have another empty block - find and free that one.
++ // (This is optional, heuristics.)
++ else if (hadEmptyBlockBeforeFree && canDeleteBlock)
++ {
++ VmaDeviceMemoryBlock* pLastBlock = m_Blocks.back();
++ if (pLastBlock->m_pMetadata->IsEmpty())
++ {
++ pBlockToDelete = pLastBlock;
++ m_Blocks.pop_back();
++ }
++ }
++
++ IncrementallySortBlocks();
++ }
++
++ // Destruction of a free block. Deferred until this point, outside of mutex
++ // lock, for performance reason.
++ if (pBlockToDelete != VMA_NULL)
++ {
++ VMA_DEBUG_LOG(" Deleted empty block #%u", pBlockToDelete->GetId());
++ pBlockToDelete->Destroy(m_hAllocator);
++ vma_delete(m_hAllocator, pBlockToDelete);
++ }
++
++ m_hAllocator->m_Budget.RemoveAllocation(m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex), hAllocation->GetSize());
++ m_hAllocator->m_AllocationObjectAllocator.Free(hAllocation);
++}
++
++VkDeviceSize VmaBlockVector::CalcMaxBlockSize() const
++{
++ VkDeviceSize result = 0;
++ for (size_t i = m_Blocks.size(); i--; )
++ {
++ result = VMA_MAX(result, m_Blocks[i]->m_pMetadata->GetSize());
++ if (result >= m_PreferredBlockSize)
++ {
++ break;
++ }
++ }
++ return result;
++}
++
++void VmaBlockVector::Remove(VmaDeviceMemoryBlock* pBlock)
++{
++ for (uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
++ {
++ if (m_Blocks[blockIndex] == pBlock)
++ {
++ VmaVectorRemove(m_Blocks, blockIndex);
++ return;
++ }
++ }
++ VMA_ASSERT(0);
++}
++
++void VmaBlockVector::IncrementallySortBlocks()
++{
++ if (!m_IncrementalSort)
++ return;
++ if (m_Algorithm != VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT)
++ {
++ // Bubble sort only until first swap.
++ for (size_t i = 1; i < m_Blocks.size(); ++i)
++ {
++ if (m_Blocks[i - 1]->m_pMetadata->GetSumFreeSize() > m_Blocks[i]->m_pMetadata->GetSumFreeSize())
++ {
++ VMA_SWAP(m_Blocks[i - 1], m_Blocks[i]);
++ return;
++ }
++ }
++ }
++}
++
++void VmaBlockVector::SortByFreeSize()
++{
++ VMA_SORT(m_Blocks.begin(), m_Blocks.end(),
++ [](auto* b1, auto* b2)
++ {
++ return b1->m_pMetadata->GetSumFreeSize() < b2->m_pMetadata->GetSumFreeSize();
++ });
++}
++
++VkResult VmaBlockVector::AllocateFromBlock(
++ VmaDeviceMemoryBlock* pBlock,
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ VmaAllocationCreateFlags allocFlags,
++ void* pUserData,
++ VmaSuballocationType suballocType,
++ uint32_t strategy,
++ VmaAllocation* pAllocation)
++{
++ const bool isUpperAddress = (allocFlags & VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0;
++
++ VmaAllocationRequest currRequest = {};
++ if (pBlock->m_pMetadata->CreateAllocationRequest(
++ size,
++ alignment,
++ isUpperAddress,
++ suballocType,
++ strategy,
++ &currRequest))
++ {
++ return CommitAllocationRequest(currRequest, pBlock, alignment, allocFlags, pUserData, suballocType, pAllocation);
++ }
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++}
++
++VkResult VmaBlockVector::CommitAllocationRequest(
++ VmaAllocationRequest& allocRequest,
++ VmaDeviceMemoryBlock* pBlock,
++ VkDeviceSize alignment,
++ VmaAllocationCreateFlags allocFlags,
++ void* pUserData,
++ VmaSuballocationType suballocType,
++ VmaAllocation* pAllocation)
++{
++ const bool mapped = (allocFlags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0;
++ const bool isUserDataString = (allocFlags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0;
++ const bool isMappingAllowed = (allocFlags &
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0;
++
++ pBlock->PostAlloc();
++ // Allocate from pCurrBlock.
++ if (mapped)
++ {
++ VkResult res = pBlock->Map(m_hAllocator, 1, VMA_NULL);
++ if (res != VK_SUCCESS)
++ {
++ return res;
++ }
++ }
++
++ *pAllocation = m_hAllocator->m_AllocationObjectAllocator.Allocate(isMappingAllowed);
++ pBlock->m_pMetadata->Alloc(allocRequest, suballocType, *pAllocation);
++ (*pAllocation)->InitBlockAllocation(
++ pBlock,
++ allocRequest.allocHandle,
++ alignment,
++ allocRequest.size, // Not size, as actual allocation size may be larger than requested!
++ m_MemoryTypeIndex,
++ suballocType,
++ mapped);
++ VMA_HEAVY_ASSERT(pBlock->Validate());
++ if (isUserDataString)
++ (*pAllocation)->SetName(m_hAllocator, (const char*)pUserData);
++ else
++ (*pAllocation)->SetUserData(m_hAllocator, pUserData);
++ m_hAllocator->m_Budget.AddAllocation(m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex), allocRequest.size);
++ if (VMA_DEBUG_INITIALIZE_ALLOCATIONS)
++ {
++ m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
++ }
++ if (IsCorruptionDetectionEnabled())
++ {
++ VkResult res = pBlock->WriteMagicValueAfterAllocation(m_hAllocator, (*pAllocation)->GetOffset(), allocRequest.size);
++ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
++ }
++ return VK_SUCCESS;
++}
++
++VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex)
++{
++ VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
++ allocInfo.pNext = m_pMemoryAllocateNext;
++ allocInfo.memoryTypeIndex = m_MemoryTypeIndex;
++ allocInfo.allocationSize = blockSize;
++
++#if VMA_BUFFER_DEVICE_ADDRESS
++ // Every standalone block can potentially contain a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT - always enable the feature.
++ VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
++ if (m_hAllocator->m_UseKhrBufferDeviceAddress)
++ {
++ allocFlagsInfo.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR;
++ VmaPnextChainPushFront(&allocInfo, &allocFlagsInfo);
++ }
++#endif // VMA_BUFFER_DEVICE_ADDRESS
++
++#if VMA_MEMORY_PRIORITY
++ VkMemoryPriorityAllocateInfoEXT priorityInfo = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
++ if (m_hAllocator->m_UseExtMemoryPriority)
++ {
++ VMA_ASSERT(m_Priority >= 0.f && m_Priority <= 1.f);
++ priorityInfo.priority = m_Priority;
++ VmaPnextChainPushFront(&allocInfo, &priorityInfo);
++ }
++#endif // VMA_MEMORY_PRIORITY
++
++#if VMA_EXTERNAL_MEMORY
++ // Attach VkExportMemoryAllocateInfoKHR if necessary.
++ VkExportMemoryAllocateInfoKHR exportMemoryAllocInfo = { VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR };
++ exportMemoryAllocInfo.handleTypes = m_hAllocator->GetExternalMemoryHandleTypeFlags(m_MemoryTypeIndex);
++ if (exportMemoryAllocInfo.handleTypes != 0)
++ {
++ VmaPnextChainPushFront(&allocInfo, &exportMemoryAllocInfo);
++ }
++#endif // VMA_EXTERNAL_MEMORY
++
++ VkDeviceMemory mem = VK_NULL_HANDLE;
++ VkResult res = m_hAllocator->AllocateVulkanMemory(&allocInfo, &mem);
++ if (res < 0)
++ {
++ return res;
++ }
++
++ // New VkDeviceMemory successfully created.
++
++ // Create new Allocation for it.
++ VmaDeviceMemoryBlock* const pBlock = vma_new(m_hAllocator, VmaDeviceMemoryBlock)(m_hAllocator);
++ pBlock->Init(
++ m_hAllocator,
++ m_hParentPool,
++ m_MemoryTypeIndex,
++ mem,
++ allocInfo.allocationSize,
++ m_NextBlockId++,
++ m_Algorithm,
++ m_BufferImageGranularity);
++
++ m_Blocks.push_back(pBlock);
++ if (pNewBlockIndex != VMA_NULL)
++ {
++ *pNewBlockIndex = m_Blocks.size() - 1;
++ }
++
++ return VK_SUCCESS;
++}
++
++bool VmaBlockVector::HasEmptyBlock()
++{
++ for (size_t index = 0, count = m_Blocks.size(); index < count; ++index)
++ {
++ VmaDeviceMemoryBlock* const pBlock = m_Blocks[index];
++ if (pBlock->m_pMetadata->IsEmpty())
++ {
++ return true;
++ }
++ }
++ return false;
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaBlockVector::PrintDetailedMap(class VmaJsonWriter& json)
++{
++ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
++
++
++ json.BeginObject();
++ for (size_t i = 0; i < m_Blocks.size(); ++i)
++ {
++ json.BeginString();
++ json.ContinueString(m_Blocks[i]->GetId());
++ json.EndString();
++
++ json.BeginObject();
++ json.WriteString("MapRefCount");
++ json.WriteNumber(m_Blocks[i]->GetMapRefCount());
++
++ m_Blocks[i]->m_pMetadata->PrintDetailedMap(json);
++ json.EndObject();
++ }
++ json.EndObject();
++}
++#endif // VMA_STATS_STRING_ENABLED
++
++VkResult VmaBlockVector::CheckCorruption()
++{
++ if (!IsCorruptionDetectionEnabled())
++ {
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++
++ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
++ for (uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
++ {
++ VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
++ VMA_ASSERT(pBlock);
++ VkResult res = pBlock->CheckCorruption(m_hAllocator);
++ if (res != VK_SUCCESS)
++ {
++ return res;
++ }
++ }
++ return VK_SUCCESS;
++}
++
++#endif // _VMA_BLOCK_VECTOR_FUNCTIONS
++
++#ifndef _VMA_DEFRAGMENTATION_CONTEXT_FUNCTIONS
++VmaDefragmentationContext_T::VmaDefragmentationContext_T(
++ VmaAllocator hAllocator,
++ const VmaDefragmentationInfo& info)
++ : m_MaxPassBytes(info.maxBytesPerPass == 0 ? VK_WHOLE_SIZE : info.maxBytesPerPass),
++ m_MaxPassAllocations(info.maxAllocationsPerPass == 0 ? UINT32_MAX : info.maxAllocationsPerPass),
++ m_MoveAllocator(hAllocator->GetAllocationCallbacks()),
++ m_Moves(m_MoveAllocator)
++{
++ m_Algorithm = info.flags & VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK;
++
++ if (info.pool != VMA_NULL)
++ {
++ m_BlockVectorCount = 1;
++ m_PoolBlockVector = &info.pool->m_BlockVector;
++ m_pBlockVectors = &m_PoolBlockVector;
++ m_PoolBlockVector->SetIncrementalSort(false);
++ m_PoolBlockVector->SortByFreeSize();
++ }
++ else
++ {
++ m_BlockVectorCount = hAllocator->GetMemoryTypeCount();
++ m_PoolBlockVector = VMA_NULL;
++ m_pBlockVectors = hAllocator->m_pBlockVectors;
++ for (uint32_t i = 0; i < m_BlockVectorCount; ++i)
++ {
++ VmaBlockVector* vector = m_pBlockVectors[i];
++ if (vector != VMA_NULL)
++ {
++ vector->SetIncrementalSort(false);
++ vector->SortByFreeSize();
++ }
++ }
++ }
++
++ switch (m_Algorithm)
++ {
++ case 0: // Default algorithm
++ m_Algorithm = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT;
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT:
++ {
++ m_AlgorithmState = vma_new_array(hAllocator, StateBalanced, m_BlockVectorCount);
++ break;
++ }
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT:
++ {
++ if (hAllocator->GetBufferImageGranularity() > 1)
++ {
++ m_AlgorithmState = vma_new_array(hAllocator, StateExtensive, m_BlockVectorCount);
++ }
++ break;
++ }
++ }
++}
++
++VmaDefragmentationContext_T::~VmaDefragmentationContext_T()
++{
++ if (m_PoolBlockVector != VMA_NULL)
++ {
++ m_PoolBlockVector->SetIncrementalSort(true);
++ }
++ else
++ {
++ for (uint32_t i = 0; i < m_BlockVectorCount; ++i)
++ {
++ VmaBlockVector* vector = m_pBlockVectors[i];
++ if (vector != VMA_NULL)
++ vector->SetIncrementalSort(true);
++ }
++ }
++
++ if (m_AlgorithmState)
++ {
++ switch (m_Algorithm)
++ {
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT:
++ vma_delete_array(m_MoveAllocator.m_pCallbacks, reinterpret_cast<StateBalanced*>(m_AlgorithmState), m_BlockVectorCount);
++ break;
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT:
++ vma_delete_array(m_MoveAllocator.m_pCallbacks, reinterpret_cast<StateExtensive*>(m_AlgorithmState), m_BlockVectorCount);
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++ }
++}
++
++VkResult VmaDefragmentationContext_T::DefragmentPassBegin(VmaDefragmentationPassMoveInfo& moveInfo)
++{
++ if (m_PoolBlockVector != VMA_NULL)
++ {
++ VmaMutexLockWrite lock(m_PoolBlockVector->GetMutex(), m_PoolBlockVector->GetAllocator()->m_UseMutex);
++
++ if (m_PoolBlockVector->GetBlockCount() > 1)
++ ComputeDefragmentation(*m_PoolBlockVector, 0);
++ else if (m_PoolBlockVector->GetBlockCount() == 1)
++ ReallocWithinBlock(*m_PoolBlockVector, m_PoolBlockVector->GetBlock(0));
++ }
++ else
++ {
++ for (uint32_t i = 0; i < m_BlockVectorCount; ++i)
++ {
++ if (m_pBlockVectors[i] != VMA_NULL)
++ {
++ VmaMutexLockWrite lock(m_pBlockVectors[i]->GetMutex(), m_pBlockVectors[i]->GetAllocator()->m_UseMutex);
++
++ if (m_pBlockVectors[i]->GetBlockCount() > 1)
++ {
++ if (ComputeDefragmentation(*m_pBlockVectors[i], i))
++ break;
++ }
++ else if (m_pBlockVectors[i]->GetBlockCount() == 1)
++ {
++ if (ReallocWithinBlock(*m_pBlockVectors[i], m_pBlockVectors[i]->GetBlock(0)))
++ break;
++ }
++ }
++ }
++ }
++
++ moveInfo.moveCount = static_cast<uint32_t>(m_Moves.size());
++ if (moveInfo.moveCount > 0)
++ {
++ moveInfo.pMoves = m_Moves.data();
++ return VK_INCOMPLETE;
++ }
++
++ moveInfo.pMoves = VMA_NULL;
++ return VK_SUCCESS;
++}
++
++VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMoveInfo& moveInfo)
++{
++ VMA_ASSERT(moveInfo.moveCount > 0 ? moveInfo.pMoves != VMA_NULL : true);
++
++ VkResult result = VK_SUCCESS;
++ VmaStlAllocator<FragmentedBlock> blockAllocator(m_MoveAllocator.m_pCallbacks);
++ VmaVector<FragmentedBlock, VmaStlAllocator<FragmentedBlock>> immovableBlocks(blockAllocator);
++ VmaVector<FragmentedBlock, VmaStlAllocator<FragmentedBlock>> mappedBlocks(blockAllocator);
++
++ VmaAllocator allocator = VMA_NULL;
++ for (uint32_t i = 0; i < moveInfo.moveCount; ++i)
++ {
++ VmaDefragmentationMove& move = moveInfo.pMoves[i];
++ size_t prevCount = 0, currentCount = 0;
++ VkDeviceSize freedBlockSize = 0;
++
++ uint32_t vectorIndex;
++ VmaBlockVector* vector;
++ if (m_PoolBlockVector != VMA_NULL)
++ {
++ vectorIndex = 0;
++ vector = m_PoolBlockVector;
++ }
++ else
++ {
++ vectorIndex = move.srcAllocation->GetMemoryTypeIndex();
++ vector = m_pBlockVectors[vectorIndex];
++ VMA_ASSERT(vector != VMA_NULL);
++ }
++
++ switch (move.operation)
++ {
++ case VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY:
++ {
++ uint8_t mapCount = move.srcAllocation->SwapBlockAllocation(vector->m_hAllocator, move.dstTmpAllocation);
++ if (mapCount > 0)
++ {
++ allocator = vector->m_hAllocator;
++ VmaDeviceMemoryBlock* newMapBlock = move.srcAllocation->GetBlock();
++ bool notPresent = true;
++ for (FragmentedBlock& block : mappedBlocks)
++ {
++ if (block.block == newMapBlock)
++ {
++ notPresent = false;
++ block.data += mapCount;
++ break;
++ }
++ }
++ if (notPresent)
++ mappedBlocks.push_back({ mapCount, newMapBlock });
++ }
++
++ // Scope for locks, Free have it's own lock
++ {
++ VmaMutexLockRead lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++ prevCount = vector->GetBlockCount();
++ freedBlockSize = move.dstTmpAllocation->GetBlock()->m_pMetadata->GetSize();
++ }
++ vector->Free(move.dstTmpAllocation);
++ {
++ VmaMutexLockRead lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++ currentCount = vector->GetBlockCount();
++ }
++
++ result = VK_INCOMPLETE;
++ break;
++ }
++ case VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE:
++ {
++ m_PassStats.bytesMoved -= move.srcAllocation->GetSize();
++ --m_PassStats.allocationsMoved;
++ vector->Free(move.dstTmpAllocation);
++
++ VmaDeviceMemoryBlock* newBlock = move.srcAllocation->GetBlock();
++ bool notPresent = true;
++ for (const FragmentedBlock& block : immovableBlocks)
++ {
++ if (block.block == newBlock)
++ {
++ notPresent = false;
++ break;
++ }
++ }
++ if (notPresent)
++ immovableBlocks.push_back({ vectorIndex, newBlock });
++ break;
++ }
++ case VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY:
++ {
++ m_PassStats.bytesMoved -= move.srcAllocation->GetSize();
++ --m_PassStats.allocationsMoved;
++ // Scope for locks, Free have it's own lock
++ {
++ VmaMutexLockRead lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++ prevCount = vector->GetBlockCount();
++ freedBlockSize = move.srcAllocation->GetBlock()->m_pMetadata->GetSize();
++ }
++ vector->Free(move.srcAllocation);
++ {
++ VmaMutexLockRead lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++ currentCount = vector->GetBlockCount();
++ }
++ freedBlockSize *= prevCount - currentCount;
++
++ VkDeviceSize dstBlockSize;
++ {
++ VmaMutexLockRead lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++ dstBlockSize = move.dstTmpAllocation->GetBlock()->m_pMetadata->GetSize();
++ }
++ vector->Free(move.dstTmpAllocation);
++ {
++ VmaMutexLockRead lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++ freedBlockSize += dstBlockSize * (currentCount - vector->GetBlockCount());
++ currentCount = vector->GetBlockCount();
++ }
++
++ result = VK_INCOMPLETE;
++ break;
++ }
++ default:
++ VMA_ASSERT(0);
++ }
++
++ if (prevCount > currentCount)
++ {
++ size_t freedBlocks = prevCount - currentCount;
++ m_PassStats.deviceMemoryBlocksFreed += static_cast<uint32_t>(freedBlocks);
++ m_PassStats.bytesFreed += freedBlockSize;
++ }
++
++ switch (m_Algorithm)
++ {
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT:
++ {
++ if (m_AlgorithmState != VMA_NULL)
++ {
++ // Avoid unnecessary tries to allocate when new free block is avaiable
++ StateExtensive& state = reinterpret_cast<StateExtensive*>(m_AlgorithmState)[vectorIndex];
++ if (state.firstFreeBlock != SIZE_MAX)
++ {
++ const size_t diff = prevCount - currentCount;
++ if (state.firstFreeBlock >= diff)
++ {
++ state.firstFreeBlock -= diff;
++ if (state.firstFreeBlock != 0)
++ state.firstFreeBlock -= vector->GetBlock(state.firstFreeBlock - 1)->m_pMetadata->IsEmpty();
++ }
++ else
++ state.firstFreeBlock = 0;
++ }
++ }
++ }
++ }
++ }
++ moveInfo.moveCount = 0;
++ moveInfo.pMoves = VMA_NULL;
++ m_Moves.clear();
++
++ // Update stats
++ m_GlobalStats.allocationsMoved += m_PassStats.allocationsMoved;
++ m_GlobalStats.bytesFreed += m_PassStats.bytesFreed;
++ m_GlobalStats.bytesMoved += m_PassStats.bytesMoved;
++ m_GlobalStats.deviceMemoryBlocksFreed += m_PassStats.deviceMemoryBlocksFreed;
++ m_PassStats = { 0 };
++
++ // Move blocks with immovable allocations according to algorithm
++ if (immovableBlocks.size() > 0)
++ {
++ switch (m_Algorithm)
++ {
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT:
++ {
++ if (m_AlgorithmState != VMA_NULL)
++ {
++ bool swapped = false;
++ // Move to the start of free blocks range
++ for (const FragmentedBlock& block : immovableBlocks)
++ {
++ StateExtensive& state = reinterpret_cast<StateExtensive*>(m_AlgorithmState)[block.data];
++ if (state.operation != StateExtensive::Operation::Cleanup)
++ {
++ VmaBlockVector* vector = m_pBlockVectors[block.data];
++ VmaMutexLockWrite lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++
++ for (size_t i = 0, count = vector->GetBlockCount() - m_ImmovableBlockCount; i < count; ++i)
++ {
++ if (vector->GetBlock(i) == block.block)
++ {
++ VMA_SWAP(vector->m_Blocks[i], vector->m_Blocks[vector->GetBlockCount() - ++m_ImmovableBlockCount]);
++ if (state.firstFreeBlock != SIZE_MAX)
++ {
++ if (i + 1 < state.firstFreeBlock)
++ {
++ if (state.firstFreeBlock > 1)
++ VMA_SWAP(vector->m_Blocks[i], vector->m_Blocks[--state.firstFreeBlock]);
++ else
++ --state.firstFreeBlock;
++ }
++ }
++ swapped = true;
++ break;
++ }
++ }
++ }
++ }
++ if (swapped)
++ result = VK_INCOMPLETE;
++ break;
++ }
++ }
++ default:
++ {
++ // Move to the begining
++ for (const FragmentedBlock& block : immovableBlocks)
++ {
++ VmaBlockVector* vector = m_pBlockVectors[block.data];
++ VmaMutexLockWrite lock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
++
++ for (size_t i = m_ImmovableBlockCount; i < vector->GetBlockCount(); ++i)
++ {
++ if (vector->GetBlock(i) == block.block)
++ {
++ VMA_SWAP(vector->m_Blocks[i], vector->m_Blocks[m_ImmovableBlockCount++]);
++ break;
++ }
++ }
++ }
++ break;
++ }
++ }
++ }
++
++ // Bulk-map destination blocks
++ for (const FragmentedBlock& block : mappedBlocks)
++ {
++ VkResult res = block.block->Map(allocator, block.data, VMA_NULL);
++ VMA_ASSERT(res == VK_SUCCESS);
++ }
++ return result;
++}
++
++bool VmaDefragmentationContext_T::ComputeDefragmentation(VmaBlockVector& vector, size_t index)
++{
++ switch (m_Algorithm)
++ {
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT:
++ return ComputeDefragmentation_Fast(vector);
++ default:
++ VMA_ASSERT(0);
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT:
++ return ComputeDefragmentation_Balanced(vector, index, true);
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT:
++ return ComputeDefragmentation_Full(vector);
++ case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT:
++ return ComputeDefragmentation_Extensive(vector, index);
++ }
++}
++
++VmaDefragmentationContext_T::MoveAllocationData VmaDefragmentationContext_T::GetMoveData(
++ VmaAllocHandle handle, VmaBlockMetadata* metadata)
++{
++ MoveAllocationData moveData;
++ moveData.move.srcAllocation = (VmaAllocation)metadata->GetAllocationUserData(handle);
++ moveData.size = moveData.move.srcAllocation->GetSize();
++ moveData.alignment = moveData.move.srcAllocation->GetAlignment();
++ moveData.type = moveData.move.srcAllocation->GetSuballocationType();
++ moveData.flags = 0;
++
++ if (moveData.move.srcAllocation->IsPersistentMap())
++ moveData.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT;
++ if (moveData.move.srcAllocation->IsMappingAllowed())
++ moveData.flags |= VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT;
++
++ return moveData;
++}
++
++VmaDefragmentationContext_T::CounterStatus VmaDefragmentationContext_T::CheckCounters(VkDeviceSize bytes)
++{
++ // Ignore allocation if will exceed max size for copy
++ if (m_PassStats.bytesMoved + bytes > m_MaxPassBytes)
++ {
++ if (++m_IgnoredAllocs < MAX_ALLOCS_TO_IGNORE)
++ return CounterStatus::Ignore;
++ else
++ return CounterStatus::End;
++ }
++ return CounterStatus::Pass;
++}
++
++bool VmaDefragmentationContext_T::IncrementCounters(VkDeviceSize bytes)
++{
++ m_PassStats.bytesMoved += bytes;
++ // Early return when max found
++ if (++m_PassStats.allocationsMoved >= m_MaxPassAllocations || m_PassStats.bytesMoved >= m_MaxPassBytes)
++ {
++ VMA_ASSERT(m_PassStats.allocationsMoved == m_MaxPassAllocations ||
++ m_PassStats.bytesMoved == m_MaxPassBytes && "Exceeded maximal pass threshold!");
++ return true;
++ }
++ return false;
++}
++
++bool VmaDefragmentationContext_T::ReallocWithinBlock(VmaBlockVector& vector, VmaDeviceMemoryBlock* block)
++{
++ VmaBlockMetadata* metadata = block->m_pMetadata;
++
++ for (VmaAllocHandle handle = metadata->GetAllocationListBegin();
++ handle != VK_NULL_HANDLE;
++ handle = metadata->GetNextAllocation(handle))
++ {
++ MoveAllocationData moveData = GetMoveData(handle, metadata);
++ // Ignore newly created allocations by defragmentation algorithm
++ if (moveData.move.srcAllocation->GetUserData() == this)
++ continue;
++ switch (CheckCounters(moveData.move.srcAllocation->GetSize()))
++ {
++ case CounterStatus::Ignore:
++ continue;
++ case CounterStatus::End:
++ return true;
++ default:
++ VMA_ASSERT(0);
++ case CounterStatus::Pass:
++ break;
++ }
++
++ VkDeviceSize offset = moveData.move.srcAllocation->GetOffset();
++ if (offset != 0 && metadata->GetSumFreeSize() >= moveData.size)
++ {
++ VmaAllocationRequest request = {};
++ if (metadata->CreateAllocationRequest(
++ moveData.size,
++ moveData.alignment,
++ false,
++ moveData.type,
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT,
++ &request))
++ {
++ if (metadata->GetAllocationOffset(request.allocHandle) < offset)
++ {
++ if (vector.CommitAllocationRequest(
++ request,
++ block,
++ moveData.alignment,
++ moveData.flags,
++ this,
++ moveData.type,
++ &moveData.move.dstTmpAllocation) == VK_SUCCESS)
++ {
++ m_Moves.push_back(moveData.move);
++ if (IncrementCounters(moveData.size))
++ return true;
++ }
++ }
++ }
++ }
++ }
++ return false;
++}
++
++bool VmaDefragmentationContext_T::AllocInOtherBlock(size_t start, size_t end, MoveAllocationData& data, VmaBlockVector& vector)
++{
++ for (; start < end; ++start)
++ {
++ VmaDeviceMemoryBlock* dstBlock = vector.GetBlock(start);
++ if (dstBlock->m_pMetadata->GetSumFreeSize() >= data.size)
++ {
++ if (vector.AllocateFromBlock(dstBlock,
++ data.size,
++ data.alignment,
++ data.flags,
++ this,
++ data.type,
++ 0,
++ &data.move.dstTmpAllocation) == VK_SUCCESS)
++ {
++ m_Moves.push_back(data.move);
++ if (IncrementCounters(data.size))
++ return true;
++ break;
++ }
++ }
++ }
++ return false;
++}
++
++bool VmaDefragmentationContext_T::ComputeDefragmentation_Fast(VmaBlockVector& vector)
++{
++ // Move only between blocks
++
++ // Go through allocations in last blocks and try to fit them inside first ones
++ for (size_t i = vector.GetBlockCount() - 1; i > m_ImmovableBlockCount; --i)
++ {
++ VmaBlockMetadata* metadata = vector.GetBlock(i)->m_pMetadata;
++
++ for (VmaAllocHandle handle = metadata->GetAllocationListBegin();
++ handle != VK_NULL_HANDLE;
++ handle = metadata->GetNextAllocation(handle))
++ {
++ MoveAllocationData moveData = GetMoveData(handle, metadata);
++ // Ignore newly created allocations by defragmentation algorithm
++ if (moveData.move.srcAllocation->GetUserData() == this)
++ continue;
++ switch (CheckCounters(moveData.move.srcAllocation->GetSize()))
++ {
++ case CounterStatus::Ignore:
++ continue;
++ case CounterStatus::End:
++ return true;
++ default:
++ VMA_ASSERT(0);
++ case CounterStatus::Pass:
++ break;
++ }
++
++ // Check all previous blocks for free space
++ if (AllocInOtherBlock(0, i, moveData, vector))
++ return true;
++ }
++ }
++ return false;
++}
++
++bool VmaDefragmentationContext_T::ComputeDefragmentation_Balanced(VmaBlockVector& vector, size_t index, bool update)
++{
++ // Go over every allocation and try to fit it in previous blocks at lowest offsets,
++ // if not possible: realloc within single block to minimize offset (exclude offset == 0),
++ // but only if there are noticable gaps between them (some heuristic, ex. average size of allocation in block)
++ VMA_ASSERT(m_AlgorithmState != VMA_NULL);
++
++ StateBalanced& vectorState = reinterpret_cast<StateBalanced*>(m_AlgorithmState)[index];
++ if (update && vectorState.avgAllocSize == UINT64_MAX)
++ UpdateVectorStatistics(vector, vectorState);
++
++ const size_t startMoveCount = m_Moves.size();
++ VkDeviceSize minimalFreeRegion = vectorState.avgFreeSize / 2;
++ for (size_t i = vector.GetBlockCount() - 1; i > m_ImmovableBlockCount; --i)
++ {
++ VmaDeviceMemoryBlock* block = vector.GetBlock(i);
++ VmaBlockMetadata* metadata = block->m_pMetadata;
++ VkDeviceSize prevFreeRegionSize = 0;
++
++ for (VmaAllocHandle handle = metadata->GetAllocationListBegin();
++ handle != VK_NULL_HANDLE;
++ handle = metadata->GetNextAllocation(handle))
++ {
++ MoveAllocationData moveData = GetMoveData(handle, metadata);
++ // Ignore newly created allocations by defragmentation algorithm
++ if (moveData.move.srcAllocation->GetUserData() == this)
++ continue;
++ switch (CheckCounters(moveData.move.srcAllocation->GetSize()))
++ {
++ case CounterStatus::Ignore:
++ continue;
++ case CounterStatus::End:
++ return true;
++ default:
++ VMA_ASSERT(0);
++ case CounterStatus::Pass:
++ break;
++ }
++
++ // Check all previous blocks for free space
++ const size_t prevMoveCount = m_Moves.size();
++ if (AllocInOtherBlock(0, i, moveData, vector))
++ return true;
++
++ VkDeviceSize nextFreeRegionSize = metadata->GetNextFreeRegionSize(handle);
++ // If no room found then realloc within block for lower offset
++ VkDeviceSize offset = moveData.move.srcAllocation->GetOffset();
++ if (prevMoveCount == m_Moves.size() && offset != 0 && metadata->GetSumFreeSize() >= moveData.size)
++ {
++ // Check if realloc will make sense
++ if (prevFreeRegionSize >= minimalFreeRegion ||
++ nextFreeRegionSize >= minimalFreeRegion ||
++ moveData.size <= vectorState.avgFreeSize ||
++ moveData.size <= vectorState.avgAllocSize)
++ {
++ VmaAllocationRequest request = {};
++ if (metadata->CreateAllocationRequest(
++ moveData.size,
++ moveData.alignment,
++ false,
++ moveData.type,
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT,
++ &request))
++ {
++ if (metadata->GetAllocationOffset(request.allocHandle) < offset)
++ {
++ if (vector.CommitAllocationRequest(
++ request,
++ block,
++ moveData.alignment,
++ moveData.flags,
++ this,
++ moveData.type,
++ &moveData.move.dstTmpAllocation) == VK_SUCCESS)
++ {
++ m_Moves.push_back(moveData.move);
++ if (IncrementCounters(moveData.size))
++ return true;
++ }
++ }
++ }
++ }
++ }
++ prevFreeRegionSize = nextFreeRegionSize;
++ }
++ }
++
++ // No moves perfomed, update statistics to current vector state
++ if (startMoveCount == m_Moves.size() && !update)
++ {
++ vectorState.avgAllocSize = UINT64_MAX;
++ return ComputeDefragmentation_Balanced(vector, index, false);
++ }
++ return false;
++}
++
++bool VmaDefragmentationContext_T::ComputeDefragmentation_Full(VmaBlockVector& vector)
++{
++ // Go over every allocation and try to fit it in previous blocks at lowest offsets,
++ // if not possible: realloc within single block to minimize offset (exclude offset == 0)
++
++ for (size_t i = vector.GetBlockCount() - 1; i > m_ImmovableBlockCount; --i)
++ {
++ VmaDeviceMemoryBlock* block = vector.GetBlock(i);
++ VmaBlockMetadata* metadata = block->m_pMetadata;
++
++ for (VmaAllocHandle handle = metadata->GetAllocationListBegin();
++ handle != VK_NULL_HANDLE;
++ handle = metadata->GetNextAllocation(handle))
++ {
++ MoveAllocationData moveData = GetMoveData(handle, metadata);
++ // Ignore newly created allocations by defragmentation algorithm
++ if (moveData.move.srcAllocation->GetUserData() == this)
++ continue;
++ switch (CheckCounters(moveData.move.srcAllocation->GetSize()))
++ {
++ case CounterStatus::Ignore:
++ continue;
++ case CounterStatus::End:
++ return true;
++ default:
++ VMA_ASSERT(0);
++ case CounterStatus::Pass:
++ break;
++ }
++
++ // Check all previous blocks for free space
++ const size_t prevMoveCount = m_Moves.size();
++ if (AllocInOtherBlock(0, i, moveData, vector))
++ return true;
++
++ // If no room found then realloc within block for lower offset
++ VkDeviceSize offset = moveData.move.srcAllocation->GetOffset();
++ if (prevMoveCount == m_Moves.size() && offset != 0 && metadata->GetSumFreeSize() >= moveData.size)
++ {
++ VmaAllocationRequest request = {};
++ if (metadata->CreateAllocationRequest(
++ moveData.size,
++ moveData.alignment,
++ false,
++ moveData.type,
++ VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT,
++ &request))
++ {
++ if (metadata->GetAllocationOffset(request.allocHandle) < offset)
++ {
++ if (vector.CommitAllocationRequest(
++ request,
++ block,
++ moveData.alignment,
++ moveData.flags,
++ this,
++ moveData.type,
++ &moveData.move.dstTmpAllocation) == VK_SUCCESS)
++ {
++ m_Moves.push_back(moveData.move);
++ if (IncrementCounters(moveData.size))
++ return true;
++ }
++ }
++ }
++ }
++ }
++ }
++ return false;
++}
++
++bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVector& vector, size_t index)
++{
++ // First free single block, then populate it to the brim, then free another block, and so on
++
++ // Fallback to previous algorithm since without granularity conflicts it can achieve max packing
++ if (vector.m_BufferImageGranularity == 1)
++ return ComputeDefragmentation_Full(vector);
++
++ VMA_ASSERT(m_AlgorithmState != VMA_NULL);
++
++ StateExtensive& vectorState = reinterpret_cast<StateExtensive*>(m_AlgorithmState)[index];
++
++ bool texturePresent = false, bufferPresent = false, otherPresent = false;
++ switch (vectorState.operation)
++ {
++ case StateExtensive::Operation::Done: // Vector defragmented
++ return false;
++ case StateExtensive::Operation::FindFreeBlockBuffer:
++ case StateExtensive::Operation::FindFreeBlockTexture:
++ case StateExtensive::Operation::FindFreeBlockAll:
++ {
++ // No more blocks to free, just perform fast realloc and move to cleanup
++ if (vectorState.firstFreeBlock == 0)
++ {
++ vectorState.operation = StateExtensive::Operation::Cleanup;
++ return ComputeDefragmentation_Fast(vector);
++ }
++
++ // No free blocks, have to clear last one
++ size_t last = (vectorState.firstFreeBlock == SIZE_MAX ? vector.GetBlockCount() : vectorState.firstFreeBlock) - 1;
++ VmaBlockMetadata* freeMetadata = vector.GetBlock(last)->m_pMetadata;
++
++ const size_t prevMoveCount = m_Moves.size();
++ for (VmaAllocHandle handle = freeMetadata->GetAllocationListBegin();
++ handle != VK_NULL_HANDLE;
++ handle = freeMetadata->GetNextAllocation(handle))
++ {
++ MoveAllocationData moveData = GetMoveData(handle, freeMetadata);
++ switch (CheckCounters(moveData.move.srcAllocation->GetSize()))
++ {
++ case CounterStatus::Ignore:
++ continue;
++ case CounterStatus::End:
++ return true;
++ default:
++ VMA_ASSERT(0);
++ case CounterStatus::Pass:
++ break;
++ }
++
++ // Check all previous blocks for free space
++ if (AllocInOtherBlock(0, last, moveData, vector))
++ {
++ // Full clear performed already
++ if (prevMoveCount != m_Moves.size() && freeMetadata->GetNextAllocation(handle) == VK_NULL_HANDLE)
++ reinterpret_cast<size_t*>(m_AlgorithmState)[index] = last;
++ return true;
++ }
++ }
++
++ if (prevMoveCount == m_Moves.size())
++ {
++ // Cannot perform full clear, have to move data in other blocks around
++ if (last != 0)
++ {
++ for (size_t i = last - 1; i; --i)
++ {
++ if (ReallocWithinBlock(vector, vector.GetBlock(i)))
++ return true;
++ }
++ }
++
++ if (prevMoveCount == m_Moves.size())
++ {
++ // No possible reallocs within blocks, try to move them around fast
++ return ComputeDefragmentation_Fast(vector);
++ }
++ }
++ else
++ {
++ switch (vectorState.operation)
++ {
++ case StateExtensive::Operation::FindFreeBlockBuffer:
++ vectorState.operation = StateExtensive::Operation::MoveBuffers;
++ break;
++ default:
++ VMA_ASSERT(0);
++ case StateExtensive::Operation::FindFreeBlockTexture:
++ vectorState.operation = StateExtensive::Operation::MoveTextures;
++ break;
++ case StateExtensive::Operation::FindFreeBlockAll:
++ vectorState.operation = StateExtensive::Operation::MoveAll;
++ break;
++ }
++ vectorState.firstFreeBlock = last;
++ // Nothing done, block found without reallocations, can perform another reallocs in same pass
++ return ComputeDefragmentation_Extensive(vector, index);
++ }
++ break;
++ }
++ case StateExtensive::Operation::MoveTextures:
++ {
++ if (MoveDataToFreeBlocks(VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL, vector,
++ vectorState.firstFreeBlock, texturePresent, bufferPresent, otherPresent))
++ {
++ if (texturePresent)
++ {
++ vectorState.operation = StateExtensive::Operation::FindFreeBlockTexture;
++ return ComputeDefragmentation_Extensive(vector, index);
++ }
++
++ if (!bufferPresent && !otherPresent)
++ {
++ vectorState.operation = StateExtensive::Operation::Cleanup;
++ break;
++ }
++
++ // No more textures to move, check buffers
++ vectorState.operation = StateExtensive::Operation::MoveBuffers;
++ bufferPresent = false;
++ otherPresent = false;
++ }
++ else
++ break;
++ }
++ case StateExtensive::Operation::MoveBuffers:
++ {
++ if (MoveDataToFreeBlocks(VMA_SUBALLOCATION_TYPE_BUFFER, vector,
++ vectorState.firstFreeBlock, texturePresent, bufferPresent, otherPresent))
++ {
++ if (bufferPresent)
++ {
++ vectorState.operation = StateExtensive::Operation::FindFreeBlockBuffer;
++ return ComputeDefragmentation_Extensive(vector, index);
++ }
++
++ if (!otherPresent)
++ {
++ vectorState.operation = StateExtensive::Operation::Cleanup;
++ break;
++ }
++
++ // No more buffers to move, check all others
++ vectorState.operation = StateExtensive::Operation::MoveAll;
++ otherPresent = false;
++ }
++ else
++ break;
++ }
++ case StateExtensive::Operation::MoveAll:
++ {
++ if (MoveDataToFreeBlocks(VMA_SUBALLOCATION_TYPE_FREE, vector,
++ vectorState.firstFreeBlock, texturePresent, bufferPresent, otherPresent))
++ {
++ if (otherPresent)
++ {
++ vectorState.operation = StateExtensive::Operation::FindFreeBlockBuffer;
++ return ComputeDefragmentation_Extensive(vector, index);
++ }
++ // Everything moved
++ vectorState.operation = StateExtensive::Operation::Cleanup;
++ }
++ break;
++ }
++ case StateExtensive::Operation::Cleanup:
++ // Cleanup is handled below so that other operations may reuse the cleanup code. This case is here to prevent the unhandled enum value warning (C4062).
++ break;
++ }
++
++ if (vectorState.operation == StateExtensive::Operation::Cleanup)
++ {
++ // All other work done, pack data in blocks even tighter if possible
++ const size_t prevMoveCount = m_Moves.size();
++ for (size_t i = 0; i < vector.GetBlockCount(); ++i)
++ {
++ if (ReallocWithinBlock(vector, vector.GetBlock(i)))
++ return true;
++ }
++
++ if (prevMoveCount == m_Moves.size())
++ vectorState.operation = StateExtensive::Operation::Done;
++ }
++ return false;
++}
++
++void VmaDefragmentationContext_T::UpdateVectorStatistics(VmaBlockVector& vector, StateBalanced& state)
++{
++ size_t allocCount = 0;
++ size_t freeCount = 0;
++ state.avgFreeSize = 0;
++ state.avgAllocSize = 0;
++
++ for (size_t i = 0; i < vector.GetBlockCount(); ++i)
++ {
++ VmaBlockMetadata* metadata = vector.GetBlock(i)->m_pMetadata;
++
++ allocCount += metadata->GetAllocationCount();
++ freeCount += metadata->GetFreeRegionsCount();
++ state.avgFreeSize += metadata->GetSumFreeSize();
++ state.avgAllocSize += metadata->GetSize();
++ }
++
++ state.avgAllocSize = (state.avgAllocSize - state.avgFreeSize) / allocCount;
++ state.avgFreeSize /= freeCount;
++}
++
++bool VmaDefragmentationContext_T::MoveDataToFreeBlocks(VmaSuballocationType currentType,
++ VmaBlockVector& vector, size_t firstFreeBlock,
++ bool& texturePresent, bool& bufferPresent, bool& otherPresent)
++{
++ const size_t prevMoveCount = m_Moves.size();
++ for (size_t i = firstFreeBlock ; i;)
++ {
++ VmaDeviceMemoryBlock* block = vector.GetBlock(--i);
++ VmaBlockMetadata* metadata = block->m_pMetadata;
++
++ for (VmaAllocHandle handle = metadata->GetAllocationListBegin();
++ handle != VK_NULL_HANDLE;
++ handle = metadata->GetNextAllocation(handle))
++ {
++ MoveAllocationData moveData = GetMoveData(handle, metadata);
++ // Ignore newly created allocations by defragmentation algorithm
++ if (moveData.move.srcAllocation->GetUserData() == this)
++ continue;
++ switch (CheckCounters(moveData.move.srcAllocation->GetSize()))
++ {
++ case CounterStatus::Ignore:
++ continue;
++ case CounterStatus::End:
++ return true;
++ default:
++ VMA_ASSERT(0);
++ case CounterStatus::Pass:
++ break;
++ }
++
++ // Move only single type of resources at once
++ if (!VmaIsBufferImageGranularityConflict(moveData.type, currentType))
++ {
++ // Try to fit allocation into free blocks
++ if (AllocInOtherBlock(firstFreeBlock, vector.GetBlockCount(), moveData, vector))
++ return false;
++ }
++
++ if (!VmaIsBufferImageGranularityConflict(moveData.type, VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL))
++ texturePresent = true;
++ else if (!VmaIsBufferImageGranularityConflict(moveData.type, VMA_SUBALLOCATION_TYPE_BUFFER))
++ bufferPresent = true;
++ else
++ otherPresent = true;
++ }
++ }
++ return prevMoveCount == m_Moves.size();
++}
++#endif // _VMA_DEFRAGMENTATION_CONTEXT_FUNCTIONS
++
++#ifndef _VMA_POOL_T_FUNCTIONS
++VmaPool_T::VmaPool_T(
++ VmaAllocator hAllocator,
++ const VmaPoolCreateInfo& createInfo,
++ VkDeviceSize preferredBlockSize)
++ : m_BlockVector(
++ hAllocator,
++ this, // hParentPool
++ createInfo.memoryTypeIndex,
++ createInfo.blockSize != 0 ? createInfo.blockSize : preferredBlockSize,
++ createInfo.minBlockCount,
++ createInfo.maxBlockCount,
++ (createInfo.flags& VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT) != 0 ? 1 : hAllocator->GetBufferImageGranularity(),
++ createInfo.blockSize != 0, // explicitBlockSize
++ createInfo.flags & VMA_POOL_CREATE_ALGORITHM_MASK, // algorithm
++ createInfo.priority,
++ VMA_MAX(hAllocator->GetMemoryTypeMinAlignment(createInfo.memoryTypeIndex), createInfo.minAllocationAlignment),
++ createInfo.pMemoryAllocateNext),
++ m_Id(0),
++ m_Name(VMA_NULL) {}
++
++VmaPool_T::~VmaPool_T()
++{
++ VMA_ASSERT(m_PrevPool == VMA_NULL && m_NextPool == VMA_NULL);
++}
++
++void VmaPool_T::SetName(const char* pName)
++{
++ const VkAllocationCallbacks* allocs = m_BlockVector.GetAllocator()->GetAllocationCallbacks();
++ VmaFreeString(allocs, m_Name);
++
++ if (pName != VMA_NULL)
++ {
++ m_Name = VmaCreateStringCopy(allocs, pName);
++ }
++ else
++ {
++ m_Name = VMA_NULL;
++ }
++}
++#endif // _VMA_POOL_T_FUNCTIONS
++
++#ifndef _VMA_ALLOCATOR_T_FUNCTIONS
++VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) :
++ m_UseMutex((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT) == 0),
++ m_VulkanApiVersion(pCreateInfo->vulkanApiVersion != 0 ? pCreateInfo->vulkanApiVersion : VK_API_VERSION_1_0),
++ m_UseKhrDedicatedAllocation((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT) != 0),
++ m_UseKhrBindMemory2((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT) != 0),
++ m_UseExtMemoryBudget((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT) != 0),
++ m_UseAmdDeviceCoherentMemory((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT) != 0),
++ m_UseKhrBufferDeviceAddress((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT) != 0),
++ m_UseExtMemoryPriority((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT) != 0),
++ m_hDevice(pCreateInfo->device),
++ m_hInstance(pCreateInfo->instance),
++ m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL),
++ m_AllocationCallbacks(pCreateInfo->pAllocationCallbacks ?
++ *pCreateInfo->pAllocationCallbacks : VmaEmptyAllocationCallbacks),
++ m_AllocationObjectAllocator(&m_AllocationCallbacks),
++ m_HeapSizeLimitMask(0),
++ m_DeviceMemoryCount(0),
++ m_PreferredLargeHeapBlockSize(0),
++ m_PhysicalDevice(pCreateInfo->physicalDevice),
++ m_GpuDefragmentationMemoryTypeBits(UINT32_MAX),
++ m_NextPoolId(0),
++ m_GlobalMemoryTypeBits(UINT32_MAX)
++{
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ m_UseKhrDedicatedAllocation = false;
++ m_UseKhrBindMemory2 = false;
++ }
++
++ if(VMA_DEBUG_DETECT_CORRUPTION)
++ {
++ // Needs to be multiply of uint32_t size because we are going to write VMA_CORRUPTION_DETECTION_MAGIC_VALUE to it.
++ VMA_ASSERT(VMA_DEBUG_MARGIN % sizeof(uint32_t) == 0);
++ }
++
++ VMA_ASSERT(pCreateInfo->physicalDevice && pCreateInfo->device && pCreateInfo->instance);
++
++ if(m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0))
++ {
++#if !(VMA_DEDICATED_ALLOCATION)
++ if((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT) != 0)
++ {
++ VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT set but required extensions are disabled by preprocessor macros.");
++ }
++#endif
++#if !(VMA_BIND_MEMORY2)
++ if((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT) != 0)
++ {
++ VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT set but required extension is disabled by preprocessor macros.");
++ }
++#endif
++ }
++#if !(VMA_MEMORY_BUDGET)
++ if((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT) != 0)
++ {
++ VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT set but required extension is disabled by preprocessor macros.");
++ }
++#endif
++#if !(VMA_BUFFER_DEVICE_ADDRESS)
++ if(m_UseKhrBufferDeviceAddress)
++ {
++ VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT is set but required extension or Vulkan 1.2 is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
++ }
++#endif
++#if VMA_VULKAN_VERSION < 1002000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 2, 0))
++ {
++ VMA_ASSERT(0 && "vulkanApiVersion >= VK_API_VERSION_1_2 but required Vulkan version is disabled by preprocessor macros.");
++ }
++#endif
++#if VMA_VULKAN_VERSION < 1001000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ VMA_ASSERT(0 && "vulkanApiVersion >= VK_API_VERSION_1_1 but required Vulkan version is disabled by preprocessor macros.");
++ }
++#endif
++#if !(VMA_MEMORY_PRIORITY)
++ if(m_UseExtMemoryPriority)
++ {
++ VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
++ }
++#endif
++
++ memset(&m_DeviceMemoryCallbacks, 0 ,sizeof(m_DeviceMemoryCallbacks));
++ memset(&m_PhysicalDeviceProperties, 0, sizeof(m_PhysicalDeviceProperties));
++ memset(&m_MemProps, 0, sizeof(m_MemProps));
++
++ memset(&m_pBlockVectors, 0, sizeof(m_pBlockVectors));
++ memset(&m_VulkanFunctions, 0, sizeof(m_VulkanFunctions));
++
++#if VMA_EXTERNAL_MEMORY
++ memset(&m_TypeExternalMemoryHandleTypes, 0, sizeof(m_TypeExternalMemoryHandleTypes));
++#endif // #if VMA_EXTERNAL_MEMORY
++
++ if(pCreateInfo->pDeviceMemoryCallbacks != VMA_NULL)
++ {
++ m_DeviceMemoryCallbacks.pUserData = pCreateInfo->pDeviceMemoryCallbacks->pUserData;
++ m_DeviceMemoryCallbacks.pfnAllocate = pCreateInfo->pDeviceMemoryCallbacks->pfnAllocate;
++ m_DeviceMemoryCallbacks.pfnFree = pCreateInfo->pDeviceMemoryCallbacks->pfnFree;
++ }
++
++ ImportVulkanFunctions(pCreateInfo->pVulkanFunctions);
++
++ (*m_VulkanFunctions.vkGetPhysicalDeviceProperties)(m_PhysicalDevice, &m_PhysicalDeviceProperties);
++ (*m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties)(m_PhysicalDevice, &m_MemProps);
++
++ VMA_ASSERT(VmaIsPow2(VMA_MIN_ALIGNMENT));
++ VMA_ASSERT(VmaIsPow2(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY));
++ VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.bufferImageGranularity));
++ VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.nonCoherentAtomSize));
++
++ m_PreferredLargeHeapBlockSize = (pCreateInfo->preferredLargeHeapBlockSize != 0) ?
++ pCreateInfo->preferredLargeHeapBlockSize : static_cast<VkDeviceSize>(VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE);
++
++ m_GlobalMemoryTypeBits = CalculateGlobalMemoryTypeBits();
++
++#if VMA_EXTERNAL_MEMORY
++ if(pCreateInfo->pTypeExternalMemoryHandleTypes != VMA_NULL)
++ {
++ memcpy(m_TypeExternalMemoryHandleTypes, pCreateInfo->pTypeExternalMemoryHandleTypes,
++ sizeof(VkExternalMemoryHandleTypeFlagsKHR) * GetMemoryTypeCount());
++ }
++#endif // #if VMA_EXTERNAL_MEMORY
++
++ if(pCreateInfo->pHeapSizeLimit != VMA_NULL)
++ {
++ for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
++ {
++ const VkDeviceSize limit = pCreateInfo->pHeapSizeLimit[heapIndex];
++ if(limit != VK_WHOLE_SIZE)
++ {
++ m_HeapSizeLimitMask |= 1u << heapIndex;
++ if(limit < m_MemProps.memoryHeaps[heapIndex].size)
++ {
++ m_MemProps.memoryHeaps[heapIndex].size = limit;
++ }
++ }
++ }
++ }
++
++ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ // Create only supported types
++ if((m_GlobalMemoryTypeBits & (1u << memTypeIndex)) != 0)
++ {
++ const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(memTypeIndex);
++ m_pBlockVectors[memTypeIndex] = vma_new(this, VmaBlockVector)(
++ this,
++ VK_NULL_HANDLE, // hParentPool
++ memTypeIndex,
++ preferredBlockSize,
++ 0,
++ SIZE_MAX,
++ GetBufferImageGranularity(),
++ false, // explicitBlockSize
++ 0, // algorithm
++ 0.5f, // priority (0.5 is the default per Vulkan spec)
++ GetMemoryTypeMinAlignment(memTypeIndex), // minAllocationAlignment
++ VMA_NULL); // // pMemoryAllocateNext
++ // No need to call m_pBlockVectors[memTypeIndex][blockVectorTypeIndex]->CreateMinBlocks here,
++ // becase minBlockCount is 0.
++ }
++ }
++}
++
++VkResult VmaAllocator_T::Init(const VmaAllocatorCreateInfo* pCreateInfo)
++{
++ VkResult res = VK_SUCCESS;
++
++#if VMA_MEMORY_BUDGET
++ if(m_UseExtMemoryBudget)
++ {
++ UpdateVulkanBudget();
++ }
++#endif // #if VMA_MEMORY_BUDGET
++
++ return res;
++}
++
++VmaAllocator_T::~VmaAllocator_T()
++{
++ VMA_ASSERT(m_Pools.IsEmpty());
++
++ for(size_t memTypeIndex = GetMemoryTypeCount(); memTypeIndex--; )
++ {
++ vma_delete(this, m_pBlockVectors[memTypeIndex]);
++ }
++}
++
++void VmaAllocator_T::ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions)
++{
++#if VMA_STATIC_VULKAN_FUNCTIONS == 1
++ ImportVulkanFunctions_Static();
++#endif
++
++ if(pVulkanFunctions != VMA_NULL)
++ {
++ ImportVulkanFunctions_Custom(pVulkanFunctions);
++ }
++
++#if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
++ ImportVulkanFunctions_Dynamic();
++#endif
++
++ ValidateVulkanFunctions();
++}
++
++#if VMA_STATIC_VULKAN_FUNCTIONS == 1
++
++void VmaAllocator_T::ImportVulkanFunctions_Static()
++{
++ // Vulkan 1.0
++ m_VulkanFunctions.vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)vkGetInstanceProcAddr;
++ m_VulkanFunctions.vkGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)vkGetDeviceProcAddr;
++ m_VulkanFunctions.vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)vkGetPhysicalDeviceProperties;
++ m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties)vkGetPhysicalDeviceMemoryProperties;
++ m_VulkanFunctions.vkAllocateMemory = (PFN_vkAllocateMemory)vkAllocateMemory;
++ m_VulkanFunctions.vkFreeMemory = (PFN_vkFreeMemory)vkFreeMemory;
++ m_VulkanFunctions.vkMapMemory = (PFN_vkMapMemory)vkMapMemory;
++ m_VulkanFunctions.vkUnmapMemory = (PFN_vkUnmapMemory)vkUnmapMemory;
++ m_VulkanFunctions.vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges)vkFlushMappedMemoryRanges;
++ m_VulkanFunctions.vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges)vkInvalidateMappedMemoryRanges;
++ m_VulkanFunctions.vkBindBufferMemory = (PFN_vkBindBufferMemory)vkBindBufferMemory;
++ m_VulkanFunctions.vkBindImageMemory = (PFN_vkBindImageMemory)vkBindImageMemory;
++ m_VulkanFunctions.vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)vkGetBufferMemoryRequirements;
++ m_VulkanFunctions.vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)vkGetImageMemoryRequirements;
++ m_VulkanFunctions.vkCreateBuffer = (PFN_vkCreateBuffer)vkCreateBuffer;
++ m_VulkanFunctions.vkDestroyBuffer = (PFN_vkDestroyBuffer)vkDestroyBuffer;
++ m_VulkanFunctions.vkCreateImage = (PFN_vkCreateImage)vkCreateImage;
++ m_VulkanFunctions.vkDestroyImage = (PFN_vkDestroyImage)vkDestroyImage;
++ m_VulkanFunctions.vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer)vkCmdCopyBuffer;
++
++ // Vulkan 1.1
++#if VMA_VULKAN_VERSION >= 1001000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2)vkGetBufferMemoryRequirements2;
++ m_VulkanFunctions.vkGetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2)vkGetImageMemoryRequirements2;
++ m_VulkanFunctions.vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2)vkBindBufferMemory2;
++ m_VulkanFunctions.vkBindImageMemory2KHR = (PFN_vkBindImageMemory2)vkBindImageMemory2;
++ m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2)vkGetPhysicalDeviceMemoryProperties2;
++ }
++#endif
++
++#if VMA_VULKAN_VERSION >= 1003000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 3, 0))
++ {
++ m_VulkanFunctions.vkGetDeviceBufferMemoryRequirements = (PFN_vkGetDeviceBufferMemoryRequirements)vkGetDeviceBufferMemoryRequirements;
++ m_VulkanFunctions.vkGetDeviceImageMemoryRequirements = (PFN_vkGetDeviceImageMemoryRequirements)vkGetDeviceImageMemoryRequirements;
++ }
++#endif
++}
++
++#endif // VMA_STATIC_VULKAN_FUNCTIONS == 1
++
++void VmaAllocator_T::ImportVulkanFunctions_Custom(const VmaVulkanFunctions* pVulkanFunctions)
++{
++ VMA_ASSERT(pVulkanFunctions != VMA_NULL);
++
++#define VMA_COPY_IF_NOT_NULL(funcName) \
++ if(pVulkanFunctions->funcName != VMA_NULL) m_VulkanFunctions.funcName = pVulkanFunctions->funcName;
++
++ VMA_COPY_IF_NOT_NULL(vkGetInstanceProcAddr);
++ VMA_COPY_IF_NOT_NULL(vkGetDeviceProcAddr);
++ VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceProperties);
++ VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties);
++ VMA_COPY_IF_NOT_NULL(vkAllocateMemory);
++ VMA_COPY_IF_NOT_NULL(vkFreeMemory);
++ VMA_COPY_IF_NOT_NULL(vkMapMemory);
++ VMA_COPY_IF_NOT_NULL(vkUnmapMemory);
++ VMA_COPY_IF_NOT_NULL(vkFlushMappedMemoryRanges);
++ VMA_COPY_IF_NOT_NULL(vkInvalidateMappedMemoryRanges);
++ VMA_COPY_IF_NOT_NULL(vkBindBufferMemory);
++ VMA_COPY_IF_NOT_NULL(vkBindImageMemory);
++ VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements);
++ VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements);
++ VMA_COPY_IF_NOT_NULL(vkCreateBuffer);
++ VMA_COPY_IF_NOT_NULL(vkDestroyBuffer);
++ VMA_COPY_IF_NOT_NULL(vkCreateImage);
++ VMA_COPY_IF_NOT_NULL(vkDestroyImage);
++ VMA_COPY_IF_NOT_NULL(vkCmdCopyBuffer);
++
++#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements2KHR);
++ VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements2KHR);
++#endif
++
++#if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
++ VMA_COPY_IF_NOT_NULL(vkBindBufferMemory2KHR);
++ VMA_COPY_IF_NOT_NULL(vkBindImageMemory2KHR);
++#endif
++
++#if VMA_MEMORY_BUDGET
++ VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties2KHR);
++#endif
++
++#if VMA_VULKAN_VERSION >= 1003000
++ VMA_COPY_IF_NOT_NULL(vkGetDeviceBufferMemoryRequirements);
++ VMA_COPY_IF_NOT_NULL(vkGetDeviceImageMemoryRequirements);
++#endif
++
++#undef VMA_COPY_IF_NOT_NULL
++}
++
++#if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
++
++void VmaAllocator_T::ImportVulkanFunctions_Dynamic()
++{
++ VMA_ASSERT(m_VulkanFunctions.vkGetInstanceProcAddr && m_VulkanFunctions.vkGetDeviceProcAddr &&
++ "To use VMA_DYNAMIC_VULKAN_FUNCTIONS in new versions of VMA you now have to pass "
++ "VmaVulkanFunctions::vkGetInstanceProcAddr and vkGetDeviceProcAddr as VmaAllocatorCreateInfo::pVulkanFunctions. "
++ "Other members can be null.");
++
++#define VMA_FETCH_INSTANCE_FUNC(memberName, functionPointerType, functionNameString) \
++ if(m_VulkanFunctions.memberName == VMA_NULL) \
++ m_VulkanFunctions.memberName = \
++ (functionPointerType)m_VulkanFunctions.vkGetInstanceProcAddr(m_hInstance, functionNameString);
++#define VMA_FETCH_DEVICE_FUNC(memberName, functionPointerType, functionNameString) \
++ if(m_VulkanFunctions.memberName == VMA_NULL) \
++ m_VulkanFunctions.memberName = \
++ (functionPointerType)m_VulkanFunctions.vkGetDeviceProcAddr(m_hDevice, functionNameString);
++
++ VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceProperties, PFN_vkGetPhysicalDeviceProperties, "vkGetPhysicalDeviceProperties");
++ VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties, PFN_vkGetPhysicalDeviceMemoryProperties, "vkGetPhysicalDeviceMemoryProperties");
++ VMA_FETCH_DEVICE_FUNC(vkAllocateMemory, PFN_vkAllocateMemory, "vkAllocateMemory");
++ VMA_FETCH_DEVICE_FUNC(vkFreeMemory, PFN_vkFreeMemory, "vkFreeMemory");
++ VMA_FETCH_DEVICE_FUNC(vkMapMemory, PFN_vkMapMemory, "vkMapMemory");
++ VMA_FETCH_DEVICE_FUNC(vkUnmapMemory, PFN_vkUnmapMemory, "vkUnmapMemory");
++ VMA_FETCH_DEVICE_FUNC(vkFlushMappedMemoryRanges, PFN_vkFlushMappedMemoryRanges, "vkFlushMappedMemoryRanges");
++ VMA_FETCH_DEVICE_FUNC(vkInvalidateMappedMemoryRanges, PFN_vkInvalidateMappedMemoryRanges, "vkInvalidateMappedMemoryRanges");
++ VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory, PFN_vkBindBufferMemory, "vkBindBufferMemory");
++ VMA_FETCH_DEVICE_FUNC(vkBindImageMemory, PFN_vkBindImageMemory, "vkBindImageMemory");
++ VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements, PFN_vkGetBufferMemoryRequirements, "vkGetBufferMemoryRequirements");
++ VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements, PFN_vkGetImageMemoryRequirements, "vkGetImageMemoryRequirements");
++ VMA_FETCH_DEVICE_FUNC(vkCreateBuffer, PFN_vkCreateBuffer, "vkCreateBuffer");
++ VMA_FETCH_DEVICE_FUNC(vkDestroyBuffer, PFN_vkDestroyBuffer, "vkDestroyBuffer");
++ VMA_FETCH_DEVICE_FUNC(vkCreateImage, PFN_vkCreateImage, "vkCreateImage");
++ VMA_FETCH_DEVICE_FUNC(vkDestroyImage, PFN_vkDestroyImage, "vkDestroyImage");
++ VMA_FETCH_DEVICE_FUNC(vkCmdCopyBuffer, PFN_vkCmdCopyBuffer, "vkCmdCopyBuffer");
++
++#if VMA_VULKAN_VERSION >= 1001000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2, "vkGetBufferMemoryRequirements2");
++ VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2, "vkGetImageMemoryRequirements2");
++ VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2, "vkBindBufferMemory2");
++ VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2, "vkBindImageMemory2");
++ VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2, "vkGetPhysicalDeviceMemoryProperties2");
++ }
++#endif
++
++#if VMA_DEDICATED_ALLOCATION
++ if(m_UseKhrDedicatedAllocation)
++ {
++ VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2KHR, "vkGetBufferMemoryRequirements2KHR");
++ VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2KHR, "vkGetImageMemoryRequirements2KHR");
++ }
++#endif
++
++#if VMA_BIND_MEMORY2
++ if(m_UseKhrBindMemory2)
++ {
++ VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2KHR, "vkBindBufferMemory2KHR");
++ VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2KHR, "vkBindImageMemory2KHR");
++ }
++#endif // #if VMA_BIND_MEMORY2
++
++#if VMA_MEMORY_BUDGET
++ if(m_UseExtMemoryBudget)
++ {
++ VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR, "vkGetPhysicalDeviceMemoryProperties2KHR");
++ }
++#endif // #if VMA_MEMORY_BUDGET
++
++#if VMA_VULKAN_VERSION >= 1003000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 3, 0))
++ {
++ VMA_FETCH_DEVICE_FUNC(vkGetDeviceBufferMemoryRequirements, PFN_vkGetDeviceBufferMemoryRequirements, "vkGetDeviceBufferMemoryRequirements");
++ VMA_FETCH_DEVICE_FUNC(vkGetDeviceImageMemoryRequirements, PFN_vkGetDeviceImageMemoryRequirements, "vkGetDeviceImageMemoryRequirements");
++ }
++#endif
++
++#undef VMA_FETCH_DEVICE_FUNC
++#undef VMA_FETCH_INSTANCE_FUNC
++}
++
++#endif // VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
++
++void VmaAllocator_T::ValidateVulkanFunctions()
++{
++ VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceProperties != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkAllocateMemory != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkFreeMemory != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkMapMemory != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkUnmapMemory != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkFlushMappedMemoryRanges != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkInvalidateMappedMemoryRanges != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkCreateBuffer != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkDestroyBuffer != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkCreateImage != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkDestroyImage != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkCmdCopyBuffer != VMA_NULL);
++
++#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0) || m_UseKhrDedicatedAllocation)
++ {
++ VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements2KHR != VMA_NULL);
++ }
++#endif
++
++#if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0) || m_UseKhrBindMemory2)
++ {
++ VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL);
++ }
++#endif
++
++#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000
++ if(m_UseExtMemoryBudget || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR != VMA_NULL);
++ }
++#endif
++
++#if VMA_VULKAN_VERSION >= 1003000
++ if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 3, 0))
++ {
++ VMA_ASSERT(m_VulkanFunctions.vkGetDeviceBufferMemoryRequirements != VMA_NULL);
++ VMA_ASSERT(m_VulkanFunctions.vkGetDeviceImageMemoryRequirements != VMA_NULL);
++ }
++#endif
++}
++
++VkDeviceSize VmaAllocator_T::CalcPreferredBlockSize(uint32_t memTypeIndex)
++{
++ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
++ const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
++ const bool isSmallHeap = heapSize <= VMA_SMALL_HEAP_MAX_SIZE;
++ return VmaAlignUp(isSmallHeap ? (heapSize / 8) : m_PreferredLargeHeapBlockSize, (VkDeviceSize)32);
++}
++
++VkResult VmaAllocator_T::AllocateMemoryOfType(
++ VmaPool pool,
++ VkDeviceSize size,
++ VkDeviceSize alignment,
++ bool dedicatedPreferred,
++ VkBuffer dedicatedBuffer,
++ VkImage dedicatedImage,
++ VkFlags dedicatedBufferImageUsage,
++ const VmaAllocationCreateInfo& createInfo,
++ uint32_t memTypeIndex,
++ VmaSuballocationType suballocType,
++ VmaDedicatedAllocationList& dedicatedAllocations,
++ VmaBlockVector& blockVector,
++ size_t allocationCount,
++ VmaAllocation* pAllocations)
++{
++ VMA_ASSERT(pAllocations != VMA_NULL);
++ VMA_DEBUG_LOG(" AllocateMemory: MemoryTypeIndex=%u, AllocationCount=%zu, Size=%llu", memTypeIndex, allocationCount, size);
++
++ VmaAllocationCreateInfo finalCreateInfo = createInfo;
++ VkResult res = CalcMemTypeParams(
++ finalCreateInfo,
++ memTypeIndex,
++ size,
++ allocationCount);
++ if(res != VK_SUCCESS)
++ return res;
++
++ if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0)
++ {
++ return AllocateDedicatedMemory(
++ pool,
++ size,
++ suballocType,
++ dedicatedAllocations,
++ memTypeIndex,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0,
++ (finalCreateInfo.flags &
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT) != 0,
++ finalCreateInfo.pUserData,
++ finalCreateInfo.priority,
++ dedicatedBuffer,
++ dedicatedImage,
++ dedicatedBufferImageUsage,
++ allocationCount,
++ pAllocations,
++ blockVector.GetAllocationNextPtr());
++ }
++ else
++ {
++ const bool canAllocateDedicated =
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0 &&
++ (pool == VK_NULL_HANDLE || !blockVector.HasExplicitBlockSize());
++
++ if(canAllocateDedicated)
++ {
++ // Heuristics: Allocate dedicated memory if requested size if greater than half of preferred block size.
++ if(size > blockVector.GetPreferredBlockSize() / 2)
++ {
++ dedicatedPreferred = true;
++ }
++ // Protection against creating each allocation as dedicated when we reach or exceed heap size/budget,
++ // which can quickly deplete maxMemoryAllocationCount: Don't prefer dedicated allocations when above
++ // 3/4 of the maximum allocation count.
++ if(m_DeviceMemoryCount.load() > m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount * 3 / 4)
++ {
++ dedicatedPreferred = false;
++ }
++
++ if(dedicatedPreferred)
++ {
++ res = AllocateDedicatedMemory(
++ pool,
++ size,
++ suballocType,
++ dedicatedAllocations,
++ memTypeIndex,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0,
++ (finalCreateInfo.flags &
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT) != 0,
++ finalCreateInfo.pUserData,
++ finalCreateInfo.priority,
++ dedicatedBuffer,
++ dedicatedImage,
++ dedicatedBufferImageUsage,
++ allocationCount,
++ pAllocations,
++ blockVector.GetAllocationNextPtr());
++ if(res == VK_SUCCESS)
++ {
++ // Succeeded: AllocateDedicatedMemory function already filld pMemory, nothing more to do here.
++ VMA_DEBUG_LOG(" Allocated as DedicatedMemory");
++ return VK_SUCCESS;
++ }
++ }
++ }
++
++ res = blockVector.Allocate(
++ size,
++ alignment,
++ finalCreateInfo,
++ suballocType,
++ allocationCount,
++ pAllocations);
++ if(res == VK_SUCCESS)
++ return VK_SUCCESS;
++
++ // Try dedicated memory.
++ if(canAllocateDedicated && !dedicatedPreferred)
++ {
++ res = AllocateDedicatedMemory(
++ pool,
++ size,
++ suballocType,
++ dedicatedAllocations,
++ memTypeIndex,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0,
++ (finalCreateInfo.flags &
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0,
++ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT) != 0,
++ finalCreateInfo.pUserData,
++ finalCreateInfo.priority,
++ dedicatedBuffer,
++ dedicatedImage,
++ dedicatedBufferImageUsage,
++ allocationCount,
++ pAllocations,
++ blockVector.GetAllocationNextPtr());
++ if(res == VK_SUCCESS)
++ {
++ // Succeeded: AllocateDedicatedMemory function already filld pMemory, nothing more to do here.
++ VMA_DEBUG_LOG(" Allocated as DedicatedMemory");
++ return VK_SUCCESS;
++ }
++ }
++ // Everything failed: Return error code.
++ VMA_DEBUG_LOG(" vkAllocateMemory FAILED");
++ return res;
++ }
++}
++
++VkResult VmaAllocator_T::AllocateDedicatedMemory(
++ VmaPool pool,
++ VkDeviceSize size,
++ VmaSuballocationType suballocType,
++ VmaDedicatedAllocationList& dedicatedAllocations,
++ uint32_t memTypeIndex,
++ bool map,
++ bool isUserDataString,
++ bool isMappingAllowed,
++ bool canAliasMemory,
++ void* pUserData,
++ float priority,
++ VkBuffer dedicatedBuffer,
++ VkImage dedicatedImage,
++ VkFlags dedicatedBufferImageUsage,
++ size_t allocationCount,
++ VmaAllocation* pAllocations,
++ const void* pNextChain)
++{
++ VMA_ASSERT(allocationCount > 0 && pAllocations);
++
++ VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
++ allocInfo.memoryTypeIndex = memTypeIndex;
++ allocInfo.allocationSize = size;
++ allocInfo.pNext = pNextChain;
++
++#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR };
++ if(!canAliasMemory)
++ {
++ if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ if(dedicatedBuffer != VK_NULL_HANDLE)
++ {
++ VMA_ASSERT(dedicatedImage == VK_NULL_HANDLE);
++ dedicatedAllocInfo.buffer = dedicatedBuffer;
++ VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
++ }
++ else if(dedicatedImage != VK_NULL_HANDLE)
++ {
++ dedicatedAllocInfo.image = dedicatedImage;
++ VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
++ }
++ }
++ }
++#endif // #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++
++#if VMA_BUFFER_DEVICE_ADDRESS
++ VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
++ if(m_UseKhrBufferDeviceAddress)
++ {
++ bool canContainBufferWithDeviceAddress = true;
++ if(dedicatedBuffer != VK_NULL_HANDLE)
++ {
++ canContainBufferWithDeviceAddress = dedicatedBufferImageUsage == UINT32_MAX || // Usage flags unknown
++ (dedicatedBufferImageUsage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT) != 0;
++ }
++ else if(dedicatedImage != VK_NULL_HANDLE)
++ {
++ canContainBufferWithDeviceAddress = false;
++ }
++ if(canContainBufferWithDeviceAddress)
++ {
++ allocFlagsInfo.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR;
++ VmaPnextChainPushFront(&allocInfo, &allocFlagsInfo);
++ }
++ }
++#endif // #if VMA_BUFFER_DEVICE_ADDRESS
++
++#if VMA_MEMORY_PRIORITY
++ VkMemoryPriorityAllocateInfoEXT priorityInfo = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
++ if(m_UseExtMemoryPriority)
++ {
++ VMA_ASSERT(priority >= 0.f && priority <= 1.f);
++ priorityInfo.priority = priority;
++ VmaPnextChainPushFront(&allocInfo, &priorityInfo);
++ }
++#endif // #if VMA_MEMORY_PRIORITY
++
++#if VMA_EXTERNAL_MEMORY
++ // Attach VkExportMemoryAllocateInfoKHR if necessary.
++ VkExportMemoryAllocateInfoKHR exportMemoryAllocInfo = { VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR };
++ exportMemoryAllocInfo.handleTypes = GetExternalMemoryHandleTypeFlags(memTypeIndex);
++ if(exportMemoryAllocInfo.handleTypes != 0)
++ {
++ VmaPnextChainPushFront(&allocInfo, &exportMemoryAllocInfo);
++ }
++#endif // #if VMA_EXTERNAL_MEMORY
++
++ size_t allocIndex;
++ VkResult res = VK_SUCCESS;
++ for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
++ {
++ res = AllocateDedicatedMemoryPage(
++ pool,
++ size,
++ suballocType,
++ memTypeIndex,
++ allocInfo,
++ map,
++ isUserDataString,
++ isMappingAllowed,
++ pUserData,
++ pAllocations + allocIndex);
++ if(res != VK_SUCCESS)
++ {
++ break;
++ }
++ }
++
++ if(res == VK_SUCCESS)
++ {
++ for (allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
++ {
++ dedicatedAllocations.Register(pAllocations[allocIndex]);
++ }
++ VMA_DEBUG_LOG(" Allocated DedicatedMemory Count=%zu, MemoryTypeIndex=#%u", allocationCount, memTypeIndex);
++ }
++ else
++ {
++ // Free all already created allocations.
++ while(allocIndex--)
++ {
++ VmaAllocation currAlloc = pAllocations[allocIndex];
++ VkDeviceMemory hMemory = currAlloc->GetMemory();
++
++ /*
++ There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory
++ before vkFreeMemory.
++
++ if(currAlloc->GetMappedData() != VMA_NULL)
++ {
++ (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory);
++ }
++ */
++
++ FreeVulkanMemory(memTypeIndex, currAlloc->GetSize(), hMemory);
++ m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(memTypeIndex), currAlloc->GetSize());
++ m_AllocationObjectAllocator.Free(currAlloc);
++ }
++
++ memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
++ }
++
++ return res;
++}
++
++VkResult VmaAllocator_T::AllocateDedicatedMemoryPage(
++ VmaPool pool,
++ VkDeviceSize size,
++ VmaSuballocationType suballocType,
++ uint32_t memTypeIndex,
++ const VkMemoryAllocateInfo& allocInfo,
++ bool map,
++ bool isUserDataString,
++ bool isMappingAllowed,
++ void* pUserData,
++ VmaAllocation* pAllocation)
++{
++ VkDeviceMemory hMemory = VK_NULL_HANDLE;
++ VkResult res = AllocateVulkanMemory(&allocInfo, &hMemory);
++ if(res < 0)
++ {
++ VMA_DEBUG_LOG(" vkAllocateMemory FAILED");
++ return res;
++ }
++
++ void* pMappedData = VMA_NULL;
++ if(map)
++ {
++ res = (*m_VulkanFunctions.vkMapMemory)(
++ m_hDevice,
++ hMemory,
++ 0,
++ VK_WHOLE_SIZE,
++ 0,
++ &pMappedData);
++ if(res < 0)
++ {
++ VMA_DEBUG_LOG(" vkMapMemory FAILED");
++ FreeVulkanMemory(memTypeIndex, size, hMemory);
++ return res;
++ }
++ }
++
++ *pAllocation = m_AllocationObjectAllocator.Allocate(isMappingAllowed);
++ (*pAllocation)->InitDedicatedAllocation(pool, memTypeIndex, hMemory, suballocType, pMappedData, size);
++ if (isUserDataString)
++ (*pAllocation)->SetName(this, (const char*)pUserData);
++ else
++ (*pAllocation)->SetUserData(this, pUserData);
++ m_Budget.AddAllocation(MemoryTypeIndexToHeapIndex(memTypeIndex), size);
++ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
++ {
++ FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
++ }
++
++ return VK_SUCCESS;
++}
++
++void VmaAllocator_T::GetBufferMemoryRequirements(
++ VkBuffer hBuffer,
++ VkMemoryRequirements& memReq,
++ bool& requiresDedicatedAllocation,
++ bool& prefersDedicatedAllocation) const
++{
++#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ VkBufferMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR };
++ memReqInfo.buffer = hBuffer;
++
++ VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
++
++ VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
++ VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
++
++ (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
++
++ memReq = memReq2.memoryRequirements;
++ requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
++ prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
++ }
++ else
++#endif // #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ {
++ (*m_VulkanFunctions.vkGetBufferMemoryRequirements)(m_hDevice, hBuffer, &memReq);
++ requiresDedicatedAllocation = false;
++ prefersDedicatedAllocation = false;
++ }
++}
++
++void VmaAllocator_T::GetImageMemoryRequirements(
++ VkImage hImage,
++ VkMemoryRequirements& memReq,
++ bool& requiresDedicatedAllocation,
++ bool& prefersDedicatedAllocation) const
++{
++#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
++ {
++ VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR };
++ memReqInfo.image = hImage;
++
++ VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
++
++ VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
++ VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
++
++ (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
++
++ memReq = memReq2.memoryRequirements;
++ requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
++ prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
++ }
++ else
++#endif // #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
++ {
++ (*m_VulkanFunctions.vkGetImageMemoryRequirements)(m_hDevice, hImage, &memReq);
++ requiresDedicatedAllocation = false;
++ prefersDedicatedAllocation = false;
++ }
++}
++
++VkResult VmaAllocator_T::FindMemoryTypeIndex(
++ uint32_t memoryTypeBits,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ VkFlags bufImgUsage,
++ uint32_t* pMemoryTypeIndex) const
++{
++ memoryTypeBits &= GetGlobalMemoryTypeBits();
++
++ if(pAllocationCreateInfo->memoryTypeBits != 0)
++ {
++ memoryTypeBits &= pAllocationCreateInfo->memoryTypeBits;
++ }
++
++ VkMemoryPropertyFlags requiredFlags = 0, preferredFlags = 0, notPreferredFlags = 0;
++ if(!FindMemoryPreferences(
++ IsIntegratedGpu(),
++ *pAllocationCreateInfo,
++ bufImgUsage,
++ requiredFlags, preferredFlags, notPreferredFlags))
++ {
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++
++ *pMemoryTypeIndex = UINT32_MAX;
++ uint32_t minCost = UINT32_MAX;
++ for(uint32_t memTypeIndex = 0, memTypeBit = 1;
++ memTypeIndex < GetMemoryTypeCount();
++ ++memTypeIndex, memTypeBit <<= 1)
++ {
++ // This memory type is acceptable according to memoryTypeBits bitmask.
++ if((memTypeBit & memoryTypeBits) != 0)
++ {
++ const VkMemoryPropertyFlags currFlags =
++ m_MemProps.memoryTypes[memTypeIndex].propertyFlags;
++ // This memory type contains requiredFlags.
++ if((requiredFlags & ~currFlags) == 0)
++ {
++ // Calculate cost as number of bits from preferredFlags not present in this memory type.
++ uint32_t currCost = VMA_COUNT_BITS_SET(preferredFlags & ~currFlags) +
++ VMA_COUNT_BITS_SET(currFlags & notPreferredFlags);
++ // Remember memory type with lowest cost.
++ if(currCost < minCost)
++ {
++ *pMemoryTypeIndex = memTypeIndex;
++ if(currCost == 0)
++ {
++ return VK_SUCCESS;
++ }
++ minCost = currCost;
++ }
++ }
++ }
++ }
++ return (*pMemoryTypeIndex != UINT32_MAX) ? VK_SUCCESS : VK_ERROR_FEATURE_NOT_PRESENT;
++}
++
++VkResult VmaAllocator_T::CalcMemTypeParams(
++ VmaAllocationCreateInfo& inoutCreateInfo,
++ uint32_t memTypeIndex,
++ VkDeviceSize size,
++ size_t allocationCount)
++{
++ // If memory type is not HOST_VISIBLE, disable MAPPED.
++ if((inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0 &&
++ (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
++ {
++ inoutCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_MAPPED_BIT;
++ }
++
++ if((inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0 &&
++ (inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT) != 0)
++ {
++ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
++ VmaBudget heapBudget = {};
++ GetHeapBudgets(&heapBudget, heapIndex, 1);
++ if(heapBudget.usage + size * allocationCount > heapBudget.budget)
++ {
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ }
++ }
++ return VK_SUCCESS;
++}
++
++VkResult VmaAllocator_T::CalcAllocationParams(
++ VmaAllocationCreateInfo& inoutCreateInfo,
++ bool dedicatedRequired,
++ bool dedicatedPreferred)
++{
++ VMA_ASSERT((inoutCreateInfo.flags &
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) !=
++ (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT) &&
++ "Specifying both flags VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT and VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT is incorrect.");
++ VMA_ASSERT((((inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT) == 0 ||
++ (inoutCreateInfo.flags & (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0)) &&
++ "Specifying VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT requires also VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT.");
++ if(inoutCreateInfo.usage == VMA_MEMORY_USAGE_AUTO || inoutCreateInfo.usage == VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE || inoutCreateInfo.usage == VMA_MEMORY_USAGE_AUTO_PREFER_HOST)
++ {
++ if((inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0)
++ {
++ VMA_ASSERT((inoutCreateInfo.flags & (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) != 0 &&
++ "When using VMA_ALLOCATION_CREATE_MAPPED_BIT and usage = VMA_MEMORY_USAGE_AUTO*, you must also specify VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT.");
++ }
++ }
++
++ // If memory is lazily allocated, it should be always dedicated.
++ if(dedicatedRequired ||
++ inoutCreateInfo.usage == VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED)
++ {
++ inoutCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
++ }
++
++ if(inoutCreateInfo.pool != VK_NULL_HANDLE)
++ {
++ if(inoutCreateInfo.pool->m_BlockVector.HasExplicitBlockSize() &&
++ (inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0)
++ {
++ VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT while current custom pool doesn't support dedicated allocations.");
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++ inoutCreateInfo.priority = inoutCreateInfo.pool->m_BlockVector.GetPriority();
++ }
++
++ if((inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0 &&
++ (inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0)
++ {
++ VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT together with VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT makes no sense.");
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++
++ if(VMA_DEBUG_ALWAYS_DEDICATED_MEMORY &&
++ (inoutCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0)
++ {
++ inoutCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
++ }
++
++ // Non-auto USAGE values imply HOST_ACCESS flags.
++ // And so does VMA_MEMORY_USAGE_UNKNOWN because it is used with custom pools.
++ // Which specific flag is used doesn't matter. They change things only when used with VMA_MEMORY_USAGE_AUTO*.
++ // Otherwise they just protect from assert on mapping.
++ if(inoutCreateInfo.usage != VMA_MEMORY_USAGE_AUTO &&
++ inoutCreateInfo.usage != VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE &&
++ inoutCreateInfo.usage != VMA_MEMORY_USAGE_AUTO_PREFER_HOST)
++ {
++ if((inoutCreateInfo.flags & (VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT)) == 0)
++ {
++ inoutCreateInfo.flags |= VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT;
++ }
++ }
++
++ return VK_SUCCESS;
++}
++
++VkResult VmaAllocator_T::AllocateMemory(
++ const VkMemoryRequirements& vkMemReq,
++ bool requiresDedicatedAllocation,
++ bool prefersDedicatedAllocation,
++ VkBuffer dedicatedBuffer,
++ VkImage dedicatedImage,
++ VkFlags dedicatedBufferImageUsage,
++ const VmaAllocationCreateInfo& createInfo,
++ VmaSuballocationType suballocType,
++ size_t allocationCount,
++ VmaAllocation* pAllocations)
++{
++ memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
++
++ VMA_ASSERT(VmaIsPow2(vkMemReq.alignment));
++
++ if(vkMemReq.size == 0)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++
++ VmaAllocationCreateInfo createInfoFinal = createInfo;
++ VkResult res = CalcAllocationParams(createInfoFinal, requiresDedicatedAllocation, prefersDedicatedAllocation);
++ if(res != VK_SUCCESS)
++ return res;
++
++ if(createInfoFinal.pool != VK_NULL_HANDLE)
++ {
++ VmaBlockVector& blockVector = createInfoFinal.pool->m_BlockVector;
++ return AllocateMemoryOfType(
++ createInfoFinal.pool,
++ vkMemReq.size,
++ vkMemReq.alignment,
++ prefersDedicatedAllocation,
++ dedicatedBuffer,
++ dedicatedImage,
++ dedicatedBufferImageUsage,
++ createInfoFinal,
++ blockVector.GetMemoryTypeIndex(),
++ suballocType,
++ createInfoFinal.pool->m_DedicatedAllocations,
++ blockVector,
++ allocationCount,
++ pAllocations);
++ }
++ else
++ {
++ // Bit mask of memory Vulkan types acceptable for this allocation.
++ uint32_t memoryTypeBits = vkMemReq.memoryTypeBits;
++ uint32_t memTypeIndex = UINT32_MAX;
++ res = FindMemoryTypeIndex(memoryTypeBits, &createInfoFinal, dedicatedBufferImageUsage, &memTypeIndex);
++ // Can't find any single memory type matching requirements. res is VK_ERROR_FEATURE_NOT_PRESENT.
++ if(res != VK_SUCCESS)
++ return res;
++ do
++ {
++ VmaBlockVector* blockVector = m_pBlockVectors[memTypeIndex];
++ VMA_ASSERT(blockVector && "Trying to use unsupported memory type!");
++ res = AllocateMemoryOfType(
++ VK_NULL_HANDLE,
++ vkMemReq.size,
++ vkMemReq.alignment,
++ requiresDedicatedAllocation || prefersDedicatedAllocation,
++ dedicatedBuffer,
++ dedicatedImage,
++ dedicatedBufferImageUsage,
++ createInfoFinal,
++ memTypeIndex,
++ suballocType,
++ m_DedicatedAllocations[memTypeIndex],
++ *blockVector,
++ allocationCount,
++ pAllocations);
++ // Allocation succeeded
++ if(res == VK_SUCCESS)
++ return VK_SUCCESS;
++
++ // Remove old memTypeIndex from list of possibilities.
++ memoryTypeBits &= ~(1u << memTypeIndex);
++ // Find alternative memTypeIndex.
++ res = FindMemoryTypeIndex(memoryTypeBits, &createInfoFinal, dedicatedBufferImageUsage, &memTypeIndex);
++ } while(res == VK_SUCCESS);
++
++ // No other matching memory type index could be found.
++ // Not returning res, which is VK_ERROR_FEATURE_NOT_PRESENT, because we already failed to allocate once.
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ }
++}
++
++void VmaAllocator_T::FreeMemory(
++ size_t allocationCount,
++ const VmaAllocation* pAllocations)
++{
++ VMA_ASSERT(pAllocations);
++
++ for(size_t allocIndex = allocationCount; allocIndex--; )
++ {
++ VmaAllocation allocation = pAllocations[allocIndex];
++
++ if(allocation != VK_NULL_HANDLE)
++ {
++ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
++ {
++ FillAllocation(allocation, VMA_ALLOCATION_FILL_PATTERN_DESTROYED);
++ }
++
++ allocation->FreeName(this);
++
++ switch(allocation->GetType())
++ {
++ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
++ {
++ VmaBlockVector* pBlockVector = VMA_NULL;
++ VmaPool hPool = allocation->GetParentPool();
++ if(hPool != VK_NULL_HANDLE)
++ {
++ pBlockVector = &hPool->m_BlockVector;
++ }
++ else
++ {
++ const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
++ pBlockVector = m_pBlockVectors[memTypeIndex];
++ VMA_ASSERT(pBlockVector && "Trying to free memory of unsupported type!");
++ }
++ pBlockVector->Free(allocation);
++ }
++ break;
++ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
++ FreeDedicatedMemory(allocation);
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++ }
++ }
++}
++
++void VmaAllocator_T::CalculateStatistics(VmaTotalStatistics* pStats)
++{
++ // Initialize.
++ VmaClearDetailedStatistics(pStats->total);
++ for(uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i)
++ VmaClearDetailedStatistics(pStats->memoryType[i]);
++ for(uint32_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i)
++ VmaClearDetailedStatistics(pStats->memoryHeap[i]);
++
++ // Process default pools.
++ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ VmaBlockVector* const pBlockVector = m_pBlockVectors[memTypeIndex];
++ if (pBlockVector != VMA_NULL)
++ pBlockVector->AddDetailedStatistics(pStats->memoryType[memTypeIndex]);
++ }
++
++ // Process custom pools.
++ {
++ VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
++ for(VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
++ {
++ VmaBlockVector& blockVector = pool->m_BlockVector;
++ const uint32_t memTypeIndex = blockVector.GetMemoryTypeIndex();
++ blockVector.AddDetailedStatistics(pStats->memoryType[memTypeIndex]);
++ pool->m_DedicatedAllocations.AddDetailedStatistics(pStats->memoryType[memTypeIndex]);
++ }
++ }
++
++ // Process dedicated allocations.
++ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ m_DedicatedAllocations[memTypeIndex].AddDetailedStatistics(pStats->memoryType[memTypeIndex]);
++ }
++
++ // Sum from memory types to memory heaps.
++ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ const uint32_t memHeapIndex = m_MemProps.memoryTypes[memTypeIndex].heapIndex;
++ VmaAddDetailedStatistics(pStats->memoryHeap[memHeapIndex], pStats->memoryType[memTypeIndex]);
++ }
++
++ // Sum from memory heaps to total.
++ for(uint32_t memHeapIndex = 0; memHeapIndex < GetMemoryHeapCount(); ++memHeapIndex)
++ VmaAddDetailedStatistics(pStats->total, pStats->memoryHeap[memHeapIndex]);
++
++ VMA_ASSERT(pStats->total.statistics.allocationCount == 0 ||
++ pStats->total.allocationSizeMax >= pStats->total.allocationSizeMin);
++ VMA_ASSERT(pStats->total.unusedRangeCount == 0 ||
++ pStats->total.unusedRangeSizeMax >= pStats->total.unusedRangeSizeMin);
++}
++
++void VmaAllocator_T::GetHeapBudgets(VmaBudget* outBudgets, uint32_t firstHeap, uint32_t heapCount)
++{
++#if VMA_MEMORY_BUDGET
++ if(m_UseExtMemoryBudget)
++ {
++ if(m_Budget.m_OperationsSinceBudgetFetch < 30)
++ {
++ VmaMutexLockRead lockRead(m_Budget.m_BudgetMutex, m_UseMutex);
++ for(uint32_t i = 0; i < heapCount; ++i, ++outBudgets)
++ {
++ const uint32_t heapIndex = firstHeap + i;
++
++ outBudgets->statistics.blockCount = m_Budget.m_BlockCount[heapIndex];
++ outBudgets->statistics.allocationCount = m_Budget.m_AllocationCount[heapIndex];
++ outBudgets->statistics.blockBytes = m_Budget.m_BlockBytes[heapIndex];
++ outBudgets->statistics.allocationBytes = m_Budget.m_AllocationBytes[heapIndex];
++
++ if(m_Budget.m_VulkanUsage[heapIndex] + outBudgets->statistics.blockBytes > m_Budget.m_BlockBytesAtBudgetFetch[heapIndex])
++ {
++ outBudgets->usage = m_Budget.m_VulkanUsage[heapIndex] +
++ outBudgets->statistics.blockBytes - m_Budget.m_BlockBytesAtBudgetFetch[heapIndex];
++ }
++ else
++ {
++ outBudgets->usage = 0;
++ }
++
++ // Have to take MIN with heap size because explicit HeapSizeLimit is included in it.
++ outBudgets->budget = VMA_MIN(
++ m_Budget.m_VulkanBudget[heapIndex], m_MemProps.memoryHeaps[heapIndex].size);
++ }
++ }
++ else
++ {
++ UpdateVulkanBudget(); // Outside of mutex lock
++ GetHeapBudgets(outBudgets, firstHeap, heapCount); // Recursion
++ }
++ }
++ else
++#endif
++ {
++ for(uint32_t i = 0; i < heapCount; ++i, ++outBudgets)
++ {
++ const uint32_t heapIndex = firstHeap + i;
++
++ outBudgets->statistics.blockCount = m_Budget.m_BlockCount[heapIndex];
++ outBudgets->statistics.allocationCount = m_Budget.m_AllocationCount[heapIndex];
++ outBudgets->statistics.blockBytes = m_Budget.m_BlockBytes[heapIndex];
++ outBudgets->statistics.allocationBytes = m_Budget.m_AllocationBytes[heapIndex];
++
++ outBudgets->usage = outBudgets->statistics.blockBytes;
++ outBudgets->budget = m_MemProps.memoryHeaps[heapIndex].size * 8 / 10; // 80% heuristics.
++ }
++ }
++}
++
++void VmaAllocator_T::GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo)
++{
++ pAllocationInfo->memoryType = hAllocation->GetMemoryTypeIndex();
++ pAllocationInfo->deviceMemory = hAllocation->GetMemory();
++ pAllocationInfo->offset = hAllocation->GetOffset();
++ pAllocationInfo->size = hAllocation->GetSize();
++ pAllocationInfo->pMappedData = hAllocation->GetMappedData();
++ pAllocationInfo->pUserData = hAllocation->GetUserData();
++ pAllocationInfo->pName = hAllocation->GetName();
++}
++
++VkResult VmaAllocator_T::CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool)
++{
++ VMA_DEBUG_LOG(" CreatePool: MemoryTypeIndex=%u, flags=%u", pCreateInfo->memoryTypeIndex, pCreateInfo->flags);
++
++ VmaPoolCreateInfo newCreateInfo = *pCreateInfo;
++
++ // Protection against uninitialized new structure member. If garbage data are left there, this pointer dereference would crash.
++ if(pCreateInfo->pMemoryAllocateNext)
++ {
++ VMA_ASSERT(((const VkBaseInStructure*)pCreateInfo->pMemoryAllocateNext)->sType != 0);
++ }
++
++ if(newCreateInfo.maxBlockCount == 0)
++ {
++ newCreateInfo.maxBlockCount = SIZE_MAX;
++ }
++ if(newCreateInfo.minBlockCount > newCreateInfo.maxBlockCount)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++ // Memory type index out of range or forbidden.
++ if(pCreateInfo->memoryTypeIndex >= GetMemoryTypeCount() ||
++ ((1u << pCreateInfo->memoryTypeIndex) & m_GlobalMemoryTypeBits) == 0)
++ {
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++ if(newCreateInfo.minAllocationAlignment > 0)
++ {
++ VMA_ASSERT(VmaIsPow2(newCreateInfo.minAllocationAlignment));
++ }
++
++ const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(newCreateInfo.memoryTypeIndex);
++
++ *pPool = vma_new(this, VmaPool_T)(this, newCreateInfo, preferredBlockSize);
++
++ VkResult res = (*pPool)->m_BlockVector.CreateMinBlocks();
++ if(res != VK_SUCCESS)
++ {
++ vma_delete(this, *pPool);
++ *pPool = VMA_NULL;
++ return res;
++ }
++
++ // Add to m_Pools.
++ {
++ VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
++ (*pPool)->SetId(m_NextPoolId++);
++ m_Pools.PushBack(*pPool);
++ }
++
++ return VK_SUCCESS;
++}
++
++void VmaAllocator_T::DestroyPool(VmaPool pool)
++{
++ // Remove from m_Pools.
++ {
++ VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
++ m_Pools.Remove(pool);
++ }
++
++ vma_delete(this, pool);
++}
++
++void VmaAllocator_T::GetPoolStatistics(VmaPool pool, VmaStatistics* pPoolStats)
++{
++ VmaClearStatistics(*pPoolStats);
++ pool->m_BlockVector.AddStatistics(*pPoolStats);
++ pool->m_DedicatedAllocations.AddStatistics(*pPoolStats);
++}
++
++void VmaAllocator_T::CalculatePoolStatistics(VmaPool pool, VmaDetailedStatistics* pPoolStats)
++{
++ VmaClearDetailedStatistics(*pPoolStats);
++ pool->m_BlockVector.AddDetailedStatistics(*pPoolStats);
++ pool->m_DedicatedAllocations.AddDetailedStatistics(*pPoolStats);
++}
++
++void VmaAllocator_T::SetCurrentFrameIndex(uint32_t frameIndex)
++{
++ m_CurrentFrameIndex.store(frameIndex);
++
++#if VMA_MEMORY_BUDGET
++ if(m_UseExtMemoryBudget)
++ {
++ UpdateVulkanBudget();
++ }
++#endif // #if VMA_MEMORY_BUDGET
++}
++
++VkResult VmaAllocator_T::CheckPoolCorruption(VmaPool hPool)
++{
++ return hPool->m_BlockVector.CheckCorruption();
++}
++
++VkResult VmaAllocator_T::CheckCorruption(uint32_t memoryTypeBits)
++{
++ VkResult finalRes = VK_ERROR_FEATURE_NOT_PRESENT;
++
++ // Process default pools.
++ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ VmaBlockVector* const pBlockVector = m_pBlockVectors[memTypeIndex];
++ if(pBlockVector != VMA_NULL)
++ {
++ VkResult localRes = pBlockVector->CheckCorruption();
++ switch(localRes)
++ {
++ case VK_ERROR_FEATURE_NOT_PRESENT:
++ break;
++ case VK_SUCCESS:
++ finalRes = VK_SUCCESS;
++ break;
++ default:
++ return localRes;
++ }
++ }
++ }
++
++ // Process custom pools.
++ {
++ VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
++ for(VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
++ {
++ if(((1u << pool->m_BlockVector.GetMemoryTypeIndex()) & memoryTypeBits) != 0)
++ {
++ VkResult localRes = pool->m_BlockVector.CheckCorruption();
++ switch(localRes)
++ {
++ case VK_ERROR_FEATURE_NOT_PRESENT:
++ break;
++ case VK_SUCCESS:
++ finalRes = VK_SUCCESS;
++ break;
++ default:
++ return localRes;
++ }
++ }
++ }
++ }
++
++ return finalRes;
++}
++
++VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
++{
++ AtomicTransactionalIncrement<uint32_t> deviceMemoryCountIncrement;
++ const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount);
++#if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
++ if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount)
++ {
++ return VK_ERROR_TOO_MANY_OBJECTS;
++ }
++#endif
++
++ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(pAllocateInfo->memoryTypeIndex);
++
++ // HeapSizeLimit is in effect for this heap.
++ if((m_HeapSizeLimitMask & (1u << heapIndex)) != 0)
++ {
++ const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
++ VkDeviceSize blockBytes = m_Budget.m_BlockBytes[heapIndex];
++ for(;;)
++ {
++ const VkDeviceSize blockBytesAfterAllocation = blockBytes + pAllocateInfo->allocationSize;
++ if(blockBytesAfterAllocation > heapSize)
++ {
++ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
++ }
++ if(m_Budget.m_BlockBytes[heapIndex].compare_exchange_strong(blockBytes, blockBytesAfterAllocation))
++ {
++ break;
++ }
++ }
++ }
++ else
++ {
++ m_Budget.m_BlockBytes[heapIndex] += pAllocateInfo->allocationSize;
++ }
++ ++m_Budget.m_BlockCount[heapIndex];
++
++ // VULKAN CALL vkAllocateMemory.
++ VkResult res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory);
++
++ if(res == VK_SUCCESS)
++ {
++#if VMA_MEMORY_BUDGET
++ ++m_Budget.m_OperationsSinceBudgetFetch;
++#endif
++
++ // Informative callback.
++ if(m_DeviceMemoryCallbacks.pfnAllocate != VMA_NULL)
++ {
++ (*m_DeviceMemoryCallbacks.pfnAllocate)(this, pAllocateInfo->memoryTypeIndex, *pMemory, pAllocateInfo->allocationSize, m_DeviceMemoryCallbacks.pUserData);
++ }
++
++ deviceMemoryCountIncrement.Commit();
++ }
++ else
++ {
++ --m_Budget.m_BlockCount[heapIndex];
++ m_Budget.m_BlockBytes[heapIndex] -= pAllocateInfo->allocationSize;
++ }
++
++ return res;
++}
++
++void VmaAllocator_T::FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory)
++{
++ // Informative callback.
++ if(m_DeviceMemoryCallbacks.pfnFree != VMA_NULL)
++ {
++ (*m_DeviceMemoryCallbacks.pfnFree)(this, memoryType, hMemory, size, m_DeviceMemoryCallbacks.pUserData);
++ }
++
++ // VULKAN CALL vkFreeMemory.
++ (*m_VulkanFunctions.vkFreeMemory)(m_hDevice, hMemory, GetAllocationCallbacks());
++
++ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memoryType);
++ --m_Budget.m_BlockCount[heapIndex];
++ m_Budget.m_BlockBytes[heapIndex] -= size;
++
++ --m_DeviceMemoryCount;
++}
++
++VkResult VmaAllocator_T::BindVulkanBuffer(
++ VkDeviceMemory memory,
++ VkDeviceSize memoryOffset,
++ VkBuffer buffer,
++ const void* pNext)
++{
++ if(pNext != VMA_NULL)
++ {
++#if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
++ if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
++ m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL)
++ {
++ VkBindBufferMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR };
++ bindBufferMemoryInfo.pNext = pNext;
++ bindBufferMemoryInfo.buffer = buffer;
++ bindBufferMemoryInfo.memory = memory;
++ bindBufferMemoryInfo.memoryOffset = memoryOffset;
++ return (*m_VulkanFunctions.vkBindBufferMemory2KHR)(m_hDevice, 1, &bindBufferMemoryInfo);
++ }
++ else
++#endif // #if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
++ {
++ return VK_ERROR_EXTENSION_NOT_PRESENT;
++ }
++ }
++ else
++ {
++ return (*m_VulkanFunctions.vkBindBufferMemory)(m_hDevice, buffer, memory, memoryOffset);
++ }
++}
++
++VkResult VmaAllocator_T::BindVulkanImage(
++ VkDeviceMemory memory,
++ VkDeviceSize memoryOffset,
++ VkImage image,
++ const void* pNext)
++{
++ if(pNext != VMA_NULL)
++ {
++#if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
++ if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
++ m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL)
++ {
++ VkBindImageMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR };
++ bindBufferMemoryInfo.pNext = pNext;
++ bindBufferMemoryInfo.image = image;
++ bindBufferMemoryInfo.memory = memory;
++ bindBufferMemoryInfo.memoryOffset = memoryOffset;
++ return (*m_VulkanFunctions.vkBindImageMemory2KHR)(m_hDevice, 1, &bindBufferMemoryInfo);
++ }
++ else
++#endif // #if VMA_BIND_MEMORY2
++ {
++ return VK_ERROR_EXTENSION_NOT_PRESENT;
++ }
++ }
++ else
++ {
++ return (*m_VulkanFunctions.vkBindImageMemory)(m_hDevice, image, memory, memoryOffset);
++ }
++}
++
++VkResult VmaAllocator_T::Map(VmaAllocation hAllocation, void** ppData)
++{
++ switch(hAllocation->GetType())
++ {
++ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
++ {
++ VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock();
++ char *pBytes = VMA_NULL;
++ VkResult res = pBlock->Map(this, 1, (void**)&pBytes);
++ if(res == VK_SUCCESS)
++ {
++ *ppData = pBytes + (ptrdiff_t)hAllocation->GetOffset();
++ hAllocation->BlockAllocMap();
++ }
++ return res;
++ }
++ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
++ return hAllocation->DedicatedAllocMap(this, ppData);
++ default:
++ VMA_ASSERT(0);
++ return VK_ERROR_MEMORY_MAP_FAILED;
++ }
++}
++
++void VmaAllocator_T::Unmap(VmaAllocation hAllocation)
++{
++ switch(hAllocation->GetType())
++ {
++ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
++ {
++ VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock();
++ hAllocation->BlockAllocUnmap();
++ pBlock->Unmap(this, 1);
++ }
++ break;
++ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
++ hAllocation->DedicatedAllocUnmap(this);
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++}
++
++VkResult VmaAllocator_T::BindBufferMemory(
++ VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkBuffer hBuffer,
++ const void* pNext)
++{
++ VkResult res = VK_SUCCESS;
++ switch(hAllocation->GetType())
++ {
++ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
++ res = BindVulkanBuffer(hAllocation->GetMemory(), allocationLocalOffset, hBuffer, pNext);
++ break;
++ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
++ {
++ VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock();
++ VMA_ASSERT(pBlock && "Binding buffer to allocation that doesn't belong to any block.");
++ res = pBlock->BindBufferMemory(this, hAllocation, allocationLocalOffset, hBuffer, pNext);
++ break;
++ }
++ default:
++ VMA_ASSERT(0);
++ }
++ return res;
++}
++
++VkResult VmaAllocator_T::BindImageMemory(
++ VmaAllocation hAllocation,
++ VkDeviceSize allocationLocalOffset,
++ VkImage hImage,
++ const void* pNext)
++{
++ VkResult res = VK_SUCCESS;
++ switch(hAllocation->GetType())
++ {
++ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
++ res = BindVulkanImage(hAllocation->GetMemory(), allocationLocalOffset, hImage, pNext);
++ break;
++ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
++ {
++ VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
++ VMA_ASSERT(pBlock && "Binding image to allocation that doesn't belong to any block.");
++ res = pBlock->BindImageMemory(this, hAllocation, allocationLocalOffset, hImage, pNext);
++ break;
++ }
++ default:
++ VMA_ASSERT(0);
++ }
++ return res;
++}
++
++VkResult VmaAllocator_T::FlushOrInvalidateAllocation(
++ VmaAllocation hAllocation,
++ VkDeviceSize offset, VkDeviceSize size,
++ VMA_CACHE_OPERATION op)
++{
++ VkResult res = VK_SUCCESS;
++
++ VkMappedMemoryRange memRange = {};
++ if(GetFlushOrInvalidateRange(hAllocation, offset, size, memRange))
++ {
++ switch(op)
++ {
++ case VMA_CACHE_FLUSH:
++ res = (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, 1, &memRange);
++ break;
++ case VMA_CACHE_INVALIDATE:
++ res = (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, 1, &memRange);
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++ }
++ // else: Just ignore this call.
++ return res;
++}
++
++VkResult VmaAllocator_T::FlushOrInvalidateAllocations(
++ uint32_t allocationCount,
++ const VmaAllocation* allocations,
++ const VkDeviceSize* offsets, const VkDeviceSize* sizes,
++ VMA_CACHE_OPERATION op)
++{
++ typedef VmaStlAllocator<VkMappedMemoryRange> RangeAllocator;
++ typedef VmaSmallVector<VkMappedMemoryRange, RangeAllocator, 16> RangeVector;
++ RangeVector ranges = RangeVector(RangeAllocator(GetAllocationCallbacks()));
++
++ for(uint32_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
++ {
++ const VmaAllocation alloc = allocations[allocIndex];
++ const VkDeviceSize offset = offsets != VMA_NULL ? offsets[allocIndex] : 0;
++ const VkDeviceSize size = sizes != VMA_NULL ? sizes[allocIndex] : VK_WHOLE_SIZE;
++ VkMappedMemoryRange newRange;
++ if(GetFlushOrInvalidateRange(alloc, offset, size, newRange))
++ {
++ ranges.push_back(newRange);
++ }
++ }
++
++ VkResult res = VK_SUCCESS;
++ if(!ranges.empty())
++ {
++ switch(op)
++ {
++ case VMA_CACHE_FLUSH:
++ res = (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, (uint32_t)ranges.size(), ranges.data());
++ break;
++ case VMA_CACHE_INVALIDATE:
++ res = (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, (uint32_t)ranges.size(), ranges.data());
++ break;
++ default:
++ VMA_ASSERT(0);
++ }
++ }
++ // else: Just ignore this call.
++ return res;
++}
++
++void VmaAllocator_T::FreeDedicatedMemory(const VmaAllocation allocation)
++{
++ VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
++
++ const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
++ VmaPool parentPool = allocation->GetParentPool();
++ if(parentPool == VK_NULL_HANDLE)
++ {
++ // Default pool
++ m_DedicatedAllocations[memTypeIndex].Unregister(allocation);
++ }
++ else
++ {
++ // Custom pool
++ parentPool->m_DedicatedAllocations.Unregister(allocation);
++ }
++
++ VkDeviceMemory hMemory = allocation->GetMemory();
++
++ /*
++ There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory
++ before vkFreeMemory.
++
++ if(allocation->GetMappedData() != VMA_NULL)
++ {
++ (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory);
++ }
++ */
++
++ FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory);
++
++ m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(allocation->GetMemoryTypeIndex()), allocation->GetSize());
++ m_AllocationObjectAllocator.Free(allocation);
++
++ VMA_DEBUG_LOG(" Freed DedicatedMemory MemoryTypeIndex=%u", memTypeIndex);
++}
++
++uint32_t VmaAllocator_T::CalculateGpuDefragmentationMemoryTypeBits() const
++{
++ VkBufferCreateInfo dummyBufCreateInfo;
++ VmaFillGpuDefragmentationBufferCreateInfo(dummyBufCreateInfo);
++
++ uint32_t memoryTypeBits = 0;
++
++ // Create buffer.
++ VkBuffer buf = VK_NULL_HANDLE;
++ VkResult res = (*GetVulkanFunctions().vkCreateBuffer)(
++ m_hDevice, &dummyBufCreateInfo, GetAllocationCallbacks(), &buf);
++ if(res == VK_SUCCESS)
++ {
++ // Query for supported memory types.
++ VkMemoryRequirements memReq;
++ (*GetVulkanFunctions().vkGetBufferMemoryRequirements)(m_hDevice, buf, &memReq);
++ memoryTypeBits = memReq.memoryTypeBits;
++
++ // Destroy buffer.
++ (*GetVulkanFunctions().vkDestroyBuffer)(m_hDevice, buf, GetAllocationCallbacks());
++ }
++
++ return memoryTypeBits;
++}
++
++uint32_t VmaAllocator_T::CalculateGlobalMemoryTypeBits() const
++{
++ // Make sure memory information is already fetched.
++ VMA_ASSERT(GetMemoryTypeCount() > 0);
++
++ uint32_t memoryTypeBits = UINT32_MAX;
++
++ if(!m_UseAmdDeviceCoherentMemory)
++ {
++ // Exclude memory types that have VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD.
++ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ if((m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY) != 0)
++ {
++ memoryTypeBits &= ~(1u << memTypeIndex);
++ }
++ }
++ }
++
++ return memoryTypeBits;
++}
++
++bool VmaAllocator_T::GetFlushOrInvalidateRange(
++ VmaAllocation allocation,
++ VkDeviceSize offset, VkDeviceSize size,
++ VkMappedMemoryRange& outRange) const
++{
++ const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
++ if(size > 0 && IsMemoryTypeNonCoherent(memTypeIndex))
++ {
++ const VkDeviceSize nonCoherentAtomSize = m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
++ const VkDeviceSize allocationSize = allocation->GetSize();
++ VMA_ASSERT(offset <= allocationSize);
++
++ outRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
++ outRange.pNext = VMA_NULL;
++ outRange.memory = allocation->GetMemory();
++
++ switch(allocation->GetType())
++ {
++ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
++ outRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
++ if(size == VK_WHOLE_SIZE)
++ {
++ outRange.size = allocationSize - outRange.offset;
++ }
++ else
++ {
++ VMA_ASSERT(offset + size <= allocationSize);
++ outRange.size = VMA_MIN(
++ VmaAlignUp(size + (offset - outRange.offset), nonCoherentAtomSize),
++ allocationSize - outRange.offset);
++ }
++ break;
++ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
++ {
++ // 1. Still within this allocation.
++ outRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
++ if(size == VK_WHOLE_SIZE)
++ {
++ size = allocationSize - offset;
++ }
++ else
++ {
++ VMA_ASSERT(offset + size <= allocationSize);
++ }
++ outRange.size = VmaAlignUp(size + (offset - outRange.offset), nonCoherentAtomSize);
++
++ // 2. Adjust to whole block.
++ const VkDeviceSize allocationOffset = allocation->GetOffset();
++ VMA_ASSERT(allocationOffset % nonCoherentAtomSize == 0);
++ const VkDeviceSize blockSize = allocation->GetBlock()->m_pMetadata->GetSize();
++ outRange.offset += allocationOffset;
++ outRange.size = VMA_MIN(outRange.size, blockSize - outRange.offset);
++
++ break;
++ }
++ default:
++ VMA_ASSERT(0);
++ }
++ return true;
++ }
++ return false;
++}
++
++#if VMA_MEMORY_BUDGET
++void VmaAllocator_T::UpdateVulkanBudget()
++{
++ VMA_ASSERT(m_UseExtMemoryBudget);
++
++ VkPhysicalDeviceMemoryProperties2KHR memProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR };
++
++ VkPhysicalDeviceMemoryBudgetPropertiesEXT budgetProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT };
++ VmaPnextChainPushFront(&memProps, &budgetProps);
++
++ GetVulkanFunctions().vkGetPhysicalDeviceMemoryProperties2KHR(m_PhysicalDevice, &memProps);
++
++ {
++ VmaMutexLockWrite lockWrite(m_Budget.m_BudgetMutex, m_UseMutex);
++
++ for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
++ {
++ m_Budget.m_VulkanUsage[heapIndex] = budgetProps.heapUsage[heapIndex];
++ m_Budget.m_VulkanBudget[heapIndex] = budgetProps.heapBudget[heapIndex];
++ m_Budget.m_BlockBytesAtBudgetFetch[heapIndex] = m_Budget.m_BlockBytes[heapIndex].load();
++
++ // Some bugged drivers return the budget incorrectly, e.g. 0 or much bigger than heap size.
++ if(m_Budget.m_VulkanBudget[heapIndex] == 0)
++ {
++ m_Budget.m_VulkanBudget[heapIndex] = m_MemProps.memoryHeaps[heapIndex].size * 8 / 10; // 80% heuristics.
++ }
++ else if(m_Budget.m_VulkanBudget[heapIndex] > m_MemProps.memoryHeaps[heapIndex].size)
++ {
++ m_Budget.m_VulkanBudget[heapIndex] = m_MemProps.memoryHeaps[heapIndex].size;
++ }
++ if(m_Budget.m_VulkanUsage[heapIndex] == 0 && m_Budget.m_BlockBytesAtBudgetFetch[heapIndex] > 0)
++ {
++ m_Budget.m_VulkanUsage[heapIndex] = m_Budget.m_BlockBytesAtBudgetFetch[heapIndex];
++ }
++ }
++ m_Budget.m_OperationsSinceBudgetFetch = 0;
++ }
++}
++#endif // VMA_MEMORY_BUDGET
++
++void VmaAllocator_T::FillAllocation(const VmaAllocation hAllocation, uint8_t pattern)
++{
++ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS &&
++ (m_MemProps.memoryTypes[hAllocation->GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
++ {
++ void* pData = VMA_NULL;
++ VkResult res = Map(hAllocation, &pData);
++ if(res == VK_SUCCESS)
++ {
++ memset(pData, (int)pattern, (size_t)hAllocation->GetSize());
++ FlushOrInvalidateAllocation(hAllocation, 0, VK_WHOLE_SIZE, VMA_CACHE_FLUSH);
++ Unmap(hAllocation);
++ }
++ else
++ {
++ VMA_ASSERT(0 && "VMA_DEBUG_INITIALIZE_ALLOCATIONS is enabled, but couldn't map memory to fill allocation.");
++ }
++ }
++}
++
++uint32_t VmaAllocator_T::GetGpuDefragmentationMemoryTypeBits()
++{
++ uint32_t memoryTypeBits = m_GpuDefragmentationMemoryTypeBits.load();
++ if(memoryTypeBits == UINT32_MAX)
++ {
++ memoryTypeBits = CalculateGpuDefragmentationMemoryTypeBits();
++ m_GpuDefragmentationMemoryTypeBits.store(memoryTypeBits);
++ }
++ return memoryTypeBits;
++}
++
++#if VMA_STATS_STRING_ENABLED
++void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json)
++{
++ json.WriteString("DefaultPools");
++ json.BeginObject();
++ {
++ for (uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ VmaBlockVector* pBlockVector = m_pBlockVectors[memTypeIndex];
++ VmaDedicatedAllocationList& dedicatedAllocList = m_DedicatedAllocations[memTypeIndex];
++ if (pBlockVector != VMA_NULL)
++ {
++ json.BeginString("Type ");
++ json.ContinueString(memTypeIndex);
++ json.EndString();
++ json.BeginObject();
++ {
++ json.WriteString("PreferredBlockSize");
++ json.WriteNumber(pBlockVector->GetPreferredBlockSize());
++
++ json.WriteString("Blocks");
++ pBlockVector->PrintDetailedMap(json);
++
++ json.WriteString("DedicatedAllocations");
++ dedicatedAllocList.BuildStatsString(json);
++ }
++ json.EndObject();
++ }
++ }
++ }
++ json.EndObject();
++
++ json.WriteString("CustomPools");
++ json.BeginObject();
++ {
++ VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
++ if (!m_Pools.IsEmpty())
++ {
++ for (uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
++ {
++ bool displayType = true;
++ size_t index = 0;
++ for (VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
++ {
++ VmaBlockVector& blockVector = pool->m_BlockVector;
++ if (blockVector.GetMemoryTypeIndex() == memTypeIndex)
++ {
++ if (displayType)
++ {
++ json.BeginString("Type ");
++ json.ContinueString(memTypeIndex);
++ json.EndString();
++ json.BeginArray();
++ displayType = false;
++ }
++
++ json.BeginObject();
++ {
++ json.WriteString("Name");
++ json.BeginString();
++ json.ContinueString_Size(index++);
++ if (pool->GetName())
++ {
++ json.ContinueString(" - ");
++ json.ContinueString(pool->GetName());
++ }
++ json.EndString();
++
++ json.WriteString("PreferredBlockSize");
++ json.WriteNumber(blockVector.GetPreferredBlockSize());
++
++ json.WriteString("Blocks");
++ blockVector.PrintDetailedMap(json);
++
++ json.WriteString("DedicatedAllocations");
++ pool->m_DedicatedAllocations.BuildStatsString(json);
++ }
++ json.EndObject();
++ }
++ }
++
++ if (!displayType)
++ json.EndArray();
++ }
++ }
++ }
++ json.EndObject();
++}
++#endif // VMA_STATS_STRING_ENABLED
++#endif // _VMA_ALLOCATOR_T_FUNCTIONS
++
++
++#ifndef _VMA_PUBLIC_INTERFACE
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
++ const VmaAllocatorCreateInfo* pCreateInfo,
++ VmaAllocator* pAllocator)
++{
++ VMA_ASSERT(pCreateInfo && pAllocator);
++ VMA_ASSERT(pCreateInfo->vulkanApiVersion == 0 ||
++ (VK_VERSION_MAJOR(pCreateInfo->vulkanApiVersion) == 1 && VK_VERSION_MINOR(pCreateInfo->vulkanApiVersion) <= 3));
++ VMA_DEBUG_LOG("vmaCreateAllocator");
++ *pAllocator = vma_new(pCreateInfo->pAllocationCallbacks, VmaAllocator_T)(pCreateInfo);
++ VkResult result = (*pAllocator)->Init(pCreateInfo);
++ if(result < 0)
++ {
++ vma_delete(pCreateInfo->pAllocationCallbacks, *pAllocator);
++ *pAllocator = VK_NULL_HANDLE;
++ }
++ return result;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
++ VmaAllocator allocator)
++{
++ if(allocator != VK_NULL_HANDLE)
++ {
++ VMA_DEBUG_LOG("vmaDestroyAllocator");
++ VkAllocationCallbacks allocationCallbacks = allocator->m_AllocationCallbacks; // Have to copy the callbacks when destroying.
++ vma_delete(&allocationCallbacks, allocator);
++ }
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocatorInfo(VmaAllocator allocator, VmaAllocatorInfo* pAllocatorInfo)
++{
++ VMA_ASSERT(allocator && pAllocatorInfo);
++ pAllocatorInfo->instance = allocator->m_hInstance;
++ pAllocatorInfo->physicalDevice = allocator->GetPhysicalDevice();
++ pAllocatorInfo->device = allocator->m_hDevice;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(
++ VmaAllocator allocator,
++ const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
++{
++ VMA_ASSERT(allocator && ppPhysicalDeviceProperties);
++ *ppPhysicalDeviceProperties = &allocator->m_PhysicalDeviceProperties;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(
++ VmaAllocator allocator,
++ const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties)
++{
++ VMA_ASSERT(allocator && ppPhysicalDeviceMemoryProperties);
++ *ppPhysicalDeviceMemoryProperties = &allocator->m_MemProps;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(
++ VmaAllocator allocator,
++ uint32_t memoryTypeIndex,
++ VkMemoryPropertyFlags* pFlags)
++{
++ VMA_ASSERT(allocator && pFlags);
++ VMA_ASSERT(memoryTypeIndex < allocator->GetMemoryTypeCount());
++ *pFlags = allocator->m_MemProps.memoryTypes[memoryTypeIndex].propertyFlags;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(
++ VmaAllocator allocator,
++ uint32_t frameIndex)
++{
++ VMA_ASSERT(allocator);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->SetCurrentFrameIndex(frameIndex);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics(
++ VmaAllocator allocator,
++ VmaTotalStatistics* pStats)
++{
++ VMA_ASSERT(allocator && pStats);
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++ allocator->CalculateStatistics(pStats);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets(
++ VmaAllocator allocator,
++ VmaBudget* pBudgets)
++{
++ VMA_ASSERT(allocator && pBudgets);
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++ allocator->GetHeapBudgets(pBudgets, 0, allocator->GetMemoryHeapCount());
++}
++
++#if VMA_STATS_STRING_ENABLED
++
++VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
++ VmaAllocator allocator,
++ char** ppStatsString,
++ VkBool32 detailedMap)
++{
++ VMA_ASSERT(allocator && ppStatsString);
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ VmaStringBuilder sb(allocator->GetAllocationCallbacks());
++ {
++ VmaBudget budgets[VK_MAX_MEMORY_HEAPS];
++ allocator->GetHeapBudgets(budgets, 0, allocator->GetMemoryHeapCount());
++
++ VmaTotalStatistics stats;
++ allocator->CalculateStatistics(&stats);
++
++ VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb);
++ json.BeginObject();
++ {
++ json.WriteString("General");
++ json.BeginObject();
++ {
++ const VkPhysicalDeviceProperties& deviceProperties = allocator->m_PhysicalDeviceProperties;
++ const VkPhysicalDeviceMemoryProperties& memoryProperties = allocator->m_MemProps;
++
++ json.WriteString("API");
++ json.WriteString("Vulkan");
++
++ json.WriteString("apiVersion");
++ json.BeginString();
++ json.ContinueString(VK_API_VERSION_MAJOR(deviceProperties.apiVersion));
++ json.ContinueString(".");
++ json.ContinueString(VK_API_VERSION_MINOR(deviceProperties.apiVersion));
++ json.ContinueString(".");
++ json.ContinueString(VK_API_VERSION_PATCH(deviceProperties.apiVersion));
++ json.EndString();
++
++ json.WriteString("GPU");
++ json.WriteString(deviceProperties.deviceName);
++ json.WriteString("deviceType");
++ json.WriteNumber(static_cast<uint32_t>(deviceProperties.deviceType));
++
++ json.WriteString("maxMemoryAllocationCount");
++ json.WriteNumber(deviceProperties.limits.maxMemoryAllocationCount);
++ json.WriteString("bufferImageGranularity");
++ json.WriteNumber(deviceProperties.limits.bufferImageGranularity);
++ json.WriteString("nonCoherentAtomSize");
++ json.WriteNumber(deviceProperties.limits.nonCoherentAtomSize);
++
++ json.WriteString("memoryHeapCount");
++ json.WriteNumber(memoryProperties.memoryHeapCount);
++ json.WriteString("memoryTypeCount");
++ json.WriteNumber(memoryProperties.memoryTypeCount);
++ }
++ json.EndObject();
++ }
++ {
++ json.WriteString("Total");
++ VmaPrintDetailedStatistics(json, stats.total);
++ }
++ {
++ json.WriteString("MemoryInfo");
++ json.BeginObject();
++ {
++ for (uint32_t heapIndex = 0; heapIndex < allocator->GetMemoryHeapCount(); ++heapIndex)
++ {
++ json.BeginString("Heap ");
++ json.ContinueString(heapIndex);
++ json.EndString();
++ json.BeginObject();
++ {
++ const VkMemoryHeap& heapInfo = allocator->m_MemProps.memoryHeaps[heapIndex];
++ json.WriteString("Flags");
++ json.BeginArray(true);
++ {
++ if (heapInfo.flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)
++ json.WriteString("DEVICE_LOCAL");
++ #if VMA_VULKAN_VERSION >= 1001000
++ if (heapInfo.flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT)
++ json.WriteString("MULTI_INSTANCE");
++ #endif
++
++ VkMemoryHeapFlags flags = heapInfo.flags &
++ ~(VK_MEMORY_HEAP_DEVICE_LOCAL_BIT
++ #if VMA_VULKAN_VERSION >= 1001000
++ | VK_MEMORY_HEAP_MULTI_INSTANCE_BIT
++ #endif
++ );
++ if (flags != 0)
++ json.WriteNumber(flags);
++ }
++ json.EndArray();
++
++ json.WriteString("Size");
++ json.WriteNumber(heapInfo.size);
++
++ json.WriteString("Budget");
++ json.BeginObject();
++ {
++ json.WriteString("BudgetBytes");
++ json.WriteNumber(budgets[heapIndex].budget);
++ json.WriteString("UsageBytes");
++ json.WriteNumber(budgets[heapIndex].usage);
++ }
++ json.EndObject();
++
++ json.WriteString("Stats");
++ VmaPrintDetailedStatistics(json, stats.memoryHeap[heapIndex]);
++
++ json.WriteString("MemoryPools");
++ json.BeginObject();
++ {
++ for (uint32_t typeIndex = 0; typeIndex < allocator->GetMemoryTypeCount(); ++typeIndex)
++ {
++ if (allocator->MemoryTypeIndexToHeapIndex(typeIndex) == heapIndex)
++ {
++ json.BeginString("Type ");
++ json.ContinueString(typeIndex);
++ json.EndString();
++ json.BeginObject();
++ {
++ json.WriteString("Flags");
++ json.BeginArray(true);
++ {
++ VkMemoryPropertyFlags flags = allocator->m_MemProps.memoryTypes[typeIndex].propertyFlags;
++ if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
++ json.WriteString("DEVICE_LOCAL");
++ if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
++ json.WriteString("HOST_VISIBLE");
++ if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
++ json.WriteString("HOST_COHERENT");
++ if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)
++ json.WriteString("HOST_CACHED");
++ if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)
++ json.WriteString("LAZILY_ALLOCATED");
++ #if VMA_VULKAN_VERSION >= 1001000
++ if (flags & VK_MEMORY_PROPERTY_PROTECTED_BIT)
++ json.WriteString("PROTECTED");
++ #endif
++ #if VK_AMD_device_coherent_memory
++ if (flags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY)
++ json.WriteString("DEVICE_COHERENT_AMD");
++ if (flags & VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY)
++ json.WriteString("DEVICE_UNCACHED_AMD");
++ #endif
++
++ flags &= ~(VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
++ #if VMA_VULKAN_VERSION >= 1001000
++ | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
++ #endif
++ #if VK_AMD_device_coherent_memory
++ | VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY
++ | VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY
++ #endif
++ | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
++ | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
++ | VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
++ if (flags != 0)
++ json.WriteNumber(flags);
++ }
++ json.EndArray();
++
++ json.WriteString("Stats");
++ VmaPrintDetailedStatistics(json, stats.memoryType[typeIndex]);
++ }
++ json.EndObject();
++ }
++ }
++
++ }
++ json.EndObject();
++ }
++ json.EndObject();
++ }
++ }
++ json.EndObject();
++ }
++
++ if (detailedMap == VK_TRUE)
++ allocator->PrintDetailedMap(json);
++
++ json.EndObject();
++ }
++
++ *ppStatsString = VmaCreateStringCopy(allocator->GetAllocationCallbacks(), sb.GetData(), sb.GetLength());
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
++ VmaAllocator allocator,
++ char* pStatsString)
++{
++ if(pStatsString != VMA_NULL)
++ {
++ VMA_ASSERT(allocator);
++ VmaFreeString(allocator->GetAllocationCallbacks(), pStatsString);
++ }
++}
++
++#endif // VMA_STATS_STRING_ENABLED
++
++/*
++This function is not protected by any mutex because it just reads immutable data.
++*/
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(
++ VmaAllocator allocator,
++ uint32_t memoryTypeBits,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ uint32_t* pMemoryTypeIndex)
++{
++ VMA_ASSERT(allocator != VK_NULL_HANDLE);
++ VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
++ VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
++
++ return allocator->FindMemoryTypeIndex(memoryTypeBits, pAllocationCreateInfo, UINT32_MAX, pMemoryTypeIndex);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(
++ VmaAllocator allocator,
++ const VkBufferCreateInfo* pBufferCreateInfo,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ uint32_t* pMemoryTypeIndex)
++{
++ VMA_ASSERT(allocator != VK_NULL_HANDLE);
++ VMA_ASSERT(pBufferCreateInfo != VMA_NULL);
++ VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
++ VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
++
++ const VkDevice hDev = allocator->m_hDevice;
++ const VmaVulkanFunctions* funcs = &allocator->GetVulkanFunctions();
++ VkResult res;
++
++#if VMA_VULKAN_VERSION >= 1003000
++ if(funcs->vkGetDeviceBufferMemoryRequirements)
++ {
++ // Can query straight from VkBufferCreateInfo :)
++ VkDeviceBufferMemoryRequirements devBufMemReq = {VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS};
++ devBufMemReq.pCreateInfo = pBufferCreateInfo;
++
++ VkMemoryRequirements2 memReq = {VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2};
++ (*funcs->vkGetDeviceBufferMemoryRequirements)(hDev, &devBufMemReq, &memReq);
++
++ res = allocator->FindMemoryTypeIndex(
++ memReq.memoryRequirements.memoryTypeBits, pAllocationCreateInfo, pBufferCreateInfo->usage, pMemoryTypeIndex);
++ }
++ else
++#endif // #if VMA_VULKAN_VERSION >= 1003000
++ {
++ // Must create a dummy buffer to query :(
++ VkBuffer hBuffer = VK_NULL_HANDLE;
++ res = funcs->vkCreateBuffer(
++ hDev, pBufferCreateInfo, allocator->GetAllocationCallbacks(), &hBuffer);
++ if(res == VK_SUCCESS)
++ {
++ VkMemoryRequirements memReq = {};
++ funcs->vkGetBufferMemoryRequirements(hDev, hBuffer, &memReq);
++
++ res = allocator->FindMemoryTypeIndex(
++ memReq.memoryTypeBits, pAllocationCreateInfo, pBufferCreateInfo->usage, pMemoryTypeIndex);
++
++ funcs->vkDestroyBuffer(
++ hDev, hBuffer, allocator->GetAllocationCallbacks());
++ }
++ }
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(
++ VmaAllocator allocator,
++ const VkImageCreateInfo* pImageCreateInfo,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ uint32_t* pMemoryTypeIndex)
++{
++ VMA_ASSERT(allocator != VK_NULL_HANDLE);
++ VMA_ASSERT(pImageCreateInfo != VMA_NULL);
++ VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
++ VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
++
++ const VkDevice hDev = allocator->m_hDevice;
++ const VmaVulkanFunctions* funcs = &allocator->GetVulkanFunctions();
++ VkResult res;
++
++#if VMA_VULKAN_VERSION >= 1003000
++ if(funcs->vkGetDeviceImageMemoryRequirements)
++ {
++ // Can query straight from VkImageCreateInfo :)
++ VkDeviceImageMemoryRequirements devImgMemReq = {VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS};
++ devImgMemReq.pCreateInfo = pImageCreateInfo;
++ VMA_ASSERT(pImageCreateInfo->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT_COPY && (pImageCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_COPY) == 0 &&
++ "Cannot use this VkImageCreateInfo with vmaFindMemoryTypeIndexForImageInfo as I don't know what to pass as VkDeviceImageMemoryRequirements::planeAspect.");
++
++ VkMemoryRequirements2 memReq = {VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2};
++ (*funcs->vkGetDeviceImageMemoryRequirements)(hDev, &devImgMemReq, &memReq);
++
++ res = allocator->FindMemoryTypeIndex(
++ memReq.memoryRequirements.memoryTypeBits, pAllocationCreateInfo, pImageCreateInfo->usage, pMemoryTypeIndex);
++ }
++ else
++#endif // #if VMA_VULKAN_VERSION >= 1003000
++ {
++ // Must create a dummy image to query :(
++ VkImage hImage = VK_NULL_HANDLE;
++ res = funcs->vkCreateImage(
++ hDev, pImageCreateInfo, allocator->GetAllocationCallbacks(), &hImage);
++ if(res == VK_SUCCESS)
++ {
++ VkMemoryRequirements memReq = {};
++ funcs->vkGetImageMemoryRequirements(hDev, hImage, &memReq);
++
++ res = allocator->FindMemoryTypeIndex(
++ memReq.memoryTypeBits, pAllocationCreateInfo, pImageCreateInfo->usage, pMemoryTypeIndex);
++
++ funcs->vkDestroyImage(
++ hDev, hImage, allocator->GetAllocationCallbacks());
++ }
++ }
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(
++ VmaAllocator allocator,
++ const VmaPoolCreateInfo* pCreateInfo,
++ VmaPool* pPool)
++{
++ VMA_ASSERT(allocator && pCreateInfo && pPool);
++
++ VMA_DEBUG_LOG("vmaCreatePool");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->CreatePool(pCreateInfo, pPool);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
++ VmaAllocator allocator,
++ VmaPool pool)
++{
++ VMA_ASSERT(allocator);
++
++ if(pool == VK_NULL_HANDLE)
++ {
++ return;
++ }
++
++ VMA_DEBUG_LOG("vmaDestroyPool");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->DestroyPool(pool);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStatistics(
++ VmaAllocator allocator,
++ VmaPool pool,
++ VmaStatistics* pPoolStats)
++{
++ VMA_ASSERT(allocator && pool && pPoolStats);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->GetPoolStatistics(pool, pPoolStats);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaCalculatePoolStatistics(
++ VmaAllocator allocator,
++ VmaPool pool,
++ VmaDetailedStatistics* pPoolStats)
++{
++ VMA_ASSERT(allocator && pool && pPoolStats);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->CalculatePoolStatistics(pool, pPoolStats);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool)
++{
++ VMA_ASSERT(allocator && pool);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ VMA_DEBUG_LOG("vmaCheckPoolCorruption");
++
++ return allocator->CheckPoolCorruption(pool);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
++ VmaAllocator allocator,
++ VmaPool pool,
++ const char** ppName)
++{
++ VMA_ASSERT(allocator && pool && ppName);
++
++ VMA_DEBUG_LOG("vmaGetPoolName");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ *ppName = pool->GetName();
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
++ VmaAllocator allocator,
++ VmaPool pool,
++ const char* pName)
++{
++ VMA_ASSERT(allocator && pool);
++
++ VMA_DEBUG_LOG("vmaSetPoolName");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ pool->SetName(pName);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
++ VmaAllocator allocator,
++ const VkMemoryRequirements* pVkMemoryRequirements,
++ const VmaAllocationCreateInfo* pCreateInfo,
++ VmaAllocation* pAllocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation);
++
++ VMA_DEBUG_LOG("vmaAllocateMemory");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ VkResult result = allocator->AllocateMemory(
++ *pVkMemoryRequirements,
++ false, // requiresDedicatedAllocation
++ false, // prefersDedicatedAllocation
++ VK_NULL_HANDLE, // dedicatedBuffer
++ VK_NULL_HANDLE, // dedicatedImage
++ UINT32_MAX, // dedicatedBufferImageUsage
++ *pCreateInfo,
++ VMA_SUBALLOCATION_TYPE_UNKNOWN,
++ 1, // allocationCount
++ pAllocation);
++
++ if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
++ {
++ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
++ }
++
++ return result;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
++ VmaAllocator allocator,
++ const VkMemoryRequirements* pVkMemoryRequirements,
++ const VmaAllocationCreateInfo* pCreateInfo,
++ size_t allocationCount,
++ VmaAllocation* pAllocations,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ if(allocationCount == 0)
++ {
++ return VK_SUCCESS;
++ }
++
++ VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocations);
++
++ VMA_DEBUG_LOG("vmaAllocateMemoryPages");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ VkResult result = allocator->AllocateMemory(
++ *pVkMemoryRequirements,
++ false, // requiresDedicatedAllocation
++ false, // prefersDedicatedAllocation
++ VK_NULL_HANDLE, // dedicatedBuffer
++ VK_NULL_HANDLE, // dedicatedImage
++ UINT32_MAX, // dedicatedBufferImageUsage
++ *pCreateInfo,
++ VMA_SUBALLOCATION_TYPE_UNKNOWN,
++ allocationCount,
++ pAllocations);
++
++ if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
++ {
++ for(size_t i = 0; i < allocationCount; ++i)
++ {
++ allocator->GetAllocationInfo(pAllocations[i], pAllocationInfo + i);
++ }
++ }
++
++ return result;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(
++ VmaAllocator allocator,
++ VkBuffer buffer,
++ const VmaAllocationCreateInfo* pCreateInfo,
++ VmaAllocation* pAllocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pCreateInfo && pAllocation);
++
++ VMA_DEBUG_LOG("vmaAllocateMemoryForBuffer");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ VkMemoryRequirements vkMemReq = {};
++ bool requiresDedicatedAllocation = false;
++ bool prefersDedicatedAllocation = false;
++ allocator->GetBufferMemoryRequirements(buffer, vkMemReq,
++ requiresDedicatedAllocation,
++ prefersDedicatedAllocation);
++
++ VkResult result = allocator->AllocateMemory(
++ vkMemReq,
++ requiresDedicatedAllocation,
++ prefersDedicatedAllocation,
++ buffer, // dedicatedBuffer
++ VK_NULL_HANDLE, // dedicatedImage
++ UINT32_MAX, // dedicatedBufferImageUsage
++ *pCreateInfo,
++ VMA_SUBALLOCATION_TYPE_BUFFER,
++ 1, // allocationCount
++ pAllocation);
++
++ if(pAllocationInfo && result == VK_SUCCESS)
++ {
++ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
++ }
++
++ return result;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
++ VmaAllocator allocator,
++ VkImage image,
++ const VmaAllocationCreateInfo* pCreateInfo,
++ VmaAllocation* pAllocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pCreateInfo && pAllocation);
++
++ VMA_DEBUG_LOG("vmaAllocateMemoryForImage");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ VkMemoryRequirements vkMemReq = {};
++ bool requiresDedicatedAllocation = false;
++ bool prefersDedicatedAllocation = false;
++ allocator->GetImageMemoryRequirements(image, vkMemReq,
++ requiresDedicatedAllocation, prefersDedicatedAllocation);
++
++ VkResult result = allocator->AllocateMemory(
++ vkMemReq,
++ requiresDedicatedAllocation,
++ prefersDedicatedAllocation,
++ VK_NULL_HANDLE, // dedicatedBuffer
++ image, // dedicatedImage
++ UINT32_MAX, // dedicatedBufferImageUsage
++ *pCreateInfo,
++ VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
++ 1, // allocationCount
++ pAllocation);
++
++ if(pAllocationInfo && result == VK_SUCCESS)
++ {
++ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
++ }
++
++ return result;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(
++ VmaAllocator allocator,
++ VmaAllocation allocation)
++{
++ VMA_ASSERT(allocator);
++
++ if(allocation == VK_NULL_HANDLE)
++ {
++ return;
++ }
++
++ VMA_DEBUG_LOG("vmaFreeMemory");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->FreeMemory(
++ 1, // allocationCount
++ &allocation);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
++ VmaAllocator allocator,
++ size_t allocationCount,
++ const VmaAllocation* pAllocations)
++{
++ if(allocationCount == 0)
++ {
++ return;
++ }
++
++ VMA_ASSERT(allocator);
++
++ VMA_DEBUG_LOG("vmaFreeMemoryPages");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->FreeMemory(allocationCount, pAllocations);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && allocation && pAllocationInfo);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->GetAllocationInfo(allocation, pAllocationInfo);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ void* pUserData)
++{
++ VMA_ASSERT(allocator && allocation);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocation->SetUserData(allocator, pUserData);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationName(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ const char* VMA_NULLABLE pName)
++{
++ allocation->SetName(allocator, pName);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationMemoryProperties(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ VkMemoryPropertyFlags* VMA_NOT_NULL pFlags)
++{
++ VMA_ASSERT(allocator && allocation && pFlags);
++ const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
++ *pFlags = allocator->m_MemProps.memoryTypes[memTypeIndex].propertyFlags;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ void** ppData)
++{
++ VMA_ASSERT(allocator && allocation && ppData);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->Map(allocation, ppData);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory(
++ VmaAllocator allocator,
++ VmaAllocation allocation)
++{
++ VMA_ASSERT(allocator && allocation);
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ allocator->Unmap(allocation);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocation(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VkDeviceSize offset,
++ VkDeviceSize size)
++{
++ VMA_ASSERT(allocator && allocation);
++
++ VMA_DEBUG_LOG("vmaFlushAllocation");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH);
++
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocation(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VkDeviceSize offset,
++ VkDeviceSize size)
++{
++ VMA_ASSERT(allocator && allocation);
++
++ VMA_DEBUG_LOG("vmaInvalidateAllocation");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE);
++
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocations(
++ VmaAllocator allocator,
++ uint32_t allocationCount,
++ const VmaAllocation* allocations,
++ const VkDeviceSize* offsets,
++ const VkDeviceSize* sizes)
++{
++ VMA_ASSERT(allocator);
++
++ if(allocationCount == 0)
++ {
++ return VK_SUCCESS;
++ }
++
++ VMA_ASSERT(allocations);
++
++ VMA_DEBUG_LOG("vmaFlushAllocations");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_FLUSH);
++
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations(
++ VmaAllocator allocator,
++ uint32_t allocationCount,
++ const VmaAllocation* allocations,
++ const VkDeviceSize* offsets,
++ const VkDeviceSize* sizes)
++{
++ VMA_ASSERT(allocator);
++
++ if(allocationCount == 0)
++ {
++ return VK_SUCCESS;
++ }
++
++ VMA_ASSERT(allocations);
++
++ VMA_DEBUG_LOG("vmaInvalidateAllocations");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_INVALIDATE);
++
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(
++ VmaAllocator allocator,
++ uint32_t memoryTypeBits)
++{
++ VMA_ASSERT(allocator);
++
++ VMA_DEBUG_LOG("vmaCheckCorruption");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->CheckCorruption(memoryTypeBits);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentation(
++ VmaAllocator allocator,
++ const VmaDefragmentationInfo* pInfo,
++ VmaDefragmentationContext* pContext)
++{
++ VMA_ASSERT(allocator && pInfo && pContext);
++
++ VMA_DEBUG_LOG("vmaBeginDefragmentation");
++
++ if (pInfo->pool != VMA_NULL)
++ {
++ // Check if run on supported algorithms
++ if (pInfo->pool->m_BlockVector.GetAlgorithm() & VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT)
++ return VK_ERROR_FEATURE_NOT_PRESENT;
++ }
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ *pContext = vma_new(allocator, VmaDefragmentationContext_T)(allocator, *pInfo);
++ return VK_SUCCESS;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaEndDefragmentation(
++ VmaAllocator allocator,
++ VmaDefragmentationContext context,
++ VmaDefragmentationStats* pStats)
++{
++ VMA_ASSERT(allocator && context);
++
++ VMA_DEBUG_LOG("vmaEndDefragmentation");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ if (pStats)
++ context->GetStats(*pStats);
++ vma_delete(allocator, context);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentationPass(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaDefragmentationContext VMA_NOT_NULL context,
++ VmaDefragmentationPassMoveInfo* VMA_NOT_NULL pPassInfo)
++{
++ VMA_ASSERT(context && pPassInfo);
++
++ VMA_DEBUG_LOG("vmaBeginDefragmentationPass");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return context->DefragmentPassBegin(*pPassInfo);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaEndDefragmentationPass(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaDefragmentationContext VMA_NOT_NULL context,
++ VmaDefragmentationPassMoveInfo* VMA_NOT_NULL pPassInfo)
++{
++ VMA_ASSERT(context && pPassInfo);
++
++ VMA_DEBUG_LOG("vmaEndDefragmentationPass");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return context->DefragmentPassEnd(*pPassInfo);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VkBuffer buffer)
++{
++ VMA_ASSERT(allocator && allocation && buffer);
++
++ VMA_DEBUG_LOG("vmaBindBufferMemory");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->BindBufferMemory(allocation, 0, buffer, VMA_NULL);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VkDeviceSize allocationLocalOffset,
++ VkBuffer buffer,
++ const void* pNext)
++{
++ VMA_ASSERT(allocator && allocation && buffer);
++
++ VMA_DEBUG_LOG("vmaBindBufferMemory2");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->BindBufferMemory(allocation, allocationLocalOffset, buffer, pNext);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VkImage image)
++{
++ VMA_ASSERT(allocator && allocation && image);
++
++ VMA_DEBUG_LOG("vmaBindImageMemory");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->BindImageMemory(allocation, 0, image, VMA_NULL);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(
++ VmaAllocator allocator,
++ VmaAllocation allocation,
++ VkDeviceSize allocationLocalOffset,
++ VkImage image,
++ const void* pNext)
++{
++ VMA_ASSERT(allocator && allocation && image);
++
++ VMA_DEBUG_LOG("vmaBindImageMemory2");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ return allocator->BindImageMemory(allocation, allocationLocalOffset, image, pNext);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(
++ VmaAllocator allocator,
++ const VkBufferCreateInfo* pBufferCreateInfo,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ VkBuffer* pBuffer,
++ VmaAllocation* pAllocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation);
++
++ if(pBufferCreateInfo->size == 0)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++ if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 &&
++ !allocator->m_UseKhrBufferDeviceAddress)
++ {
++ VMA_ASSERT(0 && "Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used.");
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++
++ VMA_DEBUG_LOG("vmaCreateBuffer");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ *pBuffer = VK_NULL_HANDLE;
++ *pAllocation = VK_NULL_HANDLE;
++
++ // 1. Create VkBuffer.
++ VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)(
++ allocator->m_hDevice,
++ pBufferCreateInfo,
++ allocator->GetAllocationCallbacks(),
++ pBuffer);
++ if(res >= 0)
++ {
++ // 2. vkGetBufferMemoryRequirements.
++ VkMemoryRequirements vkMemReq = {};
++ bool requiresDedicatedAllocation = false;
++ bool prefersDedicatedAllocation = false;
++ allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq,
++ requiresDedicatedAllocation, prefersDedicatedAllocation);
++
++ // 3. Allocate memory using allocator.
++ res = allocator->AllocateMemory(
++ vkMemReq,
++ requiresDedicatedAllocation,
++ prefersDedicatedAllocation,
++ *pBuffer, // dedicatedBuffer
++ VK_NULL_HANDLE, // dedicatedImage
++ pBufferCreateInfo->usage, // dedicatedBufferImageUsage
++ *pAllocationCreateInfo,
++ VMA_SUBALLOCATION_TYPE_BUFFER,
++ 1, // allocationCount
++ pAllocation);
++
++ if(res >= 0)
++ {
++ // 3. Bind buffer with memory.
++ if((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0)
++ {
++ res = allocator->BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL);
++ }
++ if(res >= 0)
++ {
++ // All steps succeeded.
++ #if VMA_STATS_STRING_ENABLED
++ (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage);
++ #endif
++ if(pAllocationInfo != VMA_NULL)
++ {
++ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
++ }
++
++ return VK_SUCCESS;
++ }
++ allocator->FreeMemory(
++ 1, // allocationCount
++ pAllocation);
++ *pAllocation = VK_NULL_HANDLE;
++ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
++ *pBuffer = VK_NULL_HANDLE;
++ return res;
++ }
++ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
++ *pBuffer = VK_NULL_HANDLE;
++ return res;
++ }
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment(
++ VmaAllocator allocator,
++ const VkBufferCreateInfo* pBufferCreateInfo,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ VkDeviceSize minAlignment,
++ VkBuffer* pBuffer,
++ VmaAllocation* pAllocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && VmaIsPow2(minAlignment) && pBuffer && pAllocation);
++
++ if(pBufferCreateInfo->size == 0)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++ if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 &&
++ !allocator->m_UseKhrBufferDeviceAddress)
++ {
++ VMA_ASSERT(0 && "Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used.");
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++
++ VMA_DEBUG_LOG("vmaCreateBufferWithAlignment");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ *pBuffer = VK_NULL_HANDLE;
++ *pAllocation = VK_NULL_HANDLE;
++
++ // 1. Create VkBuffer.
++ VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)(
++ allocator->m_hDevice,
++ pBufferCreateInfo,
++ allocator->GetAllocationCallbacks(),
++ pBuffer);
++ if(res >= 0)
++ {
++ // 2. vkGetBufferMemoryRequirements.
++ VkMemoryRequirements vkMemReq = {};
++ bool requiresDedicatedAllocation = false;
++ bool prefersDedicatedAllocation = false;
++ allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq,
++ requiresDedicatedAllocation, prefersDedicatedAllocation);
++
++ // 2a. Include minAlignment
++ vkMemReq.alignment = VMA_MAX(vkMemReq.alignment, minAlignment);
++
++ // 3. Allocate memory using allocator.
++ res = allocator->AllocateMemory(
++ vkMemReq,
++ requiresDedicatedAllocation,
++ prefersDedicatedAllocation,
++ *pBuffer, // dedicatedBuffer
++ VK_NULL_HANDLE, // dedicatedImage
++ pBufferCreateInfo->usage, // dedicatedBufferImageUsage
++ *pAllocationCreateInfo,
++ VMA_SUBALLOCATION_TYPE_BUFFER,
++ 1, // allocationCount
++ pAllocation);
++
++ if(res >= 0)
++ {
++ // 3. Bind buffer with memory.
++ if((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0)
++ {
++ res = allocator->BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL);
++ }
++ if(res >= 0)
++ {
++ // All steps succeeded.
++ #if VMA_STATS_STRING_ENABLED
++ (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage);
++ #endif
++ if(pAllocationInfo != VMA_NULL)
++ {
++ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
++ }
++
++ return VK_SUCCESS;
++ }
++ allocator->FreeMemory(
++ 1, // allocationCount
++ pAllocation);
++ *pAllocation = VK_NULL_HANDLE;
++ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
++ *pBuffer = VK_NULL_HANDLE;
++ return res;
++ }
++ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
++ *pBuffer = VK_NULL_HANDLE;
++ return res;
++ }
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingBuffer(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
++ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer)
++{
++ VMA_ASSERT(allocator && pBufferCreateInfo && pBuffer && allocation);
++
++ VMA_DEBUG_LOG("vmaCreateAliasingBuffer");
++
++ *pBuffer = VK_NULL_HANDLE;
++
++ if (pBufferCreateInfo->size == 0)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++ if ((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 &&
++ !allocator->m_UseKhrBufferDeviceAddress)
++ {
++ VMA_ASSERT(0 && "Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used.");
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ // 1. Create VkBuffer.
++ VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)(
++ allocator->m_hDevice,
++ pBufferCreateInfo,
++ allocator->GetAllocationCallbacks(),
++ pBuffer);
++ if (res >= 0)
++ {
++ // 2. Bind buffer with memory.
++ res = allocator->BindBufferMemory(allocation, 0, *pBuffer, VMA_NULL);
++ if (res >= 0)
++ {
++ return VK_SUCCESS;
++ }
++ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
++ }
++ return res;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer(
++ VmaAllocator allocator,
++ VkBuffer buffer,
++ VmaAllocation allocation)
++{
++ VMA_ASSERT(allocator);
++
++ if(buffer == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
++ {
++ return;
++ }
++
++ VMA_DEBUG_LOG("vmaDestroyBuffer");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ if(buffer != VK_NULL_HANDLE)
++ {
++ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks());
++ }
++
++ if(allocation != VK_NULL_HANDLE)
++ {
++ allocator->FreeMemory(
++ 1, // allocationCount
++ &allocation);
++ }
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(
++ VmaAllocator allocator,
++ const VkImageCreateInfo* pImageCreateInfo,
++ const VmaAllocationCreateInfo* pAllocationCreateInfo,
++ VkImage* pImage,
++ VmaAllocation* pAllocation,
++ VmaAllocationInfo* pAllocationInfo)
++{
++ VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation);
++
++ if(pImageCreateInfo->extent.width == 0 ||
++ pImageCreateInfo->extent.height == 0 ||
++ pImageCreateInfo->extent.depth == 0 ||
++ pImageCreateInfo->mipLevels == 0 ||
++ pImageCreateInfo->arrayLayers == 0)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++
++ VMA_DEBUG_LOG("vmaCreateImage");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ *pImage = VK_NULL_HANDLE;
++ *pAllocation = VK_NULL_HANDLE;
++
++ // 1. Create VkImage.
++ VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)(
++ allocator->m_hDevice,
++ pImageCreateInfo,
++ allocator->GetAllocationCallbacks(),
++ pImage);
++ if(res >= 0)
++ {
++ VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ?
++ VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL :
++ VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR;
++
++ // 2. Allocate memory using allocator.
++ VkMemoryRequirements vkMemReq = {};
++ bool requiresDedicatedAllocation = false;
++ bool prefersDedicatedAllocation = false;
++ allocator->GetImageMemoryRequirements(*pImage, vkMemReq,
++ requiresDedicatedAllocation, prefersDedicatedAllocation);
++
++ res = allocator->AllocateMemory(
++ vkMemReq,
++ requiresDedicatedAllocation,
++ prefersDedicatedAllocation,
++ VK_NULL_HANDLE, // dedicatedBuffer
++ *pImage, // dedicatedImage
++ pImageCreateInfo->usage, // dedicatedBufferImageUsage
++ *pAllocationCreateInfo,
++ suballocType,
++ 1, // allocationCount
++ pAllocation);
++
++ if(res >= 0)
++ {
++ // 3. Bind image with memory.
++ if((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0)
++ {
++ res = allocator->BindImageMemory(*pAllocation, 0, *pImage, VMA_NULL);
++ }
++ if(res >= 0)
++ {
++ // All steps succeeded.
++ #if VMA_STATS_STRING_ENABLED
++ (*pAllocation)->InitBufferImageUsage(pImageCreateInfo->usage);
++ #endif
++ if(pAllocationInfo != VMA_NULL)
++ {
++ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
++ }
++
++ return VK_SUCCESS;
++ }
++ allocator->FreeMemory(
++ 1, // allocationCount
++ pAllocation);
++ *pAllocation = VK_NULL_HANDLE;
++ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
++ *pImage = VK_NULL_HANDLE;
++ return res;
++ }
++ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
++ *pImage = VK_NULL_HANDLE;
++ return res;
++ }
++ return res;
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingImage(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VmaAllocation VMA_NOT_NULL allocation,
++ const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
++ VkImage VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pImage)
++{
++ VMA_ASSERT(allocator && pImageCreateInfo && pImage && allocation);
++
++ *pImage = VK_NULL_HANDLE;
++
++ VMA_DEBUG_LOG("vmaCreateImage");
++
++ if (pImageCreateInfo->extent.width == 0 ||
++ pImageCreateInfo->extent.height == 0 ||
++ pImageCreateInfo->extent.depth == 0 ||
++ pImageCreateInfo->mipLevels == 0 ||
++ pImageCreateInfo->arrayLayers == 0)
++ {
++ return VK_ERROR_INITIALIZATION_FAILED;
++ }
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ // 1. Create VkImage.
++ VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)(
++ allocator->m_hDevice,
++ pImageCreateInfo,
++ allocator->GetAllocationCallbacks(),
++ pImage);
++ if (res >= 0)
++ {
++ // 2. Bind image with memory.
++ res = allocator->BindImageMemory(allocation, 0, *pImage, VMA_NULL);
++ if (res >= 0)
++ {
++ return VK_SUCCESS;
++ }
++ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
++ }
++ return res;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
++ VmaAllocator VMA_NOT_NULL allocator,
++ VkImage VMA_NULLABLE_NON_DISPATCHABLE image,
++ VmaAllocation VMA_NULLABLE allocation)
++{
++ VMA_ASSERT(allocator);
++
++ if(image == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
++ {
++ return;
++ }
++
++ VMA_DEBUG_LOG("vmaDestroyImage");
++
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK
++
++ if(image != VK_NULL_HANDLE)
++ {
++ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks());
++ }
++ if(allocation != VK_NULL_HANDLE)
++ {
++ allocator->FreeMemory(
++ 1, // allocationCount
++ &allocation);
++ }
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateVirtualBlock(
++ const VmaVirtualBlockCreateInfo* VMA_NOT_NULL pCreateInfo,
++ VmaVirtualBlock VMA_NULLABLE * VMA_NOT_NULL pVirtualBlock)
++{
++ VMA_ASSERT(pCreateInfo && pVirtualBlock);
++ VMA_ASSERT(pCreateInfo->size > 0);
++ VMA_DEBUG_LOG("vmaCreateVirtualBlock");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ *pVirtualBlock = vma_new(pCreateInfo->pAllocationCallbacks, VmaVirtualBlock_T)(*pCreateInfo);
++ VkResult res = (*pVirtualBlock)->Init();
++ if(res < 0)
++ {
++ vma_delete(pCreateInfo->pAllocationCallbacks, *pVirtualBlock);
++ *pVirtualBlock = VK_NULL_HANDLE;
++ }
++ return res;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaDestroyVirtualBlock(VmaVirtualBlock VMA_NULLABLE virtualBlock)
++{
++ if(virtualBlock != VK_NULL_HANDLE)
++ {
++ VMA_DEBUG_LOG("vmaDestroyVirtualBlock");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ VkAllocationCallbacks allocationCallbacks = virtualBlock->m_AllocationCallbacks; // Have to copy the callbacks when destroying.
++ vma_delete(&allocationCallbacks, virtualBlock);
++ }
++}
++
++VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaIsVirtualBlockEmpty(VmaVirtualBlock VMA_NOT_NULL virtualBlock)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE);
++ VMA_DEBUG_LOG("vmaIsVirtualBlockEmpty");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ return virtualBlock->IsEmpty() ? VK_TRUE : VK_FALSE;
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetVirtualAllocationInfo(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaVirtualAllocation VMA_NOT_NULL_NON_DISPATCHABLE allocation, VmaVirtualAllocationInfo* VMA_NOT_NULL pVirtualAllocInfo)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE && pVirtualAllocInfo != VMA_NULL);
++ VMA_DEBUG_LOG("vmaGetVirtualAllocationInfo");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ virtualBlock->GetAllocationInfo(allocation, *pVirtualAllocInfo);
++}
++
++VMA_CALL_PRE VkResult VMA_CALL_POST vmaVirtualAllocate(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ const VmaVirtualAllocationCreateInfo* VMA_NOT_NULL pCreateInfo, VmaVirtualAllocation VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pAllocation,
++ VkDeviceSize* VMA_NULLABLE pOffset)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE && pCreateInfo != VMA_NULL && pAllocation != VMA_NULL);
++ VMA_DEBUG_LOG("vmaVirtualAllocate");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ return virtualBlock->Allocate(*pCreateInfo, *pAllocation, pOffset);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaVirtualFree(VmaVirtualBlock VMA_NOT_NULL virtualBlock, VmaVirtualAllocation VMA_NULLABLE_NON_DISPATCHABLE allocation)
++{
++ if(allocation != VK_NULL_HANDLE)
++ {
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE);
++ VMA_DEBUG_LOG("vmaVirtualFree");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ virtualBlock->Free(allocation);
++ }
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaClearVirtualBlock(VmaVirtualBlock VMA_NOT_NULL virtualBlock)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE);
++ VMA_DEBUG_LOG("vmaClearVirtualBlock");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ virtualBlock->Clear();
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaSetVirtualAllocationUserData(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaVirtualAllocation VMA_NOT_NULL_NON_DISPATCHABLE allocation, void* VMA_NULLABLE pUserData)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE);
++ VMA_DEBUG_LOG("vmaSetVirtualAllocationUserData");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ virtualBlock->SetAllocationUserData(allocation, pUserData);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaGetVirtualBlockStatistics(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaStatistics* VMA_NOT_NULL pStats)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE && pStats != VMA_NULL);
++ VMA_DEBUG_LOG("vmaGetVirtualBlockStatistics");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ virtualBlock->GetStatistics(*pStats);
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaCalculateVirtualBlockStatistics(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ VmaDetailedStatistics* VMA_NOT_NULL pStats)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE && pStats != VMA_NULL);
++ VMA_DEBUG_LOG("vmaCalculateVirtualBlockStatistics");
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ virtualBlock->CalculateDetailedStatistics(*pStats);
++}
++
++#if VMA_STATS_STRING_ENABLED
++
++VMA_CALL_PRE void VMA_CALL_POST vmaBuildVirtualBlockStatsString(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ char* VMA_NULLABLE * VMA_NOT_NULL ppStatsString, VkBool32 detailedMap)
++{
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE && ppStatsString != VMA_NULL);
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ const VkAllocationCallbacks* allocationCallbacks = virtualBlock->GetAllocationCallbacks();
++ VmaStringBuilder sb(allocationCallbacks);
++ virtualBlock->BuildStatsString(detailedMap != VK_FALSE, sb);
++ *ppStatsString = VmaCreateStringCopy(allocationCallbacks, sb.GetData(), sb.GetLength());
++}
++
++VMA_CALL_PRE void VMA_CALL_POST vmaFreeVirtualBlockStatsString(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
++ char* VMA_NULLABLE pStatsString)
++{
++ if(pStatsString != VMA_NULL)
++ {
++ VMA_ASSERT(virtualBlock != VK_NULL_HANDLE);
++ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
++ VmaFreeString(virtualBlock->GetAllocationCallbacks(), pStatsString);
++ }
++}
++#endif // VMA_STATS_STRING_ENABLED
++#endif // _VMA_PUBLIC_INTERFACE
++#endif // VMA_IMPLEMENTATION
++
++/**
++\page quick_start Quick start
++
++\section quick_start_project_setup Project setup
++
++Vulkan Memory Allocator comes in form of a "stb-style" single header file.
++You don't need to build it as a separate library project.
++You can add this file directly to your project and submit it to code repository next to your other source files.
++
++"Single header" doesn't mean that everything is contained in C/C++ declarations,
++like it tends to be in case of inline functions or C++ templates.
++It means that implementation is bundled with interface in a single file and needs to be extracted using preprocessor macro.
++If you don't do it properly, you will get linker errors.
++
++To do it properly:
++
++-# Include "vk_mem_alloc.h" file in each CPP file where you want to use the library.
++ This includes declarations of all members of the library.
++-# In exactly one CPP file define following macro before this include.
++ It enables also internal definitions.
++
++\code
++#define VMA_IMPLEMENTATION
++#include "vk_mem_alloc.h"
++\endcode
++
++It may be a good idea to create dedicated CPP file just for this purpose.
++
++This library includes header `<vulkan/vulkan.h>`, which in turn
++includes `<windows.h>` on Windows. If you need some specific macros defined
++before including these headers (like `WIN32_LEAN_AND_MEAN` or
++`WINVER` for Windows, `VK_USE_PLATFORM_WIN32_KHR` for Vulkan), you must define
++them before every `#include` of this library.
++
++This library is written in C++, but has C-compatible interface.
++Thus you can include and use vk_mem_alloc.h in C or C++ code, but full
++implementation with `VMA_IMPLEMENTATION` macro must be compiled as C++, NOT as C.
++Some features of C++14 used. STL containers, RTTI, or C++ exceptions are not used.
++
++
++\section quick_start_initialization Initialization
++
++At program startup:
++
++-# Initialize Vulkan to have `VkPhysicalDevice`, `VkDevice` and `VkInstance` object.
++-# Fill VmaAllocatorCreateInfo structure and create #VmaAllocator object by
++ calling vmaCreateAllocator().
++
++Only members `physicalDevice`, `device`, `instance` are required.
++However, you should inform the library which Vulkan version do you use by setting
++VmaAllocatorCreateInfo::vulkanApiVersion and which extensions did you enable
++by setting VmaAllocatorCreateInfo::flags (like #VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT for VK_KHR_buffer_device_address).
++Otherwise, VMA would use only features of Vulkan 1.0 core with no extensions.
++
++You may need to configure importing Vulkan functions. There are 3 ways to do this:
++
++-# **If you link with Vulkan static library** (e.g. "vulkan-1.lib" on Windows):
++ - You don't need to do anything.
++ - VMA will use these, as macro `VMA_STATIC_VULKAN_FUNCTIONS` is defined to 1 by default.
++-# **If you want VMA to fetch pointers to Vulkan functions dynamically** using `vkGetInstanceProcAddr`,
++ `vkGetDeviceProcAddr` (this is the option presented in the example below):
++ - Define `VMA_STATIC_VULKAN_FUNCTIONS` to 0, `VMA_DYNAMIC_VULKAN_FUNCTIONS` to 1.
++ - Provide pointers to these two functions via VmaVulkanFunctions::vkGetInstanceProcAddr,
++ VmaVulkanFunctions::vkGetDeviceProcAddr.
++ - The library will fetch pointers to all other functions it needs internally.
++-# **If you fetch pointers to all Vulkan functions in a custom way**, e.g. using some loader like
++ [Volk](https://github.com/zeux/volk):
++ - Define `VMA_STATIC_VULKAN_FUNCTIONS` and `VMA_DYNAMIC_VULKAN_FUNCTIONS` to 0.
++ - Pass these pointers via structure #VmaVulkanFunctions.
++
++\code
++VmaVulkanFunctions vulkanFunctions = {};
++vulkanFunctions.vkGetInstanceProcAddr = &vkGetInstanceProcAddr;
++vulkanFunctions.vkGetDeviceProcAddr = &vkGetDeviceProcAddr;
++
++VmaAllocatorCreateInfo allocatorCreateInfo = {};
++allocatorCreateInfo.vulkanApiVersion = VK_API_VERSION_1_2;
++allocatorCreateInfo.physicalDevice = physicalDevice;
++allocatorCreateInfo.device = device;
++allocatorCreateInfo.instance = instance;
++allocatorCreateInfo.pVulkanFunctions = &vulkanFunctions;
++
++VmaAllocator allocator;
++vmaCreateAllocator(&allocatorCreateInfo, &allocator);
++\endcode
++
++
++\section quick_start_resource_allocation Resource allocation
++
++When you want to create a buffer or image:
++
++-# Fill `VkBufferCreateInfo` / `VkImageCreateInfo` structure.
++-# Fill VmaAllocationCreateInfo structure.
++-# Call vmaCreateBuffer() / vmaCreateImage() to get `VkBuffer`/`VkImage` with memory
++ already allocated and bound to it, plus #VmaAllocation objects that represents its underlying memory.
++
++\code
++VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufferInfo.size = 65536;
++bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo allocInfo = {};
++allocInfo.usage = VMA_MEMORY_USAGE_AUTO;
++
++VkBuffer buffer;
++VmaAllocation allocation;
++vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
++\endcode
++
++Don't forget to destroy your objects when no longer needed:
++
++\code
++vmaDestroyBuffer(allocator, buffer, allocation);
++vmaDestroyAllocator(allocator);
++\endcode
++
++
++\page choosing_memory_type Choosing memory type
++
++Physical devices in Vulkan support various combinations of memory heaps and
++types. Help with choosing correct and optimal memory type for your specific
++resource is one of the key features of this library. You can use it by filling
++appropriate members of VmaAllocationCreateInfo structure, as described below.
++You can also combine multiple methods.
++
++-# If you just want to find memory type index that meets your requirements, you
++ can use function: vmaFindMemoryTypeIndexForBufferInfo(),
++ vmaFindMemoryTypeIndexForImageInfo(), vmaFindMemoryTypeIndex().
++-# If you want to allocate a region of device memory without association with any
++ specific image or buffer, you can use function vmaAllocateMemory(). Usage of
++ this function is not recommended and usually not needed.
++ vmaAllocateMemoryPages() function is also provided for creating multiple allocations at once,
++ which may be useful for sparse binding.
++-# If you already have a buffer or an image created, you want to allocate memory
++ for it and then you will bind it yourself, you can use function
++ vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage().
++ For binding you should use functions: vmaBindBufferMemory(), vmaBindImageMemory()
++ or their extended versions: vmaBindBufferMemory2(), vmaBindImageMemory2().
++-# **This is the easiest and recommended way to use this library:**
++ If you want to create a buffer or an image, allocate memory for it and bind
++ them together, all in one call, you can use function vmaCreateBuffer(),
++ vmaCreateImage().
++
++When using 3. or 4., the library internally queries Vulkan for memory types
++supported for that buffer or image (function `vkGetBufferMemoryRequirements()`)
++and uses only one of these types.
++
++If no memory type can be found that meets all the requirements, these functions
++return `VK_ERROR_FEATURE_NOT_PRESENT`.
++
++You can leave VmaAllocationCreateInfo structure completely filled with zeros.
++It means no requirements are specified for memory type.
++It is valid, although not very useful.
++
++\section choosing_memory_type_usage Usage
++
++The easiest way to specify memory requirements is to fill member
++VmaAllocationCreateInfo::usage using one of the values of enum #VmaMemoryUsage.
++It defines high level, common usage types.
++Since version 3 of the library, it is recommended to use #VMA_MEMORY_USAGE_AUTO to let it select best memory type for your resource automatically.
++
++For example, if you want to create a uniform buffer that will be filled using
++transfer only once or infrequently and then used for rendering every frame as a uniform buffer, you can
++do it using following code. The buffer will most likely end up in a memory type with
++`VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT` to be fast to access by the GPU device.
++
++\code
++VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufferInfo.size = 65536;
++bufferInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo allocInfo = {};
++allocInfo.usage = VMA_MEMORY_USAGE_AUTO;
++
++VkBuffer buffer;
++VmaAllocation allocation;
++vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
++\endcode
++
++If you have a preference for putting the resource in GPU (device) memory or CPU (host) memory
++on systems with discrete graphics card that have the memories separate, you can use
++#VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE or #VMA_MEMORY_USAGE_AUTO_PREFER_HOST.
++
++When using `VMA_MEMORY_USAGE_AUTO*` while you want to map the allocated memory,
++you also need to specify one of the host access flags:
++#VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT.
++This will help the library decide about preferred memory type to ensure it has `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`
++so you can map it.
++
++For example, a staging buffer that will be filled via mapped pointer and then
++used as a source of transfer to the buffer decribed previously can be created like this.
++It will likely and up in a memory type that is `HOST_VISIBLE` and `HOST_COHERENT`
++but not `HOST_CACHED` (meaning uncached, write-combined) and not `DEVICE_LOCAL` (meaning system RAM).
++
++\code
++VkBufferCreateInfo stagingBufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++stagingBufferInfo.size = 65536;
++stagingBufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
++
++VmaAllocationCreateInfo stagingAllocInfo = {};
++stagingAllocInfo.usage = VMA_MEMORY_USAGE_AUTO;
++stagingAllocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT;
++
++VkBuffer stagingBuffer;
++VmaAllocation stagingAllocation;
++vmaCreateBuffer(allocator, &stagingBufferInfo, &stagingAllocInfo, &stagingBuffer, &stagingAllocation, nullptr);
++\endcode
++
++For more examples of creating different kinds of resources, see chapter \ref usage_patterns.
++
++Usage values `VMA_MEMORY_USAGE_AUTO*` are legal to use only when the library knows
++about the resource being created by having `VkBufferCreateInfo` / `VkImageCreateInfo` passed,
++so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc.
++If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting
++memory type, as decribed below.
++
++\note
++Old usage values (`VMA_MEMORY_USAGE_GPU_ONLY`, `VMA_MEMORY_USAGE_CPU_ONLY`,
++`VMA_MEMORY_USAGE_CPU_TO_GPU`, `VMA_MEMORY_USAGE_GPU_TO_CPU`, `VMA_MEMORY_USAGE_CPU_COPY`)
++are still available and work same way as in previous versions of the library
++for backward compatibility, but they are not recommended.
++
++\section choosing_memory_type_required_preferred_flags Required and preferred flags
++
++You can specify more detailed requirements by filling members
++VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags
++with a combination of bits from enum `VkMemoryPropertyFlags`. For example,
++if you want to create a buffer that will be persistently mapped on host (so it
++must be `HOST_VISIBLE`) and preferably will also be `HOST_COHERENT` and `HOST_CACHED`,
++use following code:
++
++\code
++VmaAllocationCreateInfo allocInfo = {};
++allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
++allocInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
++allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT;
++
++VkBuffer buffer;
++VmaAllocation allocation;
++vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
++\endcode
++
++A memory type is chosen that has all the required flags and as many preferred
++flags set as possible.
++
++Value passed in VmaAllocationCreateInfo::usage is internally converted to a set of required and preferred flags,
++plus some extra "magic" (heuristics).
++
++\section choosing_memory_type_explicit_memory_types Explicit memory types
++
++If you inspected memory types available on the physical device and you have
++a preference for memory types that you want to use, you can fill member
++VmaAllocationCreateInfo::memoryTypeBits. It is a bit mask, where each bit set
++means that a memory type with that index is allowed to be used for the
++allocation. Special value 0, just like `UINT32_MAX`, means there are no
++restrictions to memory type index.
++
++Please note that this member is NOT just a memory type index.
++Still you can use it to choose just one, specific memory type.
++For example, if you already determined that your buffer should be created in
++memory type 2, use following code:
++
++\code
++uint32_t memoryTypeIndex = 2;
++
++VmaAllocationCreateInfo allocInfo = {};
++allocInfo.memoryTypeBits = 1u << memoryTypeIndex;
++
++VkBuffer buffer;
++VmaAllocation allocation;
++vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
++\endcode
++
++
++\section choosing_memory_type_custom_memory_pools Custom memory pools
++
++If you allocate from custom memory pool, all the ways of specifying memory
++requirements described above are not applicable and the aforementioned members
++of VmaAllocationCreateInfo structure are ignored. Memory type is selected
++explicitly when creating the pool and then used to make all the allocations from
++that pool. For further details, see \ref custom_memory_pools.
++
++\section choosing_memory_type_dedicated_allocations Dedicated allocations
++
++Memory for allocations is reserved out of larger block of `VkDeviceMemory`
++allocated from Vulkan internally. That is the main feature of this whole library.
++You can still request a separate memory block to be created for an allocation,
++just like you would do in a trivial solution without using any allocator.
++In that case, a buffer or image is always bound to that memory at offset 0.
++This is called a "dedicated allocation".
++You can explicitly request it by using flag #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++The library can also internally decide to use dedicated allocation in some cases, e.g.:
++
++- When the size of the allocation is large.
++- When [VK_KHR_dedicated_allocation](@ref vk_khr_dedicated_allocation) extension is enabled
++ and it reports that dedicated allocation is required or recommended for the resource.
++- When allocation of next big memory block fails due to not enough device memory,
++ but allocation with the exact requested size succeeds.
++
++
++\page memory_mapping Memory mapping
++
++To "map memory" in Vulkan means to obtain a CPU pointer to `VkDeviceMemory`,
++to be able to read from it or write to it in CPU code.
++Mapping is possible only of memory allocated from a memory type that has
++`VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag.
++Functions `vkMapMemory()`, `vkUnmapMemory()` are designed for this purpose.
++You can use them directly with memory allocated by this library,
++but it is not recommended because of following issue:
++Mapping the same `VkDeviceMemory` block multiple times is illegal - only one mapping at a time is allowed.
++This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan.
++Because of this, Vulkan Memory Allocator provides following facilities:
++
++\note If you want to be able to map an allocation, you need to specify one of the flags
++#VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
++in VmaAllocationCreateInfo::flags. These flags are required for an allocation to be mappable
++when using #VMA_MEMORY_USAGE_AUTO or other `VMA_MEMORY_USAGE_AUTO*` enum values.
++For other usage values they are ignored and every such allocation made in `HOST_VISIBLE` memory type is mappable,
++but they can still be used for consistency.
++
++\section memory_mapping_mapping_functions Mapping functions
++
++The library provides following functions for mapping of a specific #VmaAllocation: vmaMapMemory(), vmaUnmapMemory().
++They are safer and more convenient to use than standard Vulkan functions.
++You can map an allocation multiple times simultaneously - mapping is reference-counted internally.
++You can also map different allocations simultaneously regardless of whether they use the same `VkDeviceMemory` block.
++The way it is implemented is that the library always maps entire memory block, not just region of the allocation.
++For further details, see description of vmaMapMemory() function.
++Example:
++
++\code
++// Having these objects initialized:
++struct ConstantBuffer
++{
++ ...
++};
++ConstantBuffer constantBufferData = ...
++
++VmaAllocator allocator = ...
++VkBuffer constantBuffer = ...
++VmaAllocation constantBufferAllocation = ...
++
++// You can map and fill your buffer using following code:
++
++void* mappedData;
++vmaMapMemory(allocator, constantBufferAllocation, &mappedData);
++memcpy(mappedData, &constantBufferData, sizeof(constantBufferData));
++vmaUnmapMemory(allocator, constantBufferAllocation);
++\endcode
++
++When mapping, you may see a warning from Vulkan validation layer similar to this one:
++
++<i>Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.</i>
++
++It happens because the library maps entire `VkDeviceMemory` block, where different
++types of images and buffers may end up together, especially on GPUs with unified memory like Intel.
++You can safely ignore it if you are sure you access only memory of the intended
++object that you wanted to map.
++
++
++\section memory_mapping_persistently_mapped_memory Persistently mapped memory
++
++Kepping your memory persistently mapped is generally OK in Vulkan.
++You don't need to unmap it before using its data on the GPU.
++The library provides a special feature designed for that:
++Allocations made with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag set in
++VmaAllocationCreateInfo::flags stay mapped all the time,
++so you can just access CPU pointer to it any time
++without a need to call any "map" or "unmap" function.
++Example:
++
++\code
++VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufCreateInfo.size = sizeof(ConstantBuffer);
++bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |
++ VMA_ALLOCATION_CREATE_MAPPED_BIT;
++
++VkBuffer buf;
++VmaAllocation alloc;
++VmaAllocationInfo allocInfo;
++vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
++
++// Buffer is already mapped. You can access its memory.
++memcpy(allocInfo.pMappedData, &constantBufferData, sizeof(constantBufferData));
++\endcode
++
++\note #VMA_ALLOCATION_CREATE_MAPPED_BIT by itself doesn't guarantee that the allocation will end up
++in a mappable memory type.
++For this, you need to also specify #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or
++#VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT.
++#VMA_ALLOCATION_CREATE_MAPPED_BIT only guarantees that if the memory is `HOST_VISIBLE`, the allocation will be mapped on creation.
++For an example of how to make use of this fact, see section \ref usage_patterns_advanced_data_uploading.
++
++\section memory_mapping_cache_control Cache flush and invalidate
++
++Memory in Vulkan doesn't need to be unmapped before using it on GPU,
++but unless a memory types has `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT` flag set,
++you need to manually **invalidate** cache before reading of mapped pointer
++and **flush** cache after writing to mapped pointer.
++Map/unmap operations don't do that automatically.
++Vulkan provides following functions for this purpose `vkFlushMappedMemoryRanges()`,
++`vkInvalidateMappedMemoryRanges()`, but this library provides more convenient
++functions that refer to given allocation object: vmaFlushAllocation(),
++vmaInvalidateAllocation(),
++or multiple objects at once: vmaFlushAllocations(), vmaInvalidateAllocations().
++
++Regions of memory specified for flush/invalidate must be aligned to
++`VkPhysicalDeviceLimits::nonCoherentAtomSize`. This is automatically ensured by the library.
++In any memory type that is `HOST_VISIBLE` but not `HOST_COHERENT`, all allocations
++within blocks are aligned to this value, so their offsets are always multiply of
++`nonCoherentAtomSize` and two different allocations never share same "line" of this size.
++
++Also, Windows drivers from all 3 PC GPU vendors (AMD, Intel, NVIDIA)
++currently provide `HOST_COHERENT` flag on all memory types that are
++`HOST_VISIBLE`, so on PC you may not need to bother.
++
++
++\page staying_within_budget Staying within budget
++
++When developing a graphics-intensive game or program, it is important to avoid allocating
++more GPU memory than it is physically available. When the memory is over-committed,
++various bad things can happen, depending on the specific GPU, graphics driver, and
++operating system:
++
++- It may just work without any problems.
++- The application may slow down because some memory blocks are moved to system RAM
++ and the GPU has to access them through PCI Express bus.
++- A new allocation may take very long time to complete, even few seconds, and possibly
++ freeze entire system.
++- The new allocation may fail with `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
++- It may even result in GPU crash (TDR), observed as `VK_ERROR_DEVICE_LOST`
++ returned somewhere later.
++
++\section staying_within_budget_querying_for_budget Querying for budget
++
++To query for current memory usage and available budget, use function vmaGetHeapBudgets().
++Returned structure #VmaBudget contains quantities expressed in bytes, per Vulkan memory heap.
++
++Please note that this function returns different information and works faster than
++vmaCalculateStatistics(). vmaGetHeapBudgets() can be called every frame or even before every
++allocation, while vmaCalculateStatistics() is intended to be used rarely,
++only to obtain statistical information, e.g. for debugging purposes.
++
++It is recommended to use <b>VK_EXT_memory_budget</b> device extension to obtain information
++about the budget from Vulkan device. VMA is able to use this extension automatically.
++When not enabled, the allocator behaves same way, but then it estimates current usage
++and available budget based on its internal information and Vulkan memory heap sizes,
++which may be less precise. In order to use this extension:
++
++1. Make sure extensions VK_EXT_memory_budget and VK_KHR_get_physical_device_properties2
++ required by it are available and enable them. Please note that the first is a device
++ extension and the second is instance extension!
++2. Use flag #VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT when creating #VmaAllocator object.
++3. Make sure to call vmaSetCurrentFrameIndex() every frame. Budget is queried from
++ Vulkan inside of it to avoid overhead of querying it with every allocation.
++
++\section staying_within_budget_controlling_memory_usage Controlling memory usage
++
++There are many ways in which you can try to stay within the budget.
++
++First, when making new allocation requires allocating a new memory block, the library
++tries not to exceed the budget automatically. If a block with default recommended size
++(e.g. 256 MB) would go over budget, a smaller block is allocated, possibly even
++dedicated memory for just this resource.
++
++If the size of the requested resource plus current memory usage is more than the
++budget, by default the library still tries to create it, leaving it to the Vulkan
++implementation whether the allocation succeeds or fails. You can change this behavior
++by using #VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT flag. With it, the allocation is
++not made if it would exceed the budget or if the budget is already exceeded.
++VMA then tries to make the allocation from the next eligible Vulkan memory type.
++The all of them fail, the call then fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
++Example usage pattern may be to pass the #VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT flag
++when creating resources that are not essential for the application (e.g. the texture
++of a specific object) and not to pass it when creating critically important resources
++(e.g. render targets).
++
++On AMD graphics cards there is a custom vendor extension available: <b>VK_AMD_memory_overallocation_behavior</b>
++that allows to control the behavior of the Vulkan implementation in out-of-memory cases -
++whether it should fail with an error code or still allow the allocation.
++Usage of this extension involves only passing extra structure on Vulkan device creation,
++so it is out of scope of this library.
++
++Finally, you can also use #VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT flag to make sure
++a new allocation is created only when it fits inside one of the existing memory blocks.
++If it would require to allocate a new block, if fails instead with `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
++This also ensures that the function call is very fast because it never goes to Vulkan
++to obtain a new block.
++
++\note Creating \ref custom_memory_pools with VmaPoolCreateInfo::minBlockCount
++set to more than 0 will currently try to allocate memory blocks without checking whether they
++fit within budget.
++
++
++\page resource_aliasing Resource aliasing (overlap)
++
++New explicit graphics APIs (Vulkan and Direct3D 12), thanks to manual memory
++management, give an opportunity to alias (overlap) multiple resources in the
++same region of memory - a feature not available in the old APIs (Direct3D 11, OpenGL).
++It can be useful to save video memory, but it must be used with caution.
++
++For example, if you know the flow of your whole render frame in advance, you
++are going to use some intermediate textures or buffers only during a small range of render passes,
++and you know these ranges don't overlap in time, you can bind these resources to
++the same place in memory, even if they have completely different parameters (width, height, format etc.).
++
++![Resource aliasing (overlap)](../gfx/Aliasing.png)
++
++Such scenario is possible using VMA, but you need to create your images manually.
++Then you need to calculate parameters of an allocation to be made using formula:
++
++- allocation size = max(size of each image)
++- allocation alignment = max(alignment of each image)
++- allocation memoryTypeBits = bitwise AND(memoryTypeBits of each image)
++
++Following example shows two different images bound to the same place in memory,
++allocated to fit largest of them.
++
++\code
++// A 512x512 texture to be sampled.
++VkImageCreateInfo img1CreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
++img1CreateInfo.imageType = VK_IMAGE_TYPE_2D;
++img1CreateInfo.extent.width = 512;
++img1CreateInfo.extent.height = 512;
++img1CreateInfo.extent.depth = 1;
++img1CreateInfo.mipLevels = 10;
++img1CreateInfo.arrayLayers = 1;
++img1CreateInfo.format = VK_FORMAT_R8G8B8A8_SRGB;
++img1CreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
++img1CreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
++img1CreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
++img1CreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
++
++// A full screen texture to be used as color attachment.
++VkImageCreateInfo img2CreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
++img2CreateInfo.imageType = VK_IMAGE_TYPE_2D;
++img2CreateInfo.extent.width = 1920;
++img2CreateInfo.extent.height = 1080;
++img2CreateInfo.extent.depth = 1;
++img2CreateInfo.mipLevels = 1;
++img2CreateInfo.arrayLayers = 1;
++img2CreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
++img2CreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
++img2CreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
++img2CreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
++img2CreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
++
++VkImage img1;
++res = vkCreateImage(device, &img1CreateInfo, nullptr, &img1);
++VkImage img2;
++res = vkCreateImage(device, &img2CreateInfo, nullptr, &img2);
++
++VkMemoryRequirements img1MemReq;
++vkGetImageMemoryRequirements(device, img1, &img1MemReq);
++VkMemoryRequirements img2MemReq;
++vkGetImageMemoryRequirements(device, img2, &img2MemReq);
++
++VkMemoryRequirements finalMemReq = {};
++finalMemReq.size = std::max(img1MemReq.size, img2MemReq.size);
++finalMemReq.alignment = std::max(img1MemReq.alignment, img2MemReq.alignment);
++finalMemReq.memoryTypeBits = img1MemReq.memoryTypeBits & img2MemReq.memoryTypeBits;
++// Validate if(finalMemReq.memoryTypeBits != 0)
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
++
++VmaAllocation alloc;
++res = vmaAllocateMemory(allocator, &finalMemReq, &allocCreateInfo, &alloc, nullptr);
++
++res = vmaBindImageMemory(allocator, alloc, img1);
++res = vmaBindImageMemory(allocator, alloc, img2);
++
++// You can use img1, img2 here, but not at the same time!
++
++vmaFreeMemory(allocator, alloc);
++vkDestroyImage(allocator, img2, nullptr);
++vkDestroyImage(allocator, img1, nullptr);
++\endcode
++
++Remember that using resources that alias in memory requires proper synchronization.
++You need to issue a memory barrier to make sure commands that use `img1` and `img2`
++don't overlap on GPU timeline.
++You also need to treat a resource after aliasing as uninitialized - containing garbage data.
++For example, if you use `img1` and then want to use `img2`, you need to issue
++an image memory barrier for `img2` with `oldLayout` = `VK_IMAGE_LAYOUT_UNDEFINED`.
++
++Additional considerations:
++
++- Vulkan also allows to interpret contents of memory between aliasing resources consistently in some cases.
++See chapter 11.8. "Memory Aliasing" of Vulkan specification or `VK_IMAGE_CREATE_ALIAS_BIT` flag.
++- You can create more complex layout where different images and buffers are bound
++at different offsets inside one large allocation. For example, one can imagine
++a big texture used in some render passes, aliasing with a set of many small buffers
++used between in some further passes. To bind a resource at non-zero offset in an allocation,
++use vmaBindBufferMemory2() / vmaBindImageMemory2().
++- Before allocating memory for the resources you want to alias, check `memoryTypeBits`
++returned in memory requirements of each resource to make sure the bits overlap.
++Some GPUs may expose multiple memory types suitable e.g. only for buffers or
++images with `COLOR_ATTACHMENT` usage, so the sets of memory types supported by your
++resources may be disjoint. Aliasing them is not possible in that case.
++
++
++\page custom_memory_pools Custom memory pools
++
++A memory pool contains a number of `VkDeviceMemory` blocks.
++The library automatically creates and manages default pool for each memory type available on the device.
++Default memory pool automatically grows in size.
++Size of allocated blocks is also variable and managed automatically.
++
++You can create custom pool and allocate memory out of it.
++It can be useful if you want to:
++
++- Keep certain kind of allocations separate from others.
++- Enforce particular, fixed size of Vulkan memory blocks.
++- Limit maximum amount of Vulkan memory allocated for that pool.
++- Reserve minimum or fixed amount of Vulkan memory always preallocated for that pool.
++- Use extra parameters for a set of your allocations that are available in #VmaPoolCreateInfo but not in
++ #VmaAllocationCreateInfo - e.g., custom minimum alignment, custom `pNext` chain.
++- Perform defragmentation on a specific subset of your allocations.
++
++To use custom memory pools:
++
++-# Fill VmaPoolCreateInfo structure.
++-# Call vmaCreatePool() to obtain #VmaPool handle.
++-# When making an allocation, set VmaAllocationCreateInfo::pool to this handle.
++ You don't need to specify any other parameters of this structure, like `usage`.
++
++Example:
++
++\code
++// Find memoryTypeIndex for the pool.
++VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++sampleBufCreateInfo.size = 0x10000; // Doesn't matter.
++sampleBufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo sampleAllocCreateInfo = {};
++sampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++
++uint32_t memTypeIndex;
++VkResult res = vmaFindMemoryTypeIndexForBufferInfo(allocator,
++ &sampleBufCreateInfo, &sampleAllocCreateInfo, &memTypeIndex);
++// Check res...
++
++// Create a pool that can have at most 2 blocks, 128 MiB each.
++VmaPoolCreateInfo poolCreateInfo = {};
++poolCreateInfo.memoryTypeIndex = memTypeIndex;
++poolCreateInfo.blockSize = 128ull * 1024 * 1024;
++poolCreateInfo.maxBlockCount = 2;
++
++VmaPool pool;
++res = vmaCreatePool(allocator, &poolCreateInfo, &pool);
++// Check res...
++
++// Allocate a buffer out of it.
++VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufCreateInfo.size = 1024;
++bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.pool = pool;
++
++VkBuffer buf;
++VmaAllocation alloc;
++res = vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr);
++// Check res...
++\endcode
++
++You have to free all allocations made from this pool before destroying it.
++
++\code
++vmaDestroyBuffer(allocator, buf, alloc);
++vmaDestroyPool(allocator, pool);
++\endcode
++
++New versions of this library support creating dedicated allocations in custom pools.
++It is supported only when VmaPoolCreateInfo::blockSize = 0.
++To use this feature, set VmaAllocationCreateInfo::pool to the pointer to your custom pool and
++VmaAllocationCreateInfo::flags to #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++
++\note Excessive use of custom pools is a common mistake when using this library.
++Custom pools may be useful for special purposes - when you want to
++keep certain type of resources separate e.g. to reserve minimum amount of memory
++for them or limit maximum amount of memory they can occupy. For most
++resources this is not needed and so it is not recommended to create #VmaPool
++objects and allocations out of them. Allocating from the default pool is sufficient.
++
++
++\section custom_memory_pools_MemTypeIndex Choosing memory type index
++
++When creating a pool, you must explicitly specify memory type index.
++To find the one suitable for your buffers or images, you can use helper functions
++vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo().
++You need to provide structures with example parameters of buffers or images
++that you are going to create in that pool.
++
++\code
++VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++exampleBufCreateInfo.size = 1024; // Doesn't matter
++exampleBufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++
++uint32_t memTypeIndex;
++vmaFindMemoryTypeIndexForBufferInfo(allocator, &exampleBufCreateInfo, &allocCreateInfo, &memTypeIndex);
++
++VmaPoolCreateInfo poolCreateInfo = {};
++poolCreateInfo.memoryTypeIndex = memTypeIndex;
++// ...
++\endcode
++
++When creating buffers/images allocated in that pool, provide following parameters:
++
++- `VkBufferCreateInfo`: Prefer to pass same parameters as above.
++ Otherwise you risk creating resources in a memory type that is not suitable for them, which may result in undefined behavior.
++ Using different `VK_BUFFER_USAGE_` flags may work, but you shouldn't create images in a pool intended for buffers
++ or the other way around.
++- VmaAllocationCreateInfo: You don't need to pass same parameters. Fill only `pool` member.
++ Other members are ignored anyway.
++
++\section linear_algorithm Linear allocation algorithm
++
++Each Vulkan memory block managed by this library has accompanying metadata that
++keeps track of used and unused regions. By default, the metadata structure and
++algorithm tries to find best place for new allocations among free regions to
++optimize memory usage. This way you can allocate and free objects in any order.
++
++![Default allocation algorithm](../gfx/Linear_allocator_1_algo_default.png)
++
++Sometimes there is a need to use simpler, linear allocation algorithm. You can
++create custom pool that uses such algorithm by adding flag
++#VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT to VmaPoolCreateInfo::flags while creating
++#VmaPool object. Then an alternative metadata management is used. It always
++creates new allocations after last one and doesn't reuse free regions after
++allocations freed in the middle. It results in better allocation performance and
++less memory consumed by metadata.
++
++![Linear allocation algorithm](../gfx/Linear_allocator_2_algo_linear.png)
++
++With this one flag, you can create a custom pool that can be used in many ways:
++free-at-once, stack, double stack, and ring buffer. See below for details.
++You don't need to specify explicitly which of these options you are going to use - it is detected automatically.
++
++\subsection linear_algorithm_free_at_once Free-at-once
++
++In a pool that uses linear algorithm, you still need to free all the allocations
++individually, e.g. by using vmaFreeMemory() or vmaDestroyBuffer(). You can free
++them in any order. New allocations are always made after last one - free space
++in the middle is not reused. However, when you release all the allocation and
++the pool becomes empty, allocation starts from the beginning again. This way you
++can use linear algorithm to speed up creation of allocations that you are going
++to release all at once.
++
++![Free-at-once](../gfx/Linear_allocator_3_free_at_once.png)
++
++This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount
++value that allows multiple memory blocks.
++
++\subsection linear_algorithm_stack Stack
++
++When you free an allocation that was created last, its space can be reused.
++Thanks to this, if you always release allocations in the order opposite to their
++creation (LIFO - Last In First Out), you can achieve behavior of a stack.
++
++![Stack](../gfx/Linear_allocator_4_stack.png)
++
++This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount
++value that allows multiple memory blocks.
++
++\subsection linear_algorithm_double_stack Double stack
++
++The space reserved by a custom pool with linear algorithm may be used by two
++stacks:
++
++- First, default one, growing up from offset 0.
++- Second, "upper" one, growing down from the end towards lower offsets.
++
++To make allocation from the upper stack, add flag #VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT
++to VmaAllocationCreateInfo::flags.
++
++![Double stack](../gfx/Linear_allocator_7_double_stack.png)
++
++Double stack is available only in pools with one memory block -
++VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.
++
++When the two stacks' ends meet so there is not enough space between them for a
++new allocation, such allocation fails with usual
++`VK_ERROR_OUT_OF_DEVICE_MEMORY` error.
++
++\subsection linear_algorithm_ring_buffer Ring buffer
++
++When you free some allocations from the beginning and there is not enough free space
++for a new one at the end of a pool, allocator's "cursor" wraps around to the
++beginning and starts allocation there. Thanks to this, if you always release
++allocations in the same order as you created them (FIFO - First In First Out),
++you can achieve behavior of a ring buffer / queue.
++
++![Ring buffer](../gfx/Linear_allocator_5_ring_buffer.png)
++
++Ring buffer is available only in pools with one memory block -
++VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.
++
++\note \ref defragmentation is not supported in custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT.
++
++
++\page defragmentation Defragmentation
++
++Interleaved allocations and deallocations of many objects of varying size can
++cause fragmentation over time, which can lead to a situation where the library is unable
++to find a continuous range of free memory for a new allocation despite there is
++enough free space, just scattered across many small free ranges between existing
++allocations.
++
++To mitigate this problem, you can use defragmentation feature.
++It doesn't happen automatically though and needs your cooperation,
++because VMA is a low level library that only allocates memory.
++It cannot recreate buffers and images in a new place as it doesn't remember the contents of `VkBufferCreateInfo` / `VkImageCreateInfo` structures.
++It cannot copy their contents as it doesn't record any commands to a command buffer.
++
++Example:
++
++\code
++VmaDefragmentationInfo defragInfo = {};
++defragInfo.pool = myPool;
++defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT;
++
++VmaDefragmentationContext defragCtx;
++VkResult res = vmaBeginDefragmentation(allocator, &defragInfo, &defragCtx);
++// Check res...
++
++for(;;)
++{
++ VmaDefragmentationPassMoveInfo pass;
++ res = vmaBeginDefragmentationPass(allocator, defragCtx, &pass);
++ if(res == VK_SUCCESS)
++ break;
++ else if(res != VK_INCOMPLETE)
++ // Handle error...
++
++ for(uint32_t i = 0; i < pass.moveCount; ++i)
++ {
++ // Inspect pass.pMoves[i].srcAllocation, identify what buffer/image it represents.
++ VmaAllocationInfo allocInfo;
++ vmaGetAllocationInfo(allocator, pMoves[i].srcAllocation, &allocInfo);
++ MyEngineResourceData* resData = (MyEngineResourceData*)allocInfo.pUserData;
++
++ // Recreate and bind this buffer/image at: pass.pMoves[i].dstMemory, pass.pMoves[i].dstOffset.
++ VkImageCreateInfo imgCreateInfo = ...
++ VkImage newImg;
++ res = vkCreateImage(device, &imgCreateInfo, nullptr, &newImg);
++ // Check res...
++ res = vmaBindImageMemory(allocator, pMoves[i].dstTmpAllocation, newImg);
++ // Check res...
++
++ // Issue a vkCmdCopyBuffer/vkCmdCopyImage to copy its content to the new place.
++ vkCmdCopyImage(cmdBuf, resData->img, ..., newImg, ...);
++ }
++
++ // Make sure the copy commands finished executing.
++ vkWaitForFences(...);
++
++ // Destroy old buffers/images bound with pass.pMoves[i].srcAllocation.
++ for(uint32_t i = 0; i < pass.moveCount; ++i)
++ {
++ // ...
++ vkDestroyImage(device, resData->img, nullptr);
++ }
++
++ // Update appropriate descriptors to point to the new places...
++
++ res = vmaEndDefragmentationPass(allocator, defragCtx, &pass);
++ if(res == VK_SUCCESS)
++ break;
++ else if(res != VK_INCOMPLETE)
++ // Handle error...
++}
++
++vmaEndDefragmentation(allocator, defragCtx, nullptr);
++\endcode
++
++Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage()
++create/destroy an allocation and a buffer/image at once, these are just a shortcut for
++creating the resource, allocating memory, and binding them together.
++Defragmentation works on memory allocations only. You must handle the rest manually.
++Defragmentation is an iterative process that should repreat "passes" as long as related functions
++return `VK_INCOMPLETE` not `VK_SUCCESS`.
++In each pass:
++
++1. vmaBeginDefragmentationPass() function call:
++ - Calculates and returns the list of allocations to be moved in this pass.
++ Note this can be a time-consuming process.
++ - Reserves destination memory for them by creating temporary destination allocations
++ that you can query for their `VkDeviceMemory` + offset using vmaGetAllocationInfo().
++2. Inside the pass, **you should**:
++ - Inspect the returned list of allocations to be moved.
++ - Create new buffers/images and bind them at the returned destination temporary allocations.
++ - Copy data from source to destination resources if necessary.
++ - Destroy the source buffers/images, but NOT their allocations.
++3. vmaEndDefragmentationPass() function call:
++ - Frees the source memory reserved for the allocations that are moved.
++ - Modifies source #VmaAllocation objects that are moved to point to the destination reserved memory.
++ - Frees `VkDeviceMemory` blocks that became empty.
++
++Unlike in previous iterations of the defragmentation API, there is no list of "movable" allocations passed as a parameter.
++Defragmentation algorithm tries to move all suitable allocations.
++You can, however, refuse to move some of them inside a defragmentation pass, by setting
++`pass.pMoves[i].operation` to #VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE.
++This is not recommended and may result in suboptimal packing of the allocations after defragmentation.
++If you cannot ensure any allocation can be moved, it is better to keep movable allocations separate in a custom pool.
++
++Inside a pass, for each allocation that should be moved:
++
++- You should copy its data from the source to the destination place by calling e.g. `vkCmdCopyBuffer()`, `vkCmdCopyImage()`.
++ - You need to make sure these commands finished executing before destroying the source buffers/images and before calling vmaEndDefragmentationPass().
++- If a resource doesn't contain any meaningful data, e.g. it is a transient color attachment image to be cleared,
++ filled, and used temporarily in each rendering frame, you can just recreate this image
++ without copying its data.
++- If the resource is in `HOST_VISIBLE` and `HOST_CACHED` memory, you can copy its data on the CPU
++ using `memcpy()`.
++- If you cannot move the allocation, you can set `pass.pMoves[i].operation` to #VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE.
++ This will cancel the move.
++ - vmaEndDefragmentationPass() will then free the destination memory
++ not the source memory of the allocation, leaving it unchanged.
++- If you decide the allocation is unimportant and can be destroyed instead of moved (e.g. it wasn't used for long time),
++ you can set `pass.pMoves[i].operation` to #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY.
++ - vmaEndDefragmentationPass() will then free both source and destination memory, and will destroy the source #VmaAllocation object.
++
++You can defragment a specific custom pool by setting VmaDefragmentationInfo::pool
++(like in the example above) or all the default pools by setting this member to null.
++
++Defragmentation is always performed in each pool separately.
++Allocations are never moved between different Vulkan memory types.
++The size of the destination memory reserved for a moved allocation is the same as the original one.
++Alignment of an allocation as it was determined using `vkGetBufferMemoryRequirements()` etc. is also respected after defragmentation.
++Buffers/images should be recreated with the same `VkBufferCreateInfo` / `VkImageCreateInfo` parameters as the original ones.
++
++You can perform the defragmentation incrementally to limit the number of allocations and bytes to be moved
++in each pass, e.g. to call it in sync with render frames and not to experience too big hitches.
++See members: VmaDefragmentationInfo::maxBytesPerPass, VmaDefragmentationInfo::maxAllocationsPerPass.
++
++It is also safe to perform the defragmentation asynchronously to render frames and other Vulkan and VMA
++usage, possibly from multiple threads, with the exception that allocations
++returned in VmaDefragmentationPassMoveInfo::pMoves shouldn't be destroyed until the defragmentation pass is ended.
++
++<b>Mapping</b> is preserved on allocations that are moved during defragmentation.
++Whether through #VMA_ALLOCATION_CREATE_MAPPED_BIT or vmaMapMemory(), the allocations
++are mapped at their new place. Of course, pointer to the mapped data changes, so it needs to be queried
++using VmaAllocationInfo::pMappedData.
++
++\note Defragmentation is not supported in custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT.
++
++
++\page statistics Statistics
++
++This library contains several functions that return information about its internal state,
++especially the amount of memory allocated from Vulkan.
++
++\section statistics_numeric_statistics Numeric statistics
++
++If you need to obtain basic statistics about memory usage per heap, together with current budget,
++you can call function vmaGetHeapBudgets() and inspect structure #VmaBudget.
++This is useful to keep track of memory usage and stay withing budget
++(see also \ref staying_within_budget).
++Example:
++
++\code
++uint32_t heapIndex = ...
++
++VmaBudget budgets[VK_MAX_MEMORY_HEAPS];
++vmaGetHeapBudgets(allocator, budgets);
++
++printf("My heap currently has %u allocations taking %llu B,\n",
++ budgets[heapIndex].statistics.allocationCount,
++ budgets[heapIndex].statistics.allocationBytes);
++printf("allocated out of %u Vulkan device memory blocks taking %llu B,\n",
++ budgets[heapIndex].statistics.blockCount,
++ budgets[heapIndex].statistics.blockBytes);
++printf("Vulkan reports total usage %llu B with budget %llu B.\n",
++ budgets[heapIndex].usage,
++ budgets[heapIndex].budget);
++\endcode
++
++You can query for more detailed statistics per memory heap, type, and totals,
++including minimum and maximum allocation size and unused range size,
++by calling function vmaCalculateStatistics() and inspecting structure #VmaTotalStatistics.
++This function is slower though, as it has to traverse all the internal data structures,
++so it should be used only for debugging purposes.
++
++You can query for statistics of a custom pool using function vmaGetPoolStatistics()
++or vmaCalculatePoolStatistics().
++
++You can query for information about a specific allocation using function vmaGetAllocationInfo().
++It fill structure #VmaAllocationInfo.
++
++\section statistics_json_dump JSON dump
++
++You can dump internal state of the allocator to a string in JSON format using function vmaBuildStatsString().
++The result is guaranteed to be correct JSON.
++It uses ANSI encoding.
++Any strings provided by user (see [Allocation names](@ref allocation_names))
++are copied as-is and properly escaped for JSON, so if they use UTF-8, ISO-8859-2 or any other encoding,
++this JSON string can be treated as using this encoding.
++It must be freed using function vmaFreeStatsString().
++
++The format of this JSON string is not part of official documentation of the library,
++but it will not change in backward-incompatible way without increasing library major version number
++and appropriate mention in changelog.
++
++The JSON string contains all the data that can be obtained using vmaCalculateStatistics().
++It can also contain detailed map of allocated memory blocks and their regions -
++free and occupied by allocations.
++This allows e.g. to visualize the memory or assess fragmentation.
++
++
++\page allocation_annotation Allocation names and user data
++
++\section allocation_user_data Allocation user data
++
++You can annotate allocations with your own information, e.g. for debugging purposes.
++To do that, fill VmaAllocationCreateInfo::pUserData field when creating
++an allocation. It is an opaque `void*` pointer. You can use it e.g. as a pointer,
++some handle, index, key, ordinal number or any other value that would associate
++the allocation with your custom metadata.
++It it useful to identify appropriate data structures in your engine given #VmaAllocation,
++e.g. when doing \ref defragmentation.
++
++\code
++VkBufferCreateInfo bufCreateInfo = ...
++
++MyBufferMetadata* pMetadata = CreateBufferMetadata();
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.pUserData = pMetadata;
++
++VkBuffer buffer;
++VmaAllocation allocation;
++vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buffer, &allocation, nullptr);
++\endcode
++
++The pointer may be later retrieved as VmaAllocationInfo::pUserData:
++
++\code
++VmaAllocationInfo allocInfo;
++vmaGetAllocationInfo(allocator, allocation, &allocInfo);
++MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData;
++\endcode
++
++It can also be changed using function vmaSetAllocationUserData().
++
++Values of (non-zero) allocations' `pUserData` are printed in JSON report created by
++vmaBuildStatsString() in hexadecimal form.
++
++\section allocation_names Allocation names
++
++An allocation can also carry a null-terminated string, giving a name to the allocation.
++To set it, call vmaSetAllocationName().
++The library creates internal copy of the string, so the pointer you pass doesn't need
++to be valid for whole lifetime of the allocation. You can free it after the call.
++
++\code
++std::string imageName = "Texture: ";
++imageName += fileName;
++vmaSetAllocationName(allocator, allocation, imageName.c_str());
++\endcode
++
++The string can be later retrieved by inspecting VmaAllocationInfo::pName.
++It is also printed in JSON report created by vmaBuildStatsString().
++
++\note Setting string name to VMA allocation doesn't automatically set it to the Vulkan buffer or image created with it.
++You must do it manually using an extension like VK_EXT_debug_utils, which is independent of this library.
++
++
++\page virtual_allocator Virtual allocator
++
++As an extra feature, the core allocation algorithm of the library is exposed through a simple and convenient API of "virtual allocator".
++It doesn't allocate any real GPU memory. It just keeps track of used and free regions of a "virtual block".
++You can use it to allocate your own memory or other objects, even completely unrelated to Vulkan.
++A common use case is sub-allocation of pieces of one large GPU buffer.
++
++\section virtual_allocator_creating_virtual_block Creating virtual block
++
++To use this functionality, there is no main "allocator" object.
++You don't need to have #VmaAllocator object created.
++All you need to do is to create a separate #VmaVirtualBlock object for each block of memory you want to be managed by the allocator:
++
++-# Fill in #VmaVirtualBlockCreateInfo structure.
++-# Call vmaCreateVirtualBlock(). Get new #VmaVirtualBlock object.
++
++Example:
++
++\code
++VmaVirtualBlockCreateInfo blockCreateInfo = {};
++blockCreateInfo.size = 1048576; // 1 MB
++
++VmaVirtualBlock block;
++VkResult res = vmaCreateVirtualBlock(&blockCreateInfo, &block);
++\endcode
++
++\section virtual_allocator_making_virtual_allocations Making virtual allocations
++
++#VmaVirtualBlock object contains internal data structure that keeps track of free and occupied regions
++using the same code as the main Vulkan memory allocator.
++Similarly to #VmaAllocation for standard GPU allocations, there is #VmaVirtualAllocation type
++that represents an opaque handle to an allocation withing the virtual block.
++
++In order to make such allocation:
++
++-# Fill in #VmaVirtualAllocationCreateInfo structure.
++-# Call vmaVirtualAllocate(). Get new #VmaVirtualAllocation object that represents the allocation.
++ You can also receive `VkDeviceSize offset` that was assigned to the allocation.
++
++Example:
++
++\code
++VmaVirtualAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.size = 4096; // 4 KB
++
++VmaVirtualAllocation alloc;
++VkDeviceSize offset;
++res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc, &offset);
++if(res == VK_SUCCESS)
++{
++ // Use the 4 KB of your memory starting at offset.
++}
++else
++{
++ // Allocation failed - no space for it could be found. Handle this error!
++}
++\endcode
++
++\section virtual_allocator_deallocation Deallocation
++
++When no longer needed, an allocation can be freed by calling vmaVirtualFree().
++You can only pass to this function an allocation that was previously returned by vmaVirtualAllocate()
++called for the same #VmaVirtualBlock.
++
++When whole block is no longer needed, the block object can be released by calling vmaDestroyVirtualBlock().
++All allocations must be freed before the block is destroyed, which is checked internally by an assert.
++However, if you don't want to call vmaVirtualFree() for each allocation, you can use vmaClearVirtualBlock() to free them all at once -
++a feature not available in normal Vulkan memory allocator. Example:
++
++\code
++vmaVirtualFree(block, alloc);
++vmaDestroyVirtualBlock(block);
++\endcode
++
++\section virtual_allocator_allocation_parameters Allocation parameters
++
++You can attach a custom pointer to each allocation by using vmaSetVirtualAllocationUserData().
++Its default value is null.
++It can be used to store any data that needs to be associated with that allocation - e.g. an index, a handle, or a pointer to some
++larger data structure containing more information. Example:
++
++\code
++struct CustomAllocData
++{
++ std::string m_AllocName;
++};
++CustomAllocData* allocData = new CustomAllocData();
++allocData->m_AllocName = "My allocation 1";
++vmaSetVirtualAllocationUserData(block, alloc, allocData);
++\endcode
++
++The pointer can later be fetched, along with allocation offset and size, by passing the allocation handle to function
++vmaGetVirtualAllocationInfo() and inspecting returned structure #VmaVirtualAllocationInfo.
++If you allocated a new object to be used as the custom pointer, don't forget to delete that object before freeing the allocation!
++Example:
++
++\code
++VmaVirtualAllocationInfo allocInfo;
++vmaGetVirtualAllocationInfo(block, alloc, &allocInfo);
++delete (CustomAllocData*)allocInfo.pUserData;
++
++vmaVirtualFree(block, alloc);
++\endcode
++
++\section virtual_allocator_alignment_and_units Alignment and units
++
++It feels natural to express sizes and offsets in bytes.
++If an offset of an allocation needs to be aligned to a multiply of some number (e.g. 4 bytes), you can fill optional member
++VmaVirtualAllocationCreateInfo::alignment to request it. Example:
++
++\code
++VmaVirtualAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.size = 4096; // 4 KB
++allocCreateInfo.alignment = 4; // Returned offset must be a multiply of 4 B
++
++VmaVirtualAllocation alloc;
++res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc, nullptr);
++\endcode
++
++Alignments of different allocations made from one block may vary.
++However, if all alignments and sizes are always multiply of some size e.g. 4 B or `sizeof(MyDataStruct)`,
++you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes.
++It might be more convenient, but you need to make sure to use this new unit consistently in all the places:
++
++- VmaVirtualBlockCreateInfo::size
++- VmaVirtualAllocationCreateInfo::size and VmaVirtualAllocationCreateInfo::alignment
++- Using offset returned by vmaVirtualAllocate() or in VmaVirtualAllocationInfo::offset
++
++\section virtual_allocator_statistics Statistics
++
++You can obtain statistics of a virtual block using vmaGetVirtualBlockStatistics()
++(to get brief statistics that are fast to calculate)
++or vmaCalculateVirtualBlockStatistics() (to get more detailed statistics, slower to calculate).
++The functions fill structures #VmaStatistics, #VmaDetailedStatistics respectively - same as used by the normal Vulkan memory allocator.
++Example:
++
++\code
++VmaStatistics stats;
++vmaGetVirtualBlockStatistics(block, &stats);
++printf("My virtual block has %llu bytes used by %u virtual allocations\n",
++ stats.allocationBytes, stats.allocationCount);
++\endcode
++
++You can also request a full list of allocations and free regions as a string in JSON format by calling
++vmaBuildVirtualBlockStatsString().
++Returned string must be later freed using vmaFreeVirtualBlockStatsString().
++The format of this string differs from the one returned by the main Vulkan allocator, but it is similar.
++
++\section virtual_allocator_additional_considerations Additional considerations
++
++The "virtual allocator" functionality is implemented on a level of individual memory blocks.
++Keeping track of a whole collection of blocks, allocating new ones when out of free space,
++deleting empty ones, and deciding which one to try first for a new allocation must be implemented by the user.
++
++Alternative allocation algorithms are supported, just like in custom pools of the real GPU memory.
++See enum #VmaVirtualBlockCreateFlagBits to learn how to specify them (e.g. #VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT).
++You can find their description in chapter \ref custom_memory_pools.
++Allocation strategies are also supported.
++See enum #VmaVirtualAllocationCreateFlagBits to learn how to specify them (e.g. #VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT).
++
++Following features are supported only by the allocator of the real GPU memory and not by virtual allocations:
++buffer-image granularity, `VMA_DEBUG_MARGIN`, `VMA_MIN_ALIGNMENT`.
++
++
++\page debugging_memory_usage Debugging incorrect memory usage
++
++If you suspect a bug with memory usage, like usage of uninitialized memory or
++memory being overwritten out of bounds of an allocation,
++you can use debug features of this library to verify this.
++
++\section debugging_memory_usage_initialization Memory initialization
++
++If you experience a bug with incorrect and nondeterministic data in your program and you suspect uninitialized memory to be used,
++you can enable automatic memory initialization to verify this.
++To do it, define macro `VMA_DEBUG_INITIALIZE_ALLOCATIONS` to 1.
++
++\code
++#define VMA_DEBUG_INITIALIZE_ALLOCATIONS 1
++#include "vk_mem_alloc.h"
++\endcode
++
++It makes memory of all new allocations initialized to bit pattern `0xDCDCDCDC`.
++Before an allocation is destroyed, its memory is filled with bit pattern `0xEFEFEFEF`.
++Memory is automatically mapped and unmapped if necessary.
++
++If you find these values while debugging your program, good chances are that you incorrectly
++read Vulkan memory that is allocated but not initialized, or already freed, respectively.
++
++Memory initialization works only with memory types that are `HOST_VISIBLE`.
++It works also with dedicated allocations.
++
++\section debugging_memory_usage_margins Margins
++
++By default, allocations are laid out in memory blocks next to each other if possible
++(considering required alignment, `bufferImageGranularity`, and `nonCoherentAtomSize`).
++
++![Allocations without margin](../gfx/Margins_1.png)
++
++Define macro `VMA_DEBUG_MARGIN` to some non-zero value (e.g. 16) to enforce specified
++number of bytes as a margin after every allocation.
++
++\code
++#define VMA_DEBUG_MARGIN 16
++#include "vk_mem_alloc.h"
++\endcode
++
++![Allocations with margin](../gfx/Margins_2.png)
++
++If your bug goes away after enabling margins, it means it may be caused by memory
++being overwritten outside of allocation boundaries. It is not 100% certain though.
++Change in application behavior may also be caused by different order and distribution
++of allocations across memory blocks after margins are applied.
++
++Margins work with all types of memory.
++
++Margin is applied only to allocations made out of memory blocks and not to dedicated
++allocations, which have their own memory block of specific size.
++It is thus not applied to allocations made using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag
++or those automatically decided to put into dedicated allocations, e.g. due to its
++large size or recommended by VK_KHR_dedicated_allocation extension.
++
++Margins appear in [JSON dump](@ref statistics_json_dump) as part of free space.
++
++Note that enabling margins increases memory usage and fragmentation.
++
++Margins do not apply to \ref virtual_allocator.
++
++\section debugging_memory_usage_corruption_detection Corruption detection
++
++You can additionally define macro `VMA_DEBUG_DETECT_CORRUPTION` to 1 to enable validation
++of contents of the margins.
++
++\code
++#define VMA_DEBUG_MARGIN 16
++#define VMA_DEBUG_DETECT_CORRUPTION 1
++#include "vk_mem_alloc.h"
++\endcode
++
++When this feature is enabled, number of bytes specified as `VMA_DEBUG_MARGIN`
++(it must be multiply of 4) after every allocation is filled with a magic number.
++This idea is also know as "canary".
++Memory is automatically mapped and unmapped if necessary.
++
++This number is validated automatically when the allocation is destroyed.
++If it is not equal to the expected value, `VMA_ASSERT()` is executed.
++It clearly means that either CPU or GPU overwritten the memory outside of boundaries of the allocation,
++which indicates a serious bug.
++
++You can also explicitly request checking margins of all allocations in all memory blocks
++that belong to specified memory types by using function vmaCheckCorruption(),
++or in memory blocks that belong to specified custom pool, by using function
++vmaCheckPoolCorruption().
++
++Margin validation (corruption detection) works only for memory types that are
++`HOST_VISIBLE` and `HOST_COHERENT`.
++
++
++\page opengl_interop OpenGL Interop
++
++VMA provides some features that help with interoperability with OpenGL.
++
++\section opengl_interop_exporting_memory Exporting memory
++
++If you want to attach `VkExportMemoryAllocateInfoKHR` structure to `pNext` chain of memory allocations made by the library:
++
++It is recommended to create \ref custom_memory_pools for such allocations.
++Define and fill in your `VkExportMemoryAllocateInfoKHR` structure and attach it to VmaPoolCreateInfo::pMemoryAllocateNext
++while creating the custom pool.
++Please note that the structure must remain alive and unchanged for the whole lifetime of the #VmaPool,
++not only while creating it, as no copy of the structure is made,
++but its original pointer is used for each allocation instead.
++
++If you want to export all memory allocated by the library from certain memory types,
++also dedicated allocations or other allocations made from default pools,
++an alternative solution is to fill in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes.
++It should point to an array with `VkExternalMemoryHandleTypeFlagsKHR` to be automatically passed by the library
++through `VkExportMemoryAllocateInfoKHR` on each allocation made from a specific memory type.
++Please note that new versions of the library also support dedicated allocations created in custom pools.
++
++You should not mix these two methods in a way that allows to apply both to the same memory type.
++Otherwise, `VkExportMemoryAllocateInfoKHR` structure would be attached twice to the `pNext` chain of `VkMemoryAllocateInfo`.
++
++
++\section opengl_interop_custom_alignment Custom alignment
++
++Buffers or images exported to a different API like OpenGL may require a different alignment,
++higher than the one used by the library automatically, queried from functions like `vkGetBufferMemoryRequirements`.
++To impose such alignment:
++
++It is recommended to create \ref custom_memory_pools for such allocations.
++Set VmaPoolCreateInfo::minAllocationAlignment member to the minimum alignment required for each allocation
++to be made out of this pool.
++The alignment actually used will be the maximum of this member and the alignment returned for the specific buffer or image
++from a function like `vkGetBufferMemoryRequirements`, which is called by VMA automatically.
++
++If you want to create a buffer with a specific minimum alignment out of default pools,
++use special function vmaCreateBufferWithAlignment(), which takes additional parameter `minAlignment`.
++
++Note the problem of alignment affects only resources placed inside bigger `VkDeviceMemory` blocks and not dedicated
++allocations, as these, by definition, always have alignment = 0 because the resource is bound to the beginning of its dedicated block.
++Contrary to Direct3D 12, Vulkan doesn't have a concept of alignment of the entire memory block passed on its allocation.
++
++
++\page usage_patterns Recommended usage patterns
++
++Vulkan gives great flexibility in memory allocation.
++This chapter shows the most common patterns.
++
++See also slides from talk:
++[Sawicki, Adam. Advanced Graphics Techniques Tutorial: Memory management in Vulkan and DX12. Game Developers Conference, 2018](https://www.gdcvault.com/play/1025458/Advanced-Graphics-Techniques-Tutorial-New)
++
++
++\section usage_patterns_gpu_only GPU-only resource
++
++<b>When:</b>
++Any resources that you frequently write and read on GPU,
++e.g. images used as color attachments (aka "render targets"), depth-stencil attachments,
++images/buffers used as storage image/buffer (aka "Unordered Access View (UAV)").
++
++<b>What to do:</b>
++Let the library select the optimal memory type, which will likely have `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`.
++
++\code
++VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
++imgCreateInfo.imageType = VK_IMAGE_TYPE_2D;
++imgCreateInfo.extent.width = 3840;
++imgCreateInfo.extent.height = 2160;
++imgCreateInfo.extent.depth = 1;
++imgCreateInfo.mipLevels = 1;
++imgCreateInfo.arrayLayers = 1;
++imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
++imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
++imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
++imgCreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
++imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
++allocCreateInfo.priority = 1.0f;
++
++VkImage img;
++VmaAllocation alloc;
++vmaCreateImage(allocator, &imgCreateInfo, &allocCreateInfo, &img, &alloc, nullptr);
++\endcode
++
++<b>Also consider:</b>
++Consider creating them as dedicated allocations using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT,
++especially if they are large or if you plan to destroy and recreate them with different sizes
++e.g. when display resolution changes.
++Prefer to create such resources first and all other GPU resources (like textures and vertex buffers) later.
++When VK_EXT_memory_priority extension is enabled, it is also worth setting high priority to such allocation
++to decrease chances to be evicted to system memory by the operating system.
++
++\section usage_patterns_staging_copy_upload Staging copy for upload
++
++<b>When:</b>
++A "staging" buffer than you want to map and fill from CPU code, then use as a source od transfer
++to some GPU resource.
++
++<b>What to do:</b>
++Use flag #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT.
++Let the library select the optimal memory type, which will always have `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`.
++
++\code
++VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufCreateInfo.size = 65536;
++bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |
++ VMA_ALLOCATION_CREATE_MAPPED_BIT;
++
++VkBuffer buf;
++VmaAllocation alloc;
++VmaAllocationInfo allocInfo;
++vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
++
++...
++
++memcpy(allocInfo.pMappedData, myData, myDataSize);
++\endcode
++
++<b>Also consider:</b>
++You can map the allocation using vmaMapMemory() or you can create it as persistenly mapped
++using #VMA_ALLOCATION_CREATE_MAPPED_BIT, as in the example above.
++
++
++\section usage_patterns_readback Readback
++
++<b>When:</b>
++Buffers for data written by or transferred from the GPU that you want to read back on the CPU,
++e.g. results of some computations.
++
++<b>What to do:</b>
++Use flag #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT.
++Let the library select the optimal memory type, which will always have `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`
++and `VK_MEMORY_PROPERTY_HOST_CACHED_BIT`.
++
++\code
++VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufCreateInfo.size = 65536;
++bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT |
++ VMA_ALLOCATION_CREATE_MAPPED_BIT;
++
++VkBuffer buf;
++VmaAllocation alloc;
++VmaAllocationInfo allocInfo;
++vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
++
++...
++
++const float* downloadedData = (const float*)allocInfo.pMappedData;
++\endcode
++
++
++\section usage_patterns_advanced_data_uploading Advanced data uploading
++
++For resources that you frequently write on CPU via mapped pointer and
++freqnently read on GPU e.g. as a uniform buffer (also called "dynamic"), multiple options are possible:
++
++-# Easiest solution is to have one copy of the resource in `HOST_VISIBLE` memory,
++ even if it means system RAM (not `DEVICE_LOCAL`) on systems with a discrete graphics card,
++ and make the device reach out to that resource directly.
++ - Reads performed by the device will then go through PCI Express bus.
++ The performace of this access may be limited, but it may be fine depending on the size
++ of this resource (whether it is small enough to quickly end up in GPU cache) and the sparsity
++ of access.
++-# On systems with unified memory (e.g. AMD APU or Intel integrated graphics, mobile chips),
++ a memory type may be available that is both `HOST_VISIBLE` (available for mapping) and `DEVICE_LOCAL`
++ (fast to access from the GPU). Then, it is likely the best choice for such type of resource.
++-# Systems with a discrete graphics card and separate video memory may or may not expose
++ a memory type that is both `HOST_VISIBLE` and `DEVICE_LOCAL`, also known as Base Address Register (BAR).
++ If they do, it represents a piece of VRAM (or entire VRAM, if ReBAR is enabled in the motherboard BIOS)
++ that is available to CPU for mapping.
++ - Writes performed by the host to that memory go through PCI Express bus.
++ The performance of these writes may be limited, but it may be fine, especially on PCIe 4.0,
++ as long as rules of using uncached and write-combined memory are followed - only sequential writes and no reads.
++-# Finally, you may need or prefer to create a separate copy of the resource in `DEVICE_LOCAL` memory,
++ a separate "staging" copy in `HOST_VISIBLE` memory and perform an explicit transfer command between them.
++
++Thankfully, VMA offers an aid to create and use such resources in the the way optimal
++for the current Vulkan device. To help the library make the best choice,
++use flag #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT together with
++#VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT.
++It will then prefer a memory type that is both `DEVICE_LOCAL` and `HOST_VISIBLE` (integrated memory or BAR),
++but if no such memory type is available or allocation from it fails
++(PC graphics cards have only 256 MB of BAR by default, unless ReBAR is supported and enabled in BIOS),
++it will fall back to `DEVICE_LOCAL` memory for fast GPU access.
++It is then up to you to detect that the allocation ended up in a memory type that is not `HOST_VISIBLE`,
++so you need to create another "staging" allocation and perform explicit transfers.
++
++\code
++VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++bufCreateInfo.size = 65536;
++bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |
++ VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT |
++ VMA_ALLOCATION_CREATE_MAPPED_BIT;
++
++VkBuffer buf;
++VmaAllocation alloc;
++VmaAllocationInfo allocInfo;
++vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
++
++VkMemoryPropertyFlags memPropFlags;
++vmaGetAllocationMemoryProperties(allocator, alloc, &memPropFlags);
++
++if(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
++{
++ // Allocation ended up in a mappable memory and is already mapped - write to it directly.
++
++ // [Executed in runtime]:
++ memcpy(allocInfo.pMappedData, myData, myDataSize);
++}
++else
++{
++ // Allocation ended up in a non-mappable memory - need to transfer.
++ VkBufferCreateInfo stagingBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++ stagingBufCreateInfo.size = 65536;
++ stagingBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
++
++ VmaAllocationCreateInfo stagingAllocCreateInfo = {};
++ stagingAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++ stagingAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |
++ VMA_ALLOCATION_CREATE_MAPPED_BIT;
++
++ VkBuffer stagingBuf;
++ VmaAllocation stagingAlloc;
++ VmaAllocationInfo stagingAllocInfo;
++ vmaCreateBuffer(allocator, &stagingBufCreateInfo, &stagingAllocCreateInfo,
++ &stagingBuf, &stagingAlloc, stagingAllocInfo);
++
++ // [Executed in runtime]:
++ memcpy(stagingAllocInfo.pMappedData, myData, myDataSize);
++ //vkCmdPipelineBarrier: VK_ACCESS_HOST_WRITE_BIT --> VK_ACCESS_TRANSFER_READ_BIT
++ VkBufferCopy bufCopy = {
++ 0, // srcOffset
++ 0, // dstOffset,
++ myDataSize); // size
++ vkCmdCopyBuffer(cmdBuf, stagingBuf, buf, 1, &bufCopy);
++}
++\endcode
++
++\section usage_patterns_other_use_cases Other use cases
++
++Here are some other, less obvious use cases and their recommended settings:
++
++- An image that is used only as transfer source and destination, but it should stay on the device,
++ as it is used to temporarily store a copy of some texture, e.g. from the current to the next frame,
++ for temporal antialiasing or other temporal effects.
++ - Use `VkImageCreateInfo::usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT`
++ - Use VmaAllocationCreateInfo::usage = #VMA_MEMORY_USAGE_AUTO
++- An image that is used only as transfer source and destination, but it should be placed
++ in the system RAM despite it doesn't need to be mapped, because it serves as a "swap" copy to evict
++ least recently used textures from VRAM.
++ - Use `VkImageCreateInfo::usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT`
++ - Use VmaAllocationCreateInfo::usage = #VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
++ as VMA needs a hint here to differentiate from the previous case.
++- A buffer that you want to map and write from the CPU, directly read from the GPU
++ (e.g. as a uniform or vertex buffer), but you have a clear preference to place it in device or
++ host memory due to its large size.
++ - Use `VkBufferCreateInfo::usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT`
++ - Use VmaAllocationCreateInfo::usage = #VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE or #VMA_MEMORY_USAGE_AUTO_PREFER_HOST
++ - Use VmaAllocationCreateInfo::flags = #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
++
++
++\page configuration Configuration
++
++Please check "CONFIGURATION SECTION" in the code to find macros that you can define
++before each include of this file or change directly in this file to provide
++your own implementation of basic facilities like assert, `min()` and `max()` functions,
++mutex, atomic etc.
++The library uses its own implementation of containers by default, but you can switch to using
++STL containers instead.
++
++For example, define `VMA_ASSERT(expr)` before including the library to provide
++custom implementation of the assertion, compatible with your project.
++By default it is defined to standard C `assert(expr)` in `_DEBUG` configuration
++and empty otherwise.
++
++\section config_Vulkan_functions Pointers to Vulkan functions
++
++There are multiple ways to import pointers to Vulkan functions in the library.
++In the simplest case you don't need to do anything.
++If the compilation or linking of your program or the initialization of the #VmaAllocator
++doesn't work for you, you can try to reconfigure it.
++
++First, the allocator tries to fetch pointers to Vulkan functions linked statically,
++like this:
++
++\code
++m_VulkanFunctions.vkAllocateMemory = (PFN_vkAllocateMemory)vkAllocateMemory;
++\endcode
++
++If you want to disable this feature, set configuration macro: `#define VMA_STATIC_VULKAN_FUNCTIONS 0`.
++
++Second, you can provide the pointers yourself by setting member VmaAllocatorCreateInfo::pVulkanFunctions.
++You can fetch them e.g. using functions `vkGetInstanceProcAddr` and `vkGetDeviceProcAddr` or
++by using a helper library like [volk](https://github.com/zeux/volk).
++
++Third, VMA tries to fetch remaining pointers that are still null by calling
++`vkGetInstanceProcAddr` and `vkGetDeviceProcAddr` on its own.
++You need to only fill in VmaVulkanFunctions::vkGetInstanceProcAddr and VmaVulkanFunctions::vkGetDeviceProcAddr.
++Other pointers will be fetched automatically.
++If you want to disable this feature, set configuration macro: `#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0`.
++
++Finally, all the function pointers required by the library (considering selected
++Vulkan version and enabled extensions) are checked with `VMA_ASSERT` if they are not null.
++
++
++\section custom_memory_allocator Custom host memory allocator
++
++If you use custom allocator for CPU memory rather than default operator `new`
++and `delete` from C++, you can make this library using your allocator as well
++by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These
++functions will be passed to Vulkan, as well as used by the library itself to
++make any CPU-side allocations.
++
++\section allocation_callbacks Device memory allocation callbacks
++
++The library makes calls to `vkAllocateMemory()` and `vkFreeMemory()` internally.
++You can setup callbacks to be informed about these calls, e.g. for the purpose
++of gathering some statistics. To do it, fill optional member
++VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
++
++\section heap_memory_limit Device heap memory limit
++
++When device memory of certain heap runs out of free space, new allocations may
++fail (returning error code) or they may succeed, silently pushing some existing_
++memory blocks from GPU VRAM to system RAM (which degrades performance). This
++behavior is implementation-dependent - it depends on GPU vendor and graphics
++driver.
++
++On AMD cards it can be controlled while creating Vulkan device object by using
++VK_AMD_memory_overallocation_behavior extension, if available.
++
++Alternatively, if you want to test how your program behaves with limited amount of Vulkan device
++memory available without switching your graphics card to one that really has
++smaller VRAM, you can use a feature of this library intended for this purpose.
++To do it, fill optional member VmaAllocatorCreateInfo::pHeapSizeLimit.
++
++
++
++\page vk_khr_dedicated_allocation VK_KHR_dedicated_allocation
++
++VK_KHR_dedicated_allocation is a Vulkan extension which can be used to improve
++performance on some GPUs. It augments Vulkan API with possibility to query
++driver whether it prefers particular buffer or image to have its own, dedicated
++allocation (separate `VkDeviceMemory` block) for better efficiency - to be able
++to do some internal optimizations. The extension is supported by this library.
++It will be used automatically when enabled.
++
++It has been promoted to core Vulkan 1.1, so if you use eligible Vulkan version
++and inform VMA about it by setting VmaAllocatorCreateInfo::vulkanApiVersion,
++you are all set.
++
++Otherwise, if you want to use it as an extension:
++
++1 . When creating Vulkan device, check if following 2 device extensions are
++supported (call `vkEnumerateDeviceExtensionProperties()`).
++If yes, enable them (fill `VkDeviceCreateInfo::ppEnabledExtensionNames`).
++
++- VK_KHR_get_memory_requirements2
++- VK_KHR_dedicated_allocation
++
++If you enabled these extensions:
++
++2 . Use #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag when creating
++your #VmaAllocator to inform the library that you enabled required extensions
++and you want the library to use them.
++
++\code
++allocatorInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT;
++
++vmaCreateAllocator(&allocatorInfo, &allocator);
++\endcode
++
++That is all. The extension will be automatically used whenever you create a
++buffer using vmaCreateBuffer() or image using vmaCreateImage().
++
++When using the extension together with Vulkan Validation Layer, you will receive
++warnings like this:
++
++_vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer._
++
++It is OK, you should just ignore it. It happens because you use function
++`vkGetBufferMemoryRequirements2KHR()` instead of standard
++`vkGetBufferMemoryRequirements()`, while the validation layer seems to be
++unaware of it.
++
++To learn more about this extension, see:
++
++- [VK_KHR_dedicated_allocation in Vulkan specification](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/chap50.html#VK_KHR_dedicated_allocation)
++- [VK_KHR_dedicated_allocation unofficial manual](http://asawicki.info/articles/VK_KHR_dedicated_allocation.php5)
++
++
++
++\page vk_ext_memory_priority VK_EXT_memory_priority
++
++VK_EXT_memory_priority is a device extension that allows to pass additional "priority"
++value to Vulkan memory allocations that the implementation may use prefer certain
++buffers and images that are critical for performance to stay in device-local memory
++in cases when the memory is over-subscribed, while some others may be moved to the system memory.
++
++VMA offers convenient usage of this extension.
++If you enable it, you can pass "priority" parameter when creating allocations or custom pools
++and the library automatically passes the value to Vulkan using this extension.
++
++If you want to use this extension in connection with VMA, follow these steps:
++
++\section vk_ext_memory_priority_initialization Initialization
++
++1) Call `vkEnumerateDeviceExtensionProperties` for the physical device.
++Check if the extension is supported - if returned array of `VkExtensionProperties` contains "VK_EXT_memory_priority".
++
++2) Call `vkGetPhysicalDeviceFeatures2` for the physical device instead of old `vkGetPhysicalDeviceFeatures`.
++Attach additional structure `VkPhysicalDeviceMemoryPriorityFeaturesEXT` to `VkPhysicalDeviceFeatures2::pNext` to be returned.
++Check if the device feature is really supported - check if `VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority` is true.
++
++3) While creating device with `vkCreateDevice`, enable this extension - add "VK_EXT_memory_priority"
++to the list passed as `VkDeviceCreateInfo::ppEnabledExtensionNames`.
++
++4) While creating the device, also don't set `VkDeviceCreateInfo::pEnabledFeatures`.
++Fill in `VkPhysicalDeviceFeatures2` structure instead and pass it as `VkDeviceCreateInfo::pNext`.
++Enable this device feature - attach additional structure `VkPhysicalDeviceMemoryPriorityFeaturesEXT` to
++`VkPhysicalDeviceFeatures2::pNext` chain and set its member `memoryPriority` to `VK_TRUE`.
++
++5) While creating #VmaAllocator with vmaCreateAllocator() inform VMA that you
++have enabled this extension and feature - add #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
++to VmaAllocatorCreateInfo::flags.
++
++\section vk_ext_memory_priority_usage Usage
++
++When using this extension, you should initialize following member:
++
++- VmaAllocationCreateInfo::priority when creating a dedicated allocation with #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++- VmaPoolCreateInfo::priority when creating a custom pool.
++
++It should be a floating-point value between `0.0f` and `1.0f`, where recommended default is `0.5f`.
++Memory allocated with higher value can be treated by the Vulkan implementation as higher priority
++and so it can have lower chances of being pushed out to system memory, experiencing degraded performance.
++
++It might be a good idea to create performance-critical resources like color-attachment or depth-stencil images
++as dedicated and set high priority to them. For example:
++
++\code
++VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
++imgCreateInfo.imageType = VK_IMAGE_TYPE_2D;
++imgCreateInfo.extent.width = 3840;
++imgCreateInfo.extent.height = 2160;
++imgCreateInfo.extent.depth = 1;
++imgCreateInfo.mipLevels = 1;
++imgCreateInfo.arrayLayers = 1;
++imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
++imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
++imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
++imgCreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
++imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
++
++VmaAllocationCreateInfo allocCreateInfo = {};
++allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
++allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
++allocCreateInfo.priority = 1.0f;
++
++VkImage img;
++VmaAllocation alloc;
++vmaCreateImage(allocator, &imgCreateInfo, &allocCreateInfo, &img, &alloc, nullptr);
++\endcode
++
++`priority` member is ignored in the following situations:
++
++- Allocations created in custom pools: They inherit the priority, along with all other allocation parameters
++ from the parametrs passed in #VmaPoolCreateInfo when the pool was created.
++- Allocations created in default pools: They inherit the priority from the parameters
++ VMA used when creating default pools, which means `priority == 0.5f`.
++
++
++\page vk_amd_device_coherent_memory VK_AMD_device_coherent_memory
++
++VK_AMD_device_coherent_memory is a device extension that enables access to
++additional memory types with `VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD` and
++`VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD` flag. It is useful mostly for
++allocation of buffers intended for writing "breadcrumb markers" in between passes
++or draw calls, which in turn are useful for debugging GPU crash/hang/TDR cases.
++
++When the extension is available but has not been enabled, Vulkan physical device
++still exposes those memory types, but their usage is forbidden. VMA automatically
++takes care of that - it returns `VK_ERROR_FEATURE_NOT_PRESENT` when an attempt
++to allocate memory of such type is made.
++
++If you want to use this extension in connection with VMA, follow these steps:
++
++\section vk_amd_device_coherent_memory_initialization Initialization
++
++1) Call `vkEnumerateDeviceExtensionProperties` for the physical device.
++Check if the extension is supported - if returned array of `VkExtensionProperties` contains "VK_AMD_device_coherent_memory".
++
++2) Call `vkGetPhysicalDeviceFeatures2` for the physical device instead of old `vkGetPhysicalDeviceFeatures`.
++Attach additional structure `VkPhysicalDeviceCoherentMemoryFeaturesAMD` to `VkPhysicalDeviceFeatures2::pNext` to be returned.
++Check if the device feature is really supported - check if `VkPhysicalDeviceCoherentMemoryFeaturesAMD::deviceCoherentMemory` is true.
++
++3) While creating device with `vkCreateDevice`, enable this extension - add "VK_AMD_device_coherent_memory"
++to the list passed as `VkDeviceCreateInfo::ppEnabledExtensionNames`.
++
++4) While creating the device, also don't set `VkDeviceCreateInfo::pEnabledFeatures`.
++Fill in `VkPhysicalDeviceFeatures2` structure instead and pass it as `VkDeviceCreateInfo::pNext`.
++Enable this device feature - attach additional structure `VkPhysicalDeviceCoherentMemoryFeaturesAMD` to
++`VkPhysicalDeviceFeatures2::pNext` and set its member `deviceCoherentMemory` to `VK_TRUE`.
++
++5) While creating #VmaAllocator with vmaCreateAllocator() inform VMA that you
++have enabled this extension and feature - add #VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT
++to VmaAllocatorCreateInfo::flags.
++
++\section vk_amd_device_coherent_memory_usage Usage
++
++After following steps described above, you can create VMA allocations and custom pools
++out of the special `DEVICE_COHERENT` and `DEVICE_UNCACHED` memory types on eligible
++devices. There are multiple ways to do it, for example:
++
++- You can request or prefer to allocate out of such memory types by adding
++ `VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD` to VmaAllocationCreateInfo::requiredFlags
++ or VmaAllocationCreateInfo::preferredFlags. Those flags can be freely mixed with
++ other ways of \ref choosing_memory_type, like setting VmaAllocationCreateInfo::usage.
++- If you manually found memory type index to use for this purpose, force allocation
++ from this specific index by setting VmaAllocationCreateInfo::memoryTypeBits `= 1u << index`.
++
++\section vk_amd_device_coherent_memory_more_information More information
++
++To learn more about this extension, see [VK_AMD_device_coherent_memory in Vulkan specification](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_AMD_device_coherent_memory.html)
++
++Example use of this extension can be found in the code of the sample and test suite
++accompanying this library.
++
++
++\page enabling_buffer_device_address Enabling buffer device address
++
++Device extension VK_KHR_buffer_device_address
++allow to fetch raw GPU pointer to a buffer and pass it for usage in a shader code.
++It has been promoted to core Vulkan 1.2.
++
++If you want to use this feature in connection with VMA, follow these steps:
++
++\section enabling_buffer_device_address_initialization Initialization
++
++1) (For Vulkan version < 1.2) Call `vkEnumerateDeviceExtensionProperties` for the physical device.
++Check if the extension is supported - if returned array of `VkExtensionProperties` contains
++"VK_KHR_buffer_device_address".
++
++2) Call `vkGetPhysicalDeviceFeatures2` for the physical device instead of old `vkGetPhysicalDeviceFeatures`.
++Attach additional structure `VkPhysicalDeviceBufferDeviceAddressFeatures*` to `VkPhysicalDeviceFeatures2::pNext` to be returned.
++Check if the device feature is really supported - check if `VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress` is true.
++
++3) (For Vulkan version < 1.2) While creating device with `vkCreateDevice`, enable this extension - add
++"VK_KHR_buffer_device_address" to the list passed as `VkDeviceCreateInfo::ppEnabledExtensionNames`.
++
++4) While creating the device, also don't set `VkDeviceCreateInfo::pEnabledFeatures`.
++Fill in `VkPhysicalDeviceFeatures2` structure instead and pass it as `VkDeviceCreateInfo::pNext`.
++Enable this device feature - attach additional structure `VkPhysicalDeviceBufferDeviceAddressFeatures*` to
++`VkPhysicalDeviceFeatures2::pNext` and set its member `bufferDeviceAddress` to `VK_TRUE`.
++
++5) While creating #VmaAllocator with vmaCreateAllocator() inform VMA that you
++have enabled this feature - add #VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT
++to VmaAllocatorCreateInfo::flags.
++
++\section enabling_buffer_device_address_usage Usage
++
++After following steps described above, you can create buffers with `VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT*` using VMA.
++The library automatically adds `VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT*` to
++allocated memory blocks wherever it might be needed.
++
++Please note that the library supports only `VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT*`.
++The second part of this functionality related to "capture and replay" is not supported,
++as it is intended for usage in debugging tools like RenderDoc, not in everyday Vulkan usage.
++
++\section enabling_buffer_device_address_more_information More information
++
++To learn more about this extension, see [VK_KHR_buffer_device_address in Vulkan specification](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/chap46.html#VK_KHR_buffer_device_address)
++
++Example use of this extension can be found in the code of the sample and test suite
++accompanying this library.
++
++\page general_considerations General considerations
++
++\section general_considerations_thread_safety Thread safety
++
++- The library has no global state, so separate #VmaAllocator objects can be used
++ independently.
++ There should be no need to create multiple such objects though - one per `VkDevice` is enough.
++- By default, all calls to functions that take #VmaAllocator as first parameter
++ are safe to call from multiple threads simultaneously because they are
++ synchronized internally when needed.
++ This includes allocation and deallocation from default memory pool, as well as custom #VmaPool.
++- When the allocator is created with #VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
++ flag, calls to functions that take such #VmaAllocator object must be
++ synchronized externally.
++- Access to a #VmaAllocation object must be externally synchronized. For example,
++ you must not call vmaGetAllocationInfo() and vmaMapMemory() from different
++ threads at the same time if you pass the same #VmaAllocation object to these
++ functions.
++- #VmaVirtualBlock is not safe to be used from multiple threads simultaneously.
++
++\section general_considerations_versioning_and_compatibility Versioning and compatibility
++
++The library uses [**Semantic Versioning**](https://semver.org/),
++which means version numbers follow convention: Major.Minor.Patch (e.g. 2.3.0), where:
++
++- Incremented Patch version means a release is backward- and forward-compatible,
++ introducing only some internal improvements, bug fixes, optimizations etc.
++ or changes that are out of scope of the official API described in this documentation.
++- Incremented Minor version means a release is backward-compatible,
++ so existing code that uses the library should continue to work, while some new
++ symbols could have been added: new structures, functions, new values in existing
++ enums and bit flags, new structure members, but not new function parameters.
++- Incrementing Major version means a release could break some backward compatibility.
++
++All changes between official releases are documented in file "CHANGELOG.md".
++
++\warning Backward compatiblity is considered on the level of C++ source code, not binary linkage.
++Adding new members to existing structures is treated as backward compatible if initializing
++the new members to binary zero results in the old behavior.
++You should always fully initialize all library structures to zeros and not rely on their
++exact binary size.
++
++\section general_considerations_validation_layer_warnings Validation layer warnings
++
++When using this library, you can meet following types of warnings issued by
++Vulkan validation layer. They don't necessarily indicate a bug, so you may need
++to just ignore them.
++
++- *vkBindBufferMemory(): Binding memory to buffer 0xeb8e4 but vkGetBufferMemoryRequirements() has not been called on that buffer.*
++ - It happens when VK_KHR_dedicated_allocation extension is enabled.
++ `vkGetBufferMemoryRequirements2KHR` function is used instead, while validation layer seems to be unaware of it.
++- *Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.*
++ - It happens when you map a buffer or image, because the library maps entire
++ `VkDeviceMemory` block, where different types of images and buffers may end
++ up together, especially on GPUs with unified memory like Intel.
++- *Non-linear image 0xebc91 is aliased with linear buffer 0xeb8e4 which may indicate a bug.*
++ - It may happen when you use [defragmentation](@ref defragmentation).
++
++\section general_considerations_allocation_algorithm Allocation algorithm
++
++The library uses following algorithm for allocation, in order:
++
++-# Try to find free range of memory in existing blocks.
++-# If failed, try to create a new block of `VkDeviceMemory`, with preferred block size.
++-# If failed, try to create such block with size / 2, size / 4, size / 8.
++-# If failed, try to allocate separate `VkDeviceMemory` for this allocation,
++ just like when you use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
++-# If failed, choose other memory type that meets the requirements specified in
++ VmaAllocationCreateInfo and go to point 1.
++-# If failed, return `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
++
++\section general_considerations_features_not_supported Features not supported
++
++Features deliberately excluded from the scope of this library:
++
++-# **Data transfer.** Uploading (streaming) and downloading data of buffers and images
++ between CPU and GPU memory and related synchronization is responsibility of the user.
++ Defining some "texture" object that would automatically stream its data from a
++ staging copy in CPU memory to GPU memory would rather be a feature of another,
++ higher-level library implemented on top of VMA.
++ VMA doesn't record any commands to a `VkCommandBuffer`. It just allocates memory.
++-# **Recreation of buffers and images.** Although the library has functions for
++ buffer and image creation: vmaCreateBuffer(), vmaCreateImage(), you need to
++ recreate these objects yourself after defragmentation. That is because the big
++ structures `VkBufferCreateInfo`, `VkImageCreateInfo` are not stored in
++ #VmaAllocation object.
++-# **Handling CPU memory allocation failures.** When dynamically creating small C++
++ objects in CPU memory (not Vulkan memory), allocation failures are not checked
++ and handled gracefully, because that would complicate code significantly and
++ is usually not needed in desktop PC applications anyway.
++ Success of an allocation is just checked with an assert.
++-# **Code free of any compiler warnings.** Maintaining the library to compile and
++ work correctly on so many different platforms is hard enough. Being free of
++ any warnings, on any version of any compiler, is simply not feasible.
++ There are many preprocessor macros that make some variables unused, function parameters unreferenced,
++ or conditional expressions constant in some configurations.
++ The code of this library should not be bigger or more complicated just to silence these warnings.
++ It is recommended to disable such warnings instead.
++-# This is a C++ library with C interface. **Bindings or ports to any other programming languages** are welcome as external projects but
++ are not going to be included into this repository.
++*/
diff --git a/external/skia/windows-do-not-modify-logfont.patch.0 b/external/skia/windows-do-not-modify-logfont.patch.0 index 30c5c1e96e56..b2c067d9e0c4 100644 --- a/external/skia/windows-do-not-modify-logfont.patch.0 +++ b/external/skia/windows-do-not-modify-logfont.patch.0 @@ -1,8 +1,8 @@ --- ./src/ports/SkFontHost_win.cpp +++ ./src/ports/SkFontHost_win.cpp -@@ -349,7 +349,7 @@ static bool FindByLogFont(SkTypeface* face, void* ctx) { +@@ -357,7 +357,7 @@ static bool FindByLogFont(SkTypeface* face, void* ctx) { */ - SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT& origLF) { + sk_sp<SkTypeface> SkCreateTypefaceFromLOGFONT(const LOGFONT& origLF) { LOGFONT lf = origLF; - make_canonical(&lf); +// make_canonical(&lf); diff --git a/external/skia/windows-force-unicode-api.patch.0 b/external/skia/windows-force-unicode-api.patch.0 index f73de176dff3..13c0536891c4 100644 --- a/external/skia/windows-force-unicode-api.patch.0 +++ b/external/skia/windows-force-unicode-api.patch.0 @@ -6,8 +6,8 @@ index f659adf0e9..34446fc7a1 100644 * corresponding typeface for the specified logfont. The caller is responsible * for calling unref() when it is finished. */ --SK_API SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT&); -+SK_API SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONTW&); +-SK_API sk_sp<SkTypeface> SkCreateTypefaceFromLOGFONT(const LOGFONT&); ++SK_API sk_sp<SkTypeface> SkCreateTypefaceFromLOGFONT(const LOGFONTW&); /** * Copy the LOGFONT associated with this typeface into the lf parameter. Note diff --git a/external/skia/windows-libraries-system32.patch.1 b/external/skia/windows-libraries-system32.patch.1 new file mode 100644 index 000000000000..45c0e35d1cfa --- /dev/null +++ b/external/skia/windows-libraries-system32.patch.1 @@ -0,0 +1,13 @@ +diff --git a/src/ports/SkOSLibrary_win.cpp b/src/ports/SkOSLibrary_win.cpp +index d2dcbe0af6..c288bbf177 100644 +--- a/src/ports/SkOSLibrary_win.cpp ++++ b/src/ports/SkOSLibrary_win.cpp +@@ -11,7 +11,7 @@ + #include "src/ports/SkOSLibrary.h" + + void* SkLoadDynamicLibrary(const char* libraryName) { +- return LoadLibraryA(libraryName); ++ return LoadLibraryExA(libraryName, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); + } + + void* SkGetProcedureAddress(void* library, const char* functionName) { diff --git a/external/skia/windows-raster-surface-no-copies.patch.1 b/external/skia/windows-raster-surface-no-copies.patch.1 index 0c5804d8558b..3765f70971fd 100644 --- a/external/skia/windows-raster-surface-no-copies.patch.1 +++ b/external/skia/windows-raster-surface-no-copies.patch.1 @@ -2,7 +2,7 @@ diff --git a/tools/sk_app/win/RasterWindowContext_win.cpp b/tools/sk_app/win/Ras index 9548220ce6..49f1f9ed17 100644 --- a/tools/sk_app/win/RasterWindowContext_win.cpp +++ b/tools/sk_app/win/RasterWindowContext_win.cpp -@@ -55,7 +55,7 @@ void RasterWindowContext_win::resize(int w, int h) { +@@ -53,7 +53,7 @@ fWidth = w; fHeight = h; fBackbufferSurface.reset(); @@ -11,7 +11,7 @@ index 9548220ce6..49f1f9ed17 100644 fSurfaceMemory.reset(bmpSize); BITMAPINFO* bmpInfo = reinterpret_cast<BITMAPINFO*>(fSurfaceMemory.get()); ZeroMemory(bmpInfo, sizeof(BITMAPINFO)); -@@ -65,11 +65,12 @@ void RasterWindowContext_win::resize(int w, int h) { +@@ -63,11 +63,12 @@ bmpInfo->bmiHeader.biPlanes = 1; bmpInfo->bmiHeader.biBitCount = 32; bmpInfo->bmiHeader.biCompression = BI_RGB; @@ -21,19 +21,21 @@ index 9548220ce6..49f1f9ed17 100644 SkImageInfo info = SkImageInfo::Make(w, h, fDisplayParams.fColorType, kPremul_SkAlphaType, fDisplayParams.fColorSpace); -- fBackbufferSurface = SkSurface::MakeRasterDirect(info, pixels, sizeof(uint32_t) * w); -+ fBackbufferSurface = SkSurface::MakeRaster(info); +- fBackbufferSurface = SkSurfaces::WrapPixels(info, pixels, sizeof(uint32_t) * w); ++ fBackbufferSurface = SkSurfaces::Raster(info); } sk_sp<SkSurface> RasterWindowContext_win::getBackbufferSurface() { return fBackbufferSurface; } -@@ -77,7 +78,9 @@ sk_sp<SkSurface> RasterWindowContext_win::getBackbufferSurface() { return fBackb - void RasterWindowContext_win::swapBuffers() { +@@ -75,8 +76,10 @@ + void RasterWindowContext_win::onSwapBuffers() { BITMAPINFO* bmpInfo = reinterpret_cast<BITMAPINFO*>(fSurfaceMemory.get()); HDC dc = GetDC(fWnd); - StretchDIBits(dc, 0, 0, fWidth, fHeight, 0, 0, fWidth, fHeight, bmpInfo->bmiColors, bmpInfo, +- DIB_RGB_COLORS, SRCCOPY); + SkPixmap pixmap; + fBackbufferSurface->peekPixels(&pixmap); + StretchDIBits(dc, 0, 0, fWidth, fHeight, 0, 0, fWidth, fHeight, pixmap.addr(), bmpInfo, - DIB_RGB_COLORS, SRCCOPY); ++ DIB_RGB_COLORS, SRCCOPY); ReleaseDC(fWnd, dc); } + diff --git a/external/ucpp/Executable_ucpp.mk b/external/ucpp/Executable_ucpp.mk deleted file mode 100644 index a4be71c4901c..000000000000 --- a/external/ucpp/Executable_ucpp.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -*- 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,ucpp)) - -$(eval $(call gb_Executable_set_warnings_disabled,ucpp)) - -$(eval $(call gb_Executable_use_unpacked,ucpp,ucpp)) - -$(eval $(call gb_Executable_add_defs,ucpp,\ - -DNO_UCPP_BUF \ - -DUCPP_CONFIG \ - -DSTAND_ALONE \ -)) - -$(eval $(call gb_Executable_add_generated_cobjects,ucpp,\ - UnpackedTarball/ucpp/assert \ - UnpackedTarball/ucpp/cpp \ - UnpackedTarball/ucpp/eval \ - UnpackedTarball/ucpp/hash \ - UnpackedTarball/ucpp/lexer \ - UnpackedTarball/ucpp/macro \ - UnpackedTarball/ucpp/mem \ - UnpackedTarball/ucpp/nhash \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/README b/external/ucpp/README deleted file mode 100644 index 9246c701a267..000000000000 --- a/external/ucpp/README +++ /dev/null @@ -1,3 +0,0 @@ -ucpp is a C99 preprocessor - -Used to be hosted at https://code.google.com/p/ucpp/ - not sure where it's gone diff --git a/external/ucpp/UnpackedTarball_ucpp.mk b/external/ucpp/UnpackedTarball_ucpp.mk deleted file mode 100644 index 04d7113b8513..000000000000 --- a/external/ucpp/UnpackedTarball_ucpp.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,ucpp)) - -$(eval $(call gb_UnpackedTarball_set_tarball,ucpp,$(UCPP_TARBALL))) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,ucpp,0)) - -$(eval $(call gb_UnpackedTarball_add_patches,ucpp,\ - external/ucpp/ucpp.patch \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/ucpp.patch b/external/ucpp/ucpp.patch deleted file mode 100644 index c9c4b92b7f79..000000000000 --- a/external/ucpp/ucpp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- cpp.c -+++ cpp.c -@@ -2464,7 +2464,7 @@ - warning(-1, "unknown option '%s'", argv[i]); - } else { - if (filename != 0) { -- error(-1, "spurious filename '%s'", argv[i]); -+ error(-1, "spurious duplicate filename '%s' - vs. '%s' ", argv[i], filename); - return 2; - } - filename = argv[i]; diff --git a/external/unixODBC/inc/odbc/sqltypes.h b/external/unixODBC/inc/odbc/sqltypes.h index 5cadacb4c359..939c5d29bd60 100644 --- a/external/unixODBC/inc/odbc/sqltypes.h +++ b/external/unixODBC/inc/odbc/sqltypes.h @@ -73,7 +73,6 @@ extern "C" { ***************************/ #ifndef ALLREADY_HAVE_WINDOWS_TYPE -#define FAR #define CALLBACK #define SQL_API #define BOOL int diff --git a/external/xmlsec/BCryptKeyDerivation.patch.1 b/external/xmlsec/BCryptKeyDerivation.patch.1 new file mode 100644 index 000000000000..3747915f87d2 --- /dev/null +++ b/external/xmlsec/BCryptKeyDerivation.patch.1 @@ -0,0 +1,51 @@ +tdf#159519 Windows 7 does not have BCryptKeyDerivation + +It just occurred to me that these functions would of course not be called +by LibreOffice so this is untested. + +--- xmlsec/src/mscng/pbkdf2.c.orig 2024-02-21 19:02:56.539534152 +0100 ++++ xmlsec/src/mscng/pbkdf2.c 2024-02-21 19:01:03.282270354 +0100 +@@ -318,7 +318,20 @@ + } + + /* generate the output key */ ++#if 1 // _WIN32_WINNT <= 0x0601 ++ typedef NTSTATUS (WINAPI * BCryptKeyDerivationPtr)( ++ BCRYPT_KEY_HANDLE, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG); ++ HMODULE hBCrypt = GetModuleHandle("bcrypt.dll"); ++ BCryptKeyDerivationPtr pBCryptKeyDerivation = ++ (BCryptKeyDerivationPtr) GetProcAddress(hBCrypt, "BCryptKeyDerivation"); ++ if(NULL == pBCryptKeyDerivation) { ++ xmlSecMSCngNtError("BCryptKeyDerivation", NULL, status); ++ goto done; ++ } ++ status = (*pBCryptKeyDerivation)( ++#else + status = BCryptKeyDerivation( ++#endif + hKey, + ¶msPBKDF2, + pbOut, +--- xmlsec/src/mscng/concatkdf.c.orig 2024-02-21 19:02:37.962490885 +0100 ++++ xmlsec/src/mscng/concatkdf.c 2024-02-21 19:01:37.961351134 +0100 +@@ -318,7 +318,20 @@ + } + + /* generate the output key */ ++#if 1 // _WIN32_WINNT <= 0x0601 ++ typedef NTSTATUS (WINAPI * BCryptKeyDerivationPtr)( ++ BCRYPT_KEY_HANDLE, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG); ++ HMODULE hBCrypt = GetModuleHandle("bcrypt.dll"); ++ BCryptKeyDerivationPtr pBCryptKeyDerivation = ++ (BCryptKeyDerivationPtr) GetProcAddress(hBCrypt, "BCryptKeyDerivation"); ++ if(NULL == pBCryptKeyDerivation) { ++ xmlSecMSCngNtError("BCryptKeyDerivation", NULL, status); ++ goto done; ++ } ++ status = (*pBCryptKeyDerivation)( ++#else + status = BCryptKeyDerivation( ++#endif + hKey, + ¶msCONCATKDF2, + pbOut, diff --git a/external/xmlsec/ExternalProject_xmlsec.mk b/external/xmlsec/ExternalProject_xmlsec.mk index 8fb0ef56fa09..64b9a18626c6 100644 --- a/external/xmlsec/ExternalProject_xmlsec.mk +++ b/external/xmlsec/ExternalProject_xmlsec.mk @@ -9,14 +9,22 @@ $(eval $(call gb_ExternalProject_ExternalProject,xmlsec)) -$(eval $(call gb_ExternalProject_use_external,xmlsec,libxml2)) - -$(eval $(call gb_ExternalProject_use_external,xmlsec,nss3)) +$(eval $(call gb_ExternalProject_use_externals,xmlsec,\ + libxml2 \ + $(if $(ENABLE_NSS),nss3,$(if $(ENABLE_OPENSSL),openssl)) \ +)) $(eval $(call gb_ExternalProject_register_targets,xmlsec,\ build \ )) +# note: it's possible to use XSLT in XML signatures - that appears to be a +# really bad idea from a security point of view though, because it will run +# an XSLT script supplied as untrusted input, and XSLT implementations +# tend to have extension functions, and some of these trivially allow +# running arbitrary code... so investigate the situation with libxslt +# before enabling it here; hopefully nobody uses XSLT in practice anyway. + ifeq ($(OS),WNT) $(eval $(call gb_ExternalProject_use_nmake,xmlsec,build)) @@ -38,20 +46,30 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) : $(call gb_Trace_StartRange,xmlsec,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(if $(filter iOS MACOSX,$(OS_FOR_BUILD)),ACLOCAL="aclocal -I $(SRCDIR)/m4/mac") \ - $(if $(filter AIX,$(OS)),ACLOCAL="aclocal -I /opt/freeware/share/aclocal") \ autoreconf \ - && ./configure \ - --with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls --without-gcrypt --disable-apps --disable-docs \ + && $(gb_RUN_CONFIGURE) ./configure \ + --with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls --without-gcrypt --disable-apps --disable-docs --disable-pedantic \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS)" \ - --without-openssl \ + $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \ + CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,xmlsec) $(gb_VISIBILITY_FLAGS)" \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ - $(if $(SYSTEM_NSS),,$(if $(filter MACOSX,$(OS_FOR_BUILD)),--disable-pkgconfig)) \ - $(if $(SYSTEM_NSS),,NSPR_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" NSPR_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lnspr4") \ - $(if $(SYSTEM_NSS),,NSS_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss" NSS_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lsmime3 -lnss3 -lnssutil3") \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(if $(ENABLE_NSS), \ + --without-openssl \ + $(if $(SYSTEM_NSS),, \ + $(if $(filter MACOSX,$(OS_FOR_BUILD)),--disable-pkgconfig) \ + NSPR_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" NSPR_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lnspr4" \ + NSS_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss" NSS_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lsmime3 -lnss3 -lnssutil3" \ + ), \ + $(if $(ENABLE_OPENSSL), \ + $(if $(SYSTEM_OPENSSL),, \ + OPENSSL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,openssl)/include" \ + OPENSSL_LIBS="-L$(call gb_UnpackedTarball_get_dir,openssl) -lcrypto -lssl" \ + ), \ + --without-openssl) \ + ) \ + $(gb_CONFIGURE_PLATFORMS) \ $(if $(SYSBASE),CFLAGS="-I$(SYSBASE)/usr/include" \ - LDFLAGS="-L$(SYSBASE)/usr/lib $(if $(filter-out LINUX FREEBSD,$(OS)),",-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN)) \ + LDFLAGS="$(call gb_ExternalProject_get_link_flags,xmlsec) -L$(SYSBASE)/usr/lib $(if $(filter-out LINUX FREEBSD,$(OS)),",-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN)) \ && $(MAKE) \ ) $(call gb_Trace_EndRange,xmlsec,EXTERNAL) diff --git a/external/xmlsec/UnpackedTarball_xmlsec.mk b/external/xmlsec/UnpackedTarball_xmlsec.mk index 3ad978cdb829..906aece5f7ed 100644 --- a/external/xmlsec/UnpackedTarball_xmlsec.mk +++ b/external/xmlsec/UnpackedTarball_xmlsec.mk @@ -8,6 +8,10 @@ # xmlsec_patches := +# Remove this when Ubuntu 20.04 is EOL in 2025. +xmlsec_patches += old-nss.patch.1 +# Remove this when Windows 7 is no longer supported +xmlsec_patches += BCryptKeyDerivation.patch.1 $(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec)) diff --git a/external/xmlsec/old-nss.patch.1 b/external/xmlsec/old-nss.patch.1 new file mode 100644 index 000000000000..0da576b59920 --- /dev/null +++ b/external/xmlsec/old-nss.patch.1 @@ -0,0 +1,67 @@ +diff --git a/include/xmlsec/nss/crypto.h b/include/xmlsec/nss/crypto.h +index bb64c5f2..fe9904be 100644 +--- a/include/xmlsec/nss/crypto.h ++++ b/include/xmlsec/nss/crypto.h +@@ -105,6 +105,7 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes192CbcGetKlass(void + XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes256CbcGetKlass(void); + + ++#if 0 + /** + * xmlSecNssTransformAes128GcmId: + * +@@ -131,6 +132,7 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes192GcmGetKlass(void + #define xmlSecNssTransformAes256GcmId \ + xmlSecNssTransformAes256GcmGetKlass() + XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes256GcmGetKlass(void); ++#endif + + + /** +diff --git a/src/nss/ciphers_gcm.c b/src/nss/ciphers_gcm.c +index 5763a756..7b50e5fd 100644 +--- a/src/nss/ciphers_gcm.c ++++ b/src/nss/ciphers_gcm.c +@@ -31,6 +31,7 @@ + #include "../cast_helpers.h" + #include "../kw_aes_des.h" + ++#if 0 + /* https://www.w3.org/TR/xmlenc-core1/#sec-AES-GCM + * + * For the purposes of this specification, AES-GCM shall be used with +@@ -591,3 +592,4 @@ xmlSecNssTransformAes256GcmGetKlass(void) { + } + + #endif /* XMLSEC_NO_AES */ ++#endif +diff --git a/src/nss/crypto.c b/src/nss/crypto.c +index 429d209f..e0296bda 100644 +--- a/src/nss/crypto.c ++++ b/src/nss/crypto.c +@@ -162,10 +162,12 @@ xmlSecCryptoGetFunctions_nss(void) { + gXmlSecNssFunctions->transformAes192CbcGetKlass = xmlSecNssTransformAes192CbcGetKlass; + gXmlSecNssFunctions->transformAes256CbcGetKlass = xmlSecNssTransformAes256CbcGetKlass; + ++#if 0 + /* gcm */ + gXmlSecNssFunctions->transformAes128GcmGetKlass = xmlSecNssTransformAes128GcmGetKlass; + gXmlSecNssFunctions->transformAes192GcmGetKlass = xmlSecNssTransformAes192GcmGetKlass; + gXmlSecNssFunctions->transformAes256GcmGetKlass = xmlSecNssTransformAes256GcmGetKlass; ++#endif + + /* kw: uses AES ECB */ + gXmlSecNssFunctions->transformKWAes128GetKlass = xmlSecNssTransformKWAes128GetKlass; +diff --git a/include/xmlsec/nss/crypto.h b/include/xmlsec/nss/crypto.h +index bb64c5f2..4c3dc4d3 100644 +--- a/include/xmlsec/nss/crypto.h ++++ b/include/xmlsec/nss/crypto.h +@@ -26,7 +26,7 @@ + * RSA OAEP requires https://bugzilla.mozilla.org/show_bug.cgi?id=1666891 + * which was fixed in NSS 3.59 (https://firefox-source-docs.mozilla.org/security/nss/legacy/nss_releases/nss_3.59_release_notes/index.html) + */ +-#if (NSS_VMAJOR < 3) || ((NSS_VMAJOR == 3) && (NSS_VMINOR < 59)) ++#if 1 + #define XMLSEC_NO_RSA_OAEP 1 + #else /* (NSS_VMAJOR < 3) || ((NSS_VMAJOR == 3) && (NSS_VMINOR < 59)) */ + #define XMLSEC_NO_MD5 1 diff --git a/external/zlib/UnpackedTarball_zlib.mk b/external/zlib/UnpackedTarball_zlib.mk index e74039d25089..5149063f456d 100644 --- a/external/zlib/UnpackedTarball_zlib.mk +++ b/external/zlib/UnpackedTarball_zlib.mk @@ -19,7 +19,7 @@ $(eval $(call gb_UnpackedTarball_set_post_action,zlib,\ $(eval $(call gb_UnpackedTarball_set_patchlevel,zlib,0)) $(eval $(call gb_UnpackedTarball_add_patches,zlib, \ - external/zlib/ubsan.patch \ + external/zlib/missinginclude.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/zlib/missinginclude.patch b/external/zlib/missinginclude.patch new file mode 100644 index 000000000000..91a63288bbf1 --- /dev/null +++ b/external/zlib/missinginclude.patch @@ -0,0 +1,36 @@ +--- gzlib.c ++++ gzlib.c +@@ -3,6 +3,9 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + ++#if !defined _WIN32 ++#include <unistd.h> ++#endif + #include "gzguts.h" + + #if defined(_WIN32) && !defined(__BORLANDC__) +--- gzread.c ++++ gzread.c +@@ -3,6 +3,9 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + ++#if !defined _WIN32 ++#include <unistd.h> ++#endif + #include "gzguts.h" + + /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from +--- gzwrite.c ++++ gzwrite.c +@@ -3,6 +3,9 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + ++#if !defined _WIN32 ++#include <unistd.h> ++#endif + #include "gzguts.h" + + /* Initialize state for writing a gzip file. Mark initialization by setting diff --git a/external/zlib/ubsan.patch b/external/zlib/ubsan.patch deleted file mode 100644 index 2d7ff8d67967..000000000000 --- a/external/zlib/ubsan.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- trees.c -+++ trees.c -@@ -870,7 +870,7 @@ - bi_windup(s); /* align on byte boundary */ - put_short(s, (ush)stored_len); - put_short(s, (ush)~stored_len); -- zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); -+ if (stored_len != 0) zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); - s->pending += stored_len; - #ifdef ZLIB_DEBUG - s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; diff --git a/external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 b/external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 new file mode 100644 index 000000000000..a1fe25bba08e --- /dev/null +++ b/external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 @@ -0,0 +1,72 @@ +From 92c6ea875231876ca264187326ce2d615d5ad543 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann <stephan.bergmann@allotropia.de> +Date: Tue, 6 Feb 2024 13:14:08 +0100 +Subject: There is no std::basic_string<int> + +...and at least LLVM 19 trunk libc++ complains about it now since +<c3668779c13596e223c26fbd49670d18cd638c40> "[libc++] Remove deprecated +char_traits base template (#72694)" with + +> In file included from dict-generate.cpp:25: +> In file included from ~/llvm/inst/bin/../include/c++/v1/iostream:43: +> In file included from ~/llvm/inst/bin/../include/c++/v1/ios:223: +> In file included from ~/llvm/inst/bin/../include/c++/v1/__locale:24: +> ~/llvm/inst/bin/../include/c++/v1/string:746:43: error: implicit instantiation of undefined template 'std::char_traits<int>' +> 746 | static_assert((is_same<_CharT, typename traits_type::char_type>::value), +> | ^ +> dict-generate.cpp:861:18: note: in instantiation of template class 'std::basic_string<int>' requested here +> 861 | StringOfInts Chld; +> | ^ +> ~/llvm/inst/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here +> 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; +> | ^ + +etc., so use a std::vector<int> instead +--- + dict-generate.cpp | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/dict-generate.cpp b/dict-generate.cpp +index eebcca9..fcfaaea 100644 +--- a/dict-generate.cpp ++++ b/dict-generate.cpp +@@ -22,6 +22,7 @@ + * + **********************************************************************************/ + ++#include <algorithm> + #include <iostream> + #include <string> + #include <fstream> +@@ -387,7 +388,7 @@ typedef map<string, Entry> EntryMap_t; + typedef list<string> StringList_t; + typedef list<NodeSPtr> NodeList_t; + typedef set<StringInt> StringIntSet_t; +-typedef basic_string<int> StringOfInts; ++typedef vector<int> StringOfInts; + typedef vector<unsigned int> UintVect; + typedef vector<uint64_t> Uint64Vect; + typedef vector<StringInt *> StrIntPtrVect_t; +@@ -864,15 +865,14 @@ void CreateArrays(NodeSPtr Root, StringIntSet_t & StrSet, StringOfInts & ChildAd + for(Itc = Root->ChildBegin(); Itc != Root->ChildEnd(); ++Itc) + { + int i = Itc->second->GetAddr(); +- Chld += i; ++ Chld.push_back(i); + } + // Find where in pointer array the child pointer string is +- StringOfInts::size_type x = ChildAddrs.find(Chld); +- if (x == StringOfInts::npos) ++ StringOfInts::size_type x = search(ChildAddrs.begin(), ChildAddrs.end(), Chld.begin(), Chld.end()) - ChildAddrs.begin(); ++ if (x == ChildAddrs.size()) + { + // Not found, add it +- x = ChildAddrs.length(); +- ChildAddrs += Chld; ++ ChildAddrs.insert(ChildAddrs.end(), Chld.begin(), Chld.end()); + } + // Val will contain the final node data + uint64_t Val = Its->i; +-- +2.43.0 + diff --git a/external/zxcvbn-c/ExternalProject_zxcvbn-c.mk b/external/zxcvbn-c/ExternalProject_zxcvbn-c.mk new file mode 100644 index 000000000000..bd652464ca15 --- /dev/null +++ b/external/zxcvbn-c/ExternalProject_zxcvbn-c.mk @@ -0,0 +1,37 @@ +# -*- 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_ExternalProject_ExternalProject,zxcvbn-c)) + +$(eval $(call gb_Library_set_warnings_disabled,zxcvbn-c)) + +$(eval $(call gb_ExternalProject_register_targets,zxcvbn-c,\ + generate-dictionary-nodes \ +)) + +$(call gb_ExternalProject_get_state_target,zxcvbn-c,generate-dictionary-nodes): \ + $(call gb_Executable_get_runtime_dependencies,gcc-wrapper) \ + $(call gb_Executable_get_runtime_dependencies,g++-wrapper) \ + $(if $(CROSS_COMPILING),$(call gb_ExternalProject_get_target_for_build,zxcvbn-c)) + $(call gb_Trace_StartRange,zxcvbn-c,EXTERNAL) + $(call gb_ExternalProject_run,generate-dictionary-nodes,\ + $(if $(CROSS_COMPILING),\ + cp $(WORKDIR_FOR_BUILD)/UnpackedTarball/zxcvbn-c/dict-src.h \ + $(WORKDIR)/UnpackedTarball/zxcvbn-c/dict-src.h \ + ,\ + $(MAKE) dict-src.h \ + AR="$(gb_AR)" \ + CFLAGS="$(gb_CFLAGS)" \ + CXXFLAGS="$(gb_CXXFLAGS)" \ + $(if $(filter MSC,$(COM)),$(gb_AUTOCONF_WRAPPERS) )\ + )\ + ) + $(call gb_Trace_EndRange,zxcvbn-c,EXTERNAL) + +# vim: set noet sw=4 ts=4: diff --git a/external/zxcvbn-c/Makefile b/external/zxcvbn-c/Makefile new file mode 100644 index 000000000000..6427d44e3790 --- /dev/null +++ b/external/zxcvbn-c/Makefile @@ -0,0 +1,14 @@ +# -*- 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/. +# + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/zxcvbn-c/Module_zxcvbn-c.mk b/external/zxcvbn-c/Module_zxcvbn-c.mk new file mode 100644 index 000000000000..14d5dfbe6abc --- /dev/null +++ b/external/zxcvbn-c/Module_zxcvbn-c.mk @@ -0,0 +1,18 @@ +# -*- 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_Module_Module,zxcvbn-c)) + +$(eval $(call gb_Module_add_targets,zxcvbn-c,\ + UnpackedTarball_zxcvbn-c \ + ExternalProject_zxcvbn-c \ + StaticLibrary_zxcvbn-c \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/zxcvbn-c/README.md b/external/zxcvbn-c/README.md new file mode 100644 index 000000000000..6193c7307e85 --- /dev/null +++ b/external/zxcvbn-c/README.md @@ -0,0 +1,3 @@ +C/C++ version of the zxcvbn password strength estimator. + +zxcvbn-c is available from [ https://github.com/tsyrogit/zxcvbn-c ]. diff --git a/external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk b/external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk new file mode 100644 index 000000000000..ac670ad6ed5b --- /dev/null +++ b/external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk @@ -0,0 +1,28 @@ +# -*- 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_StaticLibrary_StaticLibrary,zxcvbn-c)) + +$(eval $(call gb_StaticLibrary_use_unpacked,zxcvbn-c,zxcvbn-c)) + +$(eval $(call gb_StaticLibrary_set_warnings_disabled,zxcvbn-c)) + +# zxcvbn-c static library depends on generation of dictionary nodes resulting in dict-src.h +$(eval $(call gb_StaticLibrary_use_external_project,zxcvbn-c,zxcvbn-c,full)) + +$(eval $(call gb_StaticLibrary_set_include,zxcvbn-c,\ + -I$(call gb_UnpackedTarball_get_dir,zxcvbn-c)\ + $$(INCLUDE)\ +)) + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,zxcvbn-c,\ + UnpackedTarball/zxcvbn-c/zxcvbn \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk b/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk new file mode 100644 index 000000000000..b3b76aa3ef1c --- /dev/null +++ b/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.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,zxcvbn-c)) + +$(eval $(call gb_UnpackedTarball_set_tarball,zxcvbn-c,$(ZXCVBN_C_TARBALL))) + +# * external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 sent upstream as +# <https://github.com/tsyrogit/zxcvbn-c/pull/31> "There is no std::basic_string<int>": +$(eval $(call gb_UnpackedTarball_add_patches,zxcvbn-c,\ + external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch \ + external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch b/external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch new file mode 100644 index 000000000000..1b5151995067 --- /dev/null +++ b/external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch @@ -0,0 +1,13 @@ +--- a/zxcvbn-c/zxcvbn.c ++++ b/zxcvbn-c/zxcvbn.c +@@ -44,11 +44,6 @@ + #endif + #endif + +-/* For pre-compiled headers under windows */ +-#ifdef _WIN32 +-#include "stdafx.h" +-#endif +- + /* Minimum number of characters in a incrementing/decrementing sequence match */ + #define MIN_SEQUENCE_LEN 3 diff --git a/external/zxing/0001-add-ZXVersion-h.patch b/external/zxing/0001-add-ZXVersion-h.patch new file mode 100644 index 000000000000..88b779e2cfd7 --- /dev/null +++ b/external/zxing/0001-add-ZXVersion-h.patch @@ -0,0 +1,21 @@ +--- /dev/null 2023-12-10 14:00:18.140142051 +0100 ++++ a/core/src/ZXVersion.h 2023-12-22 21:38:22.466302568 +0100 +@@ -0,0 +1,18 @@ ++/* ++* Copyright 2019 Nu-book Inc. ++* Copyright 2023 Axel Waggershauser ++*/ ++// SPDX-License-Identifier: Apache-2.0 ++ ++#pragma once ++ ++// Version numbering ++#define ZXING_VERSION_MAJOR 2 ++#define ZXING_VERSION_MINOR 2 ++#define ZXING_VERSION_PATCH 1 ++ ++namespace ZXing { ++ ++constexpr const char* ZXING_VERSION_STR = "2.2.1"; ++ ++} diff --git a/external/neon/Makefile b/external/zxing/Makefile index e4968cf85fb6..e4968cf85fb6 100644 --- a/external/neon/Makefile +++ b/external/zxing/Makefile diff --git a/external/ct2n/Module_ct2n.mk b/external/zxing/Module_zxing.mk index 03f4d7b33f1b..ee53696c5728 100644 --- a/external/ct2n/Module_ct2n.mk +++ b/external/zxing/Module_zxing.mk @@ -7,11 +7,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,ct2n)) +$(eval $(call gb_Module_Module,zxing)) -$(eval $(call gb_Module_add_targets,ct2n,\ - ExternalPackage_ct2n \ - UnpackedTarball_ct2n \ +$(eval $(call gb_Module_add_targets,zxing,\ + UnpackedTarball_zxing \ )) -# vim:set noet sw=4 ts=4: +$(eval $(call gb_Module_add_targets,zxing,\ + StaticLibrary_zxing \ +)) + +# vim: set noet sw=4 ts=4:
\ No newline at end of file diff --git a/external/zxing/README b/external/zxing/README new file mode 100644 index 000000000000..cc60be0ed3ef --- /dev/null +++ b/external/zxing/README @@ -0,0 +1,3 @@ +Qr code generation library availaible from [https://github.com/zxing-cpp/zxing-cpp]. + +Qr code generator to make a QR code out of a provided link or text in LibreOffice. diff --git a/external/zxing/StaticLibrary_zxing.mk b/external/zxing/StaticLibrary_zxing.mk new file mode 100644 index 000000000000..56d49accd075 --- /dev/null +++ b/external/zxing/StaticLibrary_zxing.mk @@ -0,0 +1,136 @@ +# -*- 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,zxing)) + +$(eval $(call gb_StaticLibrary_use_unpacked,zxing,zxing)) + +$(eval $(call gb_StaticLibrary_set_precompiled_header,zxing,external/zxing/inc/pch/precompiled_zxing)) + +$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,zxing,cpp)) + +$(eval $(call gb_StaticLibrary_use_external,zxing,icu_headers)) + +$(eval $(call gb_StaticLibrary_set_warnings_disabled,zxing)) + +$(eval $(call gb_StaticLibrary_set_include,zxing,\ + -I$(call gb_UnpackedTarball_get_dir,zxing/core/src/) \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_exception_objects,zxing,\ + UnpackedTarball/zxing/core/src/aztec/AZDecoder \ + UnpackedTarball/zxing/core/src/aztec/AZDetector \ + UnpackedTarball/zxing/core/src/aztec/AZEncoder \ + UnpackedTarball/zxing/core/src/aztec/AZHighLevelEncoder \ + UnpackedTarball/zxing/core/src/aztec/AZReader \ + UnpackedTarball/zxing/core/src/aztec/AZToken \ + UnpackedTarball/zxing/core/src/aztec/AZWriter \ + UnpackedTarball/zxing/core/src/BarcodeFormat \ + UnpackedTarball/zxing/core/src/BinaryBitmap \ + UnpackedTarball/zxing/core/src/BitArray \ + UnpackedTarball/zxing/core/src/BitMatrix \ + UnpackedTarball/zxing/core/src/BitMatrixIO \ + UnpackedTarball/zxing/core/src/BitSource \ + UnpackedTarball/zxing/core/src/CharacterSet \ + UnpackedTarball/zxing/core/src/ConcentricFinder \ + UnpackedTarball/zxing/core/src/Content \ + UnpackedTarball/zxing/core/src/datamatrix/DMBitLayout \ + UnpackedTarball/zxing/core/src/datamatrix/DMDataBlock \ + UnpackedTarball/zxing/core/src/datamatrix/DMDecoder \ + UnpackedTarball/zxing/core/src/datamatrix/DMDetector \ + UnpackedTarball/zxing/core/src/datamatrix/DMECEncoder \ + UnpackedTarball/zxing/core/src/datamatrix/DMHighLevelEncoder \ + UnpackedTarball/zxing/core/src/datamatrix/DMReader \ + UnpackedTarball/zxing/core/src/datamatrix/DMSymbolInfo \ + UnpackedTarball/zxing/core/src/datamatrix/DMVersion \ + UnpackedTarball/zxing/core/src/datamatrix/DMWriter \ + UnpackedTarball/zxing/core/src/ECI \ + UnpackedTarball/zxing/core/src/GenericGF \ + UnpackedTarball/zxing/core/src/GenericGFPoly \ + UnpackedTarball/zxing/core/src/GlobalHistogramBinarizer \ + UnpackedTarball/zxing/core/src/GridSampler \ + UnpackedTarball/zxing/core/src/GTIN \ + UnpackedTarball/zxing/core/src/HRI \ + UnpackedTarball/zxing/core/src/HybridBinarizer \ + UnpackedTarball/zxing/core/src/maxicode/MCBitMatrixParser \ + UnpackedTarball/zxing/core/src/maxicode/MCDecoder \ + UnpackedTarball/zxing/core/src/maxicode/MCReader \ + UnpackedTarball/zxing/core/src/MultiFormatReader \ + UnpackedTarball/zxing/core/src/MultiFormatWriter \ + UnpackedTarball/zxing/core/src/oned/ODCodabarReader \ + UnpackedTarball/zxing/core/src/oned/ODCodabarWriter \ + UnpackedTarball/zxing/core/src/oned/ODCode39Reader \ + UnpackedTarball/zxing/core/src/oned/ODCode39Writer \ + UnpackedTarball/zxing/core/src/oned/ODCode93Reader \ + UnpackedTarball/zxing/core/src/oned/ODCode93Writer \ + UnpackedTarball/zxing/core/src/oned/ODCode128Patterns \ + UnpackedTarball/zxing/core/src/oned/ODCode128Reader \ + UnpackedTarball/zxing/core/src/oned/ODCode128Writer \ + UnpackedTarball/zxing/core/src/oned/ODDataBarCommon \ + UnpackedTarball/zxing/core/src/oned/ODDataBarExpandedBitDecoder \ + UnpackedTarball/zxing/core/src/oned/ODDataBarExpandedReader \ + UnpackedTarball/zxing/core/src/oned/ODDataBarReader \ + UnpackedTarball/zxing/core/src/oned/ODEAN8Writer \ + UnpackedTarball/zxing/core/src/oned/ODEAN13Writer \ + UnpackedTarball/zxing/core/src/oned/ODITFReader \ + UnpackedTarball/zxing/core/src/oned/ODITFWriter \ + UnpackedTarball/zxing/core/src/oned/ODMultiUPCEANReader \ + UnpackedTarball/zxing/core/src/oned/ODUPCEANCommon \ + UnpackedTarball/zxing/core/src/oned/ODUPCAWriter \ + UnpackedTarball/zxing/core/src/oned/ODUPCEWriter \ + UnpackedTarball/zxing/core/src/oned/ODRowReader \ + UnpackedTarball/zxing/core/src/oned/ODReader \ + UnpackedTarball/zxing/core/src/oned/ODWriterHelper \ + UnpackedTarball/zxing/core/src/pdf417/PDFBarcodeValue \ + UnpackedTarball/zxing/core/src/pdf417/PDFBoundingBox \ + UnpackedTarball/zxing/core/src/pdf417/PDFCodewordDecoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFDecoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFDetector \ + UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResult \ + UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResultColumn \ + UnpackedTarball/zxing/core/src/pdf417/PDFEncoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFHighLevelEncoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFModulusGF \ + UnpackedTarball/zxing/core/src/pdf417/PDFModulusPoly \ + UnpackedTarball/zxing/core/src/pdf417/PDFReader \ + UnpackedTarball/zxing/core/src/pdf417/PDFScanningDecoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFWriter \ + UnpackedTarball/zxing/core/src/PerspectiveTransform \ + UnpackedTarball/zxing/core/src/qrcode/QRBitMatrixParser \ + UnpackedTarball/zxing/core/src/qrcode/QRCodecMode \ + UnpackedTarball/zxing/core/src/qrcode/QRDataBlock \ + UnpackedTarball/zxing/core/src/qrcode/QRDecoder \ + UnpackedTarball/zxing/core/src/qrcode/QRDetector \ + UnpackedTarball/zxing/core/src/qrcode/QREncoder \ + UnpackedTarball/zxing/core/src/qrcode/QRErrorCorrectionLevel \ + UnpackedTarball/zxing/core/src/qrcode/QRFormatInformation \ + UnpackedTarball/zxing/core/src/qrcode/QRMaskUtil \ + UnpackedTarball/zxing/core/src/qrcode/QRMatrixUtil \ + UnpackedTarball/zxing/core/src/qrcode/QRReader \ + UnpackedTarball/zxing/core/src/qrcode/QRWriter \ + UnpackedTarball/zxing/core/src/qrcode/QRVersion \ + UnpackedTarball/zxing/core/src/ReadBarcode \ + UnpackedTarball/zxing/core/src/ReedSolomonDecoder \ + UnpackedTarball/zxing/core/src/ReedSolomonEncoder \ + UnpackedTarball/zxing/core/src/Result \ + UnpackedTarball/zxing/core/src/ResultPoint \ + UnpackedTarball/zxing/core/src/TextDecoder \ + UnpackedTarball/zxing/core/src/TextEncoder \ + UnpackedTarball/zxing/core/src/TextUtfEncoding \ + UnpackedTarball/zxing/core/src/Utf \ + UnpackedTarball/zxing/core/src/WhiteRectDetector \ + UnpackedTarball/zxing/core/src/ZXBigInteger \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_cobjects,zxing,\ + UnpackedTarball/zxing/core/src/libzueci/zueci \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/qrcodegen/UnpackedTarball_qrcodegen.mk b/external/zxing/UnpackedTarball_zxing.mk index 1ddbc5bc5686..08a7943818be 100644 --- a/external/qrcodegen/UnpackedTarball_qrcodegen.mk +++ b/external/zxing/UnpackedTarball_zxing.mk @@ -7,13 +7,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UnpackedTarball_UnpackedTarball,qrcodegen)) +$(eval $(call gb_UnpackedTarball_UnpackedTarball,zxing)) -$(eval $(call gb_UnpackedTarball_set_tarball,qrcodegen,$(QRCODEGEN_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,zxing,$(ZXING_TARBALL))) -$(eval $(call gb_UnpackedTarball_set_patchlevel,qrcodegen,1)) +$(eval $(call gb_UnpackedTarball_set_patchlevel,zxing,1)) -$(eval $(call gb_UnpackedTarball_add_patches,qrcodegen, \ +$(eval $(call gb_UnpackedTarball_add_patches,zxing, \ + external/zxing/0001-add-ZXVersion-h.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/zxing/inc/pch/precompiled_zxing.cxx b/external/zxing/inc/pch/precompiled_zxing.cxx new file mode 100644 index 000000000000..0f24650d9284 --- /dev/null +++ b/external/zxing/inc/pch/precompiled_zxing.cxx @@ -0,0 +1,12 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +#include "precompiled_zxing.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/external/zxing/inc/pch/precompiled_zxing.hxx b/external/zxing/inc/pch/precompiled_zxing.hxx new file mode 100644 index 000000000000..a414646f118b --- /dev/null +++ b/external/zxing/inc/pch/precompiled_zxing.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +/* + This file has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2023-07-09 00:00:16 using: + ./bin/update_pch external/zxing zxing --cutoff=1 --exclude:system --include:module --include:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./external/zxing/inc/pch/precompiled_zxing.hxx "make external/zxing.build" --find-conflicts +*/ + +#include <sal/config.h> +#if PCH_LEVEL >= 1 +#include <algorithm> +#include <array> +#include <cassert> +#include <cctype> +#include <climits> +#include <cmath> +#include <cstddef> +#include <cstdint> +#include <cstdlib> +#include <cstring> +#include <fstream> +#include <functional> +#include <initializer_list> +#include <iomanip> +#include <iterator> +#include <limits> +#include <list> +#include <map> +#include <memory> +#include <mutex> +#include <numeric> +#include <optional> +#include <sstream> +#include <stdexcept> +#include <string> +#include <unordered_set> +#include <utility> +#include <vector> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <aztec/AZReader.h> +#include <aztec/AZWriter.h> +#include <datamatrix/DMReader.h> +#include <datamatrix/DMWriter.h> +#include <libzueci/zueci.h> +#include <maxicode/MCReader.h> +#include <oned/ODCodabarWriter.h> +#include <oned/ODCode128Writer.h> +#include <oned/ODCode39Writer.h> +#include <oned/ODCode93Writer.h> +#include <oned/ODEAN13Writer.h> +#include <oned/ODEAN8Writer.h> +#include <oned/ODITFWriter.h> +#include <oned/ODReader.h> +#include <oned/ODUPCAWriter.h> +#include <oned/ODUPCEWriter.h> +#include <pdf417/PDFReader.h> +#include <pdf417/PDFWriter.h> +#include <qrcode/QRErrorCorrectionLevel.h> +#include <qrcode/QRReader.h> +#include <qrcode/QRWriter.h> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |