Work around problem of pthread_attr_t definition with old compilers

This commit is contained in:
Ulrich Drepper 2012-02-26 17:41:17 -05:00
parent 4efeffc1d5
commit 4a3dded527
9 changed files with 53 additions and 14 deletions

View File

@ -35,11 +35,15 @@
typedef unsigned long int pthread_t;
typedef union __pthread_attr
union __pthread_attr
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
} pthread_attr_t;
};
#ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
typedef struct __pthread_internal_slist

View File

@ -49,11 +49,15 @@
typedef unsigned long int pthread_t;
typedef union __pthread_attr
union __pthread_attr
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
} pthread_attr_t;
};
#ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
#if __WORDSIZE == 64

View File

@ -48,11 +48,15 @@
typedef unsigned long int pthread_t;
typedef union __pthread_attr
union __pthread_attr
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
} pthread_attr_t;
};
#ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
#if __WORDSIZE == 64

View File

@ -37,11 +37,15 @@
typedef unsigned long int pthread_t;
typedef union __pthread_attr
union __pthread_attr
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
} pthread_attr_t;
};
#ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
typedef struct __pthread_internal_slist

View File

@ -49,11 +49,15 @@
typedef unsigned long int pthread_t;
typedef union __pthread_attr
union __pthread_attr
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
} pthread_attr_t;
};
#ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
#if __WORDSIZE == 64

View File

@ -48,11 +48,15 @@
typedef unsigned long int pthread_t;
typedef union __pthread_attr
union __pthread_attr
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
} pthread_attr_t;
};
#ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
#if __WORDSIZE == 64

View File

@ -270,7 +270,10 @@ enum
# endif
/* Forward declaration. */
# ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
# endif
typedef struct sigevent
{

View File

@ -271,6 +271,12 @@ enum
# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
# endif
/* Forward declaration. */
# ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
# endif
typedef struct sigevent
{
sigval_t sigev_value;
@ -288,7 +294,7 @@ typedef struct sigevent
struct
{
void (*_function) (sigval_t); /* Function to start. */
void *_attribute; /* Really pthread_attr_t. */
pthread_attr_t *_attribute; /* Thread attributes. */
} _sigev_thread;
} _sigev_un;
} sigevent_t;

View File

@ -278,6 +278,12 @@ enum
# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
# endif
/* Forward declaration. */
# ifndef __have_pthread_attr_t
typedef union __pthread_attr pthread_attr_t;
# define __have_pthread_attr_t 1
# endif
typedef struct sigevent
{
sigval_t sigev_value;
@ -295,7 +301,7 @@ typedef struct sigevent
struct
{
void (*_function) (sigval_t); /* Function to start. */
void *_attribute; /* Really pthread_attr_t. */
pthread_attr_t *_attribute; /* Thread attributes. */
} _sigev_thread;
} _sigev_un;
} sigevent_t;