Ken Van Hoeylandt d551e467b8
Moved and renamed files for consistent C code style (#463)
* **Documentation**
  * Added new C coding style guide detailing naming conventions for files, directories, macros, constants, variables, functions, and type definitions with illustrative examples.
  * Updated C++ coding style documentation with clarifications on C naming conventions and header directory organization patterns.

* **Refactor**
  * Updated header include paths throughout the codebase to use lowercase naming conventions consistently.
2026-01-27 20:17:33 +01:00

33 lines
742 B
C

#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <tactility/log.h>
__attribute__((noreturn)) extern void __crash(void);
#define CHECK_GET_MACRO(_1, _2, NAME, ...) NAME
#define check(...) CHECK_GET_MACRO(__VA_ARGS__, CHECK_MSG, CHECK_NO_MSG)(__VA_ARGS__)
#define CHECK_NO_MSG(condition) \
do { \
if (!(condition)) { \
LOG_E("Error", "Check failed: %s at %s:%d", #condition, __FILE__, __LINE__); \
__crash(); \
} \
} while (0)
#define CHECK_MSG(condition, message) \
do { \
if (!(condition)) { \
LOG_E("Error", "Check failed: %s at %s:%d", message, __FILE__, __LINE__); \
__crash(); \
} \
} while (0)
#ifdef __cplusplus
}
#endif