diff options
author | vvvv <vvvv@yandex-team.com> | 2024-11-07 04:19:26 +0300 |
---|---|---|
committer | vvvv <vvvv@yandex-team.com> | 2024-11-07 04:29:50 +0300 |
commit | 2661be00f3bc47590fda9218bf0386d6355c8c88 (patch) | |
tree | 3d316c07519191283d31c5f537efc6aabb42a2f0 /yql/essentials/minikql/defs.h | |
parent | cf2a23963ac10add28c50cc114fbf48953eca5aa (diff) | |
download | ydb-2661be00f3bc47590fda9218bf0386d6355c8c88.tar.gz |
Moved yql/minikql YQL-19206
init
[nodiff:caesar]
commit_hash:d1182ef7d430ccf7e4d37ed933c7126d7bd5d6e4
Diffstat (limited to 'yql/essentials/minikql/defs.h')
-rw-r--r-- | yql/essentials/minikql/defs.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/yql/essentials/minikql/defs.h b/yql/essentials/minikql/defs.h new file mode 100644 index 0000000000..3e332363c6 --- /dev/null +++ b/yql/essentials/minikql/defs.h @@ -0,0 +1,58 @@ +#pragma once + +// unique tag to fix pragma once gcc glueing: ./ydb/library/yql/minikql/defs.h + +#include <util/system/compiler.h> +#include <util/generic/array_ref.h> +#include <util/generic/yexception.h> + +#define THROW ::NKikimr::TThrowable() , __LOCATION__ + + +#define MKQL_ENSURE(condition, message) \ + do { \ + if (Y_UNLIKELY(!(condition))) { \ + (THROW yexception() << __FUNCTION__ << "(): requirement " \ + << #condition << " failed. " << message); \ + } \ + } while (0) + +#define MKQL_ENSURE_WITH_LOC(location, condition, message) \ + do { \ + if (Y_UNLIKELY(!(condition))) { \ + ThrowException(location + yexception() << message); \ + } \ + } while (0) + +#define MKQL_ENSURE_S(condition, ...) \ + do { \ + if (Y_UNLIKELY(!(condition))) { \ + (THROW yexception() << __FUNCTION__ << "(): requirement " \ + << #condition << " failed. " << "" __VA_ARGS__); \ + } \ + } while (0) + +namespace NKikimr { + +template <typename T> +[[noreturn]] void ThrowException(T&& e) +{ + throw e; +} + +struct TThrowable +{ + template <typename T> + [[noreturn]] void operator,(T&& e) { + ThrowException(e); + } +}; + +typedef +#ifdef _win_ +struct { ui64 Data, Meta; } +#else +unsigned __int128 +#endif +TRawUV; + +} |