Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
4.8 KiB

  1. //========= Copyright � 1996-2004, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose: PS/3 Platform include
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef _PS3_PLATFORM_H
  8. #define _PS3_PLATFORM_H
  9. //EAPS3 #undef Verify // can't use verify, because there's a Verify member of struct D3DPushBuffer
  10. #include <stdio.h>
  11. #include <math.h>
  12. #include <wchar.h>
  13. #include <string.h> // needed for memset
  14. //EAPS3: Defines of win32 types used in Visual Studio.
  15. typedef void VOID;
  16. typedef const void * LPCVOID;
  17. typedef unsigned long DWORD;
  18. typedef DWORD * LPDWORD;
  19. typedef int BOOL;
  20. typedef int * LPBOOL;
  21. typedef unsigned short WORD;
  22. typedef float FLOAT;
  23. typedef short SHORT;
  24. typedef long LONG;
  25. typedef char CHAR;
  26. typedef unsigned int UINT;
  27. typedef unsigned long ULONG;
  28. typedef unsigned char BYTE;
  29. typedef BYTE* LPBYTE;
  30. typedef long long DWORDLONG;
  31. typedef void* PVOID;
  32. typedef int DWORD_PTR;
  33. typedef int ULONG_PTR;
  34. typedef long* LONG_PTR;
  35. typedef unsigned int* UINT_PTR;
  36. typedef WORD* LPWORD;
  37. typedef ULONG_PTR * PDWORD_PTR;
  38. typedef ULONG_PTR SIZE_T;
  39. typedef ULONG_PTR * PSIZE_T;
  40. typedef wchar_t WCHAR;
  41. typedef CHAR TCHAR;
  42. typedef const char* LPCSTR;
  43. typedef char* LPSTR;
  44. typedef LPSTR LPTSTR;
  45. typedef const char* LPCTSTR;
  46. typedef const wchar_t* LPCWSTR;
  47. typedef WCHAR * LPWSTR;
  48. typedef WCHAR * PWSTR;
  49. typedef void* HICON;
  50. typedef void* HCURSOR;
  51. typedef void* HBRUSH;
  52. typedef void* HMENU;
  53. typedef void* HFONT;
  54. typedef void* HBITMAP;
  55. typedef DWORD COLORREF;
  56. typedef void* HINSTANCE;
  57. typedef UINT MMRESULT;
  58. typedef long HRESULT;
  59. typedef long LRESULT;
  60. typedef void* HANDLE;
  61. //typedef void* HWND;
  62. typedef void* LPVOID;
  63. typedef unsigned int WPARAM;
  64. typedef int LPARAM;
  65. typedef void* HDC;
  66. typedef void* HHOOK;
  67. typedef void* HMODULE;
  68. typedef void* HKL;
  69. typedef void* HKEY;
  70. typedef HKEY* PHKEY;
  71. typedef void* HGDIOBJ;
  72. typedef WORD ATOM;
  73. typedef HANDLE HGLOBAL;
  74. //typedef WORD WAVEFORMATEX;
  75. typedef long long __int64;
  76. typedef float vec3_t[3];
  77. typedef signed long long s64_t;
  78. typedef unsigned long long u64_t;
  79. typedef signed int s32_t;
  80. typedef unsigned int u32_t;
  81. typedef signed short s16_t;
  82. typedef unsigned short u16_t;
  83. typedef signed char s8_t;
  84. typedef unsigned char u8_t;
  85. typedef unsigned char byte_t;
  86. typedef unsigned int rgba_t;
  87. typedef long long ULARGE_INTEGER;
  88. typedef u64_t ULONGLONG;
  89. typedef struct _POINTL /* ptl */
  90. {
  91. LONG x;
  92. LONG y;
  93. } POINT, POINTL, *PPOINTL, *LPPOINT;
  94. typedef struct _GUID
  95. {
  96. unsigned long Data1;
  97. unsigned short Data2;
  98. unsigned short Data3;
  99. unsigned char Data4[8];
  100. } GUID;
  101. typedef struct tagRECT
  102. {
  103. LONG left;
  104. LONG top;
  105. LONG right;
  106. LONG bottom;
  107. } RECT, *PRECT, *NPRECT, *LPRECT;
  108. typedef struct _FILETIME {
  109. DWORD dwLowDateTime;
  110. DWORD dwHighDateTime;
  111. } FILETIME, *PFILETIME, *LPFILETIME;
  112. typedef struct _SECURITY_ATTRIBUTES
  113. {
  114. DWORD nLength;
  115. /* [size_is] */ LPVOID lpSecurityDescriptor;
  116. BOOL bInheritHandle;
  117. } SECURITY_ATTRIBUTES;
  118. typedef struct _SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;
  119. // Function call convention
  120. #define _cdecl
  121. #define __cdecl
  122. #define __declspec(x)
  123. #define WINAPI
  124. #define FAR
  125. #define NEAR
  126. #define CONST const
  127. #define CALLBACK
  128. #define IN
  129. #define OPTIONAL
  130. struct PDM_CMDCONT
  131. {
  132. };
  133. #ifndef __stdcall
  134. #define __stdcall
  135. #endif
  136. //typedef HRESULT (__stdcall *PDM_CMDPROC)(LPCSTR szCommand, LPSTR szResponse, DWORD cchResponse, PDM_CMDCONT pdmcc);
  137. #undef __stdcall
  138. typedef int (*PROC)();
  139. typedef int (*FARPROC)();
  140. typedef int (*NEARPROC)();
  141. #define FAILED(x) (x < 0)
  142. //EAPS3: Copied from malloc.h in Visual Studio.
  143. #define _HEAPEMPTY (-1)
  144. #define _HEAPOK (-2)
  145. #define _HEAPBADBEGIN (-3)
  146. #define _HEAPBADNODE (-4)
  147. #define _HEAPEND (-5)
  148. #define _HEAPBADPTR (-6)
  149. #define _FREEENTRY 0
  150. #define _USEDENTRY 1
  151. // use for api's 'ignored' params for clarity
  152. #define XBOX_DONTCARE 0
  153. // trap debugging output
  154. #define OutputDebugString(v) printf(v);
  155. // not defined in ps3_system.cpp.
  156. // DWORD GetTickCount();
  157. // this comment means nothing
  158. #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
  159. #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))
  160. #define S_OK ((HRESULT)0x00000000L)
  161. #ifndef _strnicmp
  162. #define _strnicmp Q_strncasecmp
  163. #endif
  164. #ifndef wcsnicmp
  165. // ???
  166. #endif
  167. #endif