include/nuttx/compiler.h, include/poll.h: Add logic to determine if the compiler supports anonymous structures and unions.

This commit is contained in:
Gregory Nutt
2018-08-26 14:20:58 -06:00
parent 56883eef3b
commit 655be281e6
2 changed files with 34 additions and 0 deletions
+5
View File
@@ -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 */