From 9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5 Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 9 Jul 2017 12:07:40 +0200 Subject: unsorted adjustments - configure * use aarch64 instead of arm64 - Makefile * rename the custom include file to "config-extra.mak" * Also avoid "rm -r /*" if $(tccdir) is empty - pp/Makefile * fix .expect generation with gcc - tcc.h * cleanup #defines for _MSC_VER - tccgen.c: * fix const-propagation for &,| * fix anonymous named struct (ms-extension) and enable -fms-extension by default - i386-gen.c * clear VT_DEFSIGN - x86_64-gen.c/win64: * fix passing structs in registers * fix alloca (need to keep "func_scratch" below each alloca area on stack) (This allows to compile a working gnu-make on win64) - tccpp.c * alternative approach to 37999a4fbf3487b363fd0c2f9b7ab622401b202a This is to avoid some slowdown with ## token pasting. * get_tok_str() : return for TOK_EOF * -funsigned-char: apply to "string" literals as well - tccpe/tools.c: -impdef: support both 32 and 64 bit dlls anyway --- tcc.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index 67d09a0..958dae7 100644 --- a/tcc.h +++ b/tcc.h @@ -41,10 +41,11 @@ # include # endif /* XXX: need to define this to use them in non ISOC99 context */ - extern float strtof (const char *__nptr, char **__endptr); - extern long double strtold (const char *__nptr, char **__endptr); +extern float strtof (const char *__nptr, char **__endptr); +extern long double strtold (const char *__nptr, char **__endptr); +#endif -#else /* on _WIN32: */ +#ifdef _WIN32 # include # include /* open, close etc. */ # include /* getcwd */ @@ -52,7 +53,6 @@ # include # endif # define inline __inline -# define inp next_inp /* inp is an intrinsic on msvc */ # define snprintf _snprintf # define vsnprintf _vsnprintf # ifndef __GNUC__ @@ -65,6 +65,7 @@ # define LIBTCCAPI __declspec(dllexport) # define PUB_FUNC LIBTCCAPI # endif +# define inp next_inp /* inp is an intrinsic on msvc/mingw */ # ifdef _MSC_VER # pragma warning (disable : 4244) // conversion from 'uint64_t' to 'int', possible loss of data # pragma warning (disable : 4267) // conversion from 'size_t' to 'int', possible loss of data @@ -72,9 +73,6 @@ # pragma warning (disable : 4018) // signed/unsigned mismatch # pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned # define ssize_t intptr_t -# define __attribute__(x) __declspec x -# define aligned align -# else # endif # undef CONFIG_TCC_STATIC #endif @@ -83,12 +81,12 @@ # define O_BINARY 0 #endif -#ifdef __GNUC__ -# define NORETURN __attribute__ ((noreturn)) -#elif defined _MSC_VER +#ifdef _MSC_VER # define NORETURN __declspec(noreturn) +# define ALIGNED(x) __declspec(align(x)) #else -# define NORETURN +# define NORETURN __attribute__((noreturn)) +# define ALIGNED(x) __attribute__((aligned(x))) #endif #ifdef _WIN32 @@ -540,7 +538,7 @@ typedef struct BufferedFile { int *ifdef_stack_ptr; /* ifdef_stack value at the start of the file */ int include_next_index; /* next search path */ char filename[1024]; /* filename */ - char filename2[1024]; /* filename not modified by # line directive */ + char *true_filename; /* filename not modified by # line directive */ unsigned char unget[4]; unsigned char buffer[1]; /* extra size for CH_EOB char */ } BufferedFile; -- cgit v1.3.1