summaryrefslogtreecommitdiff
path: root/external/vpc/public/tier0/wchartypes.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /external/vpc/public/tier0/wchartypes.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'external/vpc/public/tier0/wchartypes.h')
-rw-r--r--external/vpc/public/tier0/wchartypes.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/external/vpc/public/tier0/wchartypes.h b/external/vpc/public/tier0/wchartypes.h
new file mode 100644
index 0000000..8446b68
--- /dev/null
+++ b/external/vpc/public/tier0/wchartypes.h
@@ -0,0 +1,101 @@
+//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
+//
+// Purpose: All of our code is completely Unicode. Instead of char, you should
+// use wchar, uint8, or char8, as explained below.
+//
+// $NoKeywords: $
+//=============================================================================//
+
+
+#ifndef WCHARTYPES_H
+#define WCHARTYPES_H
+#ifdef _WIN32
+#pragma once
+#endif
+#include "stddef.h"
+#ifdef _INC_TCHAR
+#error ("Must include tier0 type headers before tchar.h")
+#endif
+
+// Temporarily turn off Valve defines
+#include "tier0/valve_off.h"
+
+#if !defined(_WCHAR_T_DEFINED) && !defined( __WCHAR_TYPE__ ) && !defined(GNUC)
+typedef unsigned short wchar_t;
+#define _WCHAR_T_DEFINED
+#endif
+
+// char8
+// char8 is equivalent to char, and should be used when you really need a char
+// (for example, when calling an external function that's declared to take
+// chars).
+typedef char char8;
+
+// uint8
+// uint8 is equivalent to byte (but is preferred over byte for clarity). Use this
+// whenever you mean a byte (for example, one byte of a network packet).
+// uint8 itself is defined in platform.h
+typedef unsigned char BYTE;
+typedef unsigned char byte;
+
+// wchar
+// wchar is a single character of text (currently 16 bits, as all of our text is
+// Unicode). Use this whenever you mean a piece of text (for example, in a string).
+typedef wchar_t wchar;
+//typedef char wchar;
+
+// __WFILE__
+// This is a Unicode version of __FILE__
+#define WIDEN2(x) L ## x
+#define WIDEN(x) WIDEN2(x)
+#define __WFILE__ WIDEN(__FILE__)
+
+#ifdef STEAM
+#ifndef _UNICODE
+#define FORCED_UNICODE
+#endif
+#define _UNICODE
+#endif
+
+#if defined( POSIX ) || defined( _PS3 )
+#define _tcsstr strstr
+#define _tcsicmp stricmp
+#define _tcscmp strcmp
+#define _tcscpy strcpy
+#define _tcsncpy strncpy
+#define _tcsrchr strrchr
+#define _tcslen strlen
+#define _tfopen fopen
+#define _stprintf sprintf
+#define _ftprintf fprintf
+#define _vsntprintf _vsnprintf
+#define _tprintf printf
+#define _sntprintf _snprintf
+#define _T(s) s
+#else
+#include <tchar.h>
+#endif
+
+#if defined(_UNICODE)
+typedef wchar tchar;
+#define tstring wstring
+#define __TFILE__ __WFILE__
+#define TCHAR_IS_WCHAR
+#else
+typedef char tchar;
+#define tstring string
+#define __TFILE__ __FILE__
+#define TCHAR_IS_CHAR
+#endif
+
+#ifdef FORCED_UNICODE
+#undef _UNICODE
+#endif
+
+// Turn valve defines back on
+#include "tier0/valve_on.h"
+
+
+#endif // WCHARTYPES
+
+