// Rebuild with the following #define to use Raylib as a dynamic library
-// #define DYNAMICLIBS
+#define DYNAMICLIBS
#ifdef __APPLE__
#define LFRAYLIB \
-Subproject commit 011c66e9c2332506752b701fdfa37739dde67f6a
+Subproject commit d6f96a0fa0b51e77492eee931de23021f69326a1
compile(files[i].name);
}
- names = allocate((i + 1) * sizeof *names);
+ names = allocate(i + 1, sizeof*names);
for (i = 0; files[i].name; ++i) names[i] = files[i].name;
lflags = target->flags;
extern char **cflags, **lflags;
-void *allocate(size_t s);
+void *allocate(size_t num, size_t size);
void compile(char *src);
void load(char type, char *target, char **objs);
if (IsFileDropped()) {
files = LoadDroppedFiles();
if (xpm) free(xpm);
- xpm = allocate(FILENAME_MAX);
+ xpm = allocate(FILENAME_MAX, sizeof*xpm);
strcpy(xpm, files.paths[0]);
UnloadDroppedFiles(files);
texture = reloadtexture(xpm, mode);
debug = 1;
break;
case 'f':
- xpm = allocate(FILENAME_MAX);
+ xpm = allocate(FILENAME_MAX, sizeof*xpm);
strcpy(xpm, optarg);
break;
case 'h':
start = p;
for (; !space(*p) && *p != '['; ++p, --l) if (l == 0) return NULL;
l = p - start;
- r = allocate(l + 1);
+ r = allocate(l + 1, sizeof*r);
strncpy(r, start, l);
return r;
}
/* Colors */
- chars = allocate(ncolors * cpp * sizeof*chars);
- colors = allocate(NUMMODES * ncolors * sizeof*colors);
+ chars = allocate(ncolors * cpp, sizeof*chars);
+ colors = allocate(NUMMODES * ncolors, sizeof*colors);
for (i = 0; i < ncolors; ++i) {
p = data[1 + i];
strncpy(chars + i * cpp, p, cpp);
}
/* Pixels */
- pixels = allocate(NUMMODES * height * width * sizeof*pixels);
+ pixels = allocate(NUMMODES * height * width, sizeof*pixels);
j = width;
l = 0;
for (i = 0, pp = &data[1 + ncolors];