aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorgrischka <grischka>2017-07-09 12:07:40 +0200
committergrischka <grischka>2017-07-09 12:07:40 +0200
commit9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5 (patch)
tree2ed2cab29b41d9b17c434d4a15565fb3e8387345 /tcc.h
parent6c468c10f70d74e962591a0584765e42ce1bcaf2 (diff)
downloadtinycc-9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5.tar.gz
tinycc-9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5.tar.bz2
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 <eof> for TOK_EOF * -funsigned-char: apply to "string" literals as well - tccpe/tools.c: -impdef: support both 32 and 64 bit dlls anyway
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/tcc.h b/tcc.h
index 67d09a0..958dae7 100644
--- a/tcc.h
+++ b/tcc.h
@@ -41,10 +41,11 @@
# include <dlfcn.h>
# 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 <windows.h>
# include <io.h> /* open, close etc. */
# include <direct.h> /* getcwd */
@@ -52,7 +53,6 @@
# include <stdint.h>
# 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;