home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WCHAR_HPP_INCLUDED
- #define _WCHAR_HPP_INCLUDED
-
- /*
- * Character codes should all start with "_"
- */
-
- #if defined( UNICODE ) || defined( _UNICODE )
- #undef _UNICODE
- #undef UNICODE
- #define _UNICODE
- #define UNICODE
- #endif
-
- #if defined( SBCS ) || defined( _SBCS )
- #undef _SBCS
- #undef SBCS
- #define _SBCS
- #define SBCS
- #endif
-
- /*
- * If we're not Unicode or SBCS, we must be DBCS!
- */
-
- #if !defined( _UNICODE ) && !defined( _SBCS )
- #undef _DBCS
- #define _DBCS
- #endif
-
- #if defined( DBCS ) || defined( _DBCS ) || defined( MBCS ) || defined( _MBCS )
- #undef _DBCS
- #undef DBCS
- #undef _MBCS
- #undef MBCS
- #define _DBCS
- #define DBCS
- #define _MBCS
- #define MBCS
- #endif
-
-
- /*
- * Complain if multiple things are defined...
- */
-
- #ifdef _DEBUG
- #if ( defined( _UNICODE ) && defined( _DBCS ) ) || \
- ( defined( _UNICODE ) && defined( _SBCS ) ) || \
- ( defined( _DBCS ) && defined( _SBCS ) )
- #error "Too many character codes!"
- #endif
- #endif
-
- /*
- * Define what a wchar_t is, if it hasn't already been defined...
- */
-
- #if defined( _WCHAR_T_DEFINED ) || defined( _WCHAR_T_DEFINED_ )
- #undef _WCHAR_T_DEFINED
- #undef _WCHAR_T_DEFINED__
- #else
- typedef unsigned short wchar_t;
- #endif
-
- #define _WCHAR_T_DEFINED_
- #define _WCHAR_T_DEFINED
-
- typedef char WAnsiChar;
- typedef wchar_t WUnicodeChar;
-
- /*
- * Define the WChar type
- */
-
- #ifdef _UNICODE
- typedef WUnicodeChar WChar;
-
- #define __WTEXT(quote) L##quote
- #else
- typedef WAnsiChar WChar;
-
- #define __WTEXT(quote) quote
- #endif
-
- #ifdef _SBCS
- typedef WAnsiChar WWidestChar;
- #else
- typedef WUnicodeChar WWidestChar; // handles DBCS too!
- #endif
-
- typedef WChar *WCharPtr;
- typedef const WChar *WCCharPtr;
-
- typedef WWidestChar *WWidestCharPtr;
- typedef const WChar *WCWidestCharPtr;
-
- #define WTEXT(quote) __WTEXT(quote)
- #define WCTEXT(quote) WTEXT(quote) // for Code text only
-
- #endif // _WCHAR_HPP_INCLUDED
-