refactor: refactor old IOHelper.
- move pointer left padding macro into single header file. - move utf8 fopen into single header but not finished. - add testbench for pointer left padding macro. - add system pointer size detector according to new migrated features requested.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Check OS macro
|
||||
#if (defined(YYCC_OS_WINDOWS) + defined(YYCC_OS_LINUX)) != 1
|
||||
#if (defined(YYCC_OS_WINDOWS) + defined(YYCC_OS_LINUX) + defined(YYCC_OS_MACOS)) != 1
|
||||
#error "Current operating system is not supported!"
|
||||
#endif
|
||||
|
||||
@ -11,6 +11,7 @@ namespace yycc::macro::os {
|
||||
enum class OsKind {
|
||||
Windows, ///< Microsoft Windows
|
||||
Linux, ///< GNU/Linux
|
||||
MacOs, ///< Apple macOS
|
||||
};
|
||||
|
||||
/**
|
||||
@ -20,8 +21,10 @@ namespace yycc::macro::os {
|
||||
inline constexpr OsKind get_os() {
|
||||
#if defined(YYCC_OS_WINDOWS)
|
||||
return OsKind::Windows;
|
||||
#else
|
||||
#elif defined(YYCC_OS_LINUX)
|
||||
return OsKind::Linux;
|
||||
#else
|
||||
return OsKind::MacOs;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
6
src/yycc/macro/ptr_size_detector.hpp
Normal file
6
src/yycc/macro/ptr_size_detector.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
#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
|
Reference in New Issue
Block a user