1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
|