Commit graph

122 commits

Author SHA1 Message Date
Dale Weiler
9fee84f250 less globals 2013-04-25 12:08:13 +00:00
Wolfgang Bumiller
3a4aba0b31 Grrrr 2013-04-24 17:47:42 +02:00
Dale Weiler
6284cc673d typo 2013-04-24 04:50:07 +00:00
Dale Weiler
b3fc77efd6 Implemented __TIME_STAMP__ predef, expands to a timestamp of when the __FILE__ was last modified, returned in the format: "Www Mmm dd hh:mm:ss yyyy", where Www is the weekday, Mmm the month (in letter), dd the day of the month, hh:mm:ss the time, and yyyy the year. 2013-04-24 04:48:05 +00:00
Dale Weiler
35988b6191 Make ftepps __NULL__ translate to gmqccs untyped nil keyword (this isn't correct behaviour of the __NULL__ constant, but it works) 2013-04-24 04:17:17 +00:00
Dale Weiler
489ad486bc Get it compiling in visual studio again. 2013-04-24 01:43:53 +00:00
Dale Weiler
10738da2fb Make it compile as C++ code too 2013-04-23 22:50:47 +00:00
Dale Weiler
160e7cf7ee Remove trailing whitespace 2013-04-21 10:24:55 +00:00
Dale Weiler
dc7e18ec73 Some inline never hurt anyone .. actually, C made a bad decision in it's design, everything should've always been implicitly inline, since most code back in the day was small, if you had large bodies, there should've been an 'outline' keyword for that instead :P 2013-04-17 11:02:42 +00:00
Dale Weiler
0b0b6423ba Use hashtable for macro definitions in the preprocessor, this speeds up the search for them, and the removal of them making it O(1) instead of O(n). This also makes my 30 second xonotic compiles take only 13 seconds 2013-04-17 10:51:33 +00:00
Dale Weiler
d7be99c9dd More perliminary reworking for threading 2013-04-17 06:30:09 +00:00
Dale Weiler
c2b5a95961 GCC specific stuff compile flags. 2013-04-15 06:23:13 +00:00
Dale Weiler
ef528d6710 Added tracing to strdup for allocations, fixed some memleaks, this isn't pretty (trying to track down some weird memory leak issues) 2013-04-14 23:51:16 +00:00
Dale Weiler
3e7340c52c More external function flatening (less external symbols) 2013-04-14 01:07:39 +00:00
Dale Weiler
3f40fcb965 Fix possible buffer overflows. 2013-04-13 18:17:15 +00:00
Dale Weiler
95172861f5 Fix possible bug 2013-04-13 18:04:07 +00:00
Dale Weiler
c74889f648 Fix some memory leaks. 2013-04-13 18:01:26 +00:00
Wolfgang Bumiller
3593a1b6b8 Merge branch 'master' into cooking 2013-02-12 14:31:27 +01:00
Wolfgang Bumiller
1dfd375738 include: guard the actual inclusion with ftepp->output_on so that include inside #if 0 doesn't happen 2013-02-11 12:13:27 +01:00
Dale Weiler
c8959a2452 BOOM 2013-02-10 13:57:22 +00:00
Dale Weiler
a568d43487 Implemented __VA_COUNT__ 2013-02-08 12:30:17 +00:00
Dale Weiler
8d59d7029d Cleanup cargocult directory and file specific things, to fs.c (renamed file.c which also contains directory handling stuff). Also cleaned up some stuff, and added proper end comments to conditional inclusion stuff. 2013-02-08 12:06:59 +00:00
Wolfgang Bumiller
530dbd85b2 properly mask #message, #warning, #error by ftepp->output_on 2013-02-03 23:23:50 +01:00
Dale Weiler
5f9f6c11b8 Get it compiling with C++ compilers again. 2013-01-30 06:49:50 +00:00
Dale Weiler
e12d492d67 Removing #error/#warning/#message from parser, and making it part of preprocessor as directives again. 2013-01-30 05:49:08 +00:00
Dale Weiler
36c5722273 Rename 2013-01-30 05:35:07 +00:00
Dale Weiler
d201cfe6b4 Work in progress options cleanup. 2013-01-30 05:24:30 +00:00
Dale Weiler
76614b311e s/WARN_PREPROCESSOR/WARN_CPP/g (to stay somewhat compatible with gcc/clang warnings for the preprocessor) 2013-01-30 01:32:10 +00:00
Dale Weiler
3d35804a7d Removed #warning and #error from ftepp, and made it part of the parser routine. These are "directives" that should exist regardless if -fftepp is enabled, like #pragma. Implemented #warning, #message and #error as directives in parser instead. 2013-01-30 01:24:58 +00:00
Dale Weiler
7ea1033a43 Handle all possible subscript errors 2013-01-27 21:31:18 +00:00
Dale Weiler
1597f38f45 Better handling of __VA_ARGS__ subscripting. 2013-01-27 21:27:50 +00:00
Dale Weiler
6fc5b32123 Fix warning, and better tests for __VA_ARGS__ 2013-01-27 13:03:02 +00:00
Dale Weiler
b4fbba5708 Implement subscripting for __VA_ARGS__, and added test-case. This only works on INTCONST for now. 2013-01-27 12:55:56 +00:00
Wolfgang Bumiller
d5ba5a6e6a linenumbers and macros are stupid 2013-01-16 23:34:54 +01:00
Wolfgang Bumiller
7d2b0e9638 more linenumber madness 2013-01-16 22:58:43 +01:00
Wolfgang Bumiller
dfad837f5b this might fix some linenumbering, I hope 2013-01-15 22:29:44 +01:00
Wolfgang Bumiller
dfa6d0c9ad call ftepp_recursion_header/footer only when there are newlines in the expanded macro 2013-01-15 22:03:16 +01:00
Wolfgang Bumiller
4d72c85f73 __STD_QCCX__ on -std=qccx - I have no idea about what qccx does/can do but at least now -fftepp includes the macros... 2013-01-06 20:52:12 +01:00
Wolfgang Bumiller
9edae7fa0a Merge remote-tracking branch 'origin/pp-unary-numbers' 2013-01-03 14:58:02 +01:00
Dale Weiler
9bda8f61f4 Add specialized diagnostics for when predefined macros are used and ftepp predefined macros are not enabled. 2013-01-03 12:04:32 +00:00
Dale Weiler
a2f63aae33 Implemented __TIME__ for ftepp 2013-01-02 21:53:46 +00:00
Dale Weiler
908f6ded8a Implemented __DATE__ for ftepp 2013-01-02 21:51:22 +00:00
Wolfgang Bumiller
654eceb33b Allow unary minus in ftepp_if_value 2013-01-02 17:26:35 +01:00
Wolfgang Bumiller
38a664ed72 __VA_ARGS__ support 2013-01-02 14:15:16 +01:00
Wolfgang Bumiller
3c212c8389 fix a leak: delete the output string of macro calls 2013-01-02 10:45:55 +01:00
Wolfgang Bumiller
dce7a0c72b update old_string on failure in ftepp_macro_expand to not segfault on a preprocessor-error inside recursive preprocessor calls 2013-01-02 10:44:39 +01:00
Wolfgang Bumiller
c7280fca52 when recursinve into macros copy the previous line number; fixes macros showing line 1 for each error 2013-01-02 10:35:00 +01:00
Dale Weiler
29db4a44ed Happy new years! 2013-01-01 05:08:55 +00:00
Wolfgang Bumiller
048ef3e796 fix: ftepp_delete needs to ftepp_flush to not cause a leak on errors 2012-12-30 10:37:15 +01:00
Dale Weiler
8f34e9fa37 added util_vasprintf/util_asprintf .. so we can stop assuming a certian static array size for formatting strings ... I expect to see full migration to this before the next release for protection of over/under flows. As well as identifers >= 1024 bytes :) 2012-12-28 15:02:53 +00:00