victorfisac / Physac

2D physics header-only library for videogames developed in C using raylib library.
http://www.victorfisac.com/physac
MIT License
432 stars 28 forks source link

C99 compilation fails #38

Closed filipencopav closed 4 years ago

filipencopav commented 4 years ago

Output

c99  -Wall -Wextra -Werror -O2  -pedantic -o main -lraylib -lglfw -lGL -lopenal -lm -lpthread -ldl main.c  
In file included from main.c:5:  
/usr/include/physac.h: In function ‘InitTimer’:  
/usr/include/physac.h:1905:21: error: storage size of ‘now’ isn’t known  
 1905 |     struct timespec now;  
      |                     ^~~  
/usr/include/physac.h:1906:23: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)  
 1906 |     if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) frequency = 1000000000;  
      |                       ^~~~~~~~~~~~~~~  
/usr/include/physac.h:1906:23: note: each undeclared identifier is reported only once for  each function it appears in  
/usr/include/physac.h: In function ‘GetTimeCount’:  
/usr/include/physac.h:1929:21: error: storage size of ‘now’ isn’t known  
 1929 |     struct timespec now;  
      |                     ^~~  
/usr/include/physac.h:1930:19: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)  
 1930 |     clock_gettime(CLOCK_MONOTONIC, &now);  
      |                   ^~~~~~~~~~~~~~~  
make: *** [Makefile:7: main] Error 1
victorfisac commented 4 years ago

Fixed.