Re: [PATCH] lib/curl_poll.h: fix header guard collision with musl libc
Alec Leamas <[email protected]>
| Newsgroups | gmane.comp.hardware.lirc |
|---|---|
| Message-ID | <[email protected]> |
Hi! Thanks for patch! It's committed on the release branch[1], and will make it into the final release. Does it build OK against the musl libc with this patch? Cheers! --alec [1] https://sourceforge.net/p/lirc/git/ci/e07a80aa00a14fc98d7347afa1fa44282732b27f/ On 23/06/17 17:35, Baruch Siach wrote: > The musl libc uses the _POLL_H macro as a double include guard for the poll.h > header. This breaks compilation of files the include curl_poll.h: > > In file included from driver.h:32:0, > from driver.c:12: > lirc/curl_poll.h:38:29: error: array type has incomplete element type ‘struct pollfd’ > int curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms); > ^~~~ > > Rename the curl_poll.h header guard macro to avoid collision. Don't use a name > that starts with an underscore and a capital letter since these names are > reserved according to the ANSI C standard. > > https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html > > Signed-off-by: Baruch Siach<[email protected]> > --- > lib/curl_poll.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/curl_poll.h b/lib/curl_poll.h > index c8813859eca6..c0162b66718b 100644 > --- a/lib/curl_poll.h > +++ b/lib/curl_poll.h > @@ -1,5 +1,5 @@ > -#ifndef _POLL_H > -#define _POLL_H > +#ifndef HEADER_LIB_CURL_POLL_H > +#define HEADER_LIB_CURL_POLL_H > /*************************************************************************** > * _ _ ____ _ > * Project ___| | | | _ \| | > @@ -44,4 +44,4 @@ int curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms); > #endif > > > -#endif /* _POLL_H */ > +#endif /* HEADER_LIB_CURL_POLL_H */ > -- 2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot