mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-27 04:41:02 +08:00
(struct cmsghdr): Don't declare __cmsg_data field if its size would be bigger
than 0. (CMSG_DATA): Adjust accordingly.
This commit is contained in:
parent
8755441d32
commit
916ea7e833
@ -203,14 +203,13 @@ struct cmsghdr
|
||||
of cmsghdr structure. */
|
||||
int cmsg_level; /* Originating protocol. */
|
||||
int cmsg_type; /* Protocol specific type. */
|
||||
#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
|
||||
unsigned char __cmsg_data[0]; /* Ancillary data. */
|
||||
/* XXX Perhaps this should be removed. */
|
||||
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
|
||||
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Ancillary data object manipulation macros. */
|
||||
#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
|
||||
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
|
||||
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
|
||||
#else
|
||||
# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
|
||||
|
@ -233,12 +233,13 @@ struct cmsghdr
|
||||
of cmsghdr structure. */
|
||||
int cmsg_level; /* Originating protocol. */
|
||||
int cmsg_type; /* Protocol specific type. */
|
||||
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
|
||||
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
|
||||
/* XXX Perhaps this should be removed. */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Ancillary data object manipulation macros. */
|
||||
#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
|
||||
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
|
||||
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
|
||||
#else
|
||||
# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
|
||||
|
@ -233,12 +233,13 @@ struct cmsghdr
|
||||
of cmsghdr structure. */
|
||||
int cmsg_level; /* Originating protocol. */
|
||||
int cmsg_type; /* Protocol specific type. */
|
||||
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
|
||||
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
|
||||
/* XXX Perhaps this should be removed. */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Ancillary data object manipulation macros. */
|
||||
#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
|
||||
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
|
||||
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
|
||||
#else
|
||||
# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
|
||||
|
Loading…
Reference in New Issue
Block a user