mailing list of musl libc
 help / color / mirror / code / Atom feed
* FTBFS on i386: aio_cancel.c relies on macro-protected defines in aio.h
@ 2012-04-03 23:09 Isaac Dunham
  2012-04-03 23:16 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Isaac Dunham @ 2012-04-03 23:09 UTC (permalink / raw)
  To: musl

aio_cancel.c won't build.
It seems one of the _*_SOURCE macros must be defined to build it, and
I'm not sure which one (guessing it's _POSIX_SOURCE or _XOPEN_SOURCE ?).

Following is the relevant output from make:
---
cc -fno-stack-protector -I./src/internal -I./include -I./arch/i386 -c
-o src/aio/aio_cancel.o src/aio/aio_cancel.c src/aio/aio_cancel.c:5:
warning: ‘struct aiocb’ declared inside parameter list
src/aio/aio_cancel.c:5: warning: its scope is only this definition or
declaration, which is probably not what you want src/aio/aio_cancel.c:
In function ‘aio_cancel’: src/aio/aio_cancel.c:13: error:
‘AIO_NOTCANCELED’ undeclared (first use in this function)
src/aio/aio_cancel.c:13: error: (Each undeclared identifier is reported
only once src/aio/aio_cancel.c:13: error: for each function it appears
in.) src/aio/aio_cancel.c:15: error: dereferencing pointer to
incomplete type src/aio/aio_cancel.c:15: error: ‘AIO_ALLDONE’
undeclared (first use in this function) make: ***
[src/aio/aio_cancel.o] Error 1
---
aio_cancel.c #include's aio.h, which does define these macros...if
appropriate defines were passed.
Relevant portions of aio.h:
---
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
/* a few lines omitted */
struct aiocb {
	int aio_fildes, aio_lio_opcode, aio_reqprio;
	volatile void *aio_buf;
	size_t aio_nbytes;
	struct sigevent aio_sigevent;
	void *__td;
	int __lock[2];
	int __err;
	ssize_t __ret;
	off_t aio_offset;
	void *__next, *__prev;
	char __dummy4[32-2*sizeof(void *)];
};

#define AIO_CANCELED 0
#define AIO_NOTCANCELED 1
#define AIO_ALLDONE 2

/* several more lines */
#endif /* _*_SOURCE */
----

Just out of curiosity, is there a reason to macro-protect headers that
are not part of ANSI C when all other flavors support them?

Isaac Dunham



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-04  0:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 23:09 FTBFS on i386: aio_cancel.c relies on macro-protected defines in aio.h Isaac Dunham
2012-04-03 23:16 ` Rich Felker
2012-04-04  0:18   ` Isaac Dunham

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).