public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/users/vapier/wip] libgloss: sparc_leon: workaround newer newlib pthread APIs
Date: Tue,  2 Jan 2024 04:38:34 +0000 (GMT)	[thread overview]
Message-ID: <20240102043834.CE6E43858283@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=1b1ed5c82ffc1bbfa7df600459b247d23980e193

commit 1b1ed5c82ffc1bbfa7df600459b247d23980e193
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Dec 29 17:52:31 2023 -0500

    libgloss: sparc_leon: workaround newer newlib pthread APIs
    
    Fix a compile error due to duplicate pthreads types:
    .../libgloss/sparc_leon/mutex.c:50:8: error: conflicting types for ‘pthread_mutex_t’; have ‘struct pthread_mutex’
       50 |      } pthread_mutex_t;
    In file included from .../newlib/libc/include/sys/types.h:221,
                     from .../libgloss/sparc_leon/mutex.c:26:
    .../newlib/libc/include/sys/_pthreadtypes.h:154:20: note: previous declaration of ‘pthread_mutex_t’ with type ‘pthread_mutex_t’ {aka ‘long unsigned int’}
      154 | typedef __uint32_t pthread_mutex_t;      /* identify a mutex */
    
    .../libgloss/sparc_leon/mutex.c:57:8: error: conflicting types for ‘pthread_mutexattr_t’; have ‘struct <anonymous>’
       57 |      } pthread_mutexattr_t;
    ../newlib/libc/include/sys/_pthreadtypes.h:169:3: note: previous declaration of ‘pthread_mutexattr_t’ with type ‘pthread_mutexattr_t’
      169 | } pthread_mutexattr_t;

Diff:
---
 libgloss/sparc_leon/mutex.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libgloss/sparc_leon/mutex.c b/libgloss/sparc_leon/mutex.c
index eb2c2996d..3f51fead3 100644
--- a/libgloss/sparc_leon/mutex.c
+++ b/libgloss/sparc_leon/mutex.c
@@ -23,9 +23,13 @@
  */
 
 
+#define pthread_mutex_t pthread_mutex_t_
+#define pthread_mutexattr_t pthread_mutexattr_t_
 #include <sys/types.h>
 #include <sys/lock.h>
 #include <asm-leon/queue.h>
+#undef pthread_mutex_t
+#undef pthread_mutexattr_t
 /*#include <sys/fsu_pthread_mutex.h>*/
 
 typedef int pthread_protocol_t;

                 reply	other threads:[~2024-01-02  4:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240102043834.CE6E43858283@sourceware.org \
    --to=vapier@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).