mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
include/poll.h: Remove un-named union from 'struct pollfd'. It is not required by OpenGroup.org and violates the NuttX C coding standard because it is not C89 compatible.
This commit is contained in:
@@ -269,6 +269,10 @@
|
|||||||
|
|
||||||
/* ISO C11 supports anonymous (unnamed) structures and unions, added in
|
/* ISO C11 supports anonymous (unnamed) structures and unions, added in
|
||||||
* GCC 4.6 (but might be suppressed with -std= option)
|
* GCC 4.6 (but might be suppressed with -std= option)
|
||||||
|
*
|
||||||
|
* CAREFUL: This can cause issues for shared data structures shared between
|
||||||
|
* C and C++ if the two versions do not support the same features. Structures
|
||||||
|
* and unions can lose binary compatibility!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# undef CONFIG_HAVE_ANONYMOUS_STRUCT
|
# undef CONFIG_HAVE_ANONYMOUS_STRUCT
|
||||||
|
|||||||
+6
-14
@@ -114,24 +114,16 @@ typedef uint8_t pollevent_t;
|
|||||||
|
|
||||||
struct pollfd
|
struct pollfd
|
||||||
{
|
{
|
||||||
/* REVISIT: Un-named unions are forbidden by the coding standard because
|
/* Standard field */
|
||||||
* 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 */
|
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 */
|
pollevent_t events; /* The input event flags */
|
||||||
pollevent_t revents; /* The output event flags */
|
pollevent_t revents; /* The output event flags */
|
||||||
|
|
||||||
|
/* Non-standard fields used internally by NuttX */
|
||||||
|
|
||||||
|
FAR void *ptr; /* The psock or file being polled */
|
||||||
|
FAR sem_t *sem; /* Pointer to semaphore used to post output event */
|
||||||
FAR void *priv; /* For use by drivers */
|
FAR void *priv; /* For use by drivers */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user