define DEBUG

This commit is contained in:
Alexander Popov 2023-03-08 23:20:50 +03:00
parent 0cbe9fce12
commit b3879d6ac5
Signed by: iiiypuk
GPG Key ID: D8C9B59A9F04A70C
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
---
title: "Константа DEBUG в Си"
date: 2023-03-08T23:15:46+03:00
draft: true
tags: [tips, development]
---
При компиляции кода есть возможность указать параметры компилятору.
Например можно вызвать **GCC** с флагом `-DEBUG`.
```c
#ifdef DEBUG
#endif
// или
#if defined(DEBUG)
#endif
```
Можно создать заголовочный файл `debug.h` и определить в нём константу `DEBUG`.
```c
#define DEBUG
```