2007-01-25 23:32:29 +01:00
|
|
|
/**
|
2007-01-25 23:39:12 +01:00
|
|
|
* ================================================================
|
|
|
|
* SourcePawn (C)2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ================================================================
|
2007-01-25 23:32:29 +01:00
|
|
|
*
|
|
|
|
* This file is not open source and may not be copied without explicit
|
|
|
|
* written permission of AlliedModders LLC. This file may not be redistributed
|
|
|
|
* in whole or significant part.
|
|
|
|
* For information, see LICENSE.txt or http://www.sourcemod.net/license.php
|
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
2006-09-20 02:41:24 +02:00
|
|
|
#include <sp_vm_api.h>
|
2007-01-25 09:31:52 +01:00
|
|
|
#include <malloc.h>
|
2006-10-10 03:55:08 +02:00
|
|
|
#include "jit_x86.h"
|
|
|
|
#include "dll_exports.h"
|
|
|
|
|
|
|
|
SourcePawn::ISourcePawnEngine *engine = NULL;
|
2007-03-12 08:08:05 +01:00
|
|
|
JITX86 g_jit;
|
2006-10-10 03:55:08 +02:00
|
|
|
|
2006-11-08 08:35:16 +01:00
|
|
|
EXPORTFUNC int GiveEnginePointer(SourcePawn::ISourcePawnEngine *engine_p)
|
2006-10-10 03:55:08 +02:00
|
|
|
{
|
|
|
|
engine = engine_p;
|
2006-11-08 08:35:16 +01:00
|
|
|
|
|
|
|
return 0;
|
2006-10-10 03:55:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
EXPORTFUNC unsigned int GetExportCount()
|
|
|
|
{
|
2006-10-10 18:39:55 +02:00
|
|
|
return 1;
|
2006-10-10 03:55:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
EXPORTFUNC SourcePawn::IVirtualMachine *GetExport(unsigned int exportnum)
|
|
|
|
{
|
|
|
|
/* Don't return anything if we're not initialized yet */
|
|
|
|
if (!engine)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We only have one export - 0 */
|
|
|
|
if (exportnum)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-03-12 08:08:05 +01:00
|
|
|
return &g_jit;
|
2006-10-10 03:55:08 +02:00
|
|
|
}
|
2007-01-25 09:31:52 +01:00
|
|
|
|
|
|
|
#if defined __linux__
|
|
|
|
extern "C" void __cxa_pure_virtual(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void *operator new(size_t size)
|
|
|
|
{
|
|
|
|
return malloc(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void *operator new[](size_t size)
|
|
|
|
{
|
|
|
|
return malloc(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void operator delete(void *ptr)
|
|
|
|
{
|
|
|
|
free(ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void operator delete[](void * ptr)
|
|
|
|
{
|
|
|
|
free(ptr);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|