From eccec8684142e05f2f92f0f5bd5b47dda3ba1529 Mon Sep 17 00:00:00 2001 From: JeanHeyd Meneide Date: Tue, 1 Dec 2020 14:39:47 -0700 Subject: 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. --- libcpp/include/cpplib.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libcpp/include/cpplib.h') diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 2becd2e..692aee5 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -1005,6 +1005,11 @@ extern class mkdeps *cpp_get_deps (cpp_reader *) ATTRIBUTE_PURE; extern const char *cpp_find_header_unit (cpp_reader *, const char *file, bool angle_p, location_t); +/* Call these to get name data about the various compile-time + charsets. */ +extern const char *cpp_get_narrow_charset_name (cpp_reader *) ATTRIBUTE_PURE; +extern const char *cpp_get_wide_charset_name (cpp_reader *) ATTRIBUTE_PURE; + /* This function reads the file, but does not start preprocessing. It returns the name of the original file; this is the same as the input file, except for preprocessed input. This will generate at -- cgit v1.1