From a77ac769b34e32119770724b687d4cd2f550510d Mon Sep 17 00:00:00 2001
From: lianx <lianx@microsoft.com>
Date: Fri, 7 Oct 2022 14:38:45 -0700
Subject: [PATCH 1/4] workaround clang 14 __has_declspec_attribute restriction

---
 Release/include/cpprest/details/cpprest_compat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Release/include/cpprest/details/cpprest_compat.h b/Release/include/cpprest/details/cpprest_compat.h
index bf10747987..6bcf3e5fff 100644
--- a/Release/include/cpprest/details/cpprest_compat.h
+++ b/Release/include/cpprest/details/cpprest_compat.h
@@ -29,7 +29,7 @@
 #else // ^^^ _WIN32 ^^^ // vvv !_WIN32 vvv
 
 #define __declspec(x) __attribute__((x))
-#define dllimport
+#define dllimport   x
 #define novtable /* no novtable equivalent */
 #define __assume(x)                                                                                                    \
     do                                                                                                                 \

From ccf78f2d9963f01a82204df3a6ab3aa08c3653c6 Mon Sep 17 00:00:00 2001
From: lianx <lianx@microsoft.com>
Date: Fri, 7 Oct 2022 18:58:25 -0700
Subject: [PATCH 2/4] remove define dllimport

---
 Release/include/cpprest/details/cpprest_compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Release/include/cpprest/details/cpprest_compat.h b/Release/include/cpprest/details/cpprest_compat.h
index 6bcf3e5fff..64d16fdc1e 100644
--- a/Release/include/cpprest/details/cpprest_compat.h
+++ b/Release/include/cpprest/details/cpprest_compat.h
@@ -29,7 +29,9 @@
 #else // ^^^ _WIN32 ^^^ // vvv !_WIN32 vvv
 
 #define __declspec(x) __attribute__((x))
-#define dllimport   x
+
+//#define dllimport
+
 #define novtable /* no novtable equivalent */
 #define __assume(x)                                                                                                    \
     do                                                                                                                 \

From d497a42c6c031c8d023564e2a0c13f1957e923a7 Mon Sep 17 00:00:00 2001
From: lianx <lianx@microsoft.com>
Date: Fri, 7 Oct 2022 20:28:26 -0700
Subject: [PATCH 3/4] suppress no-unknown-attributes on macOS

---
 Release/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt
index b8f3809dbc..0f252d6919 100644
--- a/Release/CMakeLists.txt
+++ b/Release/CMakeLists.txt
@@ -152,7 +152,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR IOS)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration")
   else()
     set(WARNINGS -Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls)
-    set(OSX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs)
+    set(OSX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs -Wno-unused-but-set-parameter -Wno-unknown-attributes -Wno-null-pointer-subtraction)
     set(WARNINGS ${WARNINGS} ${OSX_SUPPRESSIONS})
 
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration")

From dc51bc790057d7509e1338e1d2346763757628ff Mon Sep 17 00:00:00 2001
From: lianx <lianx@microsoft.com>
Date: Thu, 13 Oct 2022 16:10:37 -0700
Subject: [PATCH 4/4] add few suppress flags on Linux side

---
 Release/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt
index 0f252d6919..bec1b86ccb 100644
--- a/Release/CMakeLists.txt
+++ b/Release/CMakeLists.txt
@@ -147,7 +147,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR IOS)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic -Wno-attributes -Wno-pointer-arith")
   elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
     set(WARNINGS -Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls)
-    set(LINUX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs)
+    set(LINUX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs -Wno-unused-but-set-parameter -Wno-unknown-attributes -Wno-null-pointer-subtraction)
     set(WARNINGS ${WARNINGS} ${LINUX_SUPPRESSIONS})
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration")
   else()