aboutsummaryrefslogtreecommitdiff
path: root/tccpp.c
Commit message (Collapse)AuthorAgeFilesLines
* fix self-referential token pastingJoe Soroka2011-07-081-2/+14
|
* fix end-of-scope for self-referential macrosJoe Soroka2011-07-081-0/+2
|
* Remove unused variablesThomas Preud'homme2011-05-161-2/+1
| | | | | Remove unused local variables and declare them conditionally when they are used only on some architectures.
* tccpp: fix problem in preprocess_skip with empty #grischka2011-03-061-0/+2
| | | | | | | | for example: #ifdef stuff # /* some comment */ #endif
* Replace comment by a blankChangming Xu2011-03-011-7/+11
| | | | | | | | - fix my prev commit: put declaration above statements to stay c89 compatible - replace commit by a blank #define con(a, b) a/**/b this should yield a b, not ab
* tcc -E: append a ' ' after substChangming Xu2011-02-271-0/+10
| | | | | | | | | | We need a ' ' after subst of m in the following case #define m(name,r) name ## r #define m0(a,b,c) int m(a,b) c #define m1(a,b,c) int m(a,b)c m0(a, b, c); m1(a, b, c);
* tccpp: treat gas comments in .S files as raw text, not tokensJoe Soroka2011-02-231-0/+5
|
* fix crash with get_tok_str() in skip()grischka2011-02-041-1/+1
| | | | | crash was triggered by numbers etc. as unexpected token, i.e. everything that requires additional information with the token.
* tccpp: fix bug in handling of recursive macrosJoe Soroka2011-02-011-2/+15
|
* tccpp: fix token pasting ##grischka2010-11-251-5/+3
| | | | | This patch takes advantage of new function tcc_open_bf from previous commit.
* libtcc: new function tcc_open_bf to create BufferedFilegrischka2010-11-251-18/+13
| | | | | | | | Use it in: - tcc_open - tcc_compile_string - tcc_define_symbol - tcc_assemble_inline
* tcc: Draft suppoprt for -MD/-MF optionsKirill Smelkov2010-06-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In build systems, this is used to automatically collect target dependencies, e.g. ---- 8< (hello.c) ---- #include "hello.h" #include <stdio.h> int main() { printf("Hello World!\n"); return 0; } $ tcc -MD -c hello.c # -> hello.o, hello.d $ cat hello.d hello.o : \ hello.c \ hello.h \ /usr/include/stdio.h \ /usr/include/features.h \ /usr/include/bits/predefs.h \ /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs-32.h \ /home/kirr/local/tcc/lib/tcc/include/stddef.h \ /usr/include/bits/types.h \ /usr/include/bits/wordsize.h \ /usr/include/bits/typesizes.h \ /usr/include/libio.h \ /usr/include/_G_config.h \ /usr/include/wchar.h \ /home/kirr/local/tcc/lib/tcc/include/stdarg.h \ /usr/include/bits/stdio_lim.h \ /usr/include/bits/sys_errlist.h \ NOTE: gcc supports -MD only for .c -> .o, but in tcc, we generate dependencies for whatever action is being taken. E.g. for .c -> exe, the result will be: $ tcc -MD -o hello hello.c # -> hello, hello.d hello: \ /usr/lib/crt1.o \ /usr/lib/crti.o \ hello.c \ hello.h \ /usr/include/stdio.h \ /usr/include/features.h \ /usr/include/bits/predefs.h \ /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs-32.h \ /home/kirr/local/tcc/lib/tcc/include/stddef.h \ /usr/include/bits/types.h \ /usr/include/bits/wordsize.h \ /usr/include/bits/typesizes.h \ /usr/include/libio.h \ /usr/include/_G_config.h \ /usr/include/wchar.h \ /home/kirr/local/tcc/lib/tcc/include/stdarg.h \ /usr/include/bits/stdio_lim.h \ /usr/include/bits/sys_errlist.h \ /usr/lib/libc.so \ /lib/libc.so.6 \ /usr/lib/ld-linux.so.2 \ /lib/ld-linux.so.2 \ /usr/lib/libc_nonshared.a \ /lib/libc.so.6 \ /usr/lib/libc_nonshared.a \ /home/kirr/local/tcc/lib/tcc/libtcc1.a \ /usr/lib/crtn.o \ So tcc dependency generator is a bit more clever than one used in gcc :) Also, I've updated TODO and Changelog (in not-yet-released section). v2: (Taking inputs from grischka and me myself) - put code to generate deps file into a function. - used tcc_fileextension() instead of open-coding - generate deps only when compilation/preprocessing was successful v3: - use pstrcpy instead of snprintf(buf, sizeof(buf), "%s", ...)
* Revert "tccpp: Allow local labels to start with a dot"Daniel Glöckner2010-05-061-6/+0
| | | | | | This reverts commit f740485a5ab2ecef741bf1161b9feeea9c18cac0. It breaks access to structure elements starting with L
* Clean changes introduced by 47abdbdThomas Preud'homme2010-04-201-21/+0
| | | | | | | | | | | | * Replace the save/load_buffer_state by a dynarray approach: - Filename and libname are added to a dynarray when first encountered - Load repeatedly the files in the dynarray until no new undefined symbol are encountered * Replace snprintf by sprintf in libname_to_filename * Use tcc_fileextension in filename_to_libname * Introduce a tcc_strcpy_part fonction to copy only a subset of a string * Move new_undef_syms declaration from tcc.h to tccelf.c
* Better handle ld scriptsThomas Preud'homme2010-04-151-0/+21
| | | | | | | * search file from INPUT and GROUP commands in the library path in addition to the current directory * handle libraries specified by -lfoo options * Search lib in GROUP command repeatedly
* tccpp: Allow local labels to start with a dotDetlef Riekenberg2010-04-051-0/+6
| | | | | -- By by ... Detlef
* tccpp: Add missing bracket in an error messageDetlef Riekenberg2010-03-311-1/+1
|
* Fixed bug which prevent tcc preprocessor to ignore line number directivesAlexandre Becoulet2010-02-011-1/+1
|
* Dump the current token in skip(), when it's not the expected tokenDetlef Riekenberg2010-01-271-1/+1
|
* tccpp: signal missing #endif errorgrischka2010-01-141-2/+5
|
* tccpp: convert TOK_GET macro into functiongrischka2010-01-141-68/+63
|
* tccpp: warn about #define redefinitiongrischka2010-01-141-0/+19
|
* allow tcc be build from separate objectsgrischka2009-12-201-42/+179
| | | | If you want that, run: make NOTALLINONE=1
* tccpp: fix quirk with cached headers and #elsegrischka2009-08-241-1/+4
| | | | | | | | | | Such as with #ifndef FOO_H ... #else ... #endif
* tccpp: avoid double free with macro_ptr_allocated (after errors)grischka2009-08-241-0/+1
|
* cleanup: constify some global datagrischka2009-07-181-3/+4
|
* win32: treat long double as doublegrischka2009-07-181-0/+10
|
* win64: fix pointer <-> unsigned long typecast issuesgrischka2009-07-181-1/+5
|
* cleanup: stop abuse of sym->c for #define tokenstreamsgrischka2009-07-181-8/+10
|
* pp: return newline after directivegrischka2009-07-181-1/+2
|
* pp: simplify pasting, enable L ## numbergrischka2009-07-181-87/+25
|
* tcc_preprocess: add gcc-style include-depth flagsgrischka2009-06-171-7/+22
| | | | | | | | | # 1 "main.c" # 1 "include/stdio.h" 1 # 123 "include/stdio.h" 3 # 10 "main.c" 2 flags: 1: level++; 3: same-level 2: level--
* fix "cached include" optimizationgrischka2009-05-111-53/+58
| | | | | | | comparing the filenames as in the #include statement can be ambiguous if including files are in different directories. Now caches and checks the really opened filename instead.
* move static prototypes to libtcc.cgrischka2009-05-111-6/+11
|
* move some global variables into TCCStategrischka2009-05-111-3/+3
|
* move minor things from libtcc.c to other filesgrischka2009-05-051-0/+262
|
* move preprocessor to tccpp.cgrischka2009-05-051-0/+2643
|
* new files: tcc.h libtcc.c tccpp.c tccgen.cgrischka2009-05-051-0/+20