mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
Fix WEBP_NODISCARD comment and C++ version
Change-Id: I8b94974a46b7ac7d9bce179a48655ba8d9700edf
This commit is contained in:
parent
66408c2c7c
commit
c1c89f5189
@ -38,11 +38,11 @@ typedef long long int int64_t;
|
||||
|
||||
#ifndef WEBP_NODISCARD
|
||||
#if defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201700L) || \
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
|
||||
#define WEBP_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
// gcc's __has_attribute does not work for enums.
|
||||
// gcc's __attribute__((warn_unused_result)) does not work for enums.
|
||||
#if defined(__clang__) && defined(__has_attribute)
|
||||
#if __has_attribute(warn_unused_result)
|
||||
#define WEBP_NODISCARD __attribute__((warn_unused_result))
|
||||
|
Loading…
Reference in New Issue
Block a user