stub_plugin/h_export.cpp
author Scott Ehlert <ds@alliedmods.net>
Thu Sep 26 16:01:02 2013 -0500 (2013-09-26)
changeset 281 f570fd7c68ca
parent 280 622b9760d7ae
child 282 7a10fd71909a
permissions -rw-r--r--
Bumped version to 1.21.1-am.
     1 // vi: set ts=4 sw=4 :
     2 // vim: set tw=75 :
     3 
     4 // From SDK dlls/h_export.cpp:
     5 
     6 /***
     7 *
     8 *	Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
     9 *	
    10 *	This product contains software technology licensed from Id 
    11 *	Software, Inc. ("Id Technology").  Id Technology (c) 1996 Id Software, Inc. 
    12 *	All Rights Reserved.
    13 *
    14 *   Use, distribution, and modification of this source code and/or resulting
    15 *   object code is restricted to non-commercial enhancements to products from
    16 *   Valve LLC.  All other use, distribution, or modification is prohibited
    17 *   without written permission from Valve LLC.
    18 *
    19 ****/
    20 /*
    21 
    22 ===== h_export.cpp ========================================================
    23 
    24   Entity classes exported by Halflife.
    25 
    26 */
    27 
    28 #include <extdll.h>
    29 
    30 #include <h_export.h>
    31 
    32 // From SDK dlls/h_export.cpp:
    33 
    34 //! Holds engine functionality callbacks
    35 enginefuncs_t g_engfuncs;
    36 globalvars_t  *gpGlobals;
    37 
    38 // Receive engine function table from engine.
    39 // This appears to be the _first_ DLL routine called by the engine, so we
    40 // do some setup operations here.
    41 void WINAPI GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
    42 {
    43 	memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
    44 	gpGlobals = pGlobals;
    45 
    46 // Avoid linking to libstdc++
    47 #if defined(linux)
    48 extern "C" void __cxa_pure_virtual(void)
    49 {
    50 }
    51 
    52 void *operator new(size_t size)
    53 {
    54 	return malloc(size);
    55 }
    56 
    57 void *operator new[](size_t size)
    58 {
    59 	return malloc(size);
    60 }
    61 
    62 void operator delete(void *ptr)
    63 {
    64 	free(ptr);
    65 }
    66 
    67 void operator delete[](void * ptr)
    68 {
    69 	free(ptr);
    70 }
    71 #endif}