Skip to content

添加 MSVC 编译器支持:修复 [[assume]] 属性的跨编译器可移植性 #12

@coderabbitai

Description

@coderabbitai

问题描述

core/src/utility/assert.hppassert_debug 函数中直接使用了 C++23 的 [[assume(condition)]] 属性,但该属性在 MSVC 编译器上不受支持。

背景

目前代码库尚未在 MSVC 上进行测试,MSVC 编译器支持将在后续开发周期中处理。

需要的改进

需要为 assert_debug 函数添加跨编译器兼容性支持:

  • 使用 __has_cpp_attribute(assume) 检测 C++23 [[assume]] 支持
  • 为不同编译器提供回退方案(GCC/Clang 的 __builtin_assume,MSVC 的 __assume

相关链接

优先级

此问题将在后续支持 MSVC 的开发周期中处理。

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions