File: debug.h

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (35 lines) | stat: -rw-r--r-- 674 bytes parent folder | download
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