windows console fixes
This commit is contained in:
parent
a0748c7c10
commit
48284cfb44
@ -12,7 +12,7 @@ EROOTDIR = @exec_prefix@
|
||||
LIBDIR=@libdir@/Yap
|
||||
#
|
||||
#
|
||||
CC=@CC@
|
||||
CC=@CC@ -municode -DUNICODE -D_UNICODE
|
||||
CPPFLAGS=@CPPFLAGS@
|
||||
CFLAGS= @CFLAGS@ $(DEFS) $(CPPFLAGS) -I$(srcdir) -DRLC_VENDOR="\"YAP\""
|
||||
#
|
||||
|
@ -3239,7 +3239,7 @@ rlc_write(rlc_console c, TCHAR *buf, size_t count)
|
||||
return -1;
|
||||
|
||||
for(s=buf, e=&buf[count]; s<e; s++)
|
||||
{ if ( *s == '\n' )
|
||||
{ if ( *s == '\n' )
|
||||
b->promptlen = 0;
|
||||
else if ( b->promptlen < MAXPROMPT-1 )
|
||||
b->promptbuf[b->promptlen++] = *s;
|
||||
|
0
LGPL/swi_console/edit.c
Normal file → Executable file
0
LGPL/swi_console/edit.c
Normal file → Executable file
@ -565,13 +565,13 @@ pl-nt.o: $(srcdir)/packages/PLStream/pl-nt.c config.h
|
||||
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-nt.c -o $@
|
||||
|
||||
pl-ntcon.o: $(srcdir)/console/LGPL/pl-ntcon.c config.h
|
||||
$(CC) -c $(CFLAGS) -DPL_CONSOLE=1 -I$(srcdir)/include $(srcdir)/console/LGPL/pl-ntcon.c -o $@
|
||||
$(CC) -municode -DUNICODE -D_UNICODE -c $(CFLAGS) -DPL_CONSOLE=1 -I$(srcdir)/include $(srcdir)/console/LGPL/pl-ntcon.c -o $@
|
||||
|
||||
pl-ntconsole.o: $(srcdir)/console/LGPL/pl-ntconsole.c config.h
|
||||
$(CC) -c $(CFLAGS) -DPL_CONSOLE=1 -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/console/LGPL/pl-ntconsole.c -o $@
|
||||
$(CC) -municode -DUNICODE -D_UNICODE -c $(CFLAGS) -DPL_CONSOLE=1 -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/console/LGPL/pl-ntconsole.c -o $@
|
||||
|
||||
pl-ntmain.o: $(srcdir)/console/LGPL/pl-ntmain.c config.h
|
||||
$(CC) -c $(CFLAGS) -DPL_CONSOLE=1 -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/console/LGPL/pl-ntmain.c -o $@
|
||||
$(CC) -municode -DUNICODE -D_UNICODE -c $(CFLAGS) -DPL_CONSOLE=1 -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/console/LGPL/pl-ntmain.c -o $@
|
||||
|
||||
pl-buffer.o: $(srcdir)/packages/PLStream/pl-buffer.c config.h
|
||||
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-buffer.c -o $@
|
||||
@ -707,7 +707,7 @@ plyap: pl-yap@EXEC_SUFFIX@
|
||||
|
||||
pl-yap@EXEC_SUFFIX@: $(PLCONS_OBJECTS) $(HEADERS) @YAPLIB@ LGPL/swi_console/plterm.dll
|
||||
(cd LGPL/swi_console; $(MAKE))
|
||||
$(MPI_CC) $(EXECUTABLE_CFLAGS) $(LDFLAGS) -o pl-yap $(PLCONS_OBJECTS) LGPL/swi_console/plterm.dll @YAPLIB@ $(LIBS) @MPI_LIBS@
|
||||
$(MPI_CC) -municode -DUNICODE -D_UNICODE $(EXECUTABLE_CFLAGS) $(LDFLAGS) -Wl,-subsystem,windows -o pl-yap $(PLCONS_OBJECTS) LGPL/swi_console/plterm.dll @YAPLIB@ $(LIBS) @MPI_LIBS@
|
||||
|
||||
libYap.a: $(LIB_OBJECTS)
|
||||
-rm -f libYap.a
|
||||
|
@ -69,20 +69,20 @@ consoleHandlerRoutine(DWORD id)
|
||||
*******************************/
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
APP_main(int argc, char **argv)
|
||||
{
|
||||
#if O_CTRLC
|
||||
main_thread_id = GetCurrentThreadId();
|
||||
SetConsoleCtrlHandler((PHANDLER_ROUTINE)consoleHandlerRoutine, TRUE);
|
||||
#endif
|
||||
|
||||
if ( !PL_initialise(argc, argv) )
|
||||
PL_halt(1);
|
||||
|
||||
#if O_ANSI_COLORS
|
||||
PL_w32_wrap_ansi_console(); /* decode ANSI color sequences (ESC[...m) */
|
||||
#endif
|
||||
|
||||
if ( !PL_initialise(argc, argv) )
|
||||
PL_halt(1);
|
||||
|
||||
PL_halt(PL_toplevel() ? 0 : 1);
|
||||
|
||||
return 0;
|
||||
|
@ -433,8 +433,6 @@ PL_w32_wrap_ansi_console(void)
|
||||
HANDLE hError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
CONSOLE_SCREEN_BUFFER_INFO info;
|
||||
|
||||
fprintf(stderr,"main=%p %p\n",Sinput, Sinput->functions);
|
||||
|
||||
if ( hIn == INVALID_HANDLE_VALUE ||
|
||||
hOut == INVALID_HANDLE_VALUE ||
|
||||
hError == INVALID_HANDLE_VALUE ||
|
||||
|
@ -22,9 +22,6 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define _UNICODE 1
|
||||
#define UNICODE 1
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <malloc.h>
|
||||
@ -997,6 +994,9 @@ win32main(rlc_console c, int argc, TCHAR **argv)
|
||||
set_window_title(c);
|
||||
rlc_bind_terminal(c);
|
||||
|
||||
if ( !PL_initialise(argc, av) )
|
||||
PL_halt(1);
|
||||
|
||||
PL_register_extensions_in_module("system", extensions);
|
||||
install_readline(c);
|
||||
PL_action(PL_ACTION_GUIAPP, TRUE);
|
||||
@ -1032,9 +1032,6 @@ win32main(rlc_console c, int argc, TCHAR **argv)
|
||||
}
|
||||
av[i] = NULL;
|
||||
|
||||
if ( !PL_initialise(argc, av) )
|
||||
PL_halt(1);
|
||||
|
||||
rlc_bind_terminal(c);
|
||||
PL_halt(PL_toplevel() ? 0 : 1);
|
||||
|
||||
@ -1047,10 +1044,10 @@ And this is the real application's main as Windows sees it. See
|
||||
console.c for further details.
|
||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
int PASCAL
|
||||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpszCmdLine, int nCmdShow)
|
||||
{ LPTSTR cmdline;
|
||||
int WINAPI
|
||||
wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPWSTR lpszCmdLine, int nCmdShow)
|
||||
{ LPWSTR cmdline;
|
||||
|
||||
InitializeCriticalSection(&mutex);
|
||||
|
||||
|
@ -1307,7 +1307,6 @@ void
|
||||
PL_write_prompt(int dowrite)
|
||||
{ GET_LD
|
||||
IOSTREAM *s = getStream(Suser_output);
|
||||
|
||||
if ( s )
|
||||
{ if ( dowrite )
|
||||
{ atom_t a = PrologPrompt();
|
||||
|
@ -2915,7 +2915,13 @@ Sfileno(IOSTREAM *s)
|
||||
#ifdef __WINDOWS__
|
||||
#include "windows/popen.c"
|
||||
|
||||
#ifdef popen
|
||||
#undef popen
|
||||
#endif
|
||||
#define popen(cmd, how) pt_popen(cmd, how)
|
||||
#ifdef pclose
|
||||
#undef pclose
|
||||
#endif
|
||||
#define pclose(fd) pt_pclose(fd)
|
||||
#endif
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b2eb894ce3e41925070215f800d6df3a356dc29d
|
||||
Subproject commit bf6525f85cfcf3c08fff8cf91fb189fe71dc34fd
|
Reference in New Issue
Block a user