Renamed CallTo16* functions to wine_call_to_16* and export them from
kernel32.spec.

diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec
index 787a864..6304160 100644
--- a/dlls/kernel/kernel32.spec
+++ b/dlls/kernel/kernel32.spec
@@ -950,3 +950,7 @@
 @ varargs __wine_call_from_16_long() __wine_call_from_16_long
 @ varargs __wine_call_from_16_regs() __wine_call_from_16_regs
 @ varargs __wine_call_from_16_thunk() __wine_call_from_16_thunk
+@ stdcall wine_call_to_16_word(ptr long) wine_call_to_16_word
+@ stdcall wine_call_to_16_long(ptr long) wine_call_to_16_long
+@ stdcall wine_call_to_16_regs_short(ptr long) wine_call_to_16_regs_short
+@ stdcall wine_call_to_16_regs_long (ptr long) wine_call_to_16_regs_long
diff --git a/dlls/kernel/thunk.c b/dlls/kernel/thunk.c
index 2a57685..cf6c321 100644
--- a/dlls/kernel/thunk.c
+++ b/dlls/kernel/thunk.c
@@ -303,7 +303,7 @@
     memcpy( (LPBYTE)CURRENT_STACK16 - argsize,
             (LPBYTE)context->Esp, argsize );
 
-    CallTo16RegisterShort( &context16, argsize );
+    wine_call_to_16_regs_short( &context16, argsize );
     context->Eax = context16.Eax;
     context->Edx = context16.Edx;
     context->Ecx = context16.Ecx;
@@ -430,7 +430,7 @@
 					 + (*(LPBYTE *)arg - oldstack));
 	}
 
-    CallTo16RegisterShort( &context16, argsize );
+    wine_call_to_16_regs_short( &context16, argsize );
     context->Eax = context16.Eax;
     context->Edx = context16.Edx;
     context->Ecx = context16.Ecx;
@@ -637,7 +637,7 @@
     memcpy( (LPBYTE)CURRENT_STACK16 - argsize,
             (LPBYTE)context->Esp, argsize );
 
-    CallTo16RegisterLong(&context16, argsize + 32);
+    wine_call_to_16_regs_long(&context16, argsize + 32);
     context->Eax = context16.Eax;
 
     /* Clean up caller's stack frame */
@@ -688,7 +688,7 @@
     memcpy( (LPBYTE)CURRENT_STACK16 - argsize,
             (LPBYTE)context->Esp, argsize );
 
-    CallTo16RegisterShort(&context16, argsize);
+    wine_call_to_16_regs_short(&context16, argsize);
     context->Eax = context16.Eax;
     context->Edx = context16.Edx;
 
diff --git a/dlls/kernel/wowthunk.c b/dlls/kernel/wowthunk.c
index 4ed24f0..70a0320 100644
--- a/dlls/kernel/wowthunk.c
+++ b/dlls/kernel/wowthunk.c
@@ -266,12 +266,12 @@
 
     /*
      * Actually, we should take care whether the called routine cleans up
-     * its stack or not.  Fortunately, our CallTo16 core doesn't rely on 
+     * its stack or not.  Fortunately, our wine_call_to_16 core doesn't rely on 
      * the callee to do so; after the routine has returned, the 16-bit 
      * stack pointer is always reset to the position it had before. 
      */
 
-    ret = CallTo16Long( (FARPROC16)vpfn16, cbArgs );
+    ret = wine_call_to_16_long( (FARPROC16)vpfn16, cbArgs );
 
     if ( pdwRetCode )
         *pdwRetCode = ret;
diff --git a/dlls/user/mouse.c b/dlls/user/mouse.c
index a3e3b03..c7b2b24 100644
--- a/dlls/user/mouse.c
+++ b/dlls/user/mouse.c
@@ -82,7 +82,7 @@
     context.Esi   = LOWORD( dwExtraInfo );
     context.Edi   = HIWORD( dwExtraInfo );
 
-    CallTo16RegisterShort( &context, 0 );
+    wine_call_to_16_regs_short( &context, 0 );
 }
 
 VOID WINAPI WIN16_MOUSE_Enable( FARPROC16 proc )
diff --git a/if1632/relay.c b/if1632/relay.c
index fe82f3a..c2d770a 100644
--- a/if1632/relay.c
+++ b/if1632/relay.c
@@ -63,17 +63,37 @@
  * (these will never be called but need to be present to satisfy the linker ...)
  */
 #ifndef __i386__
-WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs )
-{ assert( FALSE ); }
+/***********************************************************************
+ *		wine_call_to_16_word
+ */
+WORD WINAPI wine_call_to_16_word( FARPROC16 target, INT nArgs )
+{
+    assert( FALSE );
+}
 
-LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs )
-{ assert( FALSE ); }
+/***********************************************************************
+ *		wine_call_to_16_long
+ */
+LONG WINAPI wine_call_to_16_long( FARPROC16 target, INT nArgs )
+{
+    assert( FALSE );
+}
 
-void CALLBACK CallTo16RegisterShort( CONTEXT86 *context, INT nArgs )
-{ assert( FALSE ); }
+/***********************************************************************
+ *		wine_call_to_16_regs_short
+ */
+void WINAPI wine_call_to_16_regs_short( CONTEXT86 *context, INT nArgs )
+{
+    assert( FALSE );
+}
 
-void CALLBACK CallTo16RegisterLong ( CONTEXT86 *context, INT nArgs )
-{ assert( FALSE ); }
+/***********************************************************************
+ *		wine_call_to_16_regs_long
+ */
+void WINAPI wine_call_to_16_regs_long ( CONTEXT86 *context, INT nArgs )
+{
+    assert( FALSE );
+}
 
 /***********************************************************************
  *		__wine_call_from_16_word
diff --git a/include/builtin16.h b/include/builtin16.h
index f939fe8..aebc0cf 100644
--- a/include/builtin16.h
+++ b/include/builtin16.h
@@ -13,11 +13,6 @@
 struct _CONTEXT86;
 struct _STACK16FRAME;
 
-extern WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs );
-extern LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs );
-extern void CALLBACK CallTo16RegisterShort( struct _CONTEXT86 *context, INT nArgs );
-extern void CALLBACK CallTo16RegisterLong ( struct _CONTEXT86 *context, INT nArgs );
-
 #include "pshpack1.h"
 
 typedef struct
diff --git a/include/wine/winbase16.h b/include/wine/winbase16.h
index ff0f39e..6bc2aa1 100644
--- a/include/wine/winbase16.h
+++ b/include/wine/winbase16.h
@@ -255,4 +255,10 @@
 LONG        WINAPI WIN16_hread(HFILE16,SEGPTR,LONG);
 UINT16      WINAPI WIN16_lread(HFILE16,SEGPTR,UINT16);
 
+/* Wine-specific functions */
+WORD        WINAPI wine_call_to_16_word( FARPROC16 target, INT nArgs );
+LONG        WINAPI wine_call_to_16_long( FARPROC16 target, INT nArgs );
+void        WINAPI wine_call_to_16_regs_short( CONTEXT86 *context, INT nArgs );
+void        WINAPI wine_call_to_16_regs_long ( CONTEXT86 *context, INT nArgs );
+
 #endif /* __WINE_WINE_WINBASE16_H */
diff --git a/loader/ne/module.c b/loader/ne/module.c
index 4111aa8..bae492c 100644
--- a/loader/ne/module.c
+++ b/loader/ne/module.c
@@ -1192,7 +1192,7 @@
               SELECTOROF(pTask->teb->cur_stack),
               OFFSETOF(pTask->teb->cur_stack) );
 
-        CallTo16RegisterShort( &context, 0 );
+        wine_call_to_16_regs_short( &context, 0 );
         ExitThread( LOWORD(context.Eax) );
     }
 
diff --git a/loader/ne/segment.c b/loader/ne/segment.c
index 9953ee0..a50664c 100644
--- a/loader/ne/segment.c
+++ b/loader/ne/segment.c
@@ -627,7 +627,7 @@
     TRACE_(dll)("Calling LibMain, cs:ip=%04lx:%04lx ds=%04lx di=%04x cx=%04x\n", 
                  context.SegCs, context.Eip, context.SegDs,
                  LOWORD(context.Edi), LOWORD(context.Ecx) );
-    CallTo16RegisterShort( &context, 0 );
+    wine_call_to_16_regs_short( &context, 0 );
     return TRUE;
 }
 
@@ -712,7 +712,7 @@
         *(DWORD *)(stack - 14) = 0;             /* dwReserved1 */
         *(WORD *) (stack - 16) = 0;             /* wReserved2 */
 
-        CallTo16RegisterShort( &context, 16 );
+        wine_call_to_16_regs_short( &context, 16 );
     }
 }
 
diff --git a/misc/system.c b/misc/system.c
index 82473e3..d0a1675 100644
--- a/misc/system.c
+++ b/misc/system.c
@@ -136,7 +136,7 @@
 
     AX_reg( &context ) = timer;
 
-    CallTo16RegisterShort( &context, 0 );
+    wine_call_to_16_regs_short( &context, 0 );
 }
 
 WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )
diff --git a/msdos/dpmi.c b/msdos/dpmi.c
index a8a75a6..abaefe6 100644
--- a/msdos/dpmi.c
+++ b/msdos/dpmi.c
@@ -287,7 +287,7 @@
             ctx.SegEs = rmcb->regs_sel;
             ctx.Edi   = rmcb->regs_ofs;
             /* FIXME: I'm pretty sure this isn't right - should push flags first */
-            CallTo16RegisterShort(&ctx, 0);
+            wine_call_to_16_regs_short(&ctx, 0);
             es = ctx.SegEs;
             edi = ctx.Edi;
         }
@@ -615,7 +615,7 @@
     pm_ctx.SegGs = 0;
 
     TRACE("DOS program is now entering protected mode\n");
-    CallTo16RegisterShort(&pm_ctx, 0);
+    wine_call_to_16_regs_short(&pm_ctx, 0);
 
     /* in the current state of affairs, we won't ever actually return here... */
     /* we should have int21/ah=4c do it someday, though... */
diff --git a/scheduler/thread.c b/scheduler/thread.c
index bdd9443..603101f 100644
--- a/scheduler/thread.c
+++ b/scheduler/thread.c
@@ -329,7 +329,7 @@
     HeapFree( GetProcessHeap(), 0, threadArgs );
 
     ((LPDWORD)CURRENT_STACK16)[-1] = param;
-    return CallTo16Long( start, sizeof(DWORD) );
+    return wine_call_to_16_long( start, sizeof(DWORD) );
 }
 HANDLE WINAPI CreateThread16( SECURITY_ATTRIBUTES *sa, DWORD stack,
                               FARPROC16 start, SEGPTR param,
diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c
index 70eba96..37f5f0a 100644
--- a/tools/winebuild/relay.c
+++ b/tools/winebuild/relay.c
@@ -417,10 +417,10 @@
  *
  * This routine builds the core routines used in 32->16 thunks:
  *
- *   extern void CALLBACK CallTo16Word( SEGPTR target, int nb_args );
- *   extern void CALLBACK CallTo16Long( SEGPTR target, int nb_args );
- *   extern void CALLBACK CallTo16RegisterShort( const CONTEXT86 *context, int nb_args );
- *   extern void CALLBACK CallTo16RegisterLong ( const CONTEXT86 *context, int nb_args );
+ *   extern void WINAPI wine_call_to_16_word( SEGPTR target, int nb_args );
+ *   extern void WINAPI wine_call_to_16_long( SEGPTR target, int nb_args );
+ *   extern void WINAPI wine_call_to_16_regs_short( const CONTEXT86 *context, int nb_args );
+ *   extern void WINAPI wine_call_to_16_regs_long ( const CONTEXT86 *context, int nb_args );
  *
  * These routines can be called directly from 32-bit code. 
  *
@@ -442,19 +442,19 @@
 
 static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
 {
-    char *name = reg_func == 2 ? "RegisterLong" : 
-                 reg_func == 1 ? "RegisterShort" :
-                 short_ret? "Word" : "Long";
+    char *name = reg_func == 2 ? "regs_long" :
+                 reg_func == 1 ? "regs_short" :
+                 short_ret? "word" : "long";
 
     /* Function header */
     fprintf( outfile, "\n\t.align 4\n" );
 #ifdef USE_STABS
-    fprintf( outfile, ".stabs \"CallTo16%s:F1\",36,0,0," PREFIX "CallTo16%s\n", 
+    fprintf( outfile, ".stabs \"wine_call_to_16_%s:F1\",36,0,0," PREFIX "wine_call_to_16_%s\n", 
 	     name, name);
 #endif
-    fprintf( outfile, "\t.type " PREFIX "CallTo16%s,@function\n", name );
-    fprintf( outfile, "\t.globl " PREFIX "CallTo16%s\n", name );
-    fprintf( outfile, PREFIX "CallTo16%s:\n", name );
+    fprintf( outfile, "\t.type " PREFIX "wine_call_to_16_%s,@function\n", name );
+    fprintf( outfile, "\t.globl " PREFIX "wine_call_to_16_%s\n", name );
+    fprintf( outfile, PREFIX "wine_call_to_16_%s:\n", name );
 
     /* Function entry sequence */
     fprintf( outfile, "\tpushl %%ebp\n" );
@@ -470,10 +470,10 @@
     if ( UsePIC )
     {
         /* Get Global Offset Table into %ebx */
-        fprintf( outfile, "\tcall .LCallTo16%s.getgot1\n", name );
-        fprintf( outfile, ".LCallTo16%s.getgot1:\n", name );
+        fprintf( outfile, "\tcall .Lwine_call_to_16_%s.getgot1\n", name );
+        fprintf( outfile, ".Lwine_call_to_16_%s.getgot1:\n", name );
         fprintf( outfile, "\tpopl %%ebx\n" );
-        fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallTo16%s.getgot1], %%ebx\n", name );
+        fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.Lwine_call_to_16_%s.getgot1], %%ebx\n", name );
     }
 
     /* Enter Win16 Mutex */
@@ -509,7 +509,7 @@
 
     /* Call the actual CallTo16 routine (simulate a lcall) */
     fprintf( outfile, "\tpushl %%cs\n" );
-    fprintf( outfile, "\tcall .LCallTo16%s\n", name );
+    fprintf( outfile, "\tcall .Lwine_call_to_16_%s\n", name );
 
     if ( !reg_func )
     {
@@ -553,10 +553,10 @@
     if ( UsePIC )
     {
         /* Get Global Offset Table into %ebx (might have been overwritten) */
-        fprintf( outfile, "\tcall .LCallTo16%s.getgot2\n", name );
-        fprintf( outfile, ".LCallTo16%s.getgot2:\n", name );
+        fprintf( outfile, "\tcall .Lwine_call_to_16_%s.getgot2\n", name );
+        fprintf( outfile, ".Lwine_call_to_16_%s.getgot2:\n", name );
         fprintf( outfile, "\tpopl %%ebx\n" );
-        fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallTo16%s.getgot2], %%ebx\n", name );
+        fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.Lwine_call_to_16_%s.getgot2], %%ebx\n", name );
     }
 
     /* Print debugging info */
@@ -595,7 +595,7 @@
 
     /* Start of the actual CallTo16 routine */
 
-    fprintf( outfile, ".LCallTo16%s:\n", name );
+    fprintf( outfile, ".Lwine_call_to_16_%s:\n", name );
 
     /* Complete STACK32FRAME */
     fprintf( outfile, "\t.byte 0x64\n\tpushl (%d)\n", STACKOFFSET );
diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c
index 8586473..2563701 100644
--- a/tools/winebuild/spec16.c
+++ b/tools/winebuild/spec16.c
@@ -413,7 +413,7 @@
  * 
  * These routines are provided solely for convenience; they simply
  * write the arguments onto the 16-bit stack, and call the appropriate
- * CallTo16... core routine.
+ * wine_call_to_16... core routine.
  *
  * If you have more sophisticated argument conversion requirements than
  * are provided by these routines, you might as well call the core 
@@ -463,8 +463,8 @@
         fprintf( outfile, " *)args = arg%d;\n", i+1 );
     }
 
-    fprintf( outfile, "    return CallTo16%s( proc, %d );\n}\n\n",
-             short_ret? "Word" : "Long", argsize );
+    fprintf( outfile, "    return wine_call_to_16_%s( proc, %d );\n}\n\n",
+             short_ret? "word" : "long", argsize );
 }
 
 
@@ -802,8 +802,8 @@
     fprintf( outfile, "#include \"builtin16.h\"\n" );
     fprintf( outfile, "#include \"stackframe.h\"\n\n" );
 
-    fprintf( outfile, "extern WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs );\n" );
-    fprintf( outfile, "extern LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs );\n" );
+    fprintf( outfile, "extern WORD WINAPI wine_call_to_16_word( FARPROC16 target, INT nArgs );\n" );
+    fprintf( outfile, "extern LONG WINAPI wine_call_to_16_long( FARPROC16 target, INT nArgs );\n" );
 
     /* Build the callback glue functions */
 
diff --git a/windows/keyboard.c b/windows/keyboard.c
index 09b38b5..0de7582 100644
--- a/windows/keyboard.c
+++ b/windows/keyboard.c
@@ -83,7 +83,7 @@
     context.Esi   = LOWORD( dwExtraInfo );
     context.Edi   = HIWORD( dwExtraInfo );
 
-    CallTo16RegisterShort( &context, 0 );
+    wine_call_to_16_regs_short( &context, 0 );
 }
 
 VOID WINAPI WIN16_KEYBOARD_Enable( FARPROC16 proc, LPBYTE lpKeyState )
diff --git a/windows/winproc.c b/windows/winproc.c
index 07b3069..5967fc0 100644
--- a/windows/winproc.c
+++ b/windows/winproc.c
@@ -238,7 +238,7 @@
     args[3] = msg;
     args[4] = hwnd;
 
-    CallTo16RegisterShort( &context, 5 * sizeof(WORD) );
+    wine_call_to_16_regs_short( &context, 5 * sizeof(WORD) );
     ret = MAKELONG( LOWORD(context.Eax), LOWORD(context.Edx) );
     if (offset) stack16_pop( offset );