mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 00:18:06 +00:00
move [[ ]] to calling sites (#6914)
This commit is contained in:
@@ -294,7 +294,7 @@ template<typename T> FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) {
|
|||||||
#if ((__cplusplus >= 201703L) \
|
#if ((__cplusplus >= 201703L) \
|
||||||
|| (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
|
|| (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
|
||||||
// All attributes unknown to an implementation are ignored without causing an error.
|
// All attributes unknown to an implementation are ignored without causing an error.
|
||||||
#define FLATBUFFERS_ATTRIBUTE(attr) [[attr]]
|
#define FLATBUFFERS_ATTRIBUTE(attr) attr
|
||||||
|
|
||||||
#define FLATBUFFERS_FALLTHROUGH() [[fallthrough]]
|
#define FLATBUFFERS_FALLTHROUGH() [[fallthrough]]
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ class FlatBufferBuilder {
|
|||||||
/// @warning Do NOT attempt to use this FlatBufferBuilder afterwards!
|
/// @warning Do NOT attempt to use this FlatBufferBuilder afterwards!
|
||||||
/// @return A `FlatBuffer` that owns the buffer and its allocator and
|
/// @return A `FlatBuffer` that owns the buffer and its allocator and
|
||||||
/// behaves similar to a `unique_ptr` with a deleter.
|
/// behaves similar to a `unique_ptr` with a deleter.
|
||||||
FLATBUFFERS_ATTRIBUTE(deprecated("use Release() instead"))
|
FLATBUFFERS_ATTRIBUTE([[deprecated("use Release() instead")]])
|
||||||
DetachedBuffer ReleaseBufferPointer() {
|
DetachedBuffer ReleaseBufferPointer() {
|
||||||
Finished();
|
Finished();
|
||||||
return buf_.release();
|
return buf_.release();
|
||||||
@@ -430,7 +430,7 @@ class FlatBufferBuilder {
|
|||||||
return vtableoffsetloc;
|
return vtableoffsetloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLATBUFFERS_ATTRIBUTE(deprecated("call the version above instead"))
|
FLATBUFFERS_ATTRIBUTE([[deprecated("call the version above instead")]])
|
||||||
uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) {
|
uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) {
|
||||||
return EndTable(start);
|
return EndTable(start);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ template<typename T> class Vector {
|
|||||||
uoffset_t size() const { return EndianScalar(length_); }
|
uoffset_t size() const { return EndianScalar(length_); }
|
||||||
|
|
||||||
// Deprecated: use size(). Here for backwards compatibility.
|
// Deprecated: use size(). Here for backwards compatibility.
|
||||||
FLATBUFFERS_ATTRIBUTE(deprecated("use size() instead"))
|
FLATBUFFERS_ATTRIBUTE([[deprecated("use size() instead")]])
|
||||||
uoffset_t Length() const { return size(); }
|
uoffset_t Length() const { return size(); }
|
||||||
|
|
||||||
typedef typename IndirectHelper<T>::return_type return_type;
|
typedef typename IndirectHelper<T>::return_type return_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user