Importc: FreeBSD compiles stdatomic.h (#15041)

This commit is contained in:
Walter Bright 2023-03-25 21:49:00 -07:00 committed by GitHub
parent 511036f31e
commit ab62befd47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View file

@ -2307,9 +2307,9 @@ final class CParser(AST) : Parser!AST
tk = peek(tk);
if (isTypeName(tk) && tk.value == TOK.rightParenthesis)
{
nextToken();
nextToken();
t = cparseTypeName();
// TODO - implement the "atomic" part of t
tkwx = TKW.x_Atomic;
break;
}
@ -2578,6 +2578,7 @@ final class CParser(AST) : Parser!AST
}
case TKW.xtag:
case TKW.x_Atomic: // no atomics for you
break; // t is already set
default:

View file

@ -41,13 +41,11 @@
#ifndef __linux__
#ifndef _MSC_VER
#ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/stdatomic.h(80): Error: type-specifier is missing
#ifndef __FreeBSD__ // /stdatomic.h(162): Error: found `volatile` when expecting `{`
#include <stdatomic.h>
#endif
#endif
#endif
#endif
#endif
#include <stdbool.h>
#include <stddef.h>

View file

@ -388,6 +388,9 @@ __attribute__((static, unsigned, long, const, extern, register, typedef, short,
_Thread_local, int, char, float, double, void, _Bool, _Atomic))
int test22196();
_Atomic(_Bool) atomicbool;
/***************************************************/
// https://issues.dlang.org/show_bug.cgi?id=22245

View file

@ -102,6 +102,8 @@
#if __FreeBSD__
#define __volatile volatile
#define __sync_synchronize()
#define __sync_swap(A, B) 1
#endif
#if _MSC_VER