Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] [Makefile]: Undefine _GNU_SOURCE for rglfw.c #4732

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[build] [Makefile]: Undefine _GNU_SOURCE for rglfw.c
Currently, a warning about _GNU_SOURCE being redefined is emitted when
compiling rglfw.c

In file included from rglfw.c:99:
external/glfw/src/posix_poll.c:27:9: warning: "_GNU_SOURCE" redefined
   27 | #define _GNU_SOURCE
      |         ^~~~~~~~~~~
<command-line>: note: this is the location of the previous definition

This can be avoided by not defining _GNU_SOURCE on the command line for
this file.

Defining feature test macros in source code is not really good practice
so this should probably reviewed in glfw itself, at least to maybe check
 #ifdef _GNU_SOURCE first. But for now this change will suffice.

Fixes #4725
Peter0x44 committed Jan 27, 2025
commit 5ceebf58f2663c0678a4a5b5d6a937d1390db142
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -742,7 +742,7 @@ rcore.o : rcore.c raylib.h rlgl.h utils.h raymath.h rcamera.h rgestures.h

# Compile rglfw module
rglfw.o : rglfw.c
$(CC) $(GLFW_OSX) -c $< $(CFLAGS) $(INCLUDE_PATHS)
$(CC) $(GLFW_OSX) -c $< $(CFLAGS) $(INCLUDE_PATHS) -U_GNU_SOURCE

# Compile shapes module
rshapes.o : rshapes.c raylib.h rlgl.h