File indexing completed on 2025-08-28 08:27:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #pragma once
0019
0020 #include <cstdint>
0021
0022 #define ARROW_EXPAND(x) x
0023 #define ARROW_STRINGIFY(x) #x
0024 #define ARROW_CONCAT(x, y) x##y
0025
0026
0027 #ifndef ARROW_DISALLOW_COPY_AND_ASSIGN
0028 # define ARROW_DISALLOW_COPY_AND_ASSIGN(TypeName) \
0029 TypeName(const TypeName&) = delete; \
0030 void operator=(const TypeName&) = delete
0031 #endif
0032
0033 #ifndef ARROW_DEFAULT_MOVE_AND_ASSIGN
0034 # define ARROW_DEFAULT_MOVE_AND_ASSIGN(TypeName) \
0035 TypeName(TypeName&&) = default; \
0036 TypeName& operator=(TypeName&&) = default
0037 #endif
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 #define ARROW_UNUSED(x) (void)(x)
0070 #ifdef ARROW_WARN_DOCUMENTATION
0071 # define ARROW_ARG_UNUSED(x) x
0072 #else
0073 # define ARROW_ARG_UNUSED(x)
0074 #endif
0075 #if defined(__GNUC__)
0076 # define ARROW_NORETURN __attribute__((noreturn))
0077 # define ARROW_NOINLINE __attribute__((noinline))
0078 # define ARROW_FORCE_INLINE __attribute__((always_inline))
0079 # define ARROW_PREDICT_FALSE(x) (__builtin_expect(!!(x), 0))
0080 # define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
0081 # define ARROW_RESTRICT __restrict
0082 # if defined(__clang__)
0083 # define ARROW_COMPILER_ASSUME(expr) __builtin_assume(expr)
0084 # else
0085 # if __GNUC__ >= 13
0086 # define ARROW_COMPILER_ASSUME(expr) __attribute__((assume(expr)))
0087 # else
0088
0089
0090
0091
0092
0093
0094 # define ARROW_COMPILER_ASSUME(expr) \
0095 if (expr) { \
0096 } else { \
0097 __builtin_unreachable(); \
0098 }
0099 # endif
0100 # endif
0101 #elif defined(_MSC_VER)
0102 # define ARROW_NORETURN __declspec(noreturn)
0103 # define ARROW_NOINLINE __declspec(noinline)
0104 # define ARROW_FORCE_INLINE __forceinline
0105 # define ARROW_PREDICT_FALSE(x) (x)
0106 # define ARROW_PREDICT_TRUE(x) (x)
0107 # define ARROW_RESTRICT __restrict
0108 # define ARROW_COMPILER_ASSUME(expr) __assume(expr)
0109 #else
0110 # define ARROW_NORETURN
0111 # define ARROW_NOINLINE
0112 # define ARROW_FORCE_INLINE
0113 # define ARROW_PREDICT_FALSE(x) (x)
0114 # define ARROW_PREDICT_TRUE(x) (x)
0115 # define ARROW_RESTRICT
0116 # define ARROW_COMPILER_ASSUME(expr)
0117 #endif
0118
0119
0120
0121
0122 #ifndef NULLPTR
0123
0124 # ifdef __cplusplus_cli
0125 # define NULLPTR __nullptr
0126 # else
0127 # define NULLPTR nullptr
0128 # endif
0129
0130 #endif
0131
0132
0133
0134
0135
0136
0137 #ifdef __COVERITY__
0138 # define ARROW_DEPRECATED(...)
0139 #else
0140 # define ARROW_DEPRECATED(...) [[deprecated(__VA_ARGS__)]]
0141 #endif
0142
0143 #ifdef __COVERITY__
0144 # define ARROW_DEPRECATED_ENUM_VALUE(...)
0145 #else
0146 # define ARROW_DEPRECATED_ENUM_VALUE(...) [[deprecated(__VA_ARGS__)]]
0147 #endif
0148
0149
0150
0151
0152
0153 #ifdef __clang__
0154 # define ARROW_SUPPRESS_DEPRECATION_WARNING \
0155 _Pragma("clang diagnostic push"); \
0156 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
0157 # define ARROW_UNSUPPRESS_DEPRECATION_WARNING _Pragma("clang diagnostic pop")
0158 #elif defined(__GNUC__)
0159 # define ARROW_SUPPRESS_DEPRECATION_WARNING \
0160 _Pragma("GCC diagnostic push"); \
0161 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
0162 # define ARROW_UNSUPPRESS_DEPRECATION_WARNING _Pragma("GCC diagnostic pop")
0163 #elif defined(_MSC_VER)
0164 # define ARROW_SUPPRESS_DEPRECATION_WARNING \
0165 __pragma(warning(push)) __pragma(warning(disable : 4996))
0166 # define ARROW_UNSUPPRESS_DEPRECATION_WARNING __pragma(warning(pop))
0167 #else
0168 # define ARROW_SUPPRESS_DEPRECATION_WARNING
0169 # define ARROW_UNSUPPRESS_DEPRECATION_WARNING
0170 #endif
0171
0172
0173
0174
0175
0176
0177 #if !defined(MANUALLY_ALIGNED_STRUCT)
0178 # if defined(_MSC_VER)
0179 # define MANUALLY_ALIGNED_STRUCT(alignment) \
0180 __pragma(pack(1)); \
0181 struct __declspec(align(alignment))
0182 # define STRUCT_END(name, size) \
0183 __pragma(pack()); \
0184 static_assert(sizeof(name) == size, "compiler breaks packing rules")
0185 # elif defined(__GNUC__) || defined(__clang__)
0186 # define MANUALLY_ALIGNED_STRUCT(alignment) \
0187 _Pragma("pack(1)") struct __attribute__((aligned(alignment)))
0188 # define STRUCT_END(name, size) \
0189 _Pragma("pack()") static_assert(sizeof(name) == size, \
0190 "compiler breaks packing rules")
0191 # else
0192 # error Unknown compiler, please define structure alignment macros
0193 # endif
0194 #endif
0195
0196
0197
0198
0199 #if defined(__clang__)
0200 # define ARROW_DISABLE_UBSAN(feature) __attribute__((no_sanitize(feature)))
0201 #else
0202 # define ARROW_DISABLE_UBSAN(feature)
0203 #endif
0204
0205
0206
0207
0208 #if INTPTR_MAX == INT64_MAX
0209 # define ARROW_BITNESS 64
0210 #elif INTPTR_MAX == INT32_MAX
0211 # define ARROW_BITNESS 32
0212 #else
0213 # error Unexpected INTPTR_MAX
0214 #endif
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238 #define FRIEND_TEST(test_case_name, test_name) \
0239 friend class test_case_name##_##test_name##_Test