[Top][All Lists]

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

Re: [Tinycc-devel] Building Unicode applications with TCC in Windows.

From: James Russell Moore
Subject: Re: [Tinycc-devel] Building Unicode applications with TCC in Windows.
Date: Sun, 6 Jul 2014 13:59:39 +0200

On Sat, Jul 5, 2014 at 4:32 PM, Daniel Glöckner <address@hidden> wrote:
In crt1.c declare main and wmain as weak.
In _start call __getmainargs/main if main and __wgetmainargs/wmain
if !main.

I searched around for weak symbols because I didn't know about them, thanks. I tried to declare them as weak but it seems not to be working (in Windows maybe?). I tried placing the __attribute__((weak)) before the semicolon and before the return type of the functions, in any case errors were shown about the missing main or wmain function depending on the setting. GCC also allows for a pragma but I think that's not implemented in TCC.

On Sat, Jul 5, 2014 at 4:52 PM, YX Hao <address@hidden> wrote:
Something more, on windows use a Unicode console environment is not convenient. It's not the default. You may need change the setting times, up and down.
You really want to pass any Unicode argv? Usually there are functions for wide chars can be used.

In a Unicode setting I know how long a character is, I can iterate through the characters of a string in the same way as if they were simple chars. If not using Unicode the characters may use more than 1 byte, so it's more complicated to know their length. I could interpret char to be in UTF-8 to be UTF-8 too I guess as in Linux, but in Windows things seem to get more complicated with code pages and the like. Think for example about creating a name of a file with Unicode characters or output an echo of the command line.

On Sat, Jul 5, 2014 at 10:12 PM, Carlos Montiers <address@hidden> wrote:
Look these code adapted from my current develop of bg tool

Thanks, that works with TCC without any modification, overriding the _start routine works fine for Unicode builds but it'd have to be conditional in the program to allow for interoperability with other compilers.

reply via email to

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