diff --git a/google/cloud/storage/async/options.h b/google/cloud/storage/async/options.h index 2637be6bab192..54ec96be8b99b 100644 --- a/google/cloud/storage/async/options.h +++ b/google/cloud/storage/async/options.h @@ -15,6 +15,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_ASYNC_OPTIONS_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_ASYNC_OPTIONS_H +#include "google/cloud/internal/attributes.h" #include "google/cloud/version.h" #include #include @@ -33,9 +34,9 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN * @deprecated Use `UploadChecksumValidationOption` and * `DownloadChecksumValidationOption` instead. */ -struct [[deprecated( +struct GOOGLE_CLOUD_CPP_DEPRECATED( "Use UploadChecksumValidationOption and DownloadChecksumValidationOption " - "instead")]] EnableCrc32cValidationOption { + "instead") EnableCrc32cValidationOption { using Type = bool; }; @@ -49,7 +50,8 @@ struct [[deprecated( * checksums. Note that this option has no effect if the service does not return * or compute a CRC32C checksum. */ -struct UseCrc32cValueOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Use PrecomputedChecksumsOption instead") + UseCrc32cValueOption { using Type = std::uint32_t; }; @@ -63,9 +65,9 @@ struct UseCrc32cValueOption { * @deprecated Use `UploadChecksumValidationOption` and * `DownloadChecksumValidationOption` instead. */ -struct [[deprecated( +struct GOOGLE_CLOUD_CPP_DEPRECATED( "Use UploadChecksumValidationOption and DownloadChecksumValidationOption " - "instead")]] EnableMD5ValidationOption { + "instead") EnableMD5ValidationOption { using Type = bool; }; @@ -79,7 +81,8 @@ struct [[deprecated( * Note that this option has no effect if the service does not return or compute * a MD5 hash. */ -struct UseMD5ValueOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Use PrecomputedChecksumsOption instead") + UseMD5ValueOption { using Type = std::string; }; diff --git a/google/cloud/storage/hashing_options.h b/google/cloud/storage/hashing_options.h index 9373d6575ca8f..035cf0c41b39d 100644 --- a/google/cloud/storage/hashing_options.h +++ b/google/cloud/storage/hashing_options.h @@ -18,6 +18,7 @@ #include "google/cloud/internal/disable_deprecation_warnings.inc" #include "google/cloud/storage/internal/complex_option.h" #include "google/cloud/storage/version.h" +#include "google/cloud/internal/attributes.h" #include "google/cloud/version.h" #include "absl/strings/string_view.h" #include @@ -49,8 +50,8 @@ struct PrecomputedChecksums { std::string md5; }; -struct MD5HashValue - : public internal::ComplexOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Use PrecomputedChecksumsOption instead") + MD5HashValue : public internal::ComplexOption { using ComplexOption::ComplexOption; // GCC <= 7.0 does not use the inherited default constructor, redeclare it // explicitly @@ -87,9 +88,9 @@ inline std::string ComputeMD5Hash(char const* payload) { * @deprecated Use `UploadChecksumValidationOption` and * `DownloadChecksumValidationOption` instead. */ -struct [[deprecated( +struct GOOGLE_CLOUD_CPP_DEPRECATED( "Use UploadChecksumValidationOption and DownloadChecksumValidationOption " - "instead")]] DisableMD5Hash + "instead") DisableMD5Hash : public internal::ComplexOption { using ComplexOption::ComplexOption; // GCC <= 7.0 does not use the inherited default constructor, redeclare it @@ -118,7 +119,8 @@ inline DisableMD5Hash EnableMD5Hash() { return DisableMD5Hash(false); } * @see * https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s01-hochschild.pdf */ -struct Crc32cChecksumValue +struct GOOGLE_CLOUD_CPP_DEPRECATED("Use PrecomputedChecksumsOption instead") + Crc32cChecksumValue : public internal::ComplexOption { using ComplexOption::ComplexOption; // GCC <= 7.0 does not use the inherited default constructor, redeclare it @@ -157,9 +159,9 @@ inline std::string ComputeCrc32cChecksum(char const* payload) { * @deprecated Use `UploadChecksumValidationOption` and * `DownloadChecksumValidationOption` instead. */ -struct [[deprecated( +struct GOOGLE_CLOUD_CPP_DEPRECATED( "Use UploadChecksumValidationOption and DownloadChecksumValidationOption " - "instead")]] DisableCrc32cChecksum + "instead") DisableCrc32cChecksum : public internal::ComplexOption { using ComplexOption::ComplexOption; // GCC <= 7.0 does not use the inherited default constructor, redeclare it