seanbaxter / circle

The compiler is available for download. Get it!
http://www.circle-lang.org/
2.42k stars 74 forks source link

Circle is incompatible with GCC's stdatomic.h #183

Open johnsonjh opened 1 year ago

johnsonjh commented 1 year ago

For example:

error: src/sirinternal.c:99:23
undeclared identifier '__auto_type'
    if (_SIR_MAGIC == atomic_load(&_sir_magic))
                      ^

error: src/sirinternal.c:99:23
undeclared identifier '__atomic_load_ptr'
    if (_SIR_MAGIC == atomic_load(&_sir_magic))
                      ^

error: src/sirinternal.c:99:23
undeclared identifier '__atomic_load_ptr'
    if (_SIR_MAGIC == atomic_load(&_sir_magic))
                      ^

error: src/sirinternal.c:99:23
undeclared identifier '__atomic_load_tmp'
    if (_SIR_MAGIC == atomic_load(&_sir_magic))
                      ^

error: src/sirinternal.c:99:20
operands must be arithmetic or object pointer type
  operands are prvalue int and void
    if (_SIR_MAGIC == atomic_load(&_sir_magic))
                   ^

error: src/sirinternal.c:122:5
undeclared identifier '__auto_type'
    atomic_store(&_sir_magic, _SIR_MAGIC);
    ^

error: src/sirinternal.c:122:5
undeclared identifier '__atomic_store_ptr'
    atomic_store(&_sir_magic, _SIR_MAGIC);
    ^

error: src/sirinternal.c:122:5
undeclared identifier '__atomic_store_ptr'
    atomic_store(&_sir_magic, _SIR_MAGIC);
    ^

error: src/sirinternal.c:200:5
undeclared identifier '__auto_type'
    atomic_store(&_sir_magic, 0);
    ^

error: src/sirinternal.c:200:5
undeclared identifier '__atomic_store_ptr'
    atomic_store(&_sir_magic, 0);
    ^

error: src/sirinternal.c:200:5
undeclared identifier '__atomic_store_ptr'
    atomic_store(&_sir_magic, 0);

These aren't implemented in LLVM - the solution would be to use LLVM's stdatomic.h but this doesn't seem trivial when wanting to use libstdc++ (but would be fine with libc++ stdlib selected).