Hello,

I've put together a few patches to compile CallWeaver on
Solaris/OpenSolaris. They also address the issues that arise when
compiling with Sun Studio instead of gcc. I'd like someone to review
them; they are located at
http://jucr.opensolaris.org/review/packages/385/ .

Here's a quick summary of what they do and where I'd like to correct
them anyway before submission:

01-configure: this changes some compilation flags (has to be made
conditional for non-gcc compilers) and looks for lber-2.4 instead of
lber. The best approach would probably be: look for lber, and if it
isn't there, for lber-2.4. This is needed with gcc too.

02-strdupa: this creates a strdupa macro for compiler platforms that
don't support __extension__ .

03-initializers: this changes all static struct initializers from the
gcc syntax to standard C99 syntax. I think this could be left as it is
(not conditional), because the standard C99 syntax is supported by gcc
too, at least in recent versions.

04-voidret: this takes the argument out of the "return" statement in
functions that return void, so that pedantic compilers don't complain.

05-arrays: I think this is a genuine bug (that goes undetected as far
as fds[] is allocated on top of the stack, and there's headroom)…

06-ternary: this replaces a ternary expression with an if statement,
for pedantic compilers that complain about type mismatches between the
two alternate expressions;

07-timersub: this avoids defining timersub in recent versions of
Solaris, since they already have it. I should actually note that this
depends on the libc, not on the compiler version, so it's kind of
wrong – there should probably be a configure test for it;

08-initfini: this works around the fact that, for some reason I
haven't been able to reproduce with a compact minimum example, Sun
Studio recognizes the constructor and destructor attributes at compile
time, but does not honor them when libcallweaver is loaded; that
obviously breaks threading. Thus, if Sun Studio is used, the patch
makes CW adopt the alternate "pragma" syntax for constructors and
destructors.

Thanks to all involved in CallWeaver for their work!

-- 
Emanuele
_______________________________________________
Callweaver-dev mailing list
[email protected]
http://lists.callweaver.org/mailman/listinfo/callweaver-dev

Reply via email to