[sane-devel] Replacing u_char and friends (was Re: [PATCH] Port to OS X)

Nikolay Shaplov dhyan at nataraj.su
Thu Apr 19 09:08:42 BST 2018


В письме от 20 октября 2015 21:52:18 пользователь Olaf Meeuwissen написал:

> > The sys/type.h problem is the same I face while compiling with musl
> > instead of glibc.  There are just some files that miss it. I have a
> > patch for them but it still misses the ifdef around it.  Check the
> > other patches that might easy your port.
> > 
> > https://github.com/openwrt/packages/blob/master/utils/sane-backends/patche
> > s/
> I looked at the 030-musl.patch and except maybe for the backend/hp*.c
> files, all fixes seem to involve u_char and friends.  Now, ./configure
> checks for their presence.  If they are absent, they will be defined
> automatically for you in include/sane/config.h.  If they are present,
> these defines are not provided and whoever uses them will need to add an
> #include for a header that does, normally sys/types.h.  However, that
> header may be absent itself, so ...
Oh! that's how it works.

I've been trying to statically link one of the backends to an executable file, 
for some wired reasons. I started from simple int main(void) added to frontend 
dir, and spend some time, trying to figure out why it can not find u_long 
though I added #include<sys/type.h> to the file. Finally I found out that I 
should include sane/config.h instead, but still did not understand why... Now 
I got it.

I am not sure, may be I am the only one to be confused by custom redefinition 
of standart types, but it would have save me some time if redefined types were 
given some non-default names sane_u_long, or something. Thus I would not look 
in wrong direction.

// it is just a comment, I just want to whine a bit, I am not sure that this 
is an important thing for others :-)


-- 
Do code for fun.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20180419/e9110f85/attachment.sig>


More information about the sane-devel mailing list