summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gthr-dce.h3
-rw-r--r--gcc/gthr-posix.h3
-rw-r--r--gcc/gthr-solaris.h3
4 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a9bbb13a401..c7ed555c992 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-13 Jason Merrill <jason@redhat.com>
+
+ * gthr-posix.h (__gthread_active_p): Move __gthread_active_ptr
+ into the function and constify it.
+ * gthr-dce.h, gthr-solaris.h: Likewise.
+
2002-03-13 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.h (PAD_VARARGS_DOWN): Define.
diff --git a/gcc/gthr-dce.h b/gcc/gthr-dce.h
index afefaca7329..957f2272924 100644
--- a/gcc/gthr-dce.h
+++ b/gcc/gthr-dce.h
@@ -87,11 +87,10 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_yield
#endif
-static void *__gthread_active_ptr = (void *) &pthread_create;
-
static inline int
__gthread_active_p (void)
{
+ static void *const __gthread_active_ptr = (void *) &pthread_create;
return __gthread_active_ptr != 0;
}
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index fe9e584bbb7..58bfcb36872 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -77,11 +77,10 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_setschedparam
#endif
-static void *__gthread_active_ptr = (void *) &pthread_create;
-
static inline int
__gthread_active_p (void)
{
+ static void *const __gthread_active_ptr = (void *) &pthread_create;
return __gthread_active_ptr != 0;
}
diff --git a/gcc/gthr-solaris.h b/gcc/gthr-solaris.h
index 291210d4e8c..6d7ff2538cd 100644
--- a/gcc/gthr-solaris.h
+++ b/gcc/gthr-solaris.h
@@ -81,11 +81,10 @@ typedef mutex_t __gthread_mutex_t;
/* This will not actually work in Solaris 2.5, since libc contains
dummy symbols of all thr_* routines. */
-static void *__gthread_active_ptr = (void *) &thr_create;
-
static inline int
__gthread_active_p (void)
{
+ static void *const __gthread_active_ptr = (void *) &thr_create;
return __gthread_active_ptr != 0;
}