diff --git a/internal/cgen/base/all-impl.c b/internal/cgen/base/all-impl.c index 33f754d8..f65f3ad4 100644 --- a/internal/cgen/base/all-impl.c +++ b/internal/cgen/base/all-impl.c @@ -32,14 +32,9 @@ #include #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 -#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 bd004077..fdf59200 100644 --- a/internal/cgen/cgen.go +++ b/internal/cgen/cgen.go @@ -406,7 +406,7 @@ func insertInterfaceDeclarations(buf *buffer) error { 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;\n", n) buf.writes("#endif\n\n") @@ -1161,7 +1161,7 @@ func (g *gen) writeCppMethods(b *buffer, n *a.Struct) error { 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 @@ func (g *gen) writeCppMethods(b *buffer, n *a.Struct) error { 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 @@ func (g *gen) writeCppMethods(b *buffer, n *a.Struct) error { 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 49dd64c0..1abc974b 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 \n#include \n#include \n#include \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 \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 \n#include \n#include \n#include \n\n#ifdef __cplusplus\n#if __cplusplus >= 201103L\n#include \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 e4d7f9be..5fffc3ff 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -36,14 +36,9 @@ #include #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 -#elif defined(__GNUC__) +#else #warning "Wuffs' C++ code requires -std=c++11 or later" #endif @@ -4177,7 +4172,7 @@ struct wuffs_base__hasher_u32__struct { } private_impl; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; #endif @@ -4328,7 +4323,7 @@ struct wuffs_base__image_decoder__struct { } private_impl; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; #endif @@ -4469,7 +4464,7 @@ struct wuffs_base__io_transformer__struct { } private_impl; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; #endif @@ -4547,7 +4542,7 @@ struct wuffs_base__token_decoder__struct { } private_impl; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; #endif @@ -4679,7 +4674,7 @@ struct wuffs_adler32__hasher__struct { } private_impl; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -4694,9 +4689,9 @@ struct wuffs_adler32__hasher__struct { 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 @@ struct wuffs_adler32__hasher__struct { // 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 @@ struct wuffs_bmp__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -4969,9 +4964,9 @@ struct wuffs_bmp__decoder__struct { 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 @@ struct wuffs_bmp__decoder__struct { // 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 @@ struct wuffs_crc32__ieee_hasher__struct { } private_impl; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -5209,9 +5204,9 @@ struct wuffs_crc32__ieee_hasher__struct { 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 @@ struct wuffs_crc32__ieee_hasher__struct { // 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 @@ struct wuffs_deflate__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -5463,9 +5458,9 @@ struct wuffs_deflate__decoder__struct { 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 @@ struct wuffs_deflate__decoder__struct { // 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 @@ struct wuffs_lzw__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -5691,9 +5686,9 @@ struct wuffs_lzw__decoder__struct { 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 @@ struct wuffs_lzw__decoder__struct { // 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 @@ struct wuffs_gif__config_decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6135,9 +6130,9 @@ struct wuffs_gif__config_decoder__struct { 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 @@ struct wuffs_gif__config_decoder__struct { // 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 @@ struct wuffs_gif__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6398,9 +6393,9 @@ struct wuffs_gif__decoder__struct { 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 @@ struct wuffs_gif__decoder__struct { // 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 @@ struct wuffs_gzip__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6671,9 +6666,9 @@ struct wuffs_gzip__decoder__struct { 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 @@ struct wuffs_gzip__decoder__struct { // 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 @@ struct wuffs_json__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6938,9 +6933,9 @@ struct wuffs_json__decoder__struct { 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 @@ struct wuffs_json__decoder__struct { // 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 @@ struct wuffs_wbmp__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -7205,9 +7200,9 @@ struct wuffs_wbmp__decoder__struct { 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 @@ struct wuffs_wbmp__decoder__struct { // 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 @@ struct wuffs_zlib__decoder__struct { } private_data; #ifdef __cplusplus -#if defined(WUFFS_HAS_CPP11) +#if (__cplusplus >= 201103L) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -7493,9 +7488,9 @@ struct wuffs_zlib__decoder__struct { 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 @@ struct wuffs_zlib__decoder__struct { // 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(