[cairo] Cairo ported to OS/2 - Suggestions

Carl Worth cworth at cworth.org
Thu Aug 18 10:11:40 PDT 2005


On Wed, 17 Aug 2005 11:44:55 +0200, Doodle wrote:
> Basically, the problem is that if the calling convention is not
> declared, then the compiler will use the default one, which is based
> on compiler switches.

Huh?

"Compiler default" is one thing.
"Compiler switches" is another.

Is there actually any problem that occurs when not overriding the
compiler's default behavior for calling convention with switches?

If not, then I don't see why cairo should change anything. At that
point, it would become a matter of "If you want to force some
non-default calling convention, then you have to do that globally."

This just looks like a packaging (eg. build-time) issue to me, and
nothing that needs to be changed upstream in the cairo source.

> For a real-live example:
> I usually compile all the code with the -5r switch of the OpenWatcom
> compiler. It instructs the compiler to use register based calling
> convention by default, for speed.

I don't understand. If we were to put something like the patch you
proposed into cairo, then you would no longer be able to use -5r to
get the register-based calling convention. In that case we would
actually be disabling whatever optimization you're trying to achieve
here. That's not what you are trying to achieve is it?

> If anybody wants to use that DLL from an application which was
> compiled with the -5s switch (or without optimization turned on),
> that application will crash when calls into my DLL.

So these compiler-specific options have to be applied consistently
throughout the stack. That sounds really painful to to use, but that's
certainly nothing to do with cairo.

As far as I can tell, the proposed patch adds non-C stuff to public
cairo headers solely to disable compiler-specific options, (and in
particular, compiler-specific options that make programs break unless
the options are applied consistently throughout the entire stack).

If this whole calling convention twiddling actually makes a
significant difference, then the only reliable way to make this all
work would be a compile-time way to shove the desired convention into
the header file. Without that, we're doing header uglification for no
benefit on any system.

Have you measured cairo as performing better after tweaking calling
conventions?

> However, once you'll agree to include that calling convention thing

I'm certainly not there yet.

> > I think it would be quite easy to write a little script that extracts
> > the public symbols out of the header files.
...
> Yes, that would also help me a lot, I wouldn't have to look through the
> public header files myself for changes after every release.

Feel free to take a whack at it.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050818/82c649ab/attachment-0001.pgp


More information about the cairo mailing list