From: Kean Johnston <jkj@sco.com>
To: Mike Stump <mrs@apple.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Guidance please: static or extern __inline__
Date: Fri, 29 Jul 2005 22:03:00 -0000 [thread overview]
Message-ID: <42EAA797.4090603@sco.com> (raw)
In-Reply-To: <4195377E-0076-11DA-BCD4-003065BDF310@apple.com>
>> That's a pretty neat trick.
>
>
> I know, we've filed a patent for it, wait for it, no, wait, ok, just
> kidding... :-)
Hehehehe :)
>
>> I dont suppose I could trouble you to give me the voodoo required for
>> inserting an extra pushl before the call could I?
>
>
> Not sure exactly what you want, but with the below I think it will be
> obvious how to do it.
>
> void ioctl(int, unsigned long, char *) __attribute__((always_inline));
> asm inline void ioctl(int fd, unsigned long m, char *buf) {
> movl #42, 12($esp)
> movl fd, 8($esp)
> movl m, 4($esp)
> movl buf, ($esp)
> call _xioctl
> xorl $eax, $eax
> leave
> ret
> }
That does help with teh general mechanism. Unfortunately I can't
use inline, becuase ioctl is supposed to be declared as
int ioctl (int, int, ...);. I dont think you can have variadic
inline's can you?
This whole notion of fixing ABI issues in header files makes
my you-know-what's ache. Of course the *rest* of the world
has decent symbol versioning, but some of us are left in the
approximate mid-90's :(
I think I may just cheat and declare ioctl incorrectly, and
put in the 3rd arg. I suspect that is the path of least
resistance, although I have no doubt it will break some
standard. But since I'm shooting for a working, real-world
compiler, I find myself strangely comfortable with the idea
of ignoring a miniscule subclause here and there in a
standard I'm not certifying to :)
Thanks for all your help tho. It's much appreciated.
Kean
prev parent reply other threads:[~2005-07-29 22:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-28 16:12 Kean Johnston
2005-07-28 16:37 ` Gabriel Dos Reis
2005-07-28 17:49 ` Kean Johnston
2005-07-28 17:54 ` Daniel Jacobowitz
2005-07-28 18:32 ` Kean Johnston
2005-07-28 18:54 ` Daniel Jacobowitz
2005-07-28 19:05 ` Mike Stump
2005-07-28 19:43 ` Kean Johnston
2005-07-28 20:15 ` Gabriel Dos Reis
2005-07-28 20:33 ` Kean Johnston
2005-07-28 20:54 ` Mike Stump
2005-07-29 20:23 ` Kean Johnston
2005-07-29 21:18 ` Mike Stump
2005-07-29 22:03 ` Kean Johnston [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42EAA797.4090603@sco.com \
--to=jkj@sco.com \
--cc=gcc@gcc.gnu.org \
--cc=mrs@apple.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).