20260829 Redesign
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include "c_Platform.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv){
|
||||
// 1. 打印基础架构诊断信息
|
||||
printf("操作系统: %s, 编译器: %s (版本: %d)\n",
|
||||
C_CURRENT_OS_NAME, C_CURRENT_COMPILER_NAME, C_CURRENT_COMPILER_VERSION);
|
||||
|
||||
// 2. 结合操作系统与编译器的复合拦截
|
||||
#if C_IS_OS_WINDOWS
|
||||
if (C_ENVIRONMENT_IS_MINGW) {
|
||||
printf("正在您的本地环境 (Windows + MSYS2 MinGW) 下高效执行...\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
// 3. 多平台特化高性能代码分支
|
||||
#if C_IS_OS_LINUX && C_IS_COMPILER_GCC
|
||||
// Linux 下使用 GCC 的特化高性能系统调用
|
||||
printf("启用 Linux Epoll & GCC 优化算法\n");
|
||||
#elif C_IS_OS_MACOS || C_IS_OS_FREEBSD
|
||||
// macOS 和 FreeBSD 属于 BSD 谱系,可以使用类似 kqueue 的特性
|
||||
printf("启用 BSD 谱系特化内核优化\n");
|
||||
#else
|
||||
printf("启用跨平台标准通用算法\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user