aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/gthr-single.h76
2 files changed, 68 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 41cc672..8f91827 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,7 +1,20 @@
+2008-05-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * gthr-single.h: Add in required interface elements as per gthr.h.
+ Add stub types for __gthread_key_t, __gthread_once_t. Add defines
+ for __GTHREAD_ONCE_INIT, __GTHREAD_RECURSIVE_MUTEX_INIT.
+ Generalize UNUSED macro.
+ (__gthread_once): Add.
+ (__gthread_key_create): Add.
+ (__gthread_key_delete): Add.
+ (__gthread_getspecific): Add.
+ (__gthread_setspecific): Add.
+
2008-05-05 Andrew Pinski <Andrew.Pinski@playstation.sony.com>
- * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have the
- same size types for the indirect reference on the rhs, then create a VCE.
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have
+ the same size types for the indirect reference on the rhs, then
+ create a VCE.
2008-05-05 Uros Bizjak <ubizjak@gmail.com>
diff --git a/gcc/gthr-single.h b/gcc/gthr-single.h
index 7dd1f54..66a9dd8 100644
--- a/gcc/gthr-single.h
+++ b/gcc/gthr-single.h
@@ -1,6 +1,6 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2004, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -31,16 +31,16 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
/* Just provide compatibility for mutex handling. */
+typedef int __gthread_key_t;
+typedef int __gthread_once_t;
typedef int __gthread_mutex_t;
typedef int __gthread_recursive_mutex_t;
+#define __GTHREAD_ONCE_INIT 0
#define __GTHREAD_MUTEX_INIT 0
+#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
-#ifdef __cplusplus
-#define UNUSED(x)
-#else
-#define UNUSED(x) x __attribute__((unused))
-#endif
+#define UNUSED __attribute__((unused))
#ifdef _LIBOBJC
@@ -69,7 +69,7 @@ __gthread_objc_close_thread_system (void)
/* Create a new thread of execution. */
static inline objc_thread_t
-__gthread_objc_thread_detach (void (* func)(void *), void * UNUSED(arg))
+__gthread_objc_thread_detach (void (* func)(void *), void * arg UNUSED)
{
/* No thread support available */
return NULL;
@@ -77,7 +77,7 @@ __gthread_objc_thread_detach (void (* func)(void *), void * UNUSED(arg))
/* Set the current thread's priority. */
static inline int
-__gthread_objc_thread_set_priority (int UNUSED(priority))
+__gthread_objc_thread_set_priority (int priority UNUSED)
{
/* No thread support available */
return -1;
@@ -134,21 +134,21 @@ __gthread_objc_thread_get_data (void)
/* Allocate a mutex. */
static inline int
-__gthread_objc_mutex_allocate (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_allocate (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Deallocate a mutex. */
static inline int
-__gthread_objc_mutex_deallocate (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_lock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_lock (objc_mutex_t mutex UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
@@ -156,7 +156,7 @@ __gthread_objc_mutex_lock (objc_mutex_t UNUSED(mutex))
/* Try to grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_trylock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_trylock (objc_mutex_t mutex UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
@@ -164,7 +164,7 @@ __gthread_objc_mutex_trylock (objc_mutex_t UNUSED(mutex))
/* Unlock the mutex */
static inline int
-__gthread_objc_mutex_unlock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_unlock (objc_mutex_t mutex UNUSED)
{
return 0;
}
@@ -173,36 +173,36 @@ __gthread_objc_mutex_unlock (objc_mutex_t UNUSED(mutex))
/* Allocate a condition. */
static inline int
-__gthread_objc_condition_allocate (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_allocate (objc_condition_t condition UNUSED)
{
return 0;
}
/* Deallocate a condition. */
static inline int
-__gthread_objc_condition_deallocate (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_deallocate (objc_condition_t condition UNUSED)
{
return 0;
}
/* Wait on the condition */
static inline int
-__gthread_objc_condition_wait (objc_condition_t UNUSED(condition),
- objc_mutex_t UNUSED(mutex))
+__gthread_objc_condition_wait (objc_condition_t condition UNUSED,
+ objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Wake up all threads waiting on this condition. */
static inline int
-__gthread_objc_condition_broadcast (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_broadcast (objc_condition_t condition UNUSED)
{
return 0;
}
/* Wake up one thread waiting on this condition. */
static inline int
-__gthread_objc_condition_signal (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_signal (objc_condition_t condition UNUSED)
{
return 0;
}
@@ -215,26 +215,56 @@ __gthread_active_p (void)
return 0;
}
+static inline int
+__gthread_once (__gthread_once_t *once UNUSED, void (*func) () UNUSED)
+{
+ return 0;
+}
+
+static inline int UNUSED
+__gthread_key_create (__gthread_key_t *key UNUSED, void (*func) (void *) UNUSED)
+{
+ return 0;
+}
+
+static int UNUSED
+__gthread_key_delete (__gthread_key_t key UNUSED)
+{
+ return 0;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t key UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t key UNUSED, const void *v UNUSED)
+{
+ return 0;
+}
+
static inline int
-__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_destroy (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_lock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_lock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_trylock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_trylock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_unlock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_unlock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}