Hi Markus,

On Thu, Nov 27, 2008 at 01:01:48AM +0100, Markus Hoenicka wrote:
>  > So if you compile with
>  >  CPPFLAGS="-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 -D_REENTRANT 
> -D_THREAD_SAFE"
>  > you should get the XS-interface on all noted platforms, as far as I
>  > know.
> 
> Would you please provide some pointers to these switches? Are they
> gcc-specific in any way? I'd like to add something like this to
> configure.in.

Sure, _POSIX_C_SOURCE and _XOPEN_SOURCE are specified by POSIX/SUS
directly:
<https://www.opengroup.org/onlinepubs/000095399/functions/xsh_chap02_02.html#tag_02_02_01_01>

Don't know if _REENTRANT is specified officially anywhere, but it's used
by Solaris.
<http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWdev/MTP/p44.html#COMPILE-4>

Since I haven't seen a source for _REENTRANT and apparently Solaris
doesn't need it if _POSIX_C_SOURCE is defined, it's probably reasonable
to leave that out until the need arises.

_THREAD_SAFE is, according to GNU's feature.h, a synonym for _REENTRANT,
so you can probably leave that out, too.

I've just tried to compile libdbi with
  ./configure --disable-docs \
    CFLAGS="-Wall -Werror" \
    CPPFLAGS="-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500"
an ran into problems with [v]asprintf: Since they're no in any standard,
Mac OS X (and therefore probably FreeBSD as well) will deactivate the
prototypes. I'll follow up on this..

> - I've used a more portable way to calculate the buffer size required
>   for readdir_r, see
>   http://womble.decadentplace.org.uk/readdir_r-advisory.html

Uh, I wouldn't use `-1' as an error indicator of type `size_t': `size_t'
is declared unsigned on many platforms, comparing it with `-1' will
cause warnings on many systems. Functions returning a memory size or a
negative error condition should use `ssize_t' (see read(2) for example).

> - I've fixed an obvious typo in the timegm.c patch (gmtime_r
>   vs. gmtime)

D'oh! How did that compile on my machine?

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libdbi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libdbi-devel

Reply via email to