1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
/*
Copyright (c) 2012-2025, Intel Corporation
SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __DEBUG_H__
#define __DEBUG_H__
#include <cassert>
#include <cstdio>
/**************************************************************\
| Macros
\**************************************************************/
#define DEBUG
// Define the correct format specifier for size_t
#ifdef _MSC_VER
// MSVC: use '%zu'
#define SIZE_T_FORMAT "%zu"
#else
// Linux/macOS: use '%lu'
#define SIZE_T_FORMAT "%lu"
#endif
#ifdef DEBUG
#define ASSERT(expr) assert(expr)
#define DEBUG_PRINT(...) printf(__VA_ARGS__)
#else
#define ASSERT(expr)
#define DEBUG_PRINT(...)
#endif
#endif
|