From e3bc5a94c67a650a9d1d7e0fcce884cab50f8fff Mon Sep 17 00:00:00 2001 From: kusugawa Date: Fri, 10 Jul 2020 18:57:35 +0800 Subject: [PATCH] =?UTF-8?q?char8=5Ft=E7=B1=BB=E5=9E=8B=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/platform/compiler/GNU.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/hgl/platform/compiler/GNU.h b/inc/hgl/platform/compiler/GNU.h index ca9e2dc..3f0d906 100644 --- a/inc/hgl/platform/compiler/GNU.h +++ b/inc/hgl/platform/compiler/GNU.h @@ -72,10 +72,11 @@ #endif//__GNUC__ -#ifdef char8_t -using u8char =char8_t; +// 假设 GCC 从 11 开始正式支持 char8_t( 这个我手头没有 11 ,不确定 ) +#if __GNUC__ >= 11 + using u8char = char8_t; #else -using u8char =char; + using u8char = char; #endif