diff --git a/inc/hgl/platform/os/Android.h b/inc/hgl/platform/os/Android.h index ad87165..fc2af35 100644 --- a/inc/hgl/platform/os/Android.h +++ b/inc/hgl/platform/os/Android.h @@ -2,15 +2,8 @@ #define HGL_OS_ANDROID_INCLUDE #include +#include //-------------------------------------------------------------------------------------------------- -using u32char =char32_t; -using u16char =char16_t; -using os_char =char; -#define to_oschar to_u8 -#define OS_TEXT(str) u8##str -#define U8_TEXT(str) u8##str -#define U16_TEXT(str) u##str - #define HGL_OS_NAME OS_TEXT("Android") #define HGL_LIB_OS "Android" //库操作系统前缀 //-------------------------------------------------------------------------------------------------- diff --git a/inc/hgl/platform/os/BSD.h b/inc/hgl/platform/os/BSD.h index 172351e..80ad19c 100644 --- a/inc/hgl/platform/os/BSD.h +++ b/inc/hgl/platform/os/BSD.h @@ -2,15 +2,8 @@ #define HGL_OS_BSD_INCLUDE #include +#include //-------------------------------------------------------------------------------------------------- -using u32char =char32_t; -using u16char =char16_t; -using os_char =char; -#define to_oschar to_u8 -#define OS_TEXT(str) u8##str -#define U8_TEXT(str) u8##str -#define U16_TEXT(str) u##str - #if defined(__FreeBSD__)||defined(__FreeBSD) #define HGL_OS_NAME OS_TEXT("FreeBSD") #define HGL_LIB_OS_NAME "FreeBSD" diff --git a/inc/hgl/platform/os/CharType.h b/inc/hgl/platform/os/CharType.h new file mode 100644 index 0000000..10751b7 --- /dev/null +++ b/inc/hgl/platform/os/CharType.h @@ -0,0 +1,18 @@ +#ifndef HGL_CHAR_TYPE_INCLUDE +#define HGL_CHAR_TYPE_INCLUDE + +using u32char =char32_t; +using u16char =char16_t; +using os_char =char; +#define to_oschar to_u8 +#define OS_TEXT(str) u8##str +#define U8_TEXT(str) u8##str +#define U16_TEXT(str) u##str + +#define os_main main +#define os_out std::cout +#define os_in std::cin +#define os_err std::cerr +#define os_log std::clog + +#endif//HGL_CHAR_TYPE_INCLUDE diff --git a/inc/hgl/platform/os/Linux.h b/inc/hgl/platform/os/Linux.h index 869c883..f8b915d 100644 --- a/inc/hgl/platform/os/Linux.h +++ b/inc/hgl/platform/os/Linux.h @@ -2,15 +2,8 @@ #define HGL_OS_LINUX_INCLUDE #include +#include //-------------------------------------------------------------------------------------------------- -using u32char =char32_t; -using u16char =char16_t; -using os_char =char; -#define to_oschar to_u8 -#define OS_TEXT(str) str -#define U8_TEXT(str) u8##str -#define U16_TEXT(str) u##str - #define HGL_OS_NAME OS_TEXT("Linux") #define HGL_LIB_OS "Linux" //库操作系统前缀 //-------------------------------------------------------------------------------------------------- diff --git a/inc/hgl/platform/os/MSWindows.h b/inc/hgl/platform/os/MSWindows.h index 6d4d853..ec51c24 100644 --- a/inc/hgl/platform/os/MSWindows.h +++ b/inc/hgl/platform/os/MSWindows.h @@ -16,6 +16,12 @@ using os_char =wchar_t; #define U8_TEXT(str) u8##str #define U16_TEXT(str) L##str +#define os_main wmain +#define os_out std::wcout +#define os_in std::wcin +#define os_err std::wcerr +#define os_log std::wclog + #define HGL_OS_NAME OS_TEXT("Windows") #if HGL_CPU == HGL_CPU_X86_32 diff --git a/inc/hgl/platform/os/MacOS.h b/inc/hgl/platform/os/MacOS.h index 15a8476..9acbc6f 100644 --- a/inc/hgl/platform/os/MacOS.h +++ b/inc/hgl/platform/os/MacOS.h @@ -2,15 +2,7 @@ #define HGL_OS_MACOS_INCLUDE #include -//------------------------------------------------------------------ -using u32char =char32_t; -using u16char =char16_t; -using os_char =char; -#define to_oschar to_u8 -#define OS_TEXT(str) u8##str -#define U8_TEXT(str) u8##str -#define U16_TEXT(str) u##str - +#include //-------------------------------------------------------------------------------------------------- #if HGL_OS == HGL_OS_iOS #define HGL_OS_NAME OS_TEXT("iOS")