2026-07-30 01:10:31 -04:00
|
|
|
/**
|
|
|
|
|
* @file error.h
|
|
|
|
|
* @brief Declares the public error API.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-05-04 00:02:31 -04:00
|
|
|
#ifndef _ERROR_H_
|
|
|
|
|
#define _ERROR_H_
|
|
|
|
|
|
2026-05-24 09:51:58 -04:00
|
|
|
// This macro is used to silence warnings on string concatenation operations that may fail.
|
|
|
|
|
// e.g., combining two element of PATH_MAX into a string buffer of AKGL_STRING_MAX_LENGTH.
|
|
|
|
|
// We have to draw a line in the sand somewhere or we will just let our buffers grow forever
|
|
|
|
|
// to keep the compiler happy.
|
Reindent all C sources to the canonical stroustrup style
Mechanical whitespace-only change across src/, include/, tests/, and
util/, applied with scripts/reindent.sh. No behavioral change.
Most files already conformed. The genuine outliers indented at 2 columns
(json_helpers.c, util.c from akgl_rectangle_points onward, assets.c,
staticstring.c, akgl_actor_add_child, util.h, staticstring.h) or used
spaces where the canonical form is a tab (draw.c). cc-mode also re-aligns
line-continuation backslashes in multi-line macros to its default
c-backslash-column, which is required for the tree to be a fixed point of
the indenter.
Verified whitespace-only: `git diff -w` over this change is empty apart
from three trailing blank lines removed at EOF in src/heap.c,
src/registry.c, and tests/tilemap.c. The build produces no new errors and
ctest is unchanged at 13/14, with `character` still the one intentional
failure.
The tree is now a fixed point of `scripts/reindent.sh --check`.
include/akgl/SDL_GameControllerDB.h is generated and excluded.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 18:17:37 -04:00
|
|
|
#define DISABLE_GCC_WARNING_FORMAT_TRUNCATION \
|
|
|
|
|
_Pragma("GCC diagnostic push") \
|
2026-05-24 09:51:58 -04:00
|
|
|
_Pragma("GCC diagnostic ignored \"-Wformat-truncation\"")
|
|
|
|
|
|
Reindent all C sources to the canonical stroustrup style
Mechanical whitespace-only change across src/, include/, tests/, and
util/, applied with scripts/reindent.sh. No behavioral change.
Most files already conformed. The genuine outliers indented at 2 columns
(json_helpers.c, util.c from akgl_rectangle_points onward, assets.c,
staticstring.c, akgl_actor_add_child, util.h, staticstring.h) or used
spaces where the canonical form is a tab (draw.c). cc-mode also re-aligns
line-continuation backslashes in multi-line macros to its default
c-backslash-column, which is required for the tree to be a fixed point of
the indenter.
Verified whitespace-only: `git diff -w` over this change is empty apart
from three trailing blank lines removed at EOF in src/heap.c,
src/registry.c, and tests/tilemap.c. The build produces no new errors and
ctest is unchanged at 13/14, with `character` still the one intentional
failure.
The tree is now a fixed point of `scripts/reindent.sh --check`.
include/akgl/SDL_GameControllerDB.h is generated and excluded.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 18:17:37 -04:00
|
|
|
#define RESTORE_GCC_WARNINGS \
|
2026-05-24 09:51:58 -04:00
|
|
|
_Pragma("GCC diagnostic pop")
|
|
|
|
|
|
2026-07-29 18:01:05 -04:00
|
|
|
#define AKGL_ERR_SDL (AKERR_LAST_ERRNO_VALUE + 18)
|
|
|
|
|
#define AKGL_ERR_REGISTRY (AKERR_LAST_ERRNO_VALUE + 19)
|
|
|
|
|
#define AKGL_ERR_HEAP (AKERR_LAST_ERRNO_VALUE + 20)
|
|
|
|
|
#define AKGL_ERR_BEHAVIOR (AKERR_LAST_ERRNO_VALUE + 21)
|
|
|
|
|
#define AKGL_ERR_LOGICINTERRUPT (AKERR_LAST_ERRNO_VALUE + 22)
|
2026-05-04 00:02:31 -04:00
|
|
|
|
|
|
|
|
#endif // _ERROR_H_
|