VirtualBox

Changeset 99802 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 16, 2023 12:05:16 AM (19 months ago)
Author:
vboxsync
Message:

*: Adjustments necessary for dropping -Zc:wchar_t- on windows and instead let the C++ compiler use the native wchar_t type.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nocrt/limits.h

    r98103 r99802  
    5454#endif
    5555
     56#if !defined(WCHAR_MIN)
     57# if defined(RT_OS_WINDOWS)
     58#  define WCHAR_MIN     0
     59# endif
     60#endif
     61#if !defined(WCHAR_MAX)
     62# if defined(RT_OS_WINDOWS)
     63#  define WCHAR_MAX     0xffff
     64# endif
     65#endif
     66/** @todo Define WCHAR_MIN+WCHAR_MAX on non-windows */
     67
    5668#define WORD_BIT        16
    5769#define USHRT_MAX       0xffff
  • trunk/include/iprt/types.h

    r99427 r99802  
    33843384
    33853385/**
    3386  * UTF-16 character.
    3387  * @remark  wchar_t is not usable since it's compiler defined.
     3386 * UTF-16 character.
     3387 * 
     3388 * @remark  wchar_t is not usable since it's compiler defined and can be 8 thru
     3389 *          64 bit wide.  On Windows it is 16-bit, though, and for various
     3390 *          reasons of convenience we need to use the native compiler type when
     3391 *          compling without the /Zc:wchar_t- option (only relevant for C++ and
     3392 *          _NATIVE_WCHAR_T_DEFINED indicates the absense of /Zc:wchar_t-).
     3393 * 
    33883394 * @remark  When we use the term character we're not talking about unicode code point, but
    33893395 *          the basic unit of the string encoding. Thus cwc - count of wide chars - means
     
    33913397 *          and cch means count of the typedef 'char', which is assumed to be an octet.
    33923398 */
     3399#if defined(_MSC_VER) && defined(__cplusplus) && defined(_NATIVE_WCHAR_T_DEFINED)
     3400typedef __wchar_t               RTUTF16;
     3401#else
    33933402typedef uint16_t                RTUTF16;
     3403#endif
    33943404/** Pointer to a UTF-16 character. */
    33953405typedef RTUTF16         RT_FAR *PRTUTF16;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette