split codes of "char type" to CharType.h
This commit is contained in:
parent
0cdc519ee6
commit
d53a65b242
@ -2,15 +2,8 @@
|
||||
#define HGL_OS_ANDROID_INCLUDE
|
||||
|
||||
#include<limits.h>
|
||||
#include<hgl/platform/os/CharType.h>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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" //库操作系统前缀
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -2,15 +2,8 @@
|
||||
#define HGL_OS_BSD_INCLUDE
|
||||
|
||||
#include<limits.h>
|
||||
#include<hgl/platform/os/CharType.h>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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"
|
||||
|
18
inc/hgl/platform/os/CharType.h
Normal file
18
inc/hgl/platform/os/CharType.h
Normal file
@ -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
|
@ -2,15 +2,8 @@
|
||||
#define HGL_OS_LINUX_INCLUDE
|
||||
|
||||
#include<limits.h>
|
||||
#include<hgl/platform/os/CharType.h>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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" //库操作系统前缀
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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
|
||||
|
@ -2,15 +2,7 @@
|
||||
#define HGL_OS_MACOS_INCLUDE
|
||||
|
||||
#include<dirent.h>
|
||||
//------------------------------------------------------------------
|
||||
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<hgl/platform/os/CharType.h>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
#if HGL_OS == HGL_OS_iOS
|
||||
#define HGL_OS_NAME OS_TEXT("iOS")
|
||||
|
Loading…
x
Reference in New Issue
Block a user