Handle THROW macro in its own scope.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a0488d7078
commit
ec3c8e7701
|
@ -5,7 +5,12 @@ project(Arbutils)
|
||||||
add_compile_options(-Wall -Wextra -Werror)
|
add_compile_options(-Wall -Wextra -Werror)
|
||||||
# We like new stuff, so set the c++ standard to c++20.
|
# We like new stuff, so set the c++ standard to c++20.
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
if (NOT WINDOWS)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
else()
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
||||||
option(SHARED "Whether we should build a shared library, instead of a static one." OFF)
|
option(SHARED "Whether we should build a shared library, instead of a static one." OFF)
|
||||||
|
|
|
@ -152,9 +152,11 @@ static consteval const char* file_name(const char* path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define THROW(message) \
|
#define THROW(message) \
|
||||||
std::stringstream ___ss; \
|
{ \
|
||||||
___ss << "[" << file_name(__FILE__) << ":" << __LINE__ << "] " << message; \
|
std::stringstream ___ss; \
|
||||||
throw ArbUt::Exception(___ss.str());
|
___ss << "[" << file_name(__FILE__) << ":" << __LINE__ << "] " << message; \
|
||||||
|
throw ArbUt::Exception(___ss.str()); \
|
||||||
|
}
|
||||||
|
|
||||||
#define NOT_REACHABLE THROW("Not reachable");
|
#define NOT_REACHABLE THROW("Not reachable");
|
||||||
#define NOT_IMPLEMENTED THROW("Not implemented");
|
#define NOT_IMPLEMENTED THROW("Not implemented");
|
||||||
|
|
Loading…
Reference in New Issue