Open Icenowy opened 9 years ago
This is a good idea. Can you make the following changes before I merge:
compile_as_library
to the code generator, pass it to Parser::parse()
instead. Then in Parser::module()
, if compile_as_library
is true, do not insert the main function at all. The code generator will then check if a main function is defined before inserting a call to it.if(!compile_as_library) {
should have a space between if
and (
.Yet, I'll fit the coding style... But I tried to prevent it from creating 'main', and failed...Then I stashed the code
@Icenowy If you let me know what was failing, I can help you get it fixed.
I tried to disable the code of global var generating, main generating and allowed the main function pointer to be NULL
Yes, I think that's the best way to do it. Let me know if you have problems implementing it.
Pulled from upstream.
-L
.test
to Makefile. Added -Wall
flag.NEW DEFECT It seems that abort()
causes segfaults in cygwin when I tried to open an inexist file.
Uh-oh I misspelled conflict.
Only ignored things about "main"... It's provided by a parameter "-l". If you don't care, I may port autobuild3(https://github.com/AOSC-Dev/autobuild3)'s plug-able library architecture to bish.