@@ -131,29 +131,18 @@ static bool AVX512Capable() {
131131namespace hnswlib {
132132
133133// hnswlib can be compiled in two modes: with and without exceptions.
134- // In the mode without exceptions, we use Abseil-style Status and StatusOr
135- // return values but without actually introducing an Abseil dependency.
136- // By default, we assume the legacy mode of using exceptions.
137-
138- // The following macros are defined for functions that can throw exceptions
139- // or return statuses:
140- //
141- // HNSWLIB_THROW_ERROR(message) -- throw an exception or return a sttatus
142- // with the given message
143- // HNSWLIB_STATUS_TYPE -- return type for a function without a return value
144- // HNSWLIB_STATUS_OR_TYPE(t) -- return type for a function with a return value
145- // HNSWLIB_RETURN_OK_STATUS -- return an OK status or simply return.
134+ // In the mode without exceptions, we use Status / StatusOr from Abseil.
135+ // By default, we assume the mode of using exceptions for compatibility.
146136
147137#if !HNSWLIB_USE_ABSEIL
148138
149- #define HNSWLIB_THROW_ERROR (message ) \
150- throw std::runtime_error (message);
151139#define HNSWLIB_STATUS_TYPE void
152140#define HNSWLIB_STATUS_OR_TYPE (t ) t
141+ #define HNSWLIB_THROW_ERROR (message ) throw std::runtime_error (message);
153142#define HNSWLIB_RETURN_OK_STATUS return
143+ #define HNSWLIB_RETURN_IF_VALUE_NOT_OK (status_or_value ) status_or_value
154144#define HNSWLIB_EXTRACT_VALUE (status_or_value ) (status_or_value)
155145#define HNSWLIB_ASSIGN_OR_RETURN (lhs, expression ) lhs = (expression)
156- #define HNSWLIB_RETURN_IF_VALUE_NOT_OK (status_or_value ) status_or_value
157146#define HNSWLIB_ASSIGN_VALUE_OR_THROW_IN_TEST (identifier, expression ) \
158147 auto identifier = (expression)
159148
0 commit comments