OSDN Git Service

2008-06-11 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / gthr-vxworks.h
index 0f3ad23..7a61a5a 100644 (file)
@@ -17,8 +17,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 /* As a special exception, if you link this library with other files,
    some of which are compiled with GCC, to produce an executable,
@@ -36,6 +36,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "gthr-posix.h"
 
 #else
+#ifdef __cplusplus
+#define UNUSED(x)
+#else
+#define UNUSED(x) x __attribute__((unused))
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #define __GTHREADS 1
 #define __gthread_active_p() 1
@@ -57,6 +66,12 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+  return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   return semTake (*mutex, WAIT_FOREVER);
@@ -103,12 +118,18 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
 
 typedef struct
 {
+#ifndef __RTP__
   volatile unsigned char busy;
+#endif
   volatile unsigned char done;
 }
 __gthread_once_t;
 
-#define __GTHREAD_ONCE_INIT { 0, 0 }
+#ifndef __RTP__
+# define __GTHREAD_ONCE_INIT { 0, 0 }
+#else
+# define __GTHREAD_ONCE_INIT { 0 }
+#endif
 
 extern int __gthread_once (__gthread_once_t *once, void (*func)(void));
 
@@ -125,6 +146,12 @@ extern int __gthread_key_delete (__gthread_key_t key);
 extern void *__gthread_getspecific (__gthread_key_t key);
 extern int __gthread_setspecific (__gthread_key_t key, void *ptr);
 
+#undef UNUSED
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* not _LIBOBJC */
 
 #endif /* gthr-vxworks.h */