diff options
| author | JackBoosY <47264268+JackBoosY@users.noreply.github.com> | 2019-03-22 14:20:18 +0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-03-21 23:20:18 -0700 |
| commit | d88fa84c86a4abfc80c14be20e07028c08a3eeda (patch) | |
| tree | 5aa2c89831e1cd46810481f14fda5367d110f769 | |
| parent | d48876bab0ee18522b99aadde212f5444130e05b (diff) | |
| download | vcpkg-d88fa84c86a4abfc80c14be20e07028c08a3eeda.tar.gz vcpkg-d88fa84c86a4abfc80c14be20e07028c08a3eeda.zip | |
[draco]Fix build error on x86-uwp. (#5755)
| -rw-r--r-- | ports/draco/CONTROL | 2 | ||||
| -rw-r--r-- | ports/draco/fix-compile-error-uwp.patch | 30 | ||||
| -rw-r--r-- | ports/draco/portfile.cmake | 2 |
3 files changed, 33 insertions, 1 deletions
diff --git a/ports/draco/CONTROL b/ports/draco/CONTROL index faa63303a..53da07b77 100644 --- a/ports/draco/CONTROL +++ b/ports/draco/CONTROL @@ -1,4 +1,4 @@ Source: draco -Version: 1.3.3 +Version: 1.3.3-1 Description: A library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics. Build-Depends: diff --git a/ports/draco/fix-compile-error-uwp.patch b/ports/draco/fix-compile-error-uwp.patch new file mode 100644 index 000000000..874ea7432 --- /dev/null +++ b/ports/draco/fix-compile-error-uwp.patch @@ -0,0 +1,30 @@ +diff --git a/src/draco/core/symbol_coding_utils.h b/src/draco/core/symbol_coding_utils.h
+index be2183d..eaaca00 100644
+--- a/src/draco/core/symbol_coding_utils.h
++++ b/src/draco/core/symbol_coding_utils.h
+@@ -41,7 +41,9 @@ typename std::make_unsigned<IntTypeT>::type ConvertSignedIntToSymbol(
+ if (val >= 0) {
+ return static_cast<UnsignedType>(val) << 1;
+ }
+- val = -(val + 1); // Map -1 to 0, -2 to -1, etc..
++ // Map -1 to 0, -2 to -1, etc..
++ val += 1;
++ val *= -1;
+ UnsignedType ret = static_cast<UnsignedType>(val);
+ ret <<= 1;
+ ret |= 1;
+diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc
+index 1aa52cc..cfbbdbd 100644
+--- a/src/draco/io/parser_utils.cc
++++ b/src/draco/io/parser_utils.cc
+@@ -150,7 +150,9 @@ bool ParseSignedInt(DecoderBuffer *buffer, int32_t *value) {
+ uint32_t v;
+ if (!ParseUnsignedInt(buffer, &v))
+ return false;
+- *value = (sign < 0) ? -v : v;
++ if (sign < 0)
++ v *= -1;
++ *value = v;
+ return true;
+ }
+
diff --git a/ports/draco/portfile.cmake b/ports/draco/portfile.cmake index 853d45e86..4b95739ca 100644 --- a/ports/draco/portfile.cmake +++ b/ports/draco/portfile.cmake @@ -23,6 +23,8 @@ vcpkg_from_github( REF 1.3.3 SHA512 80ed5a623046822f5bb26b2454c8ee8cc93ffe9eb3012e8461cefdfc577b26d69a92ea0f0c5e14f5f48c1ef99f9a7263b01710df376792e74358ae14e49c3897 HEAD_REF master + PATCHES + fix-compile-error-uwp.patch ) vcpkg_configure_cmake( |
