[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Win: Add Unicode support for _tmain and _tWinMain

From: Alexander De Sousa
Subject: Re: [Tinycc-devel] Win: Add Unicode support for _tmain and _tWinMain
Date: Sat, 16 Aug 2014 20:37:45 +0200

Sorry for the delay, I couldn't reply earlier.

I agree source separation isn't needed, using the tchar header and modifying the build scripts would suffice, but I wouldn't know how to modify the one for CMake accordingly.

I don't see the need to the flag being added outside of the pe_add_runtime() function, unless Unicode builds are to be detected using the _UNICODE macro. If you intend to detect an Unicode build when adding the appropriate startup code you just need to check in pr_add_runtime() if it is such a build or not (that's what the pe_is_unicode() was intended for).

As grischka mentioned directly executing Unicode builds would require the TCC executable to be an Unicode build as well, and it would then need to take care of the encoding conversion when running programs that use the traditional variable-width strings. Personally, I don't think there's much benefit in being able to run Unicode builds directly (passing Unicode arguments via a cmd requires the default setup to be changed at least).

Attached to this email are a set of patches atop the current mob head:
 - 001: Modifies crt1.c and wincrt1.c to add support for Unicode builds.
 - 002: Enables such modifications in the Windows build script (build-tcc.bat) and for Linux->Win32 cross compilations.
 - 003: Replaces the ternary operator structure by the equivalent if-else tree in tccpe.c.
 - 004: Finally enables Unicode builds modifying tccpe.c, throws an error if a Unicode build is detected to be directly ran.


Attachment: 001-add-unicode-startup-code-to-libtcc.patch
Description: Binary data

Attachment: 002-enable-unicode-startup-code-in-build-scripts.patch
Description: Binary data

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

Attachment: 004-enable-support-for-unicode-programs.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]