mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Work around MSVC's __cplusplus regarding C++11
This commit is contained in:
1 parent
635b502649
commit
cb19841358
4 files changed
+68
-58
No files matched your search
@@ -32,9 +32,14 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus >= 201103L
|
||||
// MSVC before Visual Studio 2017 mis-reported the __cplusplus level:
|
||||
// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
|
||||
// We just assume that ifdef __cplusplus, MSVC implies C++11 or later. Note
|
||||
// that MSVC doesn't support "#warning" and Clang also defines __GNUC__.
|
||||
#if (__cplusplus >= 201103L) || defined(_MSC_VER)
|
||||
#define WUFFS_HAS_CPP11
|
||||
#include <memory>
|
||||
#else
|
||||
#elif defined(__GNUC__)
|
||||
#warning "Wuffs' C++ code requires -std=c++11 or later"
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user