2
0
Эх сурвалжийг харах

fix: 修复MSVC编译的错误

SongZihuan 3 жил өмнө
parent
commit
ac6478a673

+ 1 - 1
CMakeLists.txt

@@ -14,7 +14,7 @@ set(CMAKE_C_STANDARD 11)
 set(C_EXTENSIONS ON)  # 启动编译器拓展
 set(C_STANDARD_REQUIRED OFF)
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 20)
 set(CXX_EXTENSIONS ON)  # 启动编译器拓展
 set(CXX_STANDARD_REQUIRED OFF)
 

+ 1 - 1
src/core/__env.hpp

@@ -21,7 +21,7 @@ typedef struct af_EnvironmentList af_EnvironmentList;
 #include "__gc.hpp"
 #include "__func.hpp"
 #include "__monitor.hpp"
-#include "regex.h"
+#include "regex.hpp"
 
 #define DEFAULT_GC_COUNT_MAX (50)
 #define ENV_VAR_HASH_SIZE (8)

+ 1 - 1
src/tool/__regex.hpp

@@ -1,6 +1,6 @@
 #ifndef TOOL_REGEX_H_
 #define TOOL_REGEX_H_
-#include "regex.h"
+#include "regex.hpp"
 
 struct af_Regex {
     pcre2_code *re;  // 正则表达式

+ 2 - 1
src/tool/stdio_.cpp

@@ -55,7 +55,8 @@ static int setCursorPosition(HANDLE std_o, CONSOLE_SCREEN_BUFFER_INFO *info_, SH
     else if (y > info_->dwSize.Y)
         y = info_->dwSize.Y;
 
-    SetConsoleCursorPosition(std_o, (COORD){.X=(SHORT)x, .Y=(SHORT)y});
+    COORD coord = {.X=(SHORT)x, .Y=(SHORT)y};
+    SetConsoleCursorPosition(std_o, coord);
     return 1;
 }