Commit Graph

35 Commits

Author SHA1 Message Date
acqn 43d2fd2a96 Added support for the popular __COUNTER__ macro. 2022-07-24 23:19:05 +08:00
acqn bb9c98f4c9 Added support for the #line directive. 2022-07-24 23:19:05 +08:00
acqn 60c1290468 Fixed the bug that preprocessor could run past the end of included files.
Fixed the wrong filename and 0 line number in disgnostics when a preprocessor error occurred at the end of a file.
Fixed diagnostics for missing #endif.
2022-07-26 21:10:26 +08:00
Greg King a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
Greg King 0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt 4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Oliver Schmidt 85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
uz f9729fd0cf Use the new FileStat function to get correct file modification times under
Windows.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5633 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-04-01 17:01:05 +00:00
uz 5449f21d9f When generating the dependency file, escape spaces in file names.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5307 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-12-05 21:32:59 +00:00
uz 314893619a Don't ignore empty paths when adding the path of a file to the search path
list.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4674 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-29 21:20:48 +00:00
uz 02f5b5499e Changed search path logic: Include files are now search first in the directory
containing the file that had the #include statement. The path of the main file
will also added to the front of the search path list, so includes will not be
search in the current directory first, but in the directory that contains the
main file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4673 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-28 12:00:12 +00:00
uz 05f7296369 Restructured search path handling.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4662 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-09 10:54:15 +00:00
uz d54ca88743 Added a new option --dep-target to the compiler. This option allows to set the
target in the generated dependency file. The cl65 utility will use this option
to override the depdendency target, if actual object files are to be generated
from C input. So the generated dependency will not have the intermediate .s
file as target, but the final .o file, which allows to use the dependency
files without further processing.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4660 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-02 09:56:40 +00:00
uz 96cf7f6271 Changed generation of makefile dependencies:
* There are now two options, --create-dep and --create-full-dep. One
    will add system includes, the other not.
  * Both options require a file name. This is an incompatible change(!)
    but has the advantage that the user is in control of extension and
    path of the generated file.
  * Output will always include a phony target for the input files. This
    may not work with all make programs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4652 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-01 09:42:12 +00:00
uz 2e6d218801 Remember the type of the input file. This may be used later to create more
variants of dependency files.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4645 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-22 19:40:50 +00:00
uz 583b9f8fcc Removed an unused function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4361 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-11 15:10:55 +00:00
cuz 45ffbc59f5 Fixed a problem with files that don't end with a newline
git-svn-id: svn://svn.cc65.org/cc65/trunk@3697 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-01-20 21:17:08 +00:00
cuz 84706bd2d5 Fixed portability problems with va_copy. In three places, calls to fstat
had to be replaced by calls to stat, because fileno is no longer available
when forcing the compiler into pure c89 (or c99) mode.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3683 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-12-11 12:40:51 +00:00
cuz 0da97c6711 Fixed a bug: Compiling an empty source file led to an internal error.
Changed the lineinfo module to take dynamically allocated string buffers
instead of char*.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3523 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-06-08 11:31:00 +00:00
cuz 06b57e6e7e Introduce a -E flag that activates just the preprocessor.
Use variable sized string buffers for input and macro processing instead
of the fixed buffers used before.
Many changes in the preprocessor to make it more standards compliant (which
it is still not).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3182 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-09-16 12:42:41 +00:00
cuz 98da4b5811 Added debugging output
git-svn-id: svn://svn.cc65.org/cc65/trunk@2189 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-06-03 07:25:49 +00:00
cuz 1f20202239 Ignore also cr's on input. This allows to compile sources with DOS/Windows
line separators on unix systems.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1419 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-09-30 19:32:33 +00:00
cuz f3f42c43e5 Use fstat instead of stat and simplify the code
git-svn-id: svn://svn.cc65.org/cc65/trunk@750 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-23 21:44:14 +00:00
cuz bc8f4f3a1e Added .dbg statement generation for the assembler
git-svn-id: svn://svn.cc65.org/cc65/trunk@744 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 20:03:26 +00:00
cuz 0e80187cec Added the lineinfo module. Changed the complete code generation to use the
supplied data structures. Re-added the -T option which is much more exact
now because of the better line info stuff.
Cleanups in the scanner (remove old #defines).


git-svn-id: svn://svn.cc65.org/cc65/trunk@740 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 09:32:24 +00:00
cuz 9d1940a124 Working on the new backend
git-svn-id: svn://svn.cc65.org/cc65/trunk@700 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-01 09:21:32 +00:00
cuz 544705e6f4 * Added several type casts to increase C++ compatibility.
* __fixargs__ is now an actual function symbol and no longer handled in the
   scanner.
 * Additional symbol __argsize__ that is a constant in normal functions and
   a const local variable for variadic functions. Using this symbol, the
   va_arg macro gets a lot simpler and smaller.
 * Added special code to handle the fixed parameters of a variadic function.
   The code has some overhead, but the va_fix macro is no longer needed (and
   the compiler generated code is better than va_fix anyway).


git-svn-id: svn://svn.cc65.org/cc65/trunk@652 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-03-23 19:17:04 +00:00
cuz 221ef5a9c2 Error handling cleanup/changes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@369 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-10-15 19:52:01 +00:00
cuz 5abb3954a6 Rewrote the input file management.
Added preliminary version of the dependency file creation.


git-svn-id: svn://svn.cc65.org/cc65/trunk@309 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-09-01 19:20:32 +00:00
cuz e133416d05 Moved the check module to the common dir.
Replaced the type constants by something more expandable.


git-svn-id: svn://svn.cc65.org/cc65/trunk@248 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-01 15:04:35 +00:00
cuz 04ee693c00 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@91 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-21 21:02:44 +00:00
cpg e27fafbea3 set MAX_INC_NESTING to 20
git-svn-id: svn://svn.cc65.org/cc65/trunk@90 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-21 00:10:12 +00:00
cuz c31008c78a Remove io.*, some cleanup
git-svn-id: svn://svn.cc65.org/cc65/trunk@87 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-15 19:03:01 +00:00
cuz 4b1abd7cc9 Better error messages when opening include files
git-svn-id: svn://svn.cc65.org/cc65/trunk@83 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-14 21:07:58 +00:00
cuz aa8737733f Use the xmalloc module from the common directory.
Rewrote the include file management, keeping a list of all include files
and cleaning up the code while going.


git-svn-id: svn://svn.cc65.org/cc65/trunk@82 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-14 21:01:37 +00:00