public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Does GCC have __gnuc_literal_encoding__ macro defined?
@ 2021-06-25 14:44 sotrdg sotrdg
  2021-06-25 21:51 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: sotrdg sotrdg @ 2021-06-25 14:44 UTC (permalink / raw)
  To: gcc

I just realized clang has this but clang does not support -fexec-charset.

Clang Language Extensions — Clang 13 documentation (llvm.org)<https://clang.llvm.org/docs/LanguageExtensions.html>


__clang_literal_encoding__
Defined to a narrow string literal that represents the current encoding of narrow string literals, e.g., "hello". This macro typically expands to “UTF-8” (but may change in the future if the -fexec-charset="Encoding-Name" option is implemented.)
__clang_wide_literal_encoding__
Defined to a narrow string literal that represents the current encoding of wide string literals, e.g., L"hello". This macro typically expands to “UTF-16” or “UTF-32” (but may change in the future if the -fwide-exec-charset="Encoding-Name" option is implemented.)


I think we probably need macros like
__gnuc_source_encoding__
__gnuc_literal_encoding__
__gnuc_wide_literal_encoding__
__gnuc_literal_encoding_is_ascii_based__
__gnuc_wide_literal_encoding_is_ascii_based__
In GCC

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Does GCC have __gnuc_literal_encoding__ macro defined?
  2021-06-25 14:44 Does GCC have __gnuc_literal_encoding__ macro defined? sotrdg sotrdg
@ 2021-06-25 21:51 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-06-25 21:51 UTC (permalink / raw)
  To: euloanty; +Cc: gcc

GCC defines __GNUC_EXECUTION_CHARSET_NAME and
__GNUC_WIDE_EXECUTION_CHARSET_NAME instead.

https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-25 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 14:44 Does GCC have __gnuc_literal_encoding__ macro defined? sotrdg sotrdg
2021-06-25 21:51 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).