fixes to have windows version of yap.
This commit is contained in:
parent
0e964c7278
commit
a83546e313
@ -193,7 +193,18 @@ Srlc_write(void *handle, char *buffer, size_t size)
|
|||||||
{ rlc_console c = handle;
|
{ rlc_console c = handle;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
|
||||||
n = rlc_write(c, (TCHAR*)buffer, size/sizeof(TCHAR));
|
if (size==1) {
|
||||||
|
TCHAR buf ='\0';
|
||||||
|
char *bufp = (char *)&buf;
|
||||||
|
|
||||||
|
if (!buffer[0]) return 1;
|
||||||
|
bufp[0] = buffer[0];
|
||||||
|
size = sizeof(TCHAR);
|
||||||
|
n = rlc_write(c, &buf, size/sizeof(TCHAR));
|
||||||
|
return (n ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
n = rlc_write(c, (TCHAR*)buffer, size/sizeof(TCHAR));
|
||||||
|
}
|
||||||
n *= sizeof(TCHAR);
|
n *= sizeof(TCHAR);
|
||||||
|
|
||||||
if ( n < (ssize_t)size && size-n < sizeof(TCHAR) )
|
if ( n < (ssize_t)size && size-n < sizeof(TCHAR) )
|
||||||
@ -760,7 +771,7 @@ HiddenFrameClass()
|
|||||||
HINSTANCE instance = rlc_hinstance();
|
HINSTANCE instance = rlc_hinstance();
|
||||||
|
|
||||||
if ( !winclassname[0] )
|
if ( !winclassname[0] )
|
||||||
{ _stprintf(winclassname, _T("SWI-Prolog-hidden-win%d"), instance);
|
{ _stprintf(winclassname, _T("YAP-hidden-win%d"), instance);
|
||||||
|
|
||||||
wndClass.style = 0;
|
wndClass.style = 0;
|
||||||
wndClass.lpfnWndProc = (LPVOID) pl_wnd_proc;
|
wndClass.lpfnWndProc = (LPVOID) pl_wnd_proc;
|
||||||
@ -794,7 +805,7 @@ create_prolog_hidden_window(rlc_console c)
|
|||||||
return (HWND)hwnd;
|
return (HWND)hwnd;
|
||||||
|
|
||||||
hwnd = (uintptr_t)CreateWindow(HiddenFrameClass(),
|
hwnd = (uintptr_t)CreateWindow(HiddenFrameClass(),
|
||||||
_T("SWI-Prolog hidden window"),
|
_T("YAP hidden window"),
|
||||||
0,
|
0,
|
||||||
0, 0, 32, 32,
|
0, 0, 32, 32,
|
||||||
NULL, NULL, rlc_hinstance(), NULL);
|
NULL, NULL, rlc_hinstance(), NULL);
|
||||||
@ -914,7 +925,7 @@ set_window_title(rlc_console c)
|
|||||||
TCHAR *w64 = _T("");
|
TCHAR *w64 = _T("");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_stprintf(title, _T("SWI-Prolog (%s%sversion %d.%d.%d)"),
|
_stprintf(title, _T("YAP (%s%sversion %d.%d.%d)"),
|
||||||
w64, mt, major, minor, patch);
|
w64, mt, major, minor, patch);
|
||||||
|
|
||||||
rlc_title(c, title, NULL, 0);
|
rlc_title(c, title, NULL, 0);
|
||||||
|
@ -2749,7 +2749,7 @@ PL_query(int query)
|
|||||||
case PL_QUERY_USER_CPU:
|
case PL_QUERY_USER_CPU:
|
||||||
return (intptr_t)Yap_cputime();
|
return (intptr_t)Yap_cputime();
|
||||||
case PL_QUERY_VERSION:
|
case PL_QUERY_VERSION:
|
||||||
return (intptr_t)600301;
|
return (intptr_t)60300;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,"Unimplemented PL_query %d\n",query);
|
fprintf(stderr,"Unimplemented PL_query %d\n",query);
|
||||||
return (intptr_t)0;
|
return (intptr_t)0;
|
||||||
|
Reference in New Issue
Block a user