Fixed Winelib compilation.
diff --git a/memory/instr.c b/memory/instr.c
index c586cf4..54162ea 100644
--- a/memory/instr.c
+++ b/memory/instr.c
@@ -43,9 +43,7 @@
(PTR_SEG_OFF_TO_LIN(SS_sig(context),STACK_sig(context)))))
/* For invalid registers fixup */
-extern DWORD CallFrom16_Start,CallFrom16_End;
-extern DWORD CALLTO16_Start,CALLTO16_End;
-
+int (*INSTR_IsRelay)( const void *addr ) = NULL;
/***********************************************************************
* INSTR_ReplaceSelector
@@ -60,11 +58,8 @@
*/
static BOOL INSTR_ReplaceSelector( SIGCONTEXT *context, WORD *sel )
{
- if ( IS_SELECTOR_SYSTEM(CS_sig(context)) )
- if ( ( EIP_sig(context) >= (DWORD)&CallFrom16_Start &&
- EIP_sig(context) < (DWORD)&CallFrom16_End )
- || ( EIP_sig(context) >= (DWORD)&CALLTO16_Start &&
- EIP_sig(context) < (DWORD)&CALLTO16_End ) )
+ if (IS_SELECTOR_SYSTEM(CS_sig(context)))
+ if (INSTR_IsRelay && INSTR_IsRelay( (void *)EIP_sig(context) ))
{
/* Saved selector may have become invalid when the relay code */
/* tries to restore it. We simply clear it. */
diff --git a/miscemu/main.c b/miscemu/main.c
index c95d852..84f94ff 100644
--- a/miscemu/main.c
+++ b/miscemu/main.c
@@ -23,6 +23,18 @@
static int MAIN_argc;
static char **MAIN_argv;
+extern int (*INSTR_IsRelay)( const void *addr );
+
+static int is_relay_addr( const void *addr )
+{
+ extern char CallFrom16_Start, CallFrom16_End, CALLTO16_Start, CALLTO16_End;
+
+ return ((((char *)addr >= &CallFrom16_Start) &&
+ ((char *)addr < &CallFrom16_End)) ||
+ (((char *)addr >= &CALLTO16_Start) &&
+ ((char *)addr < &CALLTO16_End)));
+}
+
/***********************************************************************
* Emulator initialisation
*/
@@ -141,6 +153,7 @@
MAIN_argc = argc; MAIN_argv = argv;
/* Set up debugger hook */
+ INSTR_IsRelay = is_relay_addr;
EXC_SetDebugEventHook( wine_debugger );
if (Options.debug)
diff --git a/programs/clock/Wa.rc b/programs/clock/Wa.rc
index 2d00d0a..1ef7bdb 100644
--- a/programs/clock/Wa.rc
+++ b/programs/clock/Wa.rc
@@ -7,7 +7,7 @@
*/
#define LANGUAGE_ID Wa
-#define LANGUAGE_NUMBER 0x90
+#define LANGUAGE_NUMBER 90
/* System Menu */
diff --git a/programs/progman/Wa.rc b/programs/progman/Wa.rc
index cb5dfb4..bb0e7aa 100644
--- a/programs/progman/Wa.rc
+++ b/programs/progman/Wa.rc
@@ -6,7 +6,7 @@
*/
#define LANGUAGE_ID Wa
-#define LANGUAGE_NUMBER 0x90
+#define LANGUAGE_NUMBER 90
#define LANGUAGE_MENU_ITEM "&Walon"
/* Menu */
diff --git a/programs/winhelp/Wa.rc b/programs/winhelp/Wa.rc
index f1ff1ba..16a3810 100644
--- a/programs/winhelp/Wa.rc
+++ b/programs/winhelp/Wa.rc
@@ -8,7 +8,7 @@
/* This file is not yet complete !! */
#define LANGUAGE_ID Wa
-#define LANGUAGE_NUMBER 0x90
+#define LANGUAGE_NUMBER 90
/* Menu */