onnxruntime

Форк
0
/
protobuf_cmake.patch 
55 строк · 2.2 Кб
1
diff --git a/CMakeLists.txt b/CMakeLists.txt
2
index 04cb3303a..c023001de 100644
3
--- a/CMakeLists.txt
4
+++ b/CMakeLists.txt
5
@@ -249,9 +249,7 @@ if (MSVC)
6
   # MSVC warning suppressions
7
   add_definitions(
8
     /wd4065 # switch statement contains 'default' but no 'case' labels
9
-    /wd4244 # 'conversion' conversion from 'type1' to 'type2', possible loss of data
10
     /wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
11
-    /wd4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
12
     /wd4305 # 'identifier' : truncation from 'type1' to 'type2'
13
     /wd4307 # 'operator' : integral constant overflow
14
     /wd4309 # 'conversion' : truncation of constant value
15
@@ -259,7 +257,7 @@ if (MSVC)
16
     /wd4355 # 'this' : used in base member initializer list
17
     /wd4506 # no definition for inline function 'function'
18
     /wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning)
19
-    /wd4996 # The compiler encountered a deprecated declaration.
20
+    ${onnxruntime_PROTOBUF_EXTRA_WARNING_DISABLEMENT}
21
   )
22
   # Allow big object
23
   add_definitions(/bigobj)
24
@@ -289,7 +286,6 @@ if (MSVC)
25
 else (MSVC)
26
   # No version.rc file.
27
   set(protobuf_version_rc_file)
28
-
29
   # When building with "make", "lib" prefix will be added automatically by
30
   # the build tool.
31
   set(LIB_PREFIX)
32
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
33
index 008c19225..cbab108c2 100644
34
--- a/src/google/protobuf/map.h
35
+++ b/src/google/protobuf/map.h
36
@@ -52,7 +52,8 @@
37
 #endif  // defined(__cpp_lib_string_view)
38
 
39
 #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__)
40
-#include <mach/mach_time.h>
41
+// apply update from https://github.com/protocolbuffers/protobuf/pull/15662/
42
+#include <time.h>
43
 #endif
44
 
45
 #include <google/protobuf/stubs/common.h>
46
@@ -1154,7 +1155,8 @@ class Map {
47
 #if defined(__APPLE__)
48
       // Use a commpage-based fast time function on Apple environments (MacOS,
49
       // iOS, tvOS, watchOS, etc).
50
-      s += mach_absolute_time();
51
+      // apply update from https://github.com/protocolbuffers/protobuf/pull/15662/
52
+      s += clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
53
 #elif defined(__x86_64__) && defined(__GNUC__)
54
       uint32_t hi, lo;
55
       asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
56

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.