#define RLHDR RLSRC "raylib"
#define RLLIB RLROOT "raylib" RLEXT
-#define CFGLOBALS "-Wall", "-Wextra", "-Wpedantic"
#define CFRAYLIB "-I" RLSRC
#define CFSRC "-I" SRC
RLSRC "rtextures", RLSRC "utils", \
RLSRC "rcore", RLSRC "rglfw"
-#define CFRLPLAT "-DPLATFORM_DESKTOP"
+#ifdef RLDYNAMIC
+#define CFRLGLOBAL "-DPLATFORM_DESKTOP", "-fPIC"
+#else
+#define CFRLGLOBAL "-DPLATFORM_DESKTOP"
+#endif
#define CFRLGLFW "-I" RLSRC "external/glfw/include"
#ifdef __APPLE__
#define CFRLX "-x", "objective-c"
build(NULL);
src = (char *[]){RLSRCS, NULL};
- cflags = (char *[]){CFRLPLAT, NULL};
+ cflags = (char *[]){CFRLGLOBAL, NULL};
for (i = 0; i < 6; ++i) compile(src[i], NULL);
- cflags = (char *[]){CFRLPLAT, CFRLGLFW, NULL};
+ cflags = (char *[]){CFRLGLOBAL, CFRLGLFW, NULL};
compile(src[6], NULL);
- cflags = (char *[]){CFRLPLAT, CFRLGLFW, CFRLX, NULL};
+ cflags = (char *[]){CFRLGLOBAL, CFRLGLFW, CFRLX, NULL};
compile(src[7], NULL);
#ifdef RLDYNAMIC
-Subproject commit 08b7229355a54a4339931411629bcb9ea48b5926
+Subproject commit 3f59e2fa436ef5d7e527fd39e52a050536669db7
int main(void) {
build(NULL);
- cflags = (char *[]){CFGLOBALS, NULL};
compile("error", NULL);
build("colors/");
build("font/");
- cflags = (char *[]){CFGLOBALS, CFRAYLIB, NULL};
+ cflags = (char *[]){CFRAYLIB, NULL};
compile("main", "error", RLHDR, "xpm", "font.c", NULL);
- cflags = (char *[]){CFGLOBALS, NULL};
+ cflags = NULL;
compile("options", "error", NULL);
- cflags = (char *[]){CFGLOBALS, CFRAYLIB, CFCBS, NULL};
+ cflags = (char *[]){CFRAYLIB, CFCBS, NULL};
compile("xpm", "error", RLHDR, "xpm", CBS "cbs.c", "colors.c", NULL);
#ifndef RLDYNAMIC
int main(void) {
build(NULL);
- cflags = (char *[]){CFGLOBALS, CFSRC, NULL};
+ cflags = (char *[]){CFSRC, NULL};
compile("gencolors", SRC "error", NULL);
load('x', "gencolors", SRC "error", "gencolors", NULL);
int main(void) {
build(NULL);
- cflags = (char *[]){CFGLOBALS, CFRAYLIB, CFSRC, NULL};
+ cflags = (char *[]){CFRAYLIB, CFSRC, NULL};
compile("genfont", SRC "error", RLHDR, NULL);
#ifndef RLDYNAMIC
ClearBackground(CLITERAL(Color){0xec, 0xec, 0xec, 0xff});
- width = GetRenderWidth();
- height = GetRenderHeight();
+ width = GetScreenWidth();
+ height = GetScreenHeight();
if (texture.id) {
scale = width * texture.height > height * texture.width
? (float)height / texture.height
return 0;
}
- if (r > 0xffffff || r < 0) {
+ if (r > 0xffffff) {
xpmerror("`0x%06x' is not a valid RGB color", r);
return 0;
}
}
if (cpid == -1 || waitpid(cpid, &status, 0) == -1
|| !WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS) {
- xpmerror("Unable to create `/tmp/libxpm.dylib'");
+ xpmerror("Unable to create `/tmp/libxpm" DYEXT "'");
goto munmap;
}
- if ((d = dlopen("/tmp/libxpm.dylib", 0)) == NULL) {
- xpmerror("Unable to load `/tmp/libxpm.dylib': %s", dlerror());
+ if ((d = dlopen("/tmp/libxpm" DYEXT, RTLD_LAZY)) == NULL) {
+ xpmerror("Unable to load `/tmp/libxpm" DYEXT "': %s", dlerror());
goto munmap;
}
if ((data = (char **)dlsym(d, a)) == NULL) {
- xpmerror("Unable to load image data from `/tmp/libxpm.dylib': `%s'",
+ xpmerror("Unable to load image data from `/tmp/libxpm" DYEXT "': `%s'",
dlerror());
goto dlclose;
}
if ((sizep = (long *)dlsym(d, "size")) == NULL) {
- xpmerror("Unable to load image length from `/tmp/libxpm.dylib': `%s'",
+ xpmerror("Unable to load image length from `/tmp/libxpm" DYEXT "': `%s'",
dlerror());
goto dlclose;
}
dlclose:
if (dlclose(d))
- xpmerror("Unable to unload `/tmp/libxpm.dylib': %s", dlerror());
+ xpmerror("Unable to unload `/tmp/libxpm" DYEXT "': %s", dlerror());
munmap:
if (munmap(map, l) == -1) xpmerror("Unable to unmap `%s' from memory", xpm);