2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-12-01 06:20:56 +01:00
hlsdk-xash3d/dlls/extdll.h

112 lines
2.7 KiB
C
Raw Normal View History

2016-06-04 15:24:23 +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.
*
****/
#pragma once
2021-06-20 00:53:07 +02:00
#if !defined(EXTDLL_H)
2016-06-04 15:24:23 +02:00
#define EXTDLL_H
//
// Global header file for extension DLLs
//
// Allow "DEBUG" in addition to default "_DEBUG"
2021-06-07 02:05:58 +02:00
#if _DEBUG
2016-06-04 15:24:23 +02:00
#define DEBUG 1
#endif
// Silence certain warnings
2021-06-07 02:05:58 +02:00
#if _MSC_VER
2016-06-04 15:24:23 +02: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
2017-06-29 15:56:03 +02:00
#endif
2016-06-04 15:24:23 +02:00
// Prevent tons of unused windows definitions
2021-06-07 02:05:58 +02:00
#if _WIN32
2016-06-04 15:24:23 +02:00
#define WIN32_LEAN_AND_MEAN
#define NOWINRES
#define NOSERVICE
#define NOMCX
#define NOIME
2016-08-04 00:36:50 +02:00
#define HSPRITE HSPRITE_win32
2020-03-21 14:51:14 +01:00
#include <windows.h>
2016-08-04 00:36:50 +02:00
#undef HSPRITE
2016-06-04 15:24:23 +02:00
#else // _WIN32
2021-06-20 00:53:07 +02:00
#if !defined(FALSE)
2016-06-04 15:24:23 +02:00
#define FALSE 0
2017-06-29 15:56:03 +02:00
#endif
2021-06-20 00:53:07 +02:00
#if !defined(TRUE)
2016-06-04 15:24:23 +02:00
#define TRUE (!FALSE)
2017-06-29 15:56:03 +02:00
#endif
2019-10-26 14:48:49 +02:00
#include <limits.h>
#include <stdarg.h>
typedef unsigned int ULONG;
2016-06-04 15:24:23 +02:00
typedef unsigned char BYTE;
typedef int BOOL;
#define MAX_PATH PATH_MAX
2021-06-20 00:53:07 +02:00
#if !defined(PATH_MAX)
2019-10-26 14:48:49 +02:00
#define PATH_MAX 4096
#endif
2016-06-12 11:14:28 +02:00
#endif //_WIN32
2016-06-04 15:24:23 +02:00
// Misc C-runtime library headers
2019-10-13 15:37:32 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#if HAVE_CMATH
2019-10-13 15:37:32 +02:00
#include <cmath>
#else
#include <math.h>
#endif
2016-06-04 15:24:23 +02:00
2021-06-20 00:53:07 +02:00
#if !defined(M_PI_F)
2019-10-13 13:49:25 +02:00
#define M_PI_F (float)M_PI
#endif
2016-06-04 15:24:23 +02:00
2021-06-20 00:53:07 +02:00
#if __LP64__ || __LLP64__ || _WIN64 || (__x86_64__ && !__ILP32__) || _M_X64 || __ia64 || _M_IA64 || __aarch64__ || __powerpc64__
#define XASH_64BIT 1
2017-07-14 17:34:44 +02:00
#endif
2016-06-04 15:24:23 +02:00
// Header file containing definition of globalvars_t and entvars_t
2016-08-01 13:13:13 +02:00
typedef unsigned int func_t;
typedef int string_t; // from engine's pr_comp.h;
2016-06-04 15:24:23 +02:00
typedef float vec_t; // needed before including progdefs.h
// Vector class
#include "vector.h"
// Defining it as a (bogus) struct helps enforce type-checking
#define vec3_t Vector
// Shared engine/DLL constants
#include "const.h"
#include "progdefs.h"
#include "edict.h"
// Shared header describing protocol between engine and DLLs
#include "eiface.h"
// Shared header between the client DLL and the game DLLs
#include "cdll_dll.h"
2021-06-20 00:53:07 +02:00
#if !defined(Q_min)
2017-10-14 21:57:55 +02:00
#define Q_min(a,b) (((a) < (b)) ? (a) : (b))
2016-08-19 01:23:03 +02:00
#endif
2021-06-20 00:53:07 +02:00
#if !defined(Q_max)
2017-10-14 21:57:55 +02:00
#define Q_max(a,b) (((a) > (b)) ? (a) : (b))
2016-08-19 01:23:03 +02:00
#endif
2016-06-04 15:24:23 +02:00
#endif //EXTDLL_H