Hi all, a couple of weeks ago I was looking into implementing Unicode entry 
points support as well, attached to this email there are the result patches 
against the head of the mob branch from that time.

It was only preliminary support for command line applications (no proper 
tests), adding support for GUI applications would follow the same scheme.

Some thoughts on the matter:
 - Separated startup code for Unicode entry points seem to be a must, I 
couldn't find any way of doing it using the current crt1 and wincrt1.
 - Third patch in a nutshell: check whether the wmain symbol is defined or not 
and choose the Unicode start point if it is, the appropriate startup is added 
through add_elf_sym and friends.
 - I didn't realize at the time, but the pe_is_unicode() function I defined 
could be replaced for a call to find_elf_sym.
 - Since Unicode builds are actually triggered by the _UNICODE macro being 
defined, an Unicode build could probably be identified already when the macro 
is detected to be defined. Maybe activating a flag at that point instead of 
looking for wmain or wWinMain when adding the startup code.

Committing the second patch is probably a good idea regardless of 
Unicode support being added, I think it helps maintainability.

Regards,
Alex.                                     

Attachment: 001-add-crt-startup-code-for-unicode-console-programs.patch
Description: Binary data

Attachment: 002-replace-ternary-operator.patch
Description: Binary data

Attachment: 003-add-support-for-unicode-console-builds.patch
Description: Binary data

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to