aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorgrischka <grischka>2009-05-05 20:30:39 +0200
committergrischka <grischka>2009-05-05 20:30:39 +0200
commitb8f6e1ae30572e0dba7ca1009ccd039b635b8995 (patch)
treed3702fc991f3f3e04a558cdb0f33de8a57b10f1f /tcc.h
parent92204e881834efae9f60e6cadf71fbb5f7f1c738 (diff)
downloadtinycc-b8f6e1ae30572e0dba7ca1009ccd039b635b8995.tar.gz
tinycc-b8f6e1ae30572e0dba7ca1009ccd039b635b8995.tar.bz2
move minor things from libtcc.c to other files
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/tcc.h b/tcc.h
index c074505..2890493 100644
--- a/tcc.h
+++ b/tcc.h
@@ -210,6 +210,9 @@ typedef struct Sym {
the other ones */
#define SHF_PRIVATE 0x80000000
+/* special flag, too */
+#define SECTION_ABS ((void *)1)
+
typedef struct Section {
unsigned long data_offset; /* current data offset */
unsigned char *data; /* section data */
@@ -580,9 +583,6 @@ struct TCCState {
#define countof(tab) (sizeof(tab) / sizeof((tab)[0]))
#endif
-/* WARNING: the content of this string encodes token numbers */
-static char tok_two_chars[] = "<=\236>=\235!=\225&&\240||\241++\244--\242==\224<<\1>>\2+=\253-=\255*=\252/=\257%=\245&=\246^=\336|=\374->\313..\250##\266";
-
#define TOK_EOF (-1) /* end of file */
#define TOK_LINEFEED 10 /* line feed */
@@ -655,12 +655,6 @@ enum tcc_token {
#undef DEF
};
-static const char tcc_keywords[] =
-#define DEF(id, str) str "\0"
-#include "tcctok.h"
-#undef DEF
-;
-
#define TOK_UIDENT TOK_DEFINE
#ifdef _WIN32
@@ -688,6 +682,16 @@ extern float strtof (const char *__nptr, char **__endptr);
extern long double strtold (const char *__nptr, char **__endptr);
#endif
+#ifdef _WIN32
+#define IS_PATHSEP(c) (c == '/' || c == '\\')
+#define IS_ABSPATH(p) (IS_PATHSEP(p[0]) || (p[0] && p[1] == ':' && IS_PATHSEP(p[2])))
+#define PATHCMP stricmp
+#else
+#define IS_PATHSEP(c) (c == '/')
+#define IS_ABSPATH(p) IS_PATHSEP(p[0])
+#define PATHCMP strcmp
+#endif
+
static char *pstrcpy(char *buf, int buf_size, const char *s);
static char *pstrcat(char *buf, int buf_size, const char *s);
static char *tcc_basename(const char *name);