From 74f8cc634aea79eaa918dd426a846b699075c9c8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 12 Apr 2001 00:05:57 +0000 Subject: [PATCH] * libc/include/sys/features.h: Add appropriate defines for Cygwin pthread support. * libc/include/sys/signal.h: Remove unneeded __CYGWIN__ protection. * libc/include/sys/types.h: Protect __CYGWIN__ from the rtems pthreads types. Include for the cygwin specific typedefs. --- newlib/ChangeLog | 8 ++++++++ newlib/libc/include/sys/features.h | 5 +++++ newlib/libc/include/sys/signal.h | 2 +- newlib/libc/include/sys/types.h | 17 ++++++++++++++--- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 46746a42f..01c94e169 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2001-04-12 Robert Collins + + * libc/include/sys/features.h: Add appropriate defines for Cygwin + pthread support. + * libc/include/sys/signal.h: Remove unneeded __CYGWIN__ protection. + * libc/include/sys/types.h: Protect __CYGWIN__ from the rtems pthreads + types. Include for the cygwin specific typedefs. + 2001-04-04 Richard Sandiford * libc/include/machine/ieeefp.h: Comment about new configuration diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index f492556d1..e86ce1344 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -81,6 +81,11 @@ extern "C" { # define _POSIX_JOB_CONTROL 1 # define _POSIX_SAVED_IDS 0 # define _POSIX_VERSION 199009L +# define _POSIX_THREADS 1 +# define _POSIX_THREAD_PROCESS_SHARED 1 +# define _POSIX_THREAD_SAFE_FUNCTIONS 1 +# define _POSIX_THREAD_PRIORITY_SCHEDULING 1 +# define _POSIX_THREAD_ATTR_STACKSIZE 1 #endif #ifdef __cplusplus diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index 53987afc3..e590ae38c 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -12,7 +12,7 @@ extern "C" { /* #ifndef __STRICT_ANSI__*/ -#if defined(_POSIX_THREADS) || defined(__CYGWIN__) +#if defined(_POSIX_THREADS) #include /* for pthread data types */ #endif diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 7ec35ae31..e4fcef28a 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -206,7 +206,7 @@ typedef struct _types_fd_set { condition variables, and keys. But since RTEMS is currently the only newlib user of these, the ifdef is just on RTEMS. */ -#if defined(__rtems__) +#if defined(__rtems__) || defined(__CYGWIN__) #ifndef __clockid_t_defined typedef _CLOCKID_T_ clockid_t; @@ -220,7 +220,15 @@ typedef _TIMER_T_ timer_t; #include -#if defined(_POSIX_THREADS) + +/* Cygwin will probably never have full posix compliance due to little things + * like an inability to set the stackaddress. Cygwin is also using void * + * pointers rather than structs to ensure maximum binary compatability with + * previous releases. + * This means that we don't use the types defined here, but rather in + * + */ +#if defined(_POSIX_THREADS) && !defined(__CYGWIN__) #include @@ -313,7 +321,10 @@ typedef struct { int is_initialized; /* is this structure initialized? */ int init_executed; /* has the initialization routine been run? */ } pthread_once_t; /* dynamic package initialization */ - +#else +#if defined (__CYGWIN__) +#include +#endif #endif /* defined(_POSIX_THREADS) */ #endif /* defined(__rtems__) */ -- 2.43.5