Files
libakgl/include/akgl/error.h

21 lines
1.1 KiB
C
Raw Normal View History

2026-05-04 00:02:31 -04:00
#ifndef _ERROR_H_
#define _ERROR_H_
// 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.
#define DISABLE_GCC_WARNING_FORMAT_TRUNCATION \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wformat-truncation\"")
#define RESTORE_GCC_WARNINGS \
_Pragma("GCC diagnostic pop")
#define AKGL_ERR_SDL AKERR_LAST_ERRNO_VALUE + 1 /** Error in the SDL library. See SDL_GetError() for more detail. */
#define AKGL_ERR_LOGICINTERRUPT AKERR_LAST_ERRNO_VALUE + 2 /** Raised by an actor to tell the physics simulator not to process this node */
#define AKGL_ERR_REGISTRY AKERR_LAST_ERRNO_VALUE + 3 /** The AKGL Registry was not able to fulfill the operation */
#define AKGL_ERR_OOHEAP AKERR_LAST_ERRNO_VALUE + 4 /** The AKGL Heap in this context has been exhausted */
2026-05-04 00:02:31 -04:00
#endif // _ERROR_H_