mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Miscellaneous sys/ucontext.h namespace fixes (bug 21457).
This patch fixes various miscellaneous namespace issues in sys/ucontext.h headers. Some struct tags are removed where the structs also have *_t typedef names, while other struct tags without such names are renamed to start __; the changes are noted in NEWS as they can affect C++ name mangling (although there seems to be little if any external use of these types, at least based on checking codesearch.debian.net). For powerpc, pointers to struct pt_regs (not defined in this header) are changed to point to struct __ctx(pt_regs), so in the __USE_MISC case those struct fields continue to point to the existing struct pt_regs type for maximum compatibility, while when that's a namespace issue they point to a struct __pt_regs type which is always an incomplete struct. Tested for affected architectures with build-many-glibcs.py. [BZ #21457] * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (fpregset_t): Remove struct tag. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (mcontext_t): Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (pt_regs): Declare struct type with __ctx. [__WORDSIZE != 32] (mcontext_t): Use __ctx with pt_regs struct tag. (ucontext_t) [__WORDSIZE == 32]: Use __ctx with pt_regs struct tag and regs field name.
This commit is contained in:
@ -31,6 +31,8 @@
|
||||
# define __ctx(fld) __ ## fld
|
||||
#endif
|
||||
|
||||
struct __ctx(pt_regs);
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
|
||||
/* Number of general registers. */
|
||||
@ -117,7 +119,7 @@ typedef struct {
|
||||
int __pad0;
|
||||
unsigned long __ctx(handler);
|
||||
unsigned long __ctx(oldmask);
|
||||
struct pt_regs *__ctx(regs);
|
||||
struct __ctx(pt_regs) *__ctx(regs);
|
||||
gregset_t __ctx(gp_regs);
|
||||
fpregset_t __ctx(fp_regs);
|
||||
/*
|
||||
@ -145,8 +147,6 @@ typedef struct {
|
||||
|
||||
#endif
|
||||
|
||||
#undef __ctx
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext_t
|
||||
{
|
||||
@ -179,7 +179,7 @@ typedef struct ucontext_t
|
||||
*/
|
||||
int uc_pad[7];
|
||||
union uc_regs_ptr {
|
||||
struct pt_regs *regs;
|
||||
struct __ctx(pt_regs) *__ctx(regs);
|
||||
mcontext_t *uc_regs;
|
||||
} uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
@ -190,4 +190,6 @@ typedef struct ucontext_t
|
||||
#endif
|
||||
} ucontext_t;
|
||||
|
||||
#undef __ctx
|
||||
|
||||
#endif /* sys/ucontext.h */
|
||||
|
Reference in New Issue
Block a user