// Declare a friend relationship in a class with a test. Used rather that FRIEND_TEST to avoid // globally importing gtest/gtest.h into the main ART header files. #define ART_FRIEND_TEST(test_set_name, individual_test)\ friendclass test_set_name##_##individual_test##_Test
// Declare a friend relationship in a class with a typed test. #define ART_FRIEND_TYPED_TEST(test_set_name, individual_test)\ template<typename T> ART_FRIEND_TEST(test_set_name, individual_test)
// Shorthand for formatting with compile time checking of the format string #define ART_FORMAT(str, ...) ::fmt::format(FMT_STRING(str), __VA_ARGS__)
// A macro to disallow new and delete operators for a class. It goes in the private: declarations. // NOTE: Providing placement new (and matching delete) for constructing container elements. #define DISALLOW_ALLOCATION() \ public: \
NO_RETURN ALWAYS_INLINE voidoperatordelete(void*, size_t) { UNREACHABLE(); } \
ALWAYS_INLINE void* operatornew(size_t, void* ptr) noexcept { return ptr; } \
ALWAYS_INLINE voidoperatordelete(void*, void*) noexcept { } \ private: \ void* operatornew(size_t) = delete// NOLINT
// offsetof is not defined by the spec on types with non-standard layout, // however it is implemented by compilers in practice. // (note that reinterpret_cast is not valid constexpr) // // Alternative approach would be something like: // #define OFFSETOF_HELPER(t, f) \ // (reinterpret_cast<uintptr_t>(&reinterpret_cast<t*>(16)->f) - static_cast<uintptr_t>(16u)) // #define OFFSETOF_MEMBER(t, f) \ // (__builtin_constant_p(OFFSETOF_HELPER(t,f)) ? OFFSETOF_HELPER(t,f) : OFFSETOF_HELPER(t,f)) #define OFFSETOF_MEMBER(t, f) offsetof(t, f)
// Append tokens after evaluating. #define APPEND_TOKENS_AFTER_EVAL_2(a, b) a ## b #define APPEND_TOKENS_AFTER_EVAL(a, b) APPEND_TOKENS_AFTER_EVAL_2(a, b)
// clang doesn't like attributes on lambda functions. It would be nice to say: // #define ALWAYS_INLINE_LAMBDA ALWAYS_INLINE #define ALWAYS_INLINE_LAMBDA
// Define that a position within code is unreachable, for example: // int foo () { LOG(FATAL) << "Don't call me"; UNREACHABLE(); } // without the UNREACHABLE a return statement would be necessary. #define UNREACHABLE __builtin_unreachable
// Some of the libs (e.g. libarttest(d)) require more public symbols when built // in debug configuration. // Using symbol visibility only for release builds allows to reduce the list of // exported symbols and eliminates the need to check debug build configurations // when changing the exported symbols. #ifdef NDEBUG #define HIDDEN __attribute__((visibility("hidden"))) #definePROTECTED __attribute__((visibility("protected"))) #define EXPORT __attribute__((visibility("default"))) #else #define HIDDEN #definePROTECTED #define EXPORT #endif
// Protected symbols must be declared with "protected" visibility attribute when // building the library and "default" visibility when referred to from external // libraries/binaries. Otherwise, the external code will expect the symbol to be // defined locally and fail to link. #ifdef BUILDING_LIBART #define LIBART_PROTECTED PROTECTED #else #define LIBART_PROTECTED EXPORT #endif
// Some global variables shouldn't be visible outside libraries declaring them. // The attribute allows hiding them, so preventing direct access. #define ALWAYS_HIDDEN __attribute__((visibility("hidden")))
#endif// ART_LIBARTBASE_BASE_MACROS_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.