Skip to content
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

ajudst: stdint.h 改为兼容不同编译器,并移至 include/ege 目录 #242

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

yixy-only
Copy link
Collaborator

MSVC在低于 VC2010 的版本中无 stdint.h 头文件。GCC 则是明确说明从 4.5 版本开始由 GCC 提供(Status of C99 features in GCC),其它版本则可能由系统和库提供。Clang 在极早期版本就可直接使用。

  • 默认转为包含编译器自带的 stdint.h,只有在不提供 stdint.h 的低版本编译器才会自行定义类型。
  • 对于 GCC 的 _STDINT_H 和 MSVC 的 _STDINT 包含保护宏做了包含检测,防止与其它第三方库自带的 stdint.h 冲突。由于 默认 Clang 自带 stdint.h,直接包含 <stdint.h> 而且自行定义类型, 所以不需要检测 Clang。

在 ege.h 头文件中包含 stdint.h 以允许使用标准中具有特定位宽的类型。

@yixy-only yixy-only self-assigned this Nov 28, 2024
@yixy-only
Copy link
Collaborator Author

@wysaid

@yixy-only yixy-only merged commit a74886b into wysaid:master Nov 28, 2024
1 check passed
@yixy-only yixy-only deleted the refactor_stdint branch November 28, 2024 15:22
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

Successfully merging this pull request may close these issues.

1 participant