This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [Patch: mingw/cygwin] Don't strip '@' dangles from stdcall/fastcall dllimport references


"Dave Korn" <dave.korn@artimi.com> wrote on 13.07.2007 12:15:40:

> On 13 July 2007 11:09, Danny Smith wrote:
> 
> 
> > + /* _WIN64 does not decorate stdcall DLLIMPORTS with @n suffix,
> > +    _WIN32 does.  */
> > + #if TARGET_64BIT
> >   #undef  TARGET_STRIP_NAME_ENCODING
> >   #define TARGET_STRIP_NAME_ENCODING  i386_pe_strip_name_encoding_full
> > + #endif
> 
>  :)  I don't think you can use target flags like that.  Something 
> more like (untested):
> 
> 
> #undef  TARGET_STRIP_NAME_ENCODING
> #define TARGET_STRIP_NAME_ENCODING  i386_pe_strip_name_encoding_full
> 
> 
> /* Also strip the fastcall prefix and stdcall suffix.  */
> 
> const char *
> i386_pe_strip_name_encoding_full (const char *str)
> {
>   const char *p;
> -  const char *name = default_strip_name_encoding (str);
> +  const char *name;
> +
> +  if (!TARGET_64BIT)
> +    return name;
> +
> +  name = default_strip_name_encoding (str);
> 
>   /* Strip leading '@' on fastcall symbols.  */
>   if (*name == '@')
>     name++;

AFAICS this seems to be even better, because it avoids diffent 
configuration definitions. I am on to add function attribute dependent 
amd64 abi usage and there are target specific macros a bit disturbing ;)

Cheers,
 i.A. Kai Tietz

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
  OneVision Software Entwicklungs GmbH & Co. KG
  Dr.-Leo-Ritter-StraÃe 9 - 93049 Regensburg
  Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
  Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
  Handelsregister: HRA 6744, Amtsgericht Regensburg
  KomplementÃrin: OneVision Software Entwicklungs Verwaltungs GmbH
  Dr.-Leo-Ritter-StraÃe 9 â 93049 Regensburg
  Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÃftsfÃhrer: 
Ulrike DÃhler, Manuela Kluger


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]