Commit f15555b4 authored by sewardj's avatar sewardj
Browse files

[project @ 2000-05-12 13:41:59 by sewardj]

Rename DietHEPpish things HMODULE, GetProcAddress, etc, since those
names conflict with Windows builtins.
parent 231ac169
# --------------------------------------------------------------------------- #
# $Id: Makefile,v 1.34 2000/05/09 10:13:18 sewardj Exp $ #
# $Id: Makefile,v 1.35 2000/05/12 13:41:59 sewardj Exp $ #
# --------------------------------------------------------------------------- #
TOP = ..
......@@ -38,7 +38,7 @@ C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
translate.c codegen.c lift.c free.c stgSubst.c output.c \
hugs.c dynamic.c stg.c sainteger.c object.c interface.c
SRC_CC_OPTS = -I$(GHC_INTERPRETER_DIR) -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) -D__HUGS__ -DCOMPILING_RTS -DNO_REGS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -Winline -g -O
SRC_CC_OPTS = -I$(GHC_INTERPRETER_DIR) -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) -D__HUGS__ -DCOMPILING_RTS -DNO_REGS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -Winline -g -O -DDIET_HEP
GHC_LIBS_NEEDED = $(GHC_RUNTIME_DIR)/libHSrts.a
......
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: hugs.c,v $
* $Revision: 1.72 $
* $Date: 2000/05/12 13:34:06 $
* $Revision: 1.73 $
* $Date: 2000/05/12 13:41:59 $
* ------------------------------------------------------------------------*/
#include <setjmp.h>
......@@ -178,7 +178,7 @@ void diet_hep_initialise ( void* cstackbase )
static
HMODULE LoadLibrary_wrk ( LPCSTR modname )
DH_MODULE DH_LoadLibrary_wrk ( DH_LPCSTR modname )
{
Text t;
Module m;
......@@ -188,21 +188,21 @@ HMODULE LoadLibrary_wrk ( LPCSTR modname )
if (isModule(m)) return m; else return 0;
}
HMODULE LoadLibrary ( LPCSTR modname )
DH_MODULE DH_LoadLibrary ( DH_LPCSTR modname )
{
int xxx;
HMODULE hdl;
DH_MODULE hdl;
diet_hep_initialise ( &xxx );
hdl = LoadLibrary_wrk ( modname );
hdl = DH_LoadLibrary_wrk ( modname );
printf ( "hdl = %d\n", hdl );
return hdl;
}
static
void* GetProcAddr_wrk ( DHCALLCONV cconv,
HMODULE hModule,
LPCSTR lpProcName )
void* DH_GetProcAddress_wrk ( DH_CALLCONV cconv,
DH_MODULE hModule,
DH_LPCSTR lpProcName )
{
Name n;
Text typedescr;
......@@ -234,13 +234,13 @@ void* GetProcAddr_wrk ( DHCALLCONV cconv,
return adj_thunk;
}
void* GetProcAddr ( DHCALLCONV cconv,
HMODULE hModule,
LPCSTR lpProcName )
void* DH_GetProcAddress ( DH_CALLCONV cconv,
DH_MODULE hModule,
DH_LPCSTR lpProcName )
{
int xxx;
diet_hep_initialise ( &xxx );
return GetProcAddr_wrk ( cconv, hModule, lpProcName );
return DH_GetProcAddress_wrk ( cconv, hModule, lpProcName );
}
//---------------------------------
......@@ -248,10 +248,10 @@ void* GetProcAddr ( DHCALLCONV cconv,
int main ( int argc, char** argv )
{
void* proc;
HMODULE hdl;
hdl = LoadLibrary("FooBar");
DH_MODULE hdl;
hdl = DH_LoadLibrary("FooBar");
assert(isModule(hdl));
proc = GetProcAddr ( dh_ccall, hdl, "wurble" );
proc = DH_GetProcAddress ( dh_ccall, hdl, "wurble" );
fprintf ( stderr, "just before calling it\n");
((void(*)(int)) proc) (33);
((void(*)(int)) proc) (34);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment