diff options
author | nathan <nathansmith@disroot.org> | 2025-07-03 21:34:28 +0000 |
---|---|---|
committer | nathan <nathansmith@disroot.org> | 2025-07-03 21:34:28 +0000 |
commit | d67fc3baa8180703f2280738d13335cb9665b348 (patch) | |
tree | c336f48d86b7dc6296562a068b4828177b5b47a6 /src/utils.h | |
download | FindThings-d67fc3baa8180703f2280738d13335cb9665b348.tar.gz FindThings-d67fc3baa8180703f2280738d13335cb9665b348.tar.bz2 FindThings-d67fc3baa8180703f2280738d13335cb9665b348.zip |
first commit
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..e3b52ed --- /dev/null +++ b/src/utils.h @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdlib.h> + +#include <raylib.h> +#include "raylib.h" + +#ifndef UTIL_H +#define UTIL_H + +#define FT_NAMEMAX 256 + +// Memory management. +#define FT_MALLOC(size) malloc(size) +#define FT_CALLOC(nmemb, size) calloc(nmemb, size) +#define FT_REALLOC(ptr, size) realloc(ptr, size) +#define FT_REALLOCARRAY(ptr, nmemb, size) reallocarray(ptr, nmemb, size) +//#define FT_REALLOCARRAY(ptr, nmemb, size) realloc(ptr, nmemb * size) +#define FT_FREE(ptr) free(ptr) + +// Errors. +#define ALLOCATION_ERROR TraceLog(LOG_ERROR, "Allocation error in %s:%d", \ + __FILE__, __LINE__); + +typedef enum FTError { + FTERROR = -1, + FTSUCCESS = 0 +} FTError; + +#endif |