tcc builds perform like crap, but it's nice to support a fourth
compiler. There is an issue on Linux with a Pulseaudio library not
linking correctly, however.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12795
d7cf8633-e32d-0410-b094-
e92efae38249
// d0_blind_id interface
#define D0_EXPORT
-#ifdef __GNUC__
+#if defined (__GNUC__) || (__clang__) || (__TINYC__)
#define D0_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define D0_WARN_UNUSED_RESULT
##### Extra CFLAGS #####
+ifneq ($(CC), tcc)
+ CFLAGS_MAKEDEP?=-MMD
+endif
-CFLAGS_MAKEDEP?=-MMD
ifdef DP_FS_BASEDIR
CFLAGS_FS=-DDP_FS_BASEDIR=\"$(DP_FS_BASEDIR)\"
else
else
CFLAGS_STANDARD=
endif
-CFLAGS_COMMON=$(CFLAGS_STANDARD) $(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_SND_XMP) $(CFLAGS_NET) $(CFLAGS_SDL) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
+
+CFLAGS_TCC=
+
+ifeq ($(CC), tcc)
+ CFLAGS_TCC=-DSDL_DISABLE_IMMINTRIN_H
+endif
+
+CFLAGS_COMMON=$(CFLAGS_STANDARD) $(CFLAGS_TCC) $(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_SND_XMP) $(CFLAGS_NET) $(CFLAGS_SDL) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
CFLAGS_CLIENT=-DCONFIG_MENU $(CFLAGS_VIDEO_CAPTURE)
CFLAGS_SERVER=
CFLAGS_DEBUG=-ggdb
Con_Printf("prvm_coverage: %s just executed a statement at %s for the first time. Coverage: %.2f%%.\n", prog->name, PRVM_WhereAmI(vabuf, sizeof(vabuf), prog, func, statement), prog->statements_covered * 100.0 / prog->numstatements);
}
-#if defined (__GNUC__) || (__clang__)
+#if defined (__GNUC__) || (__clang__) || (__TINYC__)
# ifndef CONFIG_PEDANTIC
# define HAVE_COMPUTED_GOTOS 1
# endif
// fall over
#define ROLL 2
-#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1400)
+#if defined(__GNUC__) || (__clang__) || (__TINYC__) || (_MSC_VER >= 1400)
#define RESTRICT __restrict
#else
#define RESTRICT
# include <TargetConditionals.h>
#endif
-#if defined(__GNUC__) && (__GNUC__ > 2)
+#if (__GNUC__ > 2) || defined (__clang__) || (__TINYC__)
#define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
#define DP_FUNC_PURE __attribute__ ((pure))
#define DP_FUNC_NORETURN __attribute__ ((noreturn))
# define DP_OS_STR "unknown"
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) || (__clang__)
# if defined(__i386__)
# define DP_ARCH_STR "686"
# define SSE_POSSIBLE
static int CPUID_Features(void)
{
int features = 0;
-# if defined(__GNUC__) && defined(__i386__)
+# if defined((__GNUC__) || (__clang__) || (__TINYC__)) && defined(__i386__)
__asm__ (
" movl %%ebx,%%edi\n"
" xorl %%eax,%%eax \n"