(reposted to dbmail-dev after I joined same).

On Thu, 3 Jun 2004, Ilja Booij wrote:

Hi,

NB: I've posted this on dbmail-dev also, as it seems to be more appropriate there.

Larry Rosenman wrote:
Is the DBMail developers interested in NON-GCC compiles on UnixWare?

I like to be as portable as possible.

I had to change all __FUNCTION__ to __func__ (which is the way
C99 spells it), as well as comment out the __attribute__ lines.

I just checked, and __func__ also works on gcc. If __func__ is standard in C99, and works in gcc, we might as well replace all instances of
__FUNCTION__ with __func__

Yes, I believe that it should be __func__ if GCC supports it.  (I use
the native compiler on UnixWare).


The __attribute__ lines are GCC dependent and should be surrounded by preprocessor guards. This is done correctly in dbmail.h (example below), but not in all places.

#ifdef __GNUC__
#define UNUSED __attribute__((__unused__))
#else
#define UNUSED
#endif

There are a number of source (.c) files that have bare __attribute__ lines, and should be protected with #ifdef __GNUC__/#endif.



I also needed to add -L/usr/ucblib -lucb to a lot of links for
the setlinebuf() function.

We should probably make both of these AutoConf changes...

yes, this (setlinebuf()) should probably be done using autoconf.
The manpage for setlinebuf states the following:

The setlinebuf function is exactly equivalent to the call:

             setvbuf(stream, (char *)NULL, _IOLBF, 0);

Does setvbuf() work on UnixWare? If so, we can change the calls to setlinebuf() (both in serverchild.c) to setvbuf() like above.
Yes, setvbuf() is in the native libc, and should be used in place of
the UCB(BSD) setlinebuf() call.

I believe setvbuf is ANSI C, and setlinebuf() is a BSDism.




Oh, I also needed to remove the -fomit-frame-pointer option
as it's not valid on UnixWare.

This would be an autoconf thingie.


Yes, and if you aren't using GCC.

One thing I forgot is the dependency generation the makefiles use
GCC-specific options which don't work in UnixWare's native cc, and
should be more portably defined for the non-GCC compilers.



I can supply an account for y'all if you'd like one.

No need at the moment, I think.

I have postgreSQL as the DB.

Seems(!) to work in some quickie tests.

Ilja

_______________________________________________
Dbmail mailing list
Dbmail@dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail



--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Reply via email to