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.
This commit is contained in:
parent
34e791376d
commit
bbdbc098dc
1 changed files with 7 additions and 0 deletions
|
@ -497,6 +497,13 @@ audio_module_playing: audio_module_playing.c
|
||||||
audio_raw_stream: audio_raw_stream.c
|
audio_raw_stream: audio_raw_stream.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
$(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
|
# compile [physac] example - physics demo
|
||||||
physics_demo: physics_demo.c
|
physics_demo: physics_demo.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue