CSC448: Code Generation: Naming and Differences Between Windows and Linux [81/133] |
Corin did not show
mystdout
is used to avoid clashes with
stdout
from the C standard library.
The code generator can generate the same code for both Windows and Linux.
There is one difference. On Windows, C function names must
be prefixed by underscores, e.g., _main
,
_malloc
, _printf
. On Linux, C
function names must not be prefixed by underscores, e.g.,
main
, malloc
, printf
.
Your code generator should generate C function names with underscores (not for COOL method names) as in the example. The Ant file:build.xml can remove the underscores.
If you are using Windows, remove or comment out the two
replace
elements in
file:build.xml.