[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Building Unicode applications with TCC inWindows.
From: |
YX Hao |
Subject: |
Re: [Tinycc-devel] Building Unicode applications with TCC inWindows. |
Date: |
Sun, 6 Jul 2014 21:04:33 +0800 |
Hi,
> James Russell Moore
>
> 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.
Try:
Findstr /s /n /r /c:"[^a-z]main[^a-z]" *.c
You will see the related codes for linking stage, together with the crt codes.
You known what linking does, you get the points.
I think it needs _start/_wstart pairs and linking process.
I searched gcc and ld codes to see how it could be made, but didn't get it.
>
>
> 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.
So you need it.
>
>
> 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.
Some one experienced, like grischka, may be interested to implement this
capability for TCC.
Regards.