Re: [sane-devel] [PATCH] Port to OS X
Hi Yurii, Yurii Kolesnykov writes: > Signed-off-by: Yurii Kolesnykov > --- > backend/epsonds-io.c | 4 > include/sane/sanei_backend.h | 10 +- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/backend/epsonds-io.c b/backend/epsonds-io.c > index 28bacfc..c0bdc28 100644 > --- a/backend/epsonds-io.c > +++ b/backend/epsonds-io.c > @@ -20,6 +20,10 @@ > #include "epsonds.h" > #include "epsonds-io.h" > > +#ifdef HAVE_SYS_TYPES_H > +#include > +#endif > + > size_t eds_send(epsonds_scanner *s, void *buf, size_t length, SANE_Status > *status) > { > DBG(32, "%s: size = %lu\n", __func__, (u_long) length); This is for u_long only, it seems. I've pushed a fix for this. > diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h > index 1b5afe2..cf37cb3 100644 > --- a/include/sane/sanei_backend.h > +++ b/include/sane/sanei_backend.h > @@ -68,8 +68,13 @@ > > /* Just enough backwards compatibility that we get by in the backends > without making handstands. */ > + > +# define sigset_t int > +# endif > # ifdef sigset_t > -# undef sigset_t > +# ifndef __APPLE__ > +# undef sigset_t > +# endif > # endif > # ifdef sigemptyset > # undef sigemptyset > @@ -96,7 +101,10 @@ > # undef SIG_SETMASK > # endif > > +# ifndef __APPLE__ > # define sigset_t int > +# endif > + > # define sigemptyset(set) do { *(set) = 0; } while (0) > # define sigfillset(set)do { *(set) = ~0; } while (0) > # define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0) Hmm, this breaks compilation. Your changeset introduces three #endif's but only two #if*'s. This leads to an "#endif without #if" error. As mentioned in my other posted, I will not push this to Alioth. Hope this helps, -- Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 Support Free Software Support the Free Software Foundation https://my.fsf.org/donatehttps://my.fsf.org/join GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9 -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] [PATCH] Port to OS X
Olaf and Yurii, 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/patches/ Regards, Em sáb, 17 de out de 2015 01:36, Olaf Meeuwissen escreveu: > Hi Yurii, > > Sorry for the late follow-up. > > Yurii Kolesnykov writes: > > > Hi Olaf, thanks for your feedback. > > Sorry, I forgot to include this comment in previous email. > > > >> > /* > >> > * SANE types and defines > >> > */ > >> > diff --git a/include/sane/sanei_backend.h > b/include/sane/sanei_backend.h > >> > index 1b5afe2..982dedc 100644 > >> > --- a/include/sane/sanei_backend.h > >> > +++ b/include/sane/sanei_backend.h > >> > @@ -96,7 +96,9 @@ > >> > # undef SIG_SETMASK > >> > # endif > >> > > >> > +# ifndef __APPLE__ > >> > # define sigset_t int > >> > +# endif > >> > >> Can you explain what this is trying to fix? The sigset_t macro is > >> undefined a bit above this. If sigset_t is still visible to the > >> compiler, it wasn't a macro and the defines below will quite likely > >> break things. > > > > I had this error: > > > > In file included from epsonds-jpeg.c:18: > > In file included from ./epsonds.h:43: > > In file included from ../include/sane/sanei_usb.h:69: > > In file included from /usr/include/stdlib.h:65: > > In file included from /usr/include/sys/wait.h:109: > > In file included from /usr/include/sys/signal.h:154: > > /usr/include/sys/_types/_sigset_t.h:30:28: error: cannot combine with > previous 'type-name' declaration specifier > > typedef __darwin_sigset_tsigset_t; > > ^ > > ../include/sane/sanei_backend.h:99:33: note: expanded from macro > 'sigset_t' > > # define sigset_tint > > ^ > > 1 error generated. > > Ok, so sigset_t wasn't a define. > > I've dug up some[1] info[2] on __darwin_sigset_t and it seems to just be > a typedef for a 32 bit unsigned integer. In that case, the other signal > related defines in sanei_backend.h won't break. > > [1] http://fxr.watson.org/fxr/ident?v=xnu-792;i=__darwin_sigset_t > [2] > https://www.opensource.apple.com/source/xnu/xnu-792.6.56/bsd/sys/_types.h > > However, I don't think that your fix is the right way to go about fixing > this. It is really something that configure should check for. > > Feel free to keep using this patch yourself but I will not commit it to > Alioth's master. > > Hope this helps, > -- > Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 > Support Free Software Support the Free Software Foundation > https://my.fsf.org/donatehttps://my.fsf.org/join > GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9 > > -- > sane-devel mailing list: sane-devel@lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel > Unsubscribe: Send mail with subject "unsubscribe your_password" > to sane-devel-requ...@lists.alioth.debian.org > -- Luiz Angelo Daros de Luca -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] [PATCH] Port to OS X
Hi Yurii, Sorry for the late follow-up. Yurii Kolesnykov writes: > Hi Olaf, thanks for your feedback. > Sorry, I forgot to include this comment in previous email. > >> > /* >> > * SANE types and defines >> > */ >> > diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h >> > index 1b5afe2..982dedc 100644 >> > --- a/include/sane/sanei_backend.h >> > +++ b/include/sane/sanei_backend.h >> > @@ -96,7 +96,9 @@ >> > # undef SIG_SETMASK >> > # endif >> > >> > +# ifndef __APPLE__ >> > # define sigset_t int >> > +# endif >> >> Can you explain what this is trying to fix? The sigset_t macro is >> undefined a bit above this. If sigset_t is still visible to the >> compiler, it wasn't a macro and the defines below will quite likely >> break things. > > I had this error: > > In file included from epsonds-jpeg.c:18: > In file included from ./epsonds.h:43: > In file included from ../include/sane/sanei_usb.h:69: > In file included from /usr/include/stdlib.h:65: > In file included from /usr/include/sys/wait.h:109: > In file included from /usr/include/sys/signal.h:154: > /usr/include/sys/_types/_sigset_t.h:30:28: error: cannot combine with > previous 'type-name' declaration specifier > typedef __darwin_sigset_tsigset_t; > ^ > ../include/sane/sanei_backend.h:99:33: note: expanded from macro 'sigset_t' > # define sigset_tint > ^ > 1 error generated. Ok, so sigset_t wasn't a define. I've dug up some[1] info[2] on __darwin_sigset_t and it seems to just be a typedef for a 32 bit unsigned integer. In that case, the other signal related defines in sanei_backend.h won't break. [1] http://fxr.watson.org/fxr/ident?v=xnu-792;i=__darwin_sigset_t [2] https://www.opensource.apple.com/source/xnu/xnu-792.6.56/bsd/sys/_types.h However, I don't think that your fix is the right way to go about fixing this. It is really something that configure should check for. Feel free to keep using this patch yourself but I will not commit it to Alioth's master. Hope this helps, -- Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 Support Free Software Support the Free Software Foundation https://my.fsf.org/donatehttps://my.fsf.org/join GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9 -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] [PATCH] Port to OS X
Hi Olaf, thanks for your feedback. Sorry, I forgot to include this comment in previous email. > > /* > > * SANE types and defines > > */ > > diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h > > index 1b5afe2..982dedc 100644 > > --- a/include/sane/sanei_backend.h > > +++ b/include/sane/sanei_backend.h > > @@ -96,7 +96,9 @@ > > # undef SIG_SETMASK > > # endif > > > > +# ifndef __APPLE__ > > # define sigset_t int > > +# endif > > Can you explain what this is trying to fix? The sigset_t macro is > undefined a bit above this. If sigset_t is still visible to the > compiler, it wasn't a macro and the defines below will quite likely > break things. I had this error: In file included from epsonds-jpeg.c:18: In file included from ./epsonds.h:43: In file included from ../include/sane/sanei_usb.h:69: In file included from /usr/include/stdlib.h:65: In file included from /usr/include/sys/wait.h:109: In file included from /usr/include/sys/signal.h:154: /usr/include/sys/_types/_sigset_t.h:30:28: error: cannot combine with previous 'type-name' declaration specifier typedef __darwin_sigset_t sigset_t; ^ ../include/sane/sanei_backend.h:99:33: note: expanded from macro 'sigset_t' # define sigset_t int ^ 1 error generated. -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] [PATCH] Port to OS X
Signed-off-by: Yurii Kolesnykov --- backend/epsonds-io.c | 4 include/sane/sanei_backend.h | 10 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/epsonds-io.c b/backend/epsonds-io.c index 28bacfc..c0bdc28 100644 --- a/backend/epsonds-io.c +++ b/backend/epsonds-io.c @@ -20,6 +20,10 @@ #include "epsonds.h" #include "epsonds-io.h" +#ifdef HAVE_SYS_TYPES_H +#include +#endif + size_t eds_send(epsonds_scanner *s, void *buf, size_t length, SANE_Status *status) { DBG(32, "%s: size = %lu\n", __func__, (u_long) length); diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h index 1b5afe2..cf37cb3 100644 --- a/include/sane/sanei_backend.h +++ b/include/sane/sanei_backend.h @@ -68,8 +68,13 @@ /* Just enough backwards compatibility that we get by in the backends without making handstands. */ + +# define sigset_t int +# endif # ifdef sigset_t -# undef sigset_t +# ifndef __APPLE__ +# undef sigset_t +# endif # endif # ifdef sigemptyset # undef sigemptyset @@ -96,7 +101,10 @@ # undef SIG_SETMASK # endif +# ifndef __APPLE__ # define sigset_t int +# endif + # define sigemptyset(set) do { *(set) = 0; } while (0) # define sigfillset(set)do { *(set) = ~0; } while (0) # define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0) -- 2.6.1 -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] [PATCH] Port to OS X
Hi Yurii, Thanks for your feedback but there are a few checks done by the configure script that can/should be used to address the fixes the suggest. Yurii Kolesnykov writes: > 4 files changed, 19 insertions(+) > > diff --git a/backend/pieusb_buffer.c b/backend/pieusb_buffer.c > index 53bd867..23fc645 100644 > --- a/backend/pieusb_buffer.c > +++ b/backend/pieusb_buffer.c > @@ -100,7 +100,13 @@ > #include > #include > #include > + > +#ifdef __APPLE__ > +#include > +#elif > #include > +#endif This should probably #include "byteorder.h" instead, independent of any OS issues. The byteorder.h file, which is generated by configure below include/ is meant to take care of those. > + > > /* When creating the release backend, make complains about unresolved > external > * le16toh, although it finds the include */ > diff --git a/include/sane/sane.h b/include/sane/sane.h > index 5320b4a..736a9cd 100644 > --- a/include/sane/sane.h > +++ b/include/sane/sane.h > @@ -20,6 +20,11 @@ > extern "C" { > #endif > > +#ifdef __APPLE__ > +// Fixes u_long missing error > +#include > +#endif > + Unless the SANE C API specification directly references anything that is in , this is a no-no. That said, the SANE C API should not reference anthing in . This header file should be directly included in those *.c files that need it, as follows: #ifdef HAVE_SYS_TYPES_H #include #endif Of course, any code that depends on getting included needs to be #ifdef'd too. > /* > * SANE types and defines > */ > diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h > index 1b5afe2..982dedc 100644 > --- a/include/sane/sanei_backend.h > +++ b/include/sane/sanei_backend.h > @@ -96,7 +96,9 @@ > # undef SIG_SETMASK > # endif > > +# ifndef __APPLE__ > # define sigset_t int > +# endif Can you explain what this is trying to fix? The sigset_t macro is undefined a bit above this. If sigset_t is still visible to the compiler, it wasn't a macro and the defines below will quite likely break things. > # define sigemptyset(set) do { *(set) = 0; } while (0) > # define sigfillset(set)do { *(set) = ~0; } while (0) > # define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0) > diff --git a/sanei/sanei_ir.c b/sanei/sanei_ir.c > index 42e82ba..0db2c29 100644 > --- a/sanei/sanei_ir.c > +++ b/sanei/sanei_ir.c > @@ -29,7 +29,13 @@ > > #include > #include > +#ifdef __APPLE__ //OSX > +#include > +#include > +#include > +#elif // not OSX > #include > +#endif > #include For , see above. The stuff has just been fixed in master in 2239d2a. Hope this helps, -- Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 Support Free Software Support the Free Software Foundation https://my.fsf.org/donatehttps://my.fsf.org/join GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9 -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] [PATCH] Port to OS X
4 files changed, 19 insertions(+) diff --git a/backend/pieusb_buffer.c b/backend/pieusb_buffer.c index 53bd867..23fc645 100644 --- a/backend/pieusb_buffer.c +++ b/backend/pieusb_buffer.c @@ -100,7 +100,13 @@ #include #include #include + +#ifdef __APPLE__ +#include +#elif #include +#endif + /* When creating the release backend, make complains about unresolved external * le16toh, although it finds the include */ diff --git a/include/sane/sane.h b/include/sane/sane.h index 5320b4a..736a9cd 100644 --- a/include/sane/sane.h +++ b/include/sane/sane.h @@ -20,6 +20,11 @@ extern "C" { #endif +#ifdef __APPLE__ +// Fixes u_long missing error +#include +#endif + /* * SANE types and defines */ diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h index 1b5afe2..982dedc 100644 --- a/include/sane/sanei_backend.h +++ b/include/sane/sanei_backend.h @@ -96,7 +96,9 @@ # undef SIG_SETMASK # endif +# ifndef __APPLE__ # define sigset_t int +# endif # define sigemptyset(set) do { *(set) = 0; } while (0) # define sigfillset(set)do { *(set) = ~0; } while (0) # define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0) diff --git a/sanei/sanei_ir.c b/sanei/sanei_ir.c index 42e82ba..0db2c29 100644 --- a/sanei/sanei_ir.c +++ b/sanei/sanei_ir.c @@ -29,7 +29,13 @@ #include #include +#ifdef __APPLE__ //OSX +#include +#include +#include +#elif // not OSX #include +#endif #include #define BACKEND_NAME sanei_ir /* name of this module for debugging */ -- 2.6.0 -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] [PATCH] Port to OS X
Quick fixes for error I have encountered during compilation. make check reports problem: > File generated for html-backends-split mode is different from reference I have no clue wath this error is about. Is this the real error? Yurii Kolesnykov (1): Port to OS X backend/pieusb_buffer.c | 6 ++ include/sane/sane.h | 5 + include/sane/sanei_backend.h | 2 ++ sanei/sanei_ir.c | 6 ++ 4 files changed, 19 insertions(+) -- 2.6.0 -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org