microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.91k stars 1.64k forks source link

workaround clang 14 __has_declspec_attribute restriction #1723

Open liam-x opened 1 year ago

liam-x commented 1 year ago

fix #1710

clang 14 impose a new restriction on __has_declspec_attribute, the argument can not be empty. https://github.com/llvm/llvm-project/issues/53269

cppresetsdk cpprest_compat.h translate dllimport to empty which cause compilation failure on clang 14.

A workaround by removing define dllimport and add no-unknown-attributes flag to suppress the compilation warning from clang on macOS and Linux.