Commit e64a6541 by Richard Henderson Committed by Richard Henderson

gthr-single.h (UNUSED): New.

        * gthr-single.h (UNUSED): New.  Distinguish between how C
        and C++ mark unused function arguments.  Use throughout.

From-SVN: r40903
parent c1e9f663
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
jump.c, toplev.c: jump.c, toplev.c:
Rename asynchronous_exceptions to flag_non_call_exceptions. Rename asynchronous_exceptions to flag_non_call_exceptions.
* gthr-single.h (UNUSED): New. Distinguish between how C
and C++ mark unused function arguments. Use throughout.
2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in: Don't check for bcopy. * configure.in: Don't check for bcopy.
......
...@@ -35,6 +35,12 @@ typedef int __gthread_mutex_t; ...@@ -35,6 +35,12 @@ typedef int __gthread_mutex_t;
#define __GTHREAD_MUTEX_INIT 0 #define __GTHREAD_MUTEX_INIT 0
#ifdef __cplusplus
#define UNUSED(x)
#else
#define UNUSED(x) x __attribute__((unused))
#endif
#ifdef _LIBOBJC #ifdef _LIBOBJC
/* Thread local storage for a single thread */ /* Thread local storage for a single thread */
...@@ -62,7 +68,7 @@ __gthread_objc_close_thread_system(void) ...@@ -62,7 +68,7 @@ __gthread_objc_close_thread_system(void)
/* Create a new thread of execution. */ /* Create a new thread of execution. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *arg), void *arg) __gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg))
{ {
/* No thread support available */ /* No thread support available */
return NULL; return NULL;
...@@ -70,7 +76,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg) ...@@ -70,7 +76,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
/* Set the current thread's priority. */ /* Set the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_set_priority(int priority) __gthread_objc_thread_set_priority(int UNUSED(priority))
{ {
/* No thread support available */ /* No thread support available */
return -1; return -1;
...@@ -127,21 +133,21 @@ __gthread_objc_thread_get_data(void) ...@@ -127,21 +133,21 @@ __gthread_objc_thread_get_data(void)
/* Allocate a mutex. */ /* Allocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex) __gthread_objc_mutex_allocate(objc_mutex_t UNUSED(mutex))
{ {
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex) __gthread_objc_mutex_deallocate(objc_mutex_t UNUSED(mutex))
{ {
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex))
{ {
/* There can only be one thread, so we always get the lock */ /* There can only be one thread, so we always get the lock */
return 0; return 0;
...@@ -149,7 +155,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -149,7 +155,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t UNUSED(mutex))
{ {
/* There can only be one thread, so we always get the lock */ /* There can only be one thread, so we always get the lock */
return 0; return 0;
...@@ -157,7 +163,7 @@ __gthread_objc_mutex_trylock(objc_mutex_t mutex) ...@@ -157,7 +163,7 @@ __gthread_objc_mutex_trylock(objc_mutex_t mutex)
/* Unlock the mutex */ /* Unlock the mutex */
static inline int static inline int
__gthread_objc_mutex_unlock(objc_mutex_t mutex) __gthread_objc_mutex_unlock(objc_mutex_t UNUSED(mutex))
{ {
return 0; return 0;
} }
...@@ -166,35 +172,36 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex) ...@@ -166,35 +172,36 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Allocate a condition. */ /* Allocate a condition. */
static inline int static inline int
__gthread_objc_condition_allocate(objc_condition_t condition) __gthread_objc_condition_allocate(objc_condition_t UNUSED(condition))
{ {
return 0; return 0;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
static inline int static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition) __gthread_objc_condition_deallocate(objc_condition_t UNUSED(condition))
{ {
return 0; return 0;
} }
/* Wait on the condition */ /* Wait on the condition */
static inline int static inline int
__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) __gthread_objc_condition_wait(objc_condition_t UNUSED(condition),
objc_mutex_t UNUSED(mutex))
{ {
return 0; return 0;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition) __gthread_objc_condition_broadcast(objc_condition_t UNUSED(condition))
{ {
return 0; return 0;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_signal(objc_condition_t condition) __gthread_objc_condition_signal(objc_condition_t UNUSED(condition))
{ {
return 0; return 0;
} }
...@@ -208,23 +215,25 @@ __gthread_active_p (void) ...@@ -208,23 +215,25 @@ __gthread_active_p (void)
} }
static inline int static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex __attribute__ ((__unused__))) __gthread_mutex_lock (__gthread_mutex_t * UNUSED(mutex))
{ {
return 0; return 0;
} }
static inline int static inline int
__gthread_mutex_trylock (__gthread_mutex_t *mutex __attribute__ ((__unused__))) __gthread_mutex_trylock (__gthread_mutex_t * UNUSED(mutex))
{ {
return 0; return 0;
} }
static inline int static inline int
__gthread_mutex_unlock (__gthread_mutex_t *mutex __attribute__ ((__unused__))) __gthread_mutex_unlock (__gthread_mutex_t * UNUSED(mutex))
{ {
return 0; return 0;
} }
#endif /* _LIBOBJC */ #endif /* _LIBOBJC */
#undef UNUSED
#endif /* not __gthr_single_h */ #endif /* not __gthr_single_h */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment