bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-standard types in public header files


From: Simon Josefsson
Subject: Re: Non-standard types in public header files
Date: Mon, 15 Aug 2005 14:05:21 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Albert Chin <address@hidden> writes:

> On Fri, Aug 12, 2005 at 06:45:16PM +0200, Simon Josefsson wrote:
>> 
>> Now that I think about this, one solution may be to avoid defining
>> ssize_t altogether.  Instead:
>> 
>> @SSIZE_T@ gnutls_record_send( gnutls_session_t session, const void *data, 
>> size_t sizeofdata);
>> @SSIZE_T@ gnutls_record_recv( gnutls_session_t session, void *data, size_t 
>> sizeofdata);
>
> Look at how glib solves a similar problem. Of course, they define
> their own types but they install a platform-specific .h file in
> $prefix/lib/include (glibconfig.h). This is similar to the
> gnutls-config.h suggested by Stepan Kasal.
>
> AC_CONFIG_COMMANDS([gnutlsconfig.h],
> [
>   outfile=gnutlsconfig.h
>   cat >$outfile <<_EOF_
> #ifndef __GNUTLSCONFIG_H__
> #define __GNUTLSCONFIG_H__
>
> _EOF_
>
>   if test x$HAVE_SSIZE_T = xyes; then
>     echo '#define GTLS_SSIZE_T ssize_t' >>$outfile
>   else
>     echo '#define GTLS_SSIZE_T long' >>$outfile
>   fi
>
>   echo '#endif /* __GNUTLSCONFIG_H__ */' >>$outfile
> ])

Yes, something like that seem like a good solution.

I wonder how much gnulib can help with this though.  So far, nothing
in gnulib is installed by 'make install', and the foo-config.h file
has to have a unique name for each project.  Also, these modules will
have to be named something differently, e.g., external-ssize_t, to not
confuse them with "normal" modules.

Thanks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]