geopm 3.1.1.dev579+g75d9c8b9
GEOPM - Global Extensible Open Power Manager
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
geopm_debug.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 - 2025 Intel Corporation
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef GEOPM_DEBUG_HPP_INCLUDE
7#define GEOPM_DEBUG_HPP_INCLUDE
8
9#include "geopm/Exception.hpp"
10#include "geopm_public.h"
11
12#ifdef GEOPM_DEBUG
16#define GEOPM_DEBUG_ASSERT(condition, fail_message) \
17 if (!(condition)) { \
18 throw Exception(std::string(__func__) + ": " + fail_message, \
19 GEOPM_ERROR_LOGIC, __FILE__, __LINE__); \
20 }
21#else
22#define GEOPM_DEBUG_ASSERT(condition, fail_message)
23#endif
24
25#endif