mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0027838: Foundation Classes - support wchar_t* input within TCollection_AsciiString and TCollection_ExtendedString
TCollection_ExtendedString/TCollection_AsciiString description has been updated to reflect usage of this classes for Unicode strings. TCollection_ExtendedString now defines constructor taking wchar_t* (all platforms) and method ::ToWideString() returning wchar_t* (Windows only). TCollection_AsciiString now defines constructor taking wchar_t*. TCollection_ExtendedString/TCollection_AsciiString now defines auxiliary methods ::StartsWith() and ::EndsWith(). TCollection_ExtendedString internals has been updated to eliminate duplicated code for converting between UTF-16 and UTF-8. Code has been cleaned up from redundant explicit conversions to wchar_t*. Global method OSD_OpenStream()/OSD_OpenFileBuf() have been replaced by C++ template to eliminate copy-paste for different STL collections. OSD_SharedLibrary now uses wide-char system API call LoadLibraryExW() on Windows for consistency. New macro Standard_UNUSED has been added for marking possibly unused functions and variables (to suppress gcc/clang compiler warnings).
This commit is contained in:
@@ -93,6 +93,9 @@ Standard_MMgrFactory::Standard_MMgrFactory()
|
||||
Standard_STATIC_ASSERT(sizeof(short) == 2);
|
||||
Standard_STATIC_ASSERT(sizeof(Standard_Utf16Char) == 2);
|
||||
Standard_STATIC_ASSERT(sizeof(Standard_Utf32Char) == 4);
|
||||
#ifdef _WIN32
|
||||
Standard_STATIC_ASSERT(sizeof(Standard_WideChar) == sizeof(Standard_Utf16Char));
|
||||
#endif
|
||||
|
||||
char* aVar;
|
||||
aVar = getenv ("MMGT_OPT");
|
||||
|
@@ -29,6 +29,14 @@
|
||||
#define Standard_OVERRIDE
|
||||
#endif
|
||||
|
||||
// Macro for marking variables / functions as possibly unused
|
||||
// so that compiler will not emit redundant "unused" warnings.
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define Standard_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define Standard_UNUSED
|
||||
#endif
|
||||
|
||||
// Macro Standard_DEPRECATED("message") can be used to declare a method deprecated.
|
||||
// If OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty.
|
||||
#ifdef OCCT_NO_DEPRECATED
|
||||
|
Reference in New Issue
Block a user