From 23a7a52841e234fd6ae30c5d1d249dc26dae7838 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 6 Mar 2014 02:03:10 +0000 Subject: [PATCH] update to SWI's latest --- swi/console/Makefile.in | 92 +++++++++++++++++++++++++---------------- swi/console/console.c | 14 +++---- swi/console/console.h | 4 ++ swi/console/edit.c | 2 +- swi/console/menu.c | 2 +- 5 files changed, 70 insertions(+), 44 deletions(-) mode change 100644 => 100755 swi/console/Makefile.in mode change 100644 => 100755 swi/console/console.c mode change 100644 => 100755 swi/console/console.h mode change 100644 => 100755 swi/console/edit.c mode change 100644 => 100755 swi/console/menu.c diff --git a/swi/console/Makefile.in b/swi/console/Makefile.in old mode 100644 new mode 100755 index d966a3f2e..60f193c24 --- a/swi/console/Makefile.in +++ b/swi/console/Makefile.in @@ -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 diff --git a/swi/console/console.c b/swi/console/console.c old mode 100644 new mode 100755 index 324fb7dcf..c580c17d0 --- a/swi/console/console.c +++ b/swi/console/console.c @@ -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; iwindow_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); diff --git a/swi/console/console.h b/swi/console/console.h old mode 100644 new mode 100755 index 75b54b6a7..11e350b9a --- a/swi/console/console.h +++ b/swi/console/console.h @@ -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 */ diff --git a/swi/console/edit.c b/swi/console/edit.c old mode 100644 new mode 100755 index 0de90ca93..ac815886a --- a/swi/console/edit.c +++ b/swi/console/edit.c @@ -634,7 +634,7 @@ read_line(rlc_console b) *******************************/ static void -init_dispatch_table() +init_dispatch_table(void) { static int done; if ( !done ) diff --git a/swi/console/menu.c b/swi/console/menu.c old mode 100644 new mode 100755 index 40263cb77..d868962b8 --- a/swi/console/menu.c +++ b/swi/console/menu.c @@ -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 )