diff options
author | JeanHeyd Meneide <phdofthehouse@gmail.com> | 2020-12-01 14:39:47 -0700 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 2020-12-01 14:46:51 -0700 |
commit | eccec8684142e05f2f92f0f5bd5b47dda3ba1529 (patch) | |
tree | fe7097d15b7f8eaa5cfa1635f0783e1824908083 /libcpp/directives.c | |
parent | 39836f8324d819459cb21198e95b993588c6a2b1 (diff) | |
download | gcc-eccec8684142e05f2f92f0f5bd5b47dda3ba1529.zip gcc-eccec8684142e05f2f92f0f5bd5b47dda3ba1529.tar.gz gcc-eccec8684142e05f2f92f0f5bd5b47dda3ba1529.tar.bz2 |
Feature: Macros for identifying the wide and narrow execution string literal encoding
gcc/c-family
* c-cppbuiltin.c (c_cpp_builtins): Add predefined
{__GNUC_EXECUTION_CHARSET_NAME} and
_WIDE_EXECUTION_CHARSET_NAME} macros.
gcc/
* doc/cpp.texi: Document new macros.
gcc/testsuite/
* c-c++-common/cpp/wide-narrow-predef-macros.c: New test.
libcpp/
* charset.c (init_iconv_desc): Initialize "to" and "from" fields.
* directives.c (cpp_get_narrow_charset_name): New function.
(cpp_get_wide_charset_name): Likewise.
* include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
(cpp_get_wide_charset_name): Likewise.
* internal.h (cset_converter): Add "to" and "from" fields.
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r-- | libcpp/directives.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c index 7511560..0d09da7 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -2596,6 +2596,20 @@ cpp_set_callbacks (cpp_reader *pfile, cpp_callbacks *cb) pfile->cb = *cb; } +/* The narrow character set identifier. */ +const char * +cpp_get_narrow_charset_name (cpp_reader *pfile) +{ + return pfile->narrow_cset_desc.to; +} + +/* The wide character set identifier. */ +const char * +cpp_get_wide_charset_name (cpp_reader *pfile) +{ + return pfile->wide_cset_desc.to; +} + /* The dependencies structure. (Creates one if it hasn't already been.) */ class mkdeps * cpp_get_deps (cpp_reader *pfile) |