Skip to content

Bug: Cannot include windowsesque header into a cpp file #1380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
A2va opened this issue Mar 6, 2025 · 0 comments
Open

Bug: Cannot include windowsesque header into a cpp file #1380

A2va opened this issue Mar 6, 2025 · 0 comments
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)

Comments

@A2va
Copy link
Contributor

A2va commented Mar 6, 2025

Contact Details

[email protected]

What happened?

If windowsesque.h is included in a cpp file it fails to find the _Atomic type declaration.

Repro code: https://github.com/A2va/cosmocc-windowsesque

Version

cosmocc v4.0.2

What operating system are you seeing the problem on?

Linux

Relevant log output

error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/modules/private/action/build/object.lua:100: @programdir/modules/core/tools/gcc.lua:966: In file included from /home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:3,
                 from /home/runner/work/_temp/cosmocc-4.0.2/include/windowsesque.h:18,
                 from main.cpp:1:
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h: In function 'int32_t InterlockedAdd(volatile int32_t*, int32_t)':
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:38:10: error: expected primary-expression before ')' token
   38 |   return atomic_fetch_add((_Atomic(int32_t) *)p, x) + x;
      |          ^~~~~~~~~~~~~~~~
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:38:10: error: '_Atomic' was not declared in this scope
   38 |   return atomic_fetch_add((_Atomic(int32_t) *)p, x) + x;
      |          ^~~~~~~~~~~~~~~~
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:38:10: error: expected primary-expression before ')' token
   38 |   return atomic_fetch_add((_Atomic(int32_t) *)p, x) + x;
      |          ^~~~~~~~~~~~~~~~
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h: In function 'int32_t InterlockedExchange(volatile int32_t*, int32_t)':
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:42:10: error: expected primary-expression before ')' token
   42 |   return atomic_exchange((_Atomic(int32_t) *)p, x);
      |          ^~~~~~~~~~~~~~~
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:42:10: error: '_Atomic' was not declared in this scope
   42 |   return atomic_exchange((_Atomic(int32_t) *)p, x);
      |          ^~~~~~~~~~~~~~~
/home/runner/work/_temp/cosmocc-4.0.2/include/libc/nt/synchronization.h:42:10: error: expected primary-expression before ')' token
   42 |   return atomic_exchange((_Atomic(int32_t) *)p, x);
@A2va A2va added the medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable) label Mar 6, 2025
A2va added a commit to A2va/syncthing-gitignore that referenced this issue Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)
Projects
None yet
Development

No branches or pull requests

1 participant