mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
include/nuttx/compiler.h, include/poll.h: Add logic to determine if the compiler supports anonymous structures and unions.
This commit is contained in:
@@ -116,11 +116,16 @@ struct pollfd
|
||||
* they are not available in C89.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HAVE_ANONYMOUS_UNION
|
||||
union
|
||||
{
|
||||
int fd; /* The descriptor being polled */
|
||||
FAR void *ptr; /* The psock or file being polled */
|
||||
};
|
||||
#else
|
||||
int fd; /* The descriptor being polled */
|
||||
FAR void *ptr; /* The psock or file being polled */
|
||||
#endif
|
||||
|
||||
FAR sem_t *sem; /* Pointer to semaphore used to post output event */
|
||||
pollevent_t events; /* The input event flags */
|
||||
|
||||
Reference in New Issue
Block a user