stub_plugin/h_export.cpp
author Scott Ehlert <ds@alliedmods.net>
Thu Sep 26 17:00:32 2013 -0500 (2013-09-26)
changeset 284 ca90ccdb8d49
parent 282 7a10fd71909a
child 286 202d9c3207a2
permissions -rw-r--r--
Fixed makefile error when issuing 'make clean' or 'make distclean'.
     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 
    47 // Avoid linking to libstdc++
    48 #if defined(linux)
    49 extern "C" void __cxa_pure_virtual(void)
    50 {
    51 }
    52 
    53 void *operator new(size_t size)
    54 {
    55 	return malloc(size);
    56 }
    57 
    58 void *operator new[](size_t size)
    59 {
    60 	return malloc(size);
    61 }
    62 
    63 void operator delete(void *ptr)
    64 {
    65 	free(ptr);
    66 }
    67 
    68 void operator delete[](void * ptr)
    69 {
    70 	free(ptr);
    71 }
    72 #endif}