This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C11 Threads on MacOS?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]