This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch[mingw/cygwin]: Fix dllimport "unmarking" thinko in winnt.c [Take 2]
- From: Christopher Faylor <cgf at redhat dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: gcc-patches at gcc dot gnu dot org, chorns at users dot sourceforge dot net
- Date: Tue, 11 Mar 2003 11:46:04 -0500
- Subject: Re: Patch[mingw/cygwin]: Fix dllimport "unmarking" thinko in winnt.c [Take 2]
- References: <20030311091719.29707.qmail@web21406.mail.yahoo.com>
On Tue, Mar 11, 2003 at 08:17:19PM +1100, Danny Smith wrote:
>"Christopher Faylor" wrote:
>
>> On Thu, Mar 06, 2003 at 09:16:18AM +1100, Danny Smith wrote:
>> >Hello,
>> >
>> >The modifications to provide __fastcall support
>> >
>> >http://gcc.gnu.org/ml/gcc-cvs/2002-12/msg00633.html
>> >
>> >introduced mistakes in config/i386/winnt.c.
>== 8< ==
>> Rather than using oldname += 3, wouldn't it make sense to define a
>constant
>> so that it was little more obvious what the "3" referred to?
>>
>> cgf
>
>
>Well, this cleans up a bit more than that to get rid of most of the magic
>numbers.
>
>I've replaced the use of DLL_IMPORT_EXPORT_PREFIX combined with the
>strings "e." and "i." with two new defines: DLL_IMPORT_PREFIX and
>DLL_EXPORT_PREFIX. These new symbolic constants get used throughout.
>This seemed to be easier to follow than fooling around with a lot of
>string/char concatenations
Rather than recalculating the strlen of the prefix repeatdly, couldn't
you just declare a DLL_IMPORT_EXPORT_PREFIX which was equal to the
sizeof DLL_IMPORT_EXPORT_PREFIX - 1? It just saves some unneeded cycles,
although, hmm, maybe gcc does this for you automatically.
cgf