Files
YYCCommonplace/src/yycc/macro/ptr_size_detector.hpp
yyc12345 20a9ef4166 fix: fix comment for new added files.
- translate zh-CN comment into en-US.
- change some comment into Doxygen style.
- add lost Doxygen comment.
- enrich the testbench for ceil_div.
- add lost metaprogramming functions for some files in macro namespace.
2025-08-11 21:57:42 +08:00

29 lines
670 B
C++

#pragma once
// Check pointer size macro
#if (defined(YYCC_PTRSIZE_32) + defined(YYCC_PTRSIZE_64)) != 1
#error "Current environment used pointer size is not supported!"
#endif
namespace yycc::macro::ptr_size {
/// @brief The pointer size kind.
enum class PtrSizeKind {
Bits32, ///< 32-bit environment
Bits64 ///< 64-bit environment
};
/**
* @brief Fetch the pointer size
* @return The kind of pointer size.
*/
inline constexpr PtrSizeKind get_ptr_size() {
#if defined(YYCC_PTRSIZE_32)
return PtrSizeKind::Bits32;
#else
return PtrSizeKind::Bits64;
#endif
}
} // namespace yycc::macro::ptr_size