update to SWI's latest

This commit is contained in:
Vitor Santos Costa 2014-03-06 02:03:10 +00:00
parent aba6d5741e
commit 23a7a52841
5 changed files with 70 additions and 44 deletions

92
swi/console/Makefile.in Normal file → Executable file
View File

@ -2,52 +2,74 @@
# Makefile for the SWI-Prolog console window.
################################################################
srcdir=@srcdir@
@VPATH@ @srcdir@
#
# default base directory for YAP installation
# (EROOT for architecture-dependent files)
#
prefix = @prefix@
exec_prefix = @exec_prefix@
ROOTDIR = $(prefix)
EROOTDIR = @exec_prefix@
#
# where YAP should look for libraries
#
LIBDIR=@libdir@/Yap
#
#
CC=@CC@
LDEXE=@LDEXE@
PLARCH=@PLARCH@
XLIBS=@XLIBS@
SOEXT=@SO_EXT@
CPPFLAGS=@CPPFLAGS@
DEFS=-D_export="extern __declspec(dllexport)" -DUNICODE -D_UNICODE \
-D__WINDOWS__ -D__YAP_PROLOG__
CFLAGS= @CFLAGS@ $(DEFS) $(CPPFLAGS) -I$(srcdir) -DRLC_VENDOR="\"YAP\""
#
#
# You shouldn't need to change what follows.
#
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
RANLIB=@RANLIB@
AR=@AR@
VPATH=@srcdir@
srcdir=@srcdir@
COFLAGS=@COFLAGS@
CWFLAGS=@CWFLAGS@
CIFLAGS=@CIFLAGS@
CMFLAGS=@CMFLAGS@ -DUNICODE -D_UNICODE
CPFLAGS=
CFLAGS= $(CWFLAGS) $(COFLAGS) $(CIFLAGS) $(CMFLAGS) $(CPFLAGS)
LDFLAGS=@LDFLAGS@ $(CPFLAGS)
SOURCES= \
$(srcdir)/complete.c $(srcdir)/console.c \
$(srcdir)/edit.c $(srcdir)/history.c \
$(srcdir)/menu.c
HEADERS= \
$(srcdir)/common.h $(srcdir)/console.h \
$(srcdir)/console_i.h $(srcdir)/history.h \
$(srcdir)/menu.h
PLHOME=../../..
OBJECTS= complete.o console.o edit.o history.o menu.o
include $(srcdir)/../../common.mk
LIBS=-lgdi32 -lcomdlg32
OBJ= complete.o console.o edit.o history.o menu.o
OUT= $(PLHOME)/lib/$(PLARCH)/plterm.$(SOEXT)
INCLDIR=$(PLHOME)/include
HDR= $(INCLDIR)/console.h
all: ../../plterm.dll
all: $(OUT) $(HDR)
../../plterm.dll: libplterm.a
$(CC) $(CFLAGS) -shared -o ../../plterm.dll \
-Wl,--export-all-symbols \
-Wl,--enable-auto-import \
-Wl,--whole-archive libplterm.a \
-Wl,--no-whole-archive $(LIBS) $(LDFLAGS)
$(OUT): $(OBJ)
$(CC) -shared $(COFLAGS) -o $@ -Wl,--out-implib,$@.a $(OBJ) $(XLIBS)
libplterm.a: $(OBJECTS) $(SOURCES) $(HEADERS)
-rm -f libplterm.a
$(AR) rc libplterm.a $(OBJECTS)
$(RANLIB) libplterm.a
$(HDR): $(INCLDIR)
install:
$(INCLDIR):
mkdir -p $@
clean:
rm -f *.o *~ *.dll
.o: .c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $@ -o $<
$(PLHOME)/include/console.h: $(srcdir)/console.h
cp -f $< $@
console.o: $(srcdir)/console_i.h $(srcdir)/console.h
clean:
rm -f *.o
rm -f *~
distclean: clean
rm -f $(PLHOME)/lib/$(PLARCH)/plterm.$(SOEXT)
rm -f $(PLHOME)/lib/$(PLARCH)/plterm.$(SOEXT).a
rm -f $(INCLDIR)/console.h
rm -f Makefile

14
swi/console/console.c Normal file → Executable file
View File

@ -222,7 +222,7 @@ static RlcQueue rlc_make_queue(int size);
static int rlc_from_queue(RlcQueue q);
static int rlc_is_empty_queue(RlcQueue q);
extern int main();
extern int main(int argc, char *argv[]);
static RlcUpdateHook _rlc_update_hook;
static RlcTimerHook _rlc_timer_hook;
@ -554,7 +554,7 @@ rlc_kill_wnd_proc(HWND hwnd, UINT message, UINT wParam, LONG lParam)
}
static TCHAR *
rlc_kill_window_class()
rlc_kill_window_class(void)
{ static TCHAR winclassname[32];
static WNDCLASS wndClass;
HINSTANCE instance = _rlc_hinstance;
@ -702,7 +702,7 @@ reg_get_str(HKEY key, const TCHAR *name, TCHAR *value, int length)
}
HKEY
static HKEY
reg_open_key(TCHAR **which, int create)
{ HKEY key = HKEY_CURRENT_USER;
DWORD disp;
@ -1019,7 +1019,7 @@ rlc_destroy(RlcData b)
static int
IsDownKey(code)
IsDownKey(int code)
{ short mask = GetKeyState(code);
return mask & 0x8000;
@ -1449,7 +1449,7 @@ rlc_yield()
*******************************/
static void
rlc_init_word_chars()
rlc_init_word_chars(void)
{ int i;
for(i=0; i<CHAR_MAX; i++)
@ -1565,7 +1565,7 @@ rlc_set_selection(RlcData b, int sl, int sc, int el, int ec)
}
void
static void
rlc_translate_mouse(RlcData b, int x, int y, int *line, int *chr)
{ int ln = b->window_start;
int n = b->window_size; /* # lines */
@ -3717,7 +3717,7 @@ free_user_data(RlcData b)
*******************************/
static void
noMemory()
noMemory(void)
{ MessageBox(NULL, _T("Not enough memory"), _T("Console"), MB_OK|MB_TASKMODAL);
ExitProcess(1);

4
swi/console/console.h Normal file → Executable file
View File

@ -26,8 +26,12 @@
#define _CONSOLE_H_INCLUDED
#ifndef RLC_VENDOR
#ifdef __YAP_PROLOG__
#define RLC_VENDOR _T("YAP")
#else
#define RLC_VENDOR TEXT("SWI")
#endif
#endif
#define RLC_TITLE_MAX 256 /* max length of window title */

2
swi/console/edit.c Normal file → Executable file
View File

@ -634,7 +634,7 @@ read_line(rlc_console b)
*******************************/
static void
init_dispatch_table()
init_dispatch_table(void)
{ static int done;
if ( !done )

2
swi/console/menu.c Normal file → Executable file
View File

@ -103,7 +103,7 @@ lookupMenuId(UINT id)
return NULL;
}
int
static int
insertMenu(HMENU in, const TCHAR *label, const TCHAR *before)
{ if ( !before )
{ if ( !label )