bug-gnulib
[Top][All Lists]
Advanced

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

Re: Compiling GNU Sharutils on NetBSD


From: Eric Blake
Subject: Re: Compiling GNU Sharutils on NetBSD
Date: Mon, 06 Apr 2015 08:54:07 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

[adding gnulib, as owner of the file in question]

On 04/06/2015 03:47 AM, HIRAMATSU Yoshifumi wrote:
> Hello,
> 
> Compiling Sharutil on recent NetBSD fails. This mail describes shortly.
> 
> 
> In GNU Sharutil's lib/fseeko.c, line 134 starts comment about NetBSD.
> 
>  /* Use a union, since on NetBSD, the compilation flags
>     determine whether fpos_t is typedef'd to off_t or a struct
>     containing a single off_t member.  */
> 
> However, NetBSD changed definition of _offset from fpos_t struct to __off_t,
> which is typedef of __int64_t.

When did this change occur?  Yes, gnulib should be taught to support it.

> 
> So the following code does not match the definition of FILE, results in build 
> fail.
> 
> See -> 
> http://cvsweb.netbsd.org/bsdweb.cgi/src/include/stdio.h.diff?r1=1.79&r2=1.80&f=h
> 
> 
> This patch fixes compilation and "make check" succeed.

Thanks for the patch; hopefully someone with more NetBSD familiarity
will confirm if this works for both pre- and post-change NetBSD FILE
definitions; otherwise, we may need to be a bit more careful to ensure
that we aren't breaking older systems.

> 
> --- lib/fseeko.c.orig 2015-04-05 22:42:44.000000000 +0900
> +++ lib/fseeko.c      2015-04-05 22:42:52.000000000 +0900
> @@ -125,7 +125,7 @@
>        fp->_flags &= ~_IO_EOF_SEEN;
>        fp->_offset = pos;
>  #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, 
> OpenBSD, DragonFly, Mac OS X, Cygwin */
> -# if defined __CYGWIN__
> +# if defined __CYGWIN__ || defined __NetBSD__
>        /* fp_->_offset is typed as an integer.  */
>        fp_->_offset = pos;
>  # else
> 
> 
> Kind regards,
> HIRAMATSU, Yoshifumi
> 
> 
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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