GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
assert.hpp
1/*
2 * glslstruct - a C++ library designed to easily represent GLSL's Uniform Buffer Objects (UBOs) and Shader Storage Buffer Objects (SSBOs) in C++.
3 *
4 * Licensed under the BSD 3-Clause License with Attribution Requirement.
5 * See the LICENSE file for details: https://github.com/MAIPA01/glslstruct/blob/main/LICENSE
6 *
7 * Copyright (c) 2025, Patryk Antosik (MAIPA01)
8 */
9
10#pragma once
11#ifndef _GLSL_STRUCT_ASSERT_HPP_
12 #define _GLSL_STRUCT_ASSERT_HPP_
13
14 #include <glslstruct/config.hpp>
15
17_GLSL_STRUCT_ERROR("This is only available for c++17 and greater!");
18 #else
19
20 #include <mstd/mstd.hpp>
21
22 /**
23 * @def glsl_struct_assert(expression, ...)
24 * @brief glslstruct assert
25 * @ingroup utils
26 */
27
28 // NOLINTBEGIN
29 #if _DEBUG
30 #define glsl_struct_assert(expression, ...)
31 MSTD_STOP_ASSERT_BASE(expression, [](const std::string_view) -> void {} __VA_OPT__(, ) __VA_ARGS__)
32 #elif !defined(GLSL_STRUCT_DISABLE_ASSERT_ON_RELEASE)
33 #define glsl_struct_assert(expression, ...)
34 MSTD_LOG_ASSERT_BASE(expression, [](const std::string_view) -> void {} __VA_OPT__(, ) __VA_ARGS__)
35 #else
36 #define glsl_struct_assert(expression, ...)
37 MSTD_EMPTY_ASSERT_BASE(expression, [](const std::string_view) -> void {} __VA_OPT__(, ) __VA_ARGS__)
38 #endif
39 // NOLINTEND
40 #endif
41#endif
#define _GLSL_STRUCT_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:130