WARN_UNUSED_RESULT for windows
This commit is contained in:
parent
76dc5cbba8
commit
e7110afe25
@ -21,7 +21,7 @@ namespace blockstore {
|
||||
KnownBlockVersions(KnownBlockVersions &&rhs); // NOLINT (intentionally not noexcept)
|
||||
~KnownBlockVersions();
|
||||
|
||||
__attribute__((warn_unused_result))
|
||||
WARN_UNUSED_RESULT
|
||||
bool checkAndUpdateVersion(uint32_t clientId, const BlockId &blockId, uint64_t version);
|
||||
|
||||
uint64_t incrementVersion(const BlockId &blockId);
|
||||
|
@ -19,12 +19,12 @@ public:
|
||||
return BlockId::Random();
|
||||
}
|
||||
|
||||
__attribute__((warn_unused_result))
|
||||
WARN_UNUSED_RESULT
|
||||
virtual bool tryCreate(const BlockId &blockId, const cpputils::Data &data) = 0;
|
||||
__attribute__((warn_unused_result))
|
||||
WARN_UNUSED_RESULT
|
||||
virtual bool remove(const BlockId &blockId) = 0;
|
||||
|
||||
__attribute__((warn_unused_result))
|
||||
WARN_UNUSED_RESULT
|
||||
virtual boost::optional<cpputils::Data> load(const BlockId &blockId) const = 0;
|
||||
|
||||
// Store the block with the given blockId. If it doesn't exist, it is created.
|
||||
|
@ -17,4 +17,13 @@
|
||||
*/
|
||||
#define UNUSED(expr) (void)(expr)
|
||||
|
||||
/**
|
||||
* Warn if function result is unused
|
||||
*/
|
||||
#if !defined(_MSC_VER)
|
||||
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
#define WARN_UNUSED_RESULT _Check_return_
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user