3 minor compatibility fixes#537
Conversation
|
Because of RGFW's nature as a single header library, it's fairly hard to enforce a posix standard without forcing the user to use RGFW in a specific way. I want to try to avoid that, which unfortunately leads to issues such as this. |
"so it wouldn't try to include X11/extensions/Xrandr.h." Shows me that you are thinking about issues in a very surface level way. Xrandr is being included because RGFW is using the X11 backend, because |
| #$(CC) -x c $(CUSTOM_CFLAGS) -c RGFW.h -D RGFW_IMPLEMENTATION -fPIC -D RGFW_EXPORT | ||
| cp RGFW.h RGFW.c | ||
| $(CC) $(CUSTOM_CFLAGS) -c RGFW.c -D RGFW_IMPLEMENTATION -fPIC -D RGFW_EXPORT | ||
| $(CC) $(CUSTOM_CFLAGS) $(LIBS) -c RGFW.c -D RGFW_IMPLEMENTATION -fPIC -D RGFW_EXPORT |
There was a problem hiding this comment.
I don't really like this fix because this also adds other files into the command unnecessarily
There was a problem hiding this comment.
I thought about separating it into it's own variable, but decided against, since I don't think libs affect .o file in any way.
There was a problem hiding this comment.
Feel free to test it and let me know, I personally think separating it into it's own variable might be the way to go.
I simply quoted the error message, I understand the issue. Maybe I should've phrased it better. |
|
If you're going to make a PR fixing an issue I want more than quoting an error that has nothing to do with the root of the issue. I'm sorry if that sounds harsh but I have found a lot of frustration when reviewing other's code or trying to understand issues others are facing comes down to the difference in thought process. |
|
The OSX issue can probably be fixed by changing from |
I think having both
Sorry, I will try to word my reasoning better next time.
I'm not experienced with OSX, but adding Edit: |
Yeah, that seems to be true. It's not a very satisfying fix unfortunately. |
|
From what I can tell, defining |
|
Also there seems to be a rule in Makefile for building |
|
Looks good. I think |
-Werror=formaton 32-bit platforms._POSIX_C_SOURCE, which is the portable/intended way to define posix version, but also keeps__USE_POSIX199309. The latter macro, from what I can tell, is internal to GLIBC. I would've removed it completely, but then it breaks examples while compiling on GLIBC, due to stdio.h and other parts of standard library being included before_POSIX_C_SOURCEdefinition. So to avoid breaking examples(and probably someone else's code),__USE_POSIX199309is kept. If I were to choose, I would remove it in the next major release, but maybe it is a good idea to keep it as is for compatibility.-D RGFW_WAYLANDto RGFW.c flags viaLIBS, so it wouldn't try to includeX11/extensions/Xrandr.h.