diff --git a/internal/cgen/base/all-impl.c b/internal/cgen/base/all-impl.c index f65f3ad4..33f754d8 100644 --- a/internal/cgen/base/all-impl.c +++ b/internal/cgen/base/all-impl.c @@ -32,9 +32,14 @@ #include #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 -#else +#elif defined(__GNUC__) #warning "Wuffs' C++ code requires -std=c++11 or later" #endif diff --git a/internal/cgen/cgen.go b/internal/cgen/cgen.go index cdcf4329..bd004077 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 __cplusplus >= 201103L\n") + buf.writes("#if defined(WUFFS_HAS_CPP11)\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 __cplusplus >= 201103L\n") + b.writes("#if defined(WUFFS_HAS_CPP11)\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 // __cplusplus >= 201103L\n\n") + b.writes("#endif // defined(WUFFS_HAS_CPP11)\n\n") - b.writes("#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)\n") + b.writes("#if defined(WUFFS_HAS_CPP11) && !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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION)\n\n") + b.writes("#endif // defined(WUFFS_HAS_CPP11) && !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 1abc974b..49dd64c0 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#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" + + "#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" + "" + "// ----------------\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 e1ed6b5a..e4d7f9be 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -36,9 +36,14 @@ #include #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 -#else +#elif defined(__GNUC__) #warning "Wuffs' C++ code requires -std=c++11 or later" #endif @@ -4172,7 +4177,7 @@ struct wuffs_base__hasher_u32__struct { } private_impl; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; #endif @@ -4323,7 +4328,7 @@ struct wuffs_base__image_decoder__struct { } private_impl; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; #endif @@ -4464,7 +4469,7 @@ struct wuffs_base__io_transformer__struct { } private_impl; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; #endif @@ -4542,7 +4547,7 @@ struct wuffs_base__token_decoder__struct { } private_impl; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; #endif @@ -4674,7 +4679,7 @@ struct wuffs_adler32__hasher__struct { } private_impl; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -4689,9 +4694,9 @@ struct wuffs_adler32__hasher__struct { return wuffs_base__hasher_u32::unique_ptr( wuffs_adler32__hasher__alloc_as__wuffs_base__hasher_u32(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -4717,7 +4722,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -4949,7 +4954,7 @@ struct wuffs_bmp__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -4964,9 +4969,9 @@ struct wuffs_bmp__decoder__struct { return wuffs_base__image_decoder::unique_ptr( wuffs_bmp__decoder__alloc_as__wuffs_base__image_decoder(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -4992,7 +4997,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -5189,7 +5194,7 @@ struct wuffs_crc32__ieee_hasher__struct { } private_impl; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -5204,9 +5209,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 // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -5232,7 +5237,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -5443,7 +5448,7 @@ struct wuffs_deflate__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -5458,9 +5463,9 @@ struct wuffs_deflate__decoder__struct { return wuffs_base__io_transformer::unique_ptr( wuffs_deflate__decoder__alloc_as__wuffs_base__io_transformer(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -5486,7 +5491,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -5671,7 +5676,7 @@ struct wuffs_lzw__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -5686,9 +5691,9 @@ struct wuffs_lzw__decoder__struct { return wuffs_base__io_transformer::unique_ptr( wuffs_lzw__decoder__alloc_as__wuffs_base__io_transformer(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -5714,7 +5719,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -6115,7 +6120,7 @@ struct wuffs_gif__config_decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6130,9 +6135,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 // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -6158,7 +6163,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -6378,7 +6383,7 @@ struct wuffs_gif__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6393,9 +6398,9 @@ struct wuffs_gif__decoder__struct { return wuffs_base__image_decoder::unique_ptr( wuffs_gif__decoder__alloc_as__wuffs_base__image_decoder(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -6421,7 +6426,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -6651,7 +6656,7 @@ struct wuffs_gzip__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6666,9 +6671,9 @@ struct wuffs_gzip__decoder__struct { return wuffs_base__io_transformer::unique_ptr( wuffs_gzip__decoder__alloc_as__wuffs_base__io_transformer(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -6694,7 +6699,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -6918,7 +6923,7 @@ struct wuffs_json__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -6933,9 +6938,9 @@ struct wuffs_json__decoder__struct { return wuffs_base__token_decoder::unique_ptr( wuffs_json__decoder__alloc_as__wuffs_base__token_decoder(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -6961,7 +6966,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -7185,7 +7190,7 @@ struct wuffs_wbmp__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -7200,9 +7205,9 @@ struct wuffs_wbmp__decoder__struct { return wuffs_base__image_decoder::unique_ptr( wuffs_wbmp__decoder__alloc_as__wuffs_base__image_decoder(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -7228,7 +7233,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize( @@ -7473,7 +7478,7 @@ struct wuffs_zlib__decoder__struct { } private_data; #ifdef __cplusplus -#if __cplusplus >= 201103L +#if defined(WUFFS_HAS_CPP11) using unique_ptr = std::unique_ptr; // On failure, the alloc_etc functions return nullptr. They don't throw. @@ -7488,9 +7493,9 @@ struct wuffs_zlib__decoder__struct { return wuffs_base__io_transformer::unique_ptr( wuffs_zlib__decoder__alloc_as__wuffs_base__io_transformer(), &free); } -#endif // __cplusplus >= 201103L +#endif // defined(WUFFS_HAS_CPP11) -#if (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#if defined(WUFFS_HAS_CPP11) && !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. @@ -7516,7 +7521,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 // (__cplusplus >= 201103L) && !defined(WUFFS_IMPLEMENTATION) +#endif // defined(WUFFS_HAS_CPP11) && !defined(WUFFS_IMPLEMENTATION) inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT initialize(