2022-12-17 13:32:43 +01:00
|
|
|
/***
|
2018-09-02 22:46:08 +02:00
|
|
|
*
|
|
|
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
|
|
|
*
|
|
|
|
* This product contains software technology licensed from Id
|
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use, distribution, and modification of this source code and/or resulting
|
|
|
|
* object code is restricted to non-commercial enhancements to products from
|
|
|
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
|
|
* without written permission from Valve LLC.
|
|
|
|
*
|
|
|
|
****/
|
|
|
|
|
2021-11-18 19:17:53 +01:00
|
|
|
#pragma once
|
2018-09-02 22:46:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Platform abstractions, common header includes, workarounds for compiler warnings
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Allow "DEBUG" in addition to default "_DEBUG"
|
|
|
|
#ifdef _DEBUG
|
|
|
|
#define DEBUG 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Silence certain warnings
|
2021-11-29 20:55:01 +01:00
|
|
|
#pragma warning(disable : 4244) // int or float down-conversion
|
|
|
|
#pragma warning(disable : 4305) // int or float data truncation
|
|
|
|
#pragma warning(disable : 4201) // nameless struct/union
|
|
|
|
#pragma warning(disable : 4514) // unreferenced inline function removed
|
|
|
|
#pragma warning(disable : 4100) // unreferenced formal parameter
|
2021-11-28 21:50:12 +01:00
|
|
|
#pragma warning(disable : 26495) // Variable is uninitialized
|
|
|
|
#pragma warning(disable : 26451) // Arithmetic overflow
|
|
|
|
#pragma warning(disable : 26812) // The enum type is unscoped
|
2018-09-02 22:46:08 +02:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#include "steam/steamtypes.h" // DAL
|
2021-11-18 17:50:02 +01:00
|
|
|
#include "common_types.h"
|
2018-09-02 22:46:08 +02:00
|
|
|
|
|
|
|
// Misc C-runtime library headers
|
2021-11-18 20:20:32 +01:00
|
|
|
#include <cctype>
|
2021-11-18 21:38:37 +01:00
|
|
|
#include <climits>
|
2018-09-02 22:46:08 +02:00
|
|
|
#include <cmath>
|
2021-11-18 21:38:37 +01:00
|
|
|
#include <cstdarg>
|
2021-11-18 20:27:59 +01:00
|
|
|
#include <cstddef>
|
2021-11-18 18:46:42 +01:00
|
|
|
#include <cstdint>
|
2018-09-02 22:46:08 +02:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
|
|
|
|
2021-03-16 20:01:08 +01:00
|
|
|
using byte = unsigned char;
|
|
|
|
using string_t = unsigned int;
|
|
|
|
using qboolean = int;
|
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define ARRAYSIZE(p) (sizeof(p) / sizeof(p[0]))
|
2021-03-16 21:05:51 +01:00
|
|
|
|
2021-11-18 20:02:04 +01:00
|
|
|
#ifdef WIN32
|
2018-09-02 22:46:08 +02:00
|
|
|
//Avoid the ISO conformant warning
|
|
|
|
#define stricmp _stricmp
|
|
|
|
#define strnicmp _strnicmp
|
|
|
|
#define itoa _itoa
|
|
|
|
#define strupr _strupr
|
2018-09-03 10:47:51 +02:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define DLLEXPORT __declspec(dllexport)
|
2021-11-18 21:18:30 +01:00
|
|
|
#define DLLHIDDEN
|
2021-11-18 20:02:04 +01:00
|
|
|
#else // WIN32
|
2020-02-13 14:51:18 +01:00
|
|
|
#define stricmp strcasecmp
|
|
|
|
#define strnicmp strncasecmp
|
|
|
|
#define _alloca alloca
|
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define DLLEXPORT __attribute__((visibility("default")))
|
|
|
|
#define DLLHIDDEN __attribute__((visibility("hidden")))
|
2021-11-18 20:02:04 +01:00
|
|
|
#endif //WIN32
|
2018-09-02 22:46:08 +02:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define V_min(a, b) (((a) < (b)) ? (a) : (b))
|
|
|
|
#define V_max(a, b) (((a) > (b)) ? (a) : (b))
|
2018-09-03 10:26:06 +02:00
|
|
|
|
2022-05-05 04:51:36 +03:00
|
|
|
// Clamp macro is deprecated. Use std::clamp instead.
|
|
|
|
// #define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
|