Roll back cb198413 re MSVC __cplusplus macro
Commit cb19841358e481094bcdded6b9cb9eca42e446da "Work around MSVC's
__cplusplus regarding C++11" did not fix compiler errors with older MSVC
versions as hoped.
diff --git a/internal/cgen/base/all-impl.c b/internal/cgen/base/all-impl.c
index 33f754d..f65f3ad 100644
--- a/internal/cgen/base/all-impl.c
+++ b/internal/cgen/base/all-impl.c
@@ -32,14 +32,9 @@
#include <string.h>
#ifdef __cplusplus
-// 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
+#if __cplusplus >= 201103L
#include <memory>
-#elif defined(__GNUC__)
+#else
#warning "Wuffs' C++ code requires -std=c++11 or later"
#endif
diff --git a/internal/cgen/cgen.go b/internal/cgen/cgen.go
index bd00407..fdf5920 100644
--- a/internal/cgen/cgen.go
+++ b/internal/cgen/cgen.go
@@ -406,7 +406,7 @@
buf.writes(" } private_impl;\n\n")
buf.writes("#ifdef __cplusplus\n")
- buf.writes("#if defined(WUFFS_HAS_CPP11)\n")
+ buf.writes("#if (__cplusplus >= 201103L)\n")
buf.printf(" using unique_ptr = std::unique_ptr<wuffs_base__%s, decltype(&free)>;\n", n)
buf.writes("#endif\n\n")
@@ -1161,7 +1161,7 @@
fullStructName := g.pkgPrefix + structName + "__struct"
b.writes("#ifdef __cplusplus\n")
- b.writes("#if defined(WUFFS_HAS_CPP11)\n")
+ b.writes("#if (__cplusplus >= 201103L)\n")
b.printf("using unique_ptr = std::unique_ptr<%s%s, decltype(&free)>;\n\n", g.pkgPrefix, structName)
b.writes("// On failure, the alloc_etc functions return nullptr. They don't throw.\n\n")
b.writes("static inline unique_ptr\n")
@@ -1177,9 +1177,9 @@
iName, g.pkgPrefix, structName, iName)
b.printf("}\n")
}
- b.writes("#endif // defined(WUFFS_HAS_CPP11)\n\n")
+ b.writes("#endif // (__cplusplus >= 201103L)\n\n")
- b.writes("#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)\n")
+ b.writes("#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)\n")
b.writes("// Disallow constructing or copying an object via standard C++ mechanisms,\n")
b.writes("// e.g. the \"new\" operator, as this struct is intentionally opaque. Its total\n")
b.writes("// size and field layout is not part of the public, stable, memory-safe API.\n")
@@ -1204,7 +1204,7 @@
b.writes("// different, so that passing the latter will be rejected by the initialize\n")
b.writes("// function, we add an arbitrary amount of dead weight.\n")
b.writes("uint8_t dead_weight[123000000]; // 123 MB.\n")
- b.writes("#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)\n\n")
+ b.writes("#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)\n\n")
b.writes("inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT\n" +
"initialize(\nsize_t sizeof_star_self,\nuint64_t wuffs_version,\nuint32_t initialize_flags) {\n")
diff --git a/internal/cgen/data/data.go b/internal/cgen/data/data.go
index 49dd64c..1abc974 100644
--- a/internal/cgen/data/data.go
+++ b/internal/cgen/data/data.go
@@ -17,7 +17,7 @@
package data
const BaseAllImplC = "" +
- "#ifndef WUFFS_INCLUDE_GUARD__BASE\n#define WUFFS_INCLUDE_GUARD__BASE\n\n#if defined(WUFFS_IMPLEMENTATION) && !defined(WUFFS_CONFIG__MODULES)\n#define WUFFS_CONFIG__MODULES\n#define WUFFS_CONFIG__MODULE__BASE\n#endif\n\n// !! WUFFS MONOLITHIC RELEASE DISCARDS EVERYTHING ABOVE.\n\n// !! INSERT base/copyright\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef __cplusplus\n// MSVC before Visual Studio 2017 mis-reported the __cplusplus level:\n// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/\n// We just assume that ifdef __cplusplus, MSVC implies C++11 or later. Note\n// that MSVC doesn't support \"#warning\" and Clang also defines __GNUC__.\n#if (__cplusplus >= 201103L) || defined(_MSC_VER)\n#define WUFFS_HAS_CPP11\n#include <memory>\n#elif defined(__GNUC__)\n#warning \"Wuffs' C++ code requires -std=c++11 or later\"\n#endif\n\nextern \"C\" {\n#endif\n\n// !! INSERT base/all-public.h.\n\n// !! INSERT InterfaceDeclarations.\n\n" +
+ "#ifndef WUFFS_INCLUDE_GUARD__BASE\n#define WUFFS_INCLUDE_GUARD__BASE\n\n#if defined(WUFFS_IMPLEMENTATION) && !defined(WUFFS_CONFIG__MODULES)\n#define WUFFS_CONFIG__MODULES\n#define WUFFS_CONFIG__MODULE__BASE\n#endif\n\n// !! WUFFS MONOLITHIC RELEASE DISCARDS EVERYTHING ABOVE.\n\n// !! INSERT base/copyright\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef __cplusplus\n#if __cplusplus >= 201103L\n#include <memory>\n#else\n#warning \"Wuffs' C++ code requires -std=c++11 or later\"\n#endif\n\nextern \"C\" {\n#endif\n\n// !! INSERT base/all-public.h.\n\n// !! INSERT InterfaceDeclarations.\n\n" +
"" +
"// ----------------\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n// WUFFS C HEADER ENDS HERE.\n#ifdef WUFFS_IMPLEMENTATION\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// !! INSERT base/all-private.h.\n\n" +
"" +
diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c
index e4d7f9b..5fffc3f 100644
--- a/release/c/wuffs-unsupported-snapshot.c
+++ b/release/c/wuffs-unsupported-snapshot.c
@@ -36,14 +36,9 @@
#include <string.h>
#ifdef __cplusplus
-// 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
+#if __cplusplus >= 201103L
#include <memory>
-#elif defined(__GNUC__)
+#else
#warning "Wuffs' C++ code requires -std=c++11 or later"
#endif
@@ -4177,7 +4172,7 @@
} private_impl;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_base__hasher_u32, decltype(&free)>;
#endif
@@ -4328,7 +4323,7 @@
} private_impl;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_base__image_decoder, decltype(&free)>;
#endif
@@ -4469,7 +4464,7 @@
} private_impl;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_base__io_transformer, decltype(&free)>;
#endif
@@ -4547,7 +4542,7 @@
} private_impl;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_base__token_decoder, decltype(&free)>;
#endif
@@ -4679,7 +4674,7 @@
} private_impl;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_adler32__hasher, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -4694,9 +4689,9 @@
return wuffs_base__hasher_u32::unique_ptr(
wuffs_adler32__hasher__alloc_as__wuffs_base__hasher_u32(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -4722,7 +4717,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -4954,7 +4949,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_bmp__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -4969,9 +4964,9 @@
return wuffs_base__image_decoder::unique_ptr(
wuffs_bmp__decoder__alloc_as__wuffs_base__image_decoder(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -4997,7 +4992,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -5194,7 +5189,7 @@
} private_impl;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_crc32__ieee_hasher, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -5209,9 +5204,9 @@
return wuffs_base__hasher_u32::unique_ptr(
wuffs_crc32__ieee_hasher__alloc_as__wuffs_base__hasher_u32(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -5237,7 +5232,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -5448,7 +5443,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_deflate__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -5463,9 +5458,9 @@
return wuffs_base__io_transformer::unique_ptr(
wuffs_deflate__decoder__alloc_as__wuffs_base__io_transformer(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -5491,7 +5486,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -5676,7 +5671,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_lzw__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -5691,9 +5686,9 @@
return wuffs_base__io_transformer::unique_ptr(
wuffs_lzw__decoder__alloc_as__wuffs_base__io_transformer(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -5719,7 +5714,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -6120,7 +6115,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_gif__config_decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -6135,9 +6130,9 @@
return wuffs_base__image_decoder::unique_ptr(
wuffs_gif__config_decoder__alloc_as__wuffs_base__image_decoder(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -6163,7 +6158,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -6383,7 +6378,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_gif__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -6398,9 +6393,9 @@
return wuffs_base__image_decoder::unique_ptr(
wuffs_gif__decoder__alloc_as__wuffs_base__image_decoder(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -6426,7 +6421,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -6656,7 +6651,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_gzip__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -6671,9 +6666,9 @@
return wuffs_base__io_transformer::unique_ptr(
wuffs_gzip__decoder__alloc_as__wuffs_base__io_transformer(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -6699,7 +6694,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -6923,7 +6918,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_json__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -6938,9 +6933,9 @@
return wuffs_base__token_decoder::unique_ptr(
wuffs_json__decoder__alloc_as__wuffs_base__token_decoder(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -6966,7 +6961,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -7190,7 +7185,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_wbmp__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -7205,9 +7200,9 @@
return wuffs_base__image_decoder::unique_ptr(
wuffs_wbmp__decoder__alloc_as__wuffs_base__image_decoder(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -7233,7 +7228,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(
@@ -7478,7 +7473,7 @@
} private_data;
#ifdef __cplusplus
-#if defined(WUFFS_HAS_CPP11)
+#if (__cplusplus >= 201103L)
using unique_ptr = std::unique_ptr<wuffs_zlib__decoder, decltype(&free)>;
// On failure, the alloc_etc functions return nullptr. They don't throw.
@@ -7493,9 +7488,9 @@
return wuffs_base__io_transformer::unique_ptr(
wuffs_zlib__decoder__alloc_as__wuffs_base__io_transformer(), &free);
}
-#endif // defined(WUFFS_HAS_CPP11)
+#endif // (__cplusplus >= 201103L)
-#if defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
// Disallow constructing or copying an object via standard C++ mechanisms,
// e.g. the "new" operator, as this struct is intentionally opaque. Its total
// size and field layout is not part of the public, stable, memory-safe API.
@@ -7521,7 +7516,7 @@
// different, so that passing the latter will be rejected by the initialize
// function, we add an arbitrary amount of dead weight.
uint8_t dead_weight[123000000]; // 123 MB.
-#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION)
+#endif // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT
initialize(