aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorOdnetninI <odnetnininds@gmail.com>2017-02-23 17:13:57 +0100
committerGitHub <noreply@github.com>2017-02-23 17:13:57 +0100
commitbbdbc098dcfd6573b7934e3e3f8e6ce6dbd1da63 (patch)
tree5011f847ac998a7296ba43504124a25a0118d0d2 /examples
parent34e791376deeafa76b3bfad3b371b0142ba82e26 (diff)
downloadraylib-bbdbc098dcfd6573b7934e3e3f8e6ce6dbd1da63.tar.gz
raylib-bbdbc098dcfd6573b7934e3e3f8e6ce6dbd1da63.zip
Examples Linux Physics Fix
According to Man Pages, timespec with std=c99 needs "_POSIX_C_SOURCE 199309L". Due a some kind of bug, "#define _POSIX_C_SOURCE 199309L" doesn't work, so we must use "-D_POSIX_C_SOURCE=199309L" in compiler options.
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/Makefile b/examples/Makefile
index bef0fa11..ab70c5de 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -497,6 +497,13 @@ audio_module_playing: audio_module_playing.c
audio_raw_stream: audio_raw_stream.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
+# Linux Fix to timespect from
+ifeq ($(PLATFORM),PLATFORM_DESKTOP)
+ ifeq ($(PLATFORM_OS),LINUX)
+ CFLAGS += -D_POSIX_C_SOURCE=199309L
+ endif
+endif
+
# compile [physac] example - physics demo
physics_demo: physics_demo.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)