summaryrefslogtreecommitdiffstats
path: root/Source/ThirdParty/woff2/src/woff2_common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Source/ThirdParty/woff2/src/woff2_common.cc')
-rw-r--r--Source/ThirdParty/woff2/src/woff2_common.cc28
1 files changed, 11 insertions, 17 deletions
diff --git a/Source/ThirdParty/woff2/src/woff2_common.cc b/Source/ThirdParty/woff2/src/woff2_common.cc
index eba6a46e2..fe0a3beda 100644
--- a/Source/ThirdParty/woff2/src/woff2_common.cc
+++ b/Source/ThirdParty/woff2/src/woff2_common.cc
@@ -1,23 +1,17 @@
-// Copyright 2013 Google Inc. All Rights Reserved.
-//
-// Licensed 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
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Helpers common across multiple parts of woff2
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+/* Helpers common across multiple parts of woff2 */
#include <algorithm>
#include "./woff2_common.h"
+#include "./port.h"
+
namespace woff2 {
@@ -25,11 +19,11 @@ uint32_t ComputeULongSum(const uint8_t* buf, size_t size) {
uint32_t checksum = 0;
size_t aligned_size = size & ~3;
for (size_t i = 0; i < aligned_size; i += 4) {
-#if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+#if defined(WOFF_LITTLE_ENDIAN)
uint32_t v = *reinterpret_cast<const uint32_t*>(buf + i);
checksum += (((v & 0xFF) << 24) | ((v & 0xFF00) << 8) |
((v & 0xFF0000) >> 8) | ((v & 0xFF000000) >> 24));
-#elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
+#elif defined(WOFF_BIG_ENDIAN)
checksum += *reinterpret_cast<const uint32_t*>(buf + i);
#else
checksum += (buf[i] << 24) | (buf[i + 1] << 16) |