8000 Predefine __unix__ on POSIX targets · Issue #193 · tyfkda/xcc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Predefine __unix__ on POSIX targets #193

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

Closed
LekKit opened this issue May 1, 2025 · 1 comment
Closed

Predefine __unix__ on POSIX targets #193

LekKit opened this issue May 1, 2025 · 1 comment

Comments

@LekKit
8000
Copy link
LekKit commented May 1, 2025
  • GCC and Clang uniformly predefine __unix__ macro to 1, except on Windows, MacOS and Haiku (And some more obscure systems which are definitely not POSIX compliant)
  • This predefined macro is expected by many portable projects, and may lead to build failures if not fixed (Ignoring the other stuff I stumbled upon, which will be reported separately)

Example output from GCC & Clang on a Linux system:

$ echo | gcc -E -dM -c - | grep __unix__
#define __unix__ 1

$ echo | clang -E -dM -c - | grep __unix__
#define __unix__ 1

^ The following shell syntax may be used to figure out other missing (And well-known and expected) predefined macros

tyfkda added a commit that referenced this issue May 4, 2025
  * C99
  * __unix__
  * __MACH__

#193
#194
@tyfkda
Copy link
Owner
tyfkda commented May 4, 2025

I have updated the code to define __unix__.

@LekKit LekKit closed this as completed May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0