24#include "rawspeedconfig.h"
34[[noreturn]]
void RAWSPEED_UNLIKELY_FUNCTION RAWSPEED_NOINLINE
36 ThrowException(const
char* fmt, ...) {
37 static constexpr size_t bufSize = 8192;
38#if defined(HAVE_CXX_THREAD_LOCAL)
39 static thread_local std::array<char, bufSize>
buf;
40#elif defined(HAVE_GCC_THREAD_LOCAL)
41 static __thread
char buf[bufSize];
44 "Don't have thread-local-storage! Exception text may be garbled if used multithreaded"
45 static char buf[bufSize];
57 static void RAWSPEED_UNLIKELY_FUNCTION RAWSPEED_NOINLINE
58 log(
const char* msg) {
62 virtual void anchor()
const;
65 explicit RAWSPEED_UNLIKELY_FUNCTION RAWSPEED_NOINLINE
67 : std::runtime_error(msg) {
83#define ThrowExceptionHelper(CLASS, fmt, ...) \
84 rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt, \
85 __PRETTY_FUNCTION__ __VA_OPT__(, ) \
88#define ThrowExceptionHelper(CLASS, fmt, ...) \
89 rawspeed::ThrowException<CLASS>(__FILE__ ":" STR(__LINE__) ": %s: " fmt, \
90 __PRETTY_FUNCTION__ __VA_OPT__(, ) \
94#define ThrowRSE(...) \
95 ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
static void RAWSPEED_UNLIKELY_FUNCTION RAWSPEED_NOINLINE log(const char *msg)
RAWSPEED_UNLIKELY_FUNCTION RAWSPEED_NOINLINE RawspeedException(const char *msg)
virtual void anchor() const
vsnprintf(buf.data(), sizeof(buf), fmt, val)
void writeLog(DEBUG_PRIO priority, const char *format,...)
__attribute__((noinline)) __attribute__((visibility("default"))) JPEGStuffedByteStreamGenerator
void RAWSPEED_UNLIKELY_FUNCTION RAWSPEED_NOINLINE static char buf[bufSize]