aboutsummaryrefslogtreecommitdiff
path: root/ports/draco/fix-compile-error-uwp.patch
diff options
context:
space:
mode:
authorGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-04-12 02:30:59 -0700
committerGitHub <noreply@github.com>2019-04-12 02:30:59 -0700
commit0e000644053015b7f7a0985e14f0bd384c847d17 (patch)
tree7e456fd12b3bf281b28587338f1650017c8b32ab /ports/draco/fix-compile-error-uwp.patch
parent93ce6b4f27602cd18f4327c2cfd84093d472b8bb (diff)
parent39ba5b2b30c9f7b49e777a62093cdd49d05b53a9 (diff)
downloadvcpkg-0e000644053015b7f7a0985e14f0bd384c847d17.tar.gz
vcpkg-0e000644053015b7f7a0985e14f0bd384c847d17.zip
Merge branch 'master' into master
Diffstat (limited to 'ports/draco/fix-compile-error-uwp.patch')
-rw-r--r--ports/draco/fix-compile-error-uwp.patch30
1 files changed, 30 insertions, 0 deletions
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;
+ }
+