summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-01-19 13:05:21 +0100
committerraysan5 <[email protected]>2020-01-19 13:05:21 +0100
commitcff38308b76458ce5114a5fc00ef9de5e2ad76ce (patch)
tree3a0fa344d532ad7dee95e49e0c0c430b3c2a651b /src
parent9c52a4932d8f5495724bb94a2e64b646df44fc29 (diff)
downloadraylib-cff38308b76458ce5114a5fc00ef9de5e2ad76ce.tar.gz
raylib-cff38308b76458ce5114a5fc00ef9de5e2ad76ce.zip
Support custom allocator
Diffstat (limited to 'src')
-rw-r--r--src/external/glad.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/external/glad.h b/src/external/glad.h
index 70dbc739..c92e1845 100644
--- a/src/external/glad.h
+++ b/src/external/glad.h
@@ -40,6 +40,14 @@
#define APIENTRYP APIENTRY *
#endif
+// RAY: Added
+#ifndef GLAD_REALLOC
+ #define GLAD_REALLOC(n,sz) realloc(n,sz)
+#endif
+#ifndef GLAD_FREE
+ #define GLAD_FREE(p) free(p)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -3760,7 +3768,7 @@ static int get_exts(void) {
num_exts_i = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
if (num_exts_i > 0) {
- exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i);
+ exts_i = (const char **)GLAD_REALLOC((void *)exts_i, num_exts_i * sizeof *exts_i);
}
if (exts_i == NULL) {
@@ -3777,7 +3785,7 @@ static int get_exts(void) {
static void free_exts(void) {
if (exts_i != NULL) {
- free((char **)exts_i);
+ GLAD_FREE((char **)exts_i);
exts_i = NULL;
}
}