From 69261c4b5fa020ad50bcd15f3b7e3e881ad6ded7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Apr 2010 23:42:07 +0200 Subject: Work around the GCC visibility and specialization issue If a template has any specializations, it is considered as defined by GCC and any attempt to later set a visibility attribute via explicit instantiation has no effect. --- libxsd/xsd/cxx/tree/bits/literals.hxx | 78 ++++++++++ libxsd/xsd/cxx/tree/bits/literals.ixx | 270 ++++++++++++++++++++++++++++++++++ 2 files changed, 348 insertions(+) (limited to 'libxsd/xsd/cxx/tree/bits') diff --git a/libxsd/xsd/cxx/tree/bits/literals.hxx b/libxsd/xsd/cxx/tree/bits/literals.hxx index 6fe6ddd..49ac0ca 100644 --- a/libxsd/xsd/cxx/tree/bits/literals.hxx +++ b/libxsd/xsd/cxx/tree/bits/literals.hxx @@ -173,6 +173,84 @@ namespace xsd template const C* gmonth_prefix (); + + // Exception and diagnostics string literals. + // + template + const C* + ex_error_error (); // " error: " + + template + const C* + ex_error_warning (); // " warning: " + + template + const C* + ex_parsing_msg (); // "instance document parsing failed" + + template + const C* + ex_eel_expected (); // "expected element '" + + template + const C* + ex_uel_expected (); // "expected element '" + + template + const C* + ex_uel_instead (); // "' instead of '" + + template + const C* + ex_uel_unexpected (); // "unexpected element '" + + template + const C* + ex_eat_expected (); // "expected attribute '" + + template + const C* + ex_uen_unexpected (); // "unexpected enumerator '" + + template + const C* + ex_etc_msg (); // "expected text content" + + template + const C* + ex_nti_no_type_info (); // "no type information available for type '" + + template + const C* + ex_nei_no_element_info (); // "no parsing or serialization information + // available for element '" + template + const C* + ex_nd_type (); // "type '" + + template + const C* + ex_nd_not_derived (); // "' is not derived from '" + + template + const C* + ex_di_id (); // "ID '" + + template + const C* + ex_di_already_exist (); // "' already exist" + + template + const C* + ex_serialization_msg (); // "serialization failed" + + template + const C* + ex_npm_no_mapping (); // "no mapping provided for namespace prefix '" + + template + const C* + ex_bounds_msg (); // "buffer boundary rules have been violated" } } } diff --git a/libxsd/xsd/cxx/tree/bits/literals.ixx b/libxsd/xsd/cxx/tree/bits/literals.ixx index bd6fd30..e11bcac 100644 --- a/libxsd/xsd/cxx/tree/bits/literals.ixx +++ b/libxsd/xsd/cxx/tree/bits/literals.ixx @@ -306,6 +306,141 @@ namespace xsd { return "--"; } + + // + // + template <> + inline const char* + ex_error_error () + { + return " error: "; + } + + template <> + inline const char* + ex_error_warning () + { + return " warning: "; + } + + template <> + inline const char* + ex_parsing_msg () + { + return "instance document parsing failed"; + } + + template <> + inline const char* + ex_eel_expected () + { + return "expected element '"; + } + + template <> + inline const char* + ex_uel_expected () + { + return "expected element '"; + } + + template <> + inline const char* + ex_uel_instead () + { + return "' instead of '"; + } + + template <> + inline const char* + ex_uel_unexpected () + { + return "unexpected element '"; + } + + template <> + inline const char* + ex_eat_expected () + { + return "expected attribute '"; + } + + template <> + inline const char* + ex_uen_unexpected () + { + return "unexpected enumerator '"; + } + + template <> + inline const char* + ex_etc_msg () + { + return "expected text content"; + } + + template <> + inline const char* + ex_nti_no_type_info () + { + return "no type information available for type '"; + } + + template <> + inline const char* + ex_nei_no_element_info () + { + return "no parsing or serialization information available for " + "element '"; + } + template <> + inline const char* + ex_nd_type () + { + return "type '"; + } + + template <> + inline const char* + ex_nd_not_derived () + { + return "' is not derived from '"; + } + + template <> + inline const char* + ex_di_id () + { + return "ID '"; + } + + template <> + inline const char* + ex_di_already_exist () + { + return "' already exist"; + } + + template <> + inline const char* + ex_serialization_msg () + { + return "serialization failed"; + } + + template <> + inline const char* + ex_npm_no_mapping () + { + return "no mapping provided for namespace prefix '"; + } + + template <> + inline const char* + ex_bounds_msg () + { + return "buffer boundary rules have been violated"; + } } } } @@ -597,6 +732,141 @@ namespace xsd { return L"--"; } + + // + // + template <> + inline const wchar_t* + ex_error_error () + { + return L" error: "; + } + + template <> + inline const wchar_t* + ex_error_warning () + { + return L" warning: "; + } + + template <> + inline const wchar_t* + ex_parsing_msg () + { + return L"instance document parsing failed"; + } + + template <> + inline const wchar_t* + ex_eel_expected () + { + return L"expected element '"; + } + + template <> + inline const wchar_t* + ex_uel_expected () + { + return L"expected element '"; + } + + template <> + inline const wchar_t* + ex_uel_instead () + { + return L"' instead of '"; + } + + template <> + inline const wchar_t* + ex_uel_unexpected () + { + return L"unexpected element '"; + } + + template <> + inline const wchar_t* + ex_eat_expected () + { + return L"expected attribute '"; + } + + template <> + inline const wchar_t* + ex_uen_unexpected () + { + return L"unexpected enumerator '"; + } + + template <> + inline const wchar_t* + ex_etc_msg () + { + return L"expected text content"; + } + + template <> + inline const wchar_t* + ex_nti_no_type_info () + { + return L"no type information available for type '"; + } + + template <> + inline const wchar_t* + ex_nei_no_element_info () + { + return L"no parsing or serialization information available for " + L"element '"; + } + template <> + inline const wchar_t* + ex_nd_type () + { + return L"type '"; + } + + template <> + inline const wchar_t* + ex_nd_not_derived () + { + return L"' is not derived from '"; + } + + template <> + inline const wchar_t* + ex_di_id () + { + return L"ID '"; + } + + template <> + inline const wchar_t* + ex_di_already_exist () + { + return L"' already exist"; + } + + template <> + inline const wchar_t* + ex_serialization_msg () + { + return L"serialization failed"; + } + + template <> + inline const wchar_t* + ex_npm_no_mapping () + { + return L"no mapping provided for namespace prefix '"; + } + + template <> + inline const wchar_t* + ex_bounds_msg () + { + return L"buffer boundary rules have been violated"; + } } } } -- cgit v1.1