macho and underscores on global function names

Mike Frysinger vapier at gentoo.org
Fri Mar 16 21:06:30 PDT 2007


On Friday 16 March 2007, Mark Charney wrote:
> That helped. I opted for this variant:
>
> %ifdef UNDERSCORE
> %define NAME(x) _ %+ x
> %else
> %define NAME(x) x
> %endif
>
> since it also allows me to cover both macho32, macho64 and cygwin-gcc
> behavior.  I can control the "-D UNDERSCORE"  flag on the command line from
> my build system.

well, i dont think the ABI prefix will ever change between these formats, so 
no reason you cant have:
%ifidfn __OUTPUT_FORMAT__,macho
% define NAME(x) _ %+ x
%elifidfn __OUTPUT_FORMAT__,win64
% define NAME(x) _ %+ x
....
%else
% define NAME(x) x
%endif

might be a way to chain those macho/win64/etc... together, but i'm not that 
strong with yasm preprocessing ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://cvs.tortall.net/pipermail/yasm-devel/attachments/20070317/4502a22d/attachment.pgp 


More information about the yasm-devel mailing list