#ifndef SkAssert_DEFINED
#define SkAssert_DEFINED
#include "include/private/base/SkAPI.h"
#include "include/private/base/SkAttributes.h"
#include "include/private/base/SkDebug.h"
#include <cstddef>
#include <limits>
#if defined(__clang__) && defined(__has_attribute)
#if __has_attribute(likely)
#define SK_LIKELY …
#define SK_UNLIKELY …
#else
#define SK_LIKELY
#define SK_UNLIKELY
#endif
#else
#define SK_LIKELY
#define SK_UNLIKELY
#endif
#if defined(__clang__)
#define SK_ASSUME(cond) …
#elif defined(__GNUC__)
#if __GNUC__ >= 13
#define SK_ASSUME …
#else
#define SK_ASSUME …
#endif
#elif defined(_MSC_VER)
#define SK_ASSUME …
#else
#define SK_ASSUME …
#endif
[[noreturn]] SK_API extern void sk_abort_no_print(void);
#if defined(SK_BUILD_FOR_GOOGLE3)
void SkDebugfForDumpStackTrace(const char* data, void* unused);
namespace base {
void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg);
}
#define SK_DUMP_GOOGLE3_STACK …
#else
#define SK_DUMP_GOOGLE3_STACK() …
#endif
#if !defined(SK_ABORT)
# if defined(SK_BUILD_FOR_WIN)
#define SK_DUMP_LINE_FORMAT …
# else
#define SK_DUMP_LINE_FORMAT …
# endif
#define SK_ABORT …
#endif
#if defined(__clang__)
#define SkASSERT_RELEASE(cond) …
#define SkASSERTF_RELEASE(cond, fmt, ...) …
#else
#define SkASSERT_RELEASE …
#define SkASSERTF_RELEASE …
#endif
#if defined(SK_DEBUG)
#define SkASSERT(cond) …
#define SkASSERTF(cond, fmt, ...) …
#define SkDEBUGFAIL(message) …
#define SkDEBUGFAILF(fmt, ...) …
#define SkAssertResult(cond) …
#else
#define SkASSERT …
#define SkASSERTF …
#define SkDEBUGFAIL …
#define SkDEBUGFAILF …
#define SkAssertResult …
#endif
#if !defined(SkUNREACHABLE)
# if defined(_MSC_VER) && !defined(__clang__)
# include <intrin.h>
#define FAST_FAIL_INVALID_ARG …
[[noreturn]] static inline void sk_fast_fail() { __fastfail(FAST_FAIL_INVALID_ARG); }
#define SkUNREACHABLE …
# else
#define SkUNREACHABLE …
# endif
#endif
[[noreturn]] SK_API inline void sk_print_index_out_of_bounds(size_t i, size_t size) { … }
template <typename T> SK_API inline T sk_collection_check_bounds(T i, T size) { … }
[[noreturn]] SK_API inline void sk_print_length_too_big(size_t i, size_t size) { … }
template <typename T> SK_API inline T sk_collection_check_length(T i, T size) { … }
SK_API inline void sk_collection_not_empty(bool empty) { … }
[[noreturn]] SK_API inline void sk_print_size_too_big(size_t size, size_t maxSize) { … }
template <typename T>
SK_ALWAYS_INLINE size_t check_size_bytes_too_big(size_t size) { … }
#endif