Skip to content

Commit

Permalink
[MINOR] Adopt 2023.12 version of C++ XMP Toolkit (#188)
Browse files Browse the repository at this point in the history
(Bumps MSRV to 1.70.0.)
  • Loading branch information
scouten-adobe authored Jan 15, 2024
1 parent 80462d7 commit bf54bd6
Show file tree
Hide file tree
Showing 20 changed files with 249 additions and 207 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-13-xlarge, ubuntu-latest]
rust_version: [stable, 1.67.0]
rust_version: [stable, 1.70.0]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
fail-fast: false
matrix:
target: [aarch64-unknown-linux-gnu]
rust_version: [stable, 1.67.0]
rust_version: [stable, 1.70.0]

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = ["Eric Scouten <scouten@adobe.com>"]
keywords = ["xmp", "metadata"]
categories = ["api-bindings"]
edition = "2021"
rust-version = "1.67.0"
rust-version = "1.70.0"
exclude = [
"external/xmp_toolkit/docs",
"external/xmp_toolkit/samples",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We welcome contributions to this project. For information on contributing, provi

## Requirements

The toolkit requires **Rust version 1.67.0** or newer. When a newer version of Rust becomes required, a new minor (1.x.0) version of this crate will be released.
The toolkit requires **Rust version 1.70.0** or newer. When a newer version of Rust becomes required, a new minor (1.x.0) version of this crate will be released.

## Crate features

Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ fn main() {
.define("XMP_MacBuild", "1")
.define("_LARGEFILE64_SOURCE", None)
.define("XML_DEV_URANDOM", None)
.define("XMP_OSX_SDK", Some("13.1"))
.define("XMP_OSX_TARGET", Some("10.15"))
.define("APPLE_UNIVERSAL", Some("1"))
.flag("-Wno-deprecated-declarations")
.flag("-Wno-deprecated-register")
.flag("-Wno-int-in-bool-context")
Expand Down Expand Up @@ -205,7 +208,7 @@ fn main() {
.define("XML_STATIC", "1")
.define("XMP_StaticBuild", "1")
.define("HAVE_EXPAT_CONFIG_H", "1")
.flag_if_supported("-std=c++11")
.flag_if_supported("-std=c++17")
.flag_if_supported("-Wno-deprecated")
.flag_if_supported("-Wno-deprecated-declarations")
.flag_if_supported("-Wno-missing-field-initializers")
Expand Down Expand Up @@ -435,7 +438,7 @@ fn compile_for_docs() {
config
.cpp(true)
.define("NOOP_FFI", Some("1"))
.flag_if_supported("-std=c++11")
.flag_if_supported("-std=c++17")
.flag_if_supported("-Wno-deprecated")
.flag_if_supported("-Wno-deprecated-declarations")
.flag_if_supported("-Wno-missing-field-initializers")
Expand Down
2 changes: 1 addition & 1 deletion external/libexpat
Submodule libexpat updated 52 files
+3 −15 .github/workflows/autotools-cmake.yml
+1 −1 .github/workflows/cmake-required-version.yml
+25 −16 .github/workflows/coverage.yml
+2 −2 .github/workflows/cppcheck.yml
+1 −0 .github/workflows/data/expat_config_h_cmake__expected.txt
+1 −0 .github/workflows/data/expat_config_h_in__expected.txt
+2 −2 .github/workflows/expat_config_h.yml
+38 −15 .github/workflows/linux.yml
+2 −2 .github/workflows/macos.yml
+2 −2 .github/workflows/scripts/list-shared-library-symbols.sh
+1 −1 .github/workflows/valid-xml.yml
+1 −0 .mailmap
+1 −1 .travis.sh
+21 −0 COPYING
+28 −1 appveyor.yml
+6 −6 expat/CMake.README
+165 −122 expat/CMakeLists.txt
+1 −1 expat/COPYING
+99 −1 expat/Changes
+11 −11 expat/README.md
+4 −3 expat/apply-clang-format.sh
+2 −2 expat/buildconf.sh
+2 −2 expat/cmake/autotools/expat-noconfig__linux.cmake.in
+2 −2 expat/cmake/autotools/expat-noconfig__macos.cmake.in
+2 −2 expat/cmake/autotools/expat-noconfig__windows.cmake.in
+42 −34 expat/cmake/autotools/expat.cmake
+1 −0 expat/cmake/mingw-toolchain.cmake
+9 −5 expat/configure.ac
+14 −12 expat/coverage.sh
+7 −3 expat/doc/reference.html
+1 −1 expat/doc/xmlwf.xml
+33 −14 expat/examples/elements.c
+39 −38 expat/examples/outline.c
+6 −1 expat/expat_config.h.cmake
+3 −1 expat/fix-xmltest-log.sh
+1 −0 expat/fuzz/.gitignore
+2 −3 expat/lib/Makefile.am
+2 −2 expat/lib/expat.h
+4 −2 expat/lib/internal.h
+3 −4 expat/lib/libexpat.def.cmake
+0 −80 expat/lib/libexpatw.def
+1 −1 expat/lib/siphash.h
+43 −21 expat/lib/xmlparse.c
+4 −3 expat/lib/xmltok.c
+4 −2 expat/lib/xmltok_impl.c
+1 −1 expat/lib/xmltok_impl.h
+4 −4 expat/qa.sh
+249 −4 expat/tests/runtests.c
+5 −5 expat/win32/build_expat_iss.bat
+2 −2 expat/win32/expat.iss
+3 −2 expat/xmlwf/win32filemap.c
+2 −1 expat/xmlwf/xmlwf.c
2 changes: 1 addition & 1 deletion external/xmp_toolkit
Submodule xmp_toolkit updated 82 files
+ XMP-Toolkit-SDK-Overview.pdf
+2 −1 XMPCommon/source/ErrorImpl.cpp
+2 −2 XMPCore/resource/android/expat_config.h
+2 −2 XMPCore/resource/ios/expat_config.h
+2 −2 XMPCore/resource/linux/expat_config.h
+2 −2 XMPCore/resource/mac/expat_config.h
+2 −2 XMPCore/resource/win/expat_config.h
+1 −7 XMPCore/source/XMPUtils.cpp
+0 −8 XMPCore/source/XMPUtils.hpp
+2 −2 XMPFiles/resource/android/expat_config.h
+2 −2 XMPFiles/resource/ios/expat_config.h
+2 −2 XMPFiles/resource/linux/expat_config.h
+2 −2 XMPFiles/resource/mac/expat_config.h
+2 −2 XMPFiles/resource/win/expat_config.h
+4 −4 XMPFiles/source/FileHandlers/AVCHD_Handler.cpp
+2 −2 XMPFiles/source/FileHandlers/P2_Handler.cpp
+1 −0 XMPFiles/source/FileHandlers/PostScript_Handler.cpp
+5 −0 XMPFiles/source/FileHandlers/SVG_Handler.cpp
+11 −10 XMPFiles/source/FileHandlers/SonyHDV_Handler.cpp
+1 −0 XMPFiles/source/FormatSupport/ASF_Support.cpp
+7 −1 XMPFiles/source/FormatSupport/MacScriptExtracts.h
+8 −3 XMPFiles/source/FormatSupport/PNG_Support.cpp
+2 −2 XMPFiles/source/FormatSupport/PostScript_Support.cpp
+133 −135 XMPFiles/source/FormatSupport/QuickTime_Support.cpp
+36 −0 XMPFiles/source/FormatSupport/QuickTime_Support.hpp
+5 −5 XMPFiles/source/FormatSupport/Reconcile_Impl.cpp
+4 −1 XMPFiles/source/FormatSupport/Reconcile_Impl.hpp
+8 −8 XMPFiles/source/FormatSupport/XMPScanner.cpp
+1 −1 XMPFiles/source/FormatSupport/XMPScanner.hpp
+2 −2 XMPFiles/source/PluginHandler/PluginManager.cpp
+1 −8 XMPFiles/source/PluginHandler/XMPAtoms.h
+0 −0 XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux/PDF_Handler.resources/MODULE_IDENTIFIER.txt
+0 −0 XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux/PDF_Handler.resources/XMPPLUGINUIDS.txt
+ XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux/PDF_Handler.xpi
+ XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux/libMiniPDFL.so
+0 −0 XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux_x64/PDF_Handler.resources/MODULE_IDENTIFIER.txt
+0 −0 XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux_x64/PDF_Handler.resources/XMPPLUGINUIDS.txt
+ XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux_x64/PDF_Handler.xpi
+ XMPFilesPlugins/PDF_Handler/i80386linux/i80386linux_x64/libMiniPDFL.so
+ XMPFilesPlugins/PDF_Handler/macintosh/intel_64_libcpp/PDF_Handler.xpi/Versions/A/PDF_Handler
+0 −40 XMPFilesPlugins/PDF_Handler/macintosh/intel_64_libcpp/PDF_Handler.xpi/Versions/A/Resources/Info.plist
+ ...ndler/macintosh/intel_64_libcpp/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/MiniPDFL
+0 −0 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/PDF_Handler
+0 −0 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources
+ XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/PDF_Handler
+52 −0 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/Info.plist
+0 −0 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MODULE_IDENTIFIER.txt
+0 −0 ...lesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/MiniPDFL
+0 −0 ...esPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Resources
+ ...PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/MiniPDFL
+ ...DF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
+5 −5 ...macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/Resources/Info.plist
+14 −4 ...h/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/_CodeSignature/CodeResources
+0 −0 ...ns/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/Current
+1 −1 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/XMPPLUGINUIDS.txt
+22 −44 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/_CodeSignature/CodeResources
+0 −0 XMPFilesPlugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current
+ XMPFilesPlugins/PDF_Handler/windows/windows_x64/MiniPDFL.dll
+ XMPFilesPlugins/PDF_Handler/windows/windows_x64/PDF_Handler.xpi
+5 −5 XMPFilesPlugins/PluginTemplate/build/GeneratePluginTemplate_win.bat
+1 −8 XMPFilesPlugins/api/source/PluginRegistry.h
+7 −7 build/GenerateXMPToolkitSDK_win.bat
+2 −2 build/XMP_BuildInfo.h
+6 −6 build/shared/CMakeUtils.bat
+1 −1 build/shared/SharedConfig_Android.cmake
+1 −1 build/shared/SharedConfig_Ios.cmake
+1 −1 build/shared/SharedConfig_Mac.cmake
+3 −0 build/shared/SharedConfig_Win.cmake
+5 −4 build/shared/ToolchainLLVM.cmake
+ docs/DynamicMediaXMPPartnerGuide.pdf
+ docs/XMPProgrammersGuide.pdf
+4 −1 public/include/XMP_Const.h
+8 −8 samples/build/GenerateSamples_win.bat
+1 −1 samples/source/DumpMainXMP.cpp
+1 −1 samples/source/DumpScannedXMP.cpp
+2 −2 samples/source/UnicodeCorrectness.cpp
+3 −3 samples/source/UnicodeParseSerialize.cpp
+2 −2 samples/source/UnicodePerformance.cpp
+1 −1 samples/source/XMPCoreCoverage.cpp
+1 −1 samples/source/XMPFilesCoverage.cpp
+2 −2 third-party/expat/ReadMe.txt
+1 −1 third-party/zlib/ReadMe.txt
31 changes: 20 additions & 11 deletions external/zlib/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,22 @@
# endif
#endif

/* If available, use the ARM processor CRC32 instruction. */
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
# define ARMCRC32
#endif

/* Local functions. */
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));

/* If available, use the ARM processor CRC32 instruction. */
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
# define ARMCRC32
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
local z_word_t byte_swap OF((z_word_t word));
#endif

#if defined(W) && !defined(ARMCRC32)
local z_crc_t crc_word OF((z_word_t data));
local z_word_t crc_word_big OF((z_word_t data));
#endif

#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
Expand Down Expand Up @@ -630,7 +639,7 @@ unsigned long ZEXPORT crc32_z(
#endif /* DYNAMIC_CRC_TABLE */

/* Pre-condition the CRC */
crc ^= 0xffffffff;
crc = (~crc) & 0xffffffff;

/* Compute the CRC up to a word boundary. */
while (len && ((z_size_t)buf & 7) != 0) {
Expand All @@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(
len &= 7;

/* Do three interleaved CRCs to realize the throughput of one crc32x
instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
CRCs are combined into a single CRC after each set of batches. */
instruction per cycle. Each CRC is calculated on Z_BATCH words. The
three CRCs are combined into a single CRC after each set of batches. */
while (num >= 3 * Z_BATCH) {
crc1 = 0;
crc2 = 0;
Expand Down Expand Up @@ -749,7 +758,7 @@ unsigned long ZEXPORT crc32_z(
#endif /* DYNAMIC_CRC_TABLE */

/* Pre-condition the CRC */
crc ^= 0xffffffff;
crc = (~crc) & 0xffffffff;

#ifdef W

Expand Down Expand Up @@ -1077,7 +1086,7 @@ uLong ZEXPORT crc32_combine64(
#ifdef DYNAMIC_CRC_TABLE
once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
}

/* ========================================================================= */
Expand All @@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(
uLong crc2,
z_off_t len2)
{
return crc32_combine64(crc1, crc2, len2);
return crc32_combine64(crc1, crc2, (z_off64_t)len2);
}

/* ========================================================================= */
Expand All @@ -1103,7 +1112,7 @@ uLong ZEXPORT crc32_combine_gen64(
uLong ZEXPORT crc32_combine_gen(
z_off_t len2)
{
return crc32_combine_gen64(len2);
return crc32_combine_gen64((z_off64_t)len2);
}

/* ========================================================================= */
Expand All @@ -1112,5 +1121,5 @@ uLong crc32_combine_op(
uLong crc2,
uLong op)
{
return multmodp(op, crc1) ^ crc2;
return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
}
Loading

0 comments on commit bf54bd6

Please sign in to comment.