libretro / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
43 stars 19 forks source link

Build failed in openSUSE Tumbleweed #30

Open guoyunhe opened 4 years ago

guoyunhe commented 4 years ago

It seems caused by tinycthread. But openSUSE Leap 15.1 and 15.0 (older) works fine.

[ 12s] cc -DSQLITE_OMIT_LOAD_EXTENSION -DGIT_VERSION=\"\" -DINLINE="inline" -std=c99 -MMD -O2 -DNDEBUG -DLIBRETRO -I./src -I./deps/tinycthread -I./deps/noise -I./deps/lodepng -I./deps/sqlite -I./include -I./libretro -I./deps/libretro-common/include -fPIC -DHAVE_OPENGL -c src/main.c -osrc/main.o [ 12s] In file included from ./deps/tinycthread/tinycthread.h:81, [ 12s] from src/main.c:23: [ 12s] /usr/include/pthread.h:775:9: error: unknown type name 'clockid_t'; did you mean 'clock_t'? [ 12s] 775 | clockid_t clockid, [ 12s] | ^~~~~ [ 12s] | clock_t [ 12s] /usr/include/pthread.h:921:12: error: unknown type name 'clockid_t'; did you mean 'clock_t'? [ 12s] 921 | clockid_t clockid, [ 12s] | ^~~~~ [ 12s] | clock_t [ 12s] /usr/include/pthread.h:943:12: error: unknown type name 'clockid_t'; did you mean 'clock_t'? [ 12s] 943 | clockid_t __clockid, [ 12s] | ^~~~~ [ 12s] | clock_t [ 12s] make: *** [Makefile.libretro:483: src/main.o] Error 1

guoyunhe commented 4 years ago

Patched tinycthread.h :

diff -rub craft/deps/tinycthread/tinycthread.h craft-patched/deps/tinycthread/tinycthread.h
--- craft/deps/tinycthread/tinycthread.h    2019-10-25 01:39:05.150038579 +0300
+++ craft-patched/deps/tinycthread/tinycthread.h    2019-10-25 01:43:53.623190099 +0300
@@ -59,7 +59,6 @@

 /* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */
 #if defined(_TTHREAD_POSIX_)
-  #undef _FEATURES_H
   #if !defined(_GNU_SOURCE)
     #define _GNU_SOURCE
   #endif