public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* C11 Threads on MacOS?
@ 2019-11-03 10:00 Quincey Koziol
  2019-11-03 10:28 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Quincey Koziol @ 2019-11-03 10:00 UTC (permalink / raw)
  To: libc-help

Hi!
	I’m using GCC 9.2 on MacOS 10.14 (Mojave), installed with homebrew.   I can’t get a simple C11 threads program to compile:

#include <stdatomic.h>
#include <stdio.h>
#include <threads.h>

int main()
{
    printf("sizeof(thrd_t)=%u\n", (unsigned)sizeof(thrd_t));
    return(0);
}


	I’m getting this from "gcc-9 -std=c11 -pthread foo.c"

foo.c:3:10: fatal error: threads.h: No such file or directory
    3 | #include <threads.h>
      |          ^~~~~~~~~~~
compilation terminated.


	I see that C11 threads was added to glibc in the 2.28 release, but how do I enable it for my builds?  Is there another homebrew package I should install?

	Thanks,
		Quincey

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C11 Threads on MacOS?
  2019-11-03 10:00 C11 Threads on MacOS? Quincey Koziol
@ 2019-11-03 10:28 ` Florian Weimer
  2019-11-04 15:46   ` Quincey Koziol
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2019-11-03 10:28 UTC (permalink / raw)
  To: Quincey Koziol; +Cc: libc-help

* Quincey Koziol:

> I see that C11 threads was added to glibc in the 2.28 release, but
> how do I enable it for my builds?  Is there another homebrew package
> I should install?

There is no glibc port for MacOS, and there are no plans to create
one.  You have to install GNU/Linux (or GNU/Hurd, but that is still
experimental) in order to use glibc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C11 Threads on MacOS?
  2019-11-03 10:28 ` Florian Weimer
@ 2019-11-04 15:46   ` Quincey Koziol
  0 siblings, 0 replies; 3+ messages in thread
From: Quincey Koziol @ 2019-11-04 15:46 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help

Got it, thanks!

> On Nov 3, 2019, at 4:28 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> 
> * Quincey Koziol:
> 
>> I see that C11 threads was added to glibc in the 2.28 release, but
>> how do I enable it for my builds?  Is there another homebrew package
>> I should install?
> 
> There is no glibc port for MacOS, and there are no plans to create
> one.  You have to install GNU/Linux (or GNU/Hurd, but that is still
> experimental) in order to use glibc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-04 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-03 10:00 C11 Threads on MacOS? Quincey Koziol
2019-11-03 10:28 ` Florian Weimer
2019-11-04 15:46   ` Quincey Koziol

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).