about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/LYCgi.c11
-rw-r--r--src/LYCurses.c13
-rw-r--r--src/LYExtern.c2
-rw-r--r--src/LYStrings.c36
-rw-r--r--src/LYUtils.c8
5 files changed, 67 insertions, 3 deletions
diff --git a/src/LYCgi.c b/src/LYCgi.c
index 7f304759..4c819ffe 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -140,6 +140,16 @@ PUBLIC void add_lynxcgi_environment ARGS1(
     }
 }
 
+#ifdef __MINGW32__
+PRIVATE int LYLoadCGI ARGS4(
+	CONST char *, 		arg,
+	HTParentAnchor *,	anAnchor,
+	HTFormat,		format_out,
+	HTStream*,		sink)
+{
+	return -1;
+}
+#else
 PRIVATE int LYLoadCGI ARGS4(
 	CONST char *, 		arg,
 	HTParentAnchor *,	anAnchor,
@@ -684,6 +694,7 @@ PRIVATE int LYLoadCGI ARGS4(
 #endif /* LYNXCGI_LINKS */
     return(status);
 }
+#endif /* __MINGW32__ */
 
 #ifdef GLOBALDEF_IS_MACRO
 #define _LYCGI_C_GLOBALDEF_1_INIT { "lynxcgi", LYLoadCGI, 0 }
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 5058f989..5ef96702 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,6 +1,12 @@
 #include <HTUtils.h>
 #include <HTAlert.h>
 
+#ifdef __MINGW32__
+#ifdef UNIX
+#undef UNIX
+#endif /* UNIX */
+#endif /* __MINGW32__ */
+
 #include <LYCurses.h>
 #include <LYStyle.h>
 #include <LYUtils.h>
@@ -1327,8 +1333,12 @@ PUBLIC void stop_curses NOARGS
 #ifdef __DJGPP__
     ScreenClear();
 #else
+#ifdef __MINGW32__
+    clear();
+#else
     clrscr();
 #endif
+#endif
 #else
 
     if(LYCursesON == TRUE)	{
@@ -2691,10 +2701,11 @@ PRIVATE void make_blink_boldbg NOARGS
  */
 PUBLIC long LYgetattrs ARGS1(WINDOW *, win)
 {
-    attr_t result = 0;
 #if (defined(NCURSES_VERSION_MAJOR) && NCURSES_VERSION_MAJOR < 5) || !defined(NCURSES_MAJOR_VERSION)
+    long result = 0;
     result = getattrs(win);
 #else
+    attr_t result = 0;
     short pair = 0;
 
     wattr_get(win, &result, &pair, NULL);
diff --git a/src/LYExtern.c b/src/LYExtern.c
index 2a46c131..2ea87a0c 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -323,7 +323,7 @@ BOOL run_external ARGS2(
 
 	    /* command running. */
 #ifdef WIN_EX			/* 1997/10/17 (Fri) 14:07:50 */
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) || defined(__MINGW32__)
 	    status = system(cmdbuf);
 #else
 	    status = xsystem(cmdbuf);
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 28cca3b9..58fa79ea 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1316,6 +1316,18 @@ PRIVATE void setup_vtXXX_keymap NOARGS
 	INTERN_KEY( "\033OP",	F1,		KEY_F(1) ),
 	INTERN_KEY( "\033[OP",	F1,		KEY_F(1) ),
 	INTERN_KEY( "\033[29~",	DO_KEY,		KEY_F(16) ),
+#if defined(USE_SLANG) && defined(__MINGW32__)
+	INTERN_KEY( "\xE0H",	UPARROW,	KEY_UP ),
+	INTERN_KEY( "\xE0P",	DNARROW,	KEY_DOWN ),
+	INTERN_KEY( "\xE0M",	RTARROW,	KEY_RIGHT ),
+	INTERN_KEY( "\xE0K",	LTARROW,	KEY_LEFT ),
+	INTERN_KEY( "\xE0R",	INSERT_KEY,	KEY_IC ),
+	INTERN_KEY( "\xE0S",	REMOVE_KEY,	KEY_DC ),
+	INTERN_KEY( "\xE0I",	PGUP,		KEY_PPAGE ),
+	INTERN_KEY( "\xE0Q",	PGDOWN,		KEY_NPAGE ),
+	INTERN_KEY( "\xE0G",	HOME,		KEY_HOME),
+	INTERN_KEY( "\xE0O",	END_KEY,	KEY_END ),
+#endif
 #if defined(USE_SLANG) && !defined(VMS)
 	INTERN_KEY(	"^(ku)", UPARROW,	KEY_UP ),
 	INTERN_KEY(	"^(kd)", DNARROW,	KEY_DOWN ),
@@ -1509,8 +1521,30 @@ PRIVATE int LYgetch_for ARGS1(
    current_sl_modifier = 0;
 
    key = SLang_do_key (Keymap_List, myGetChar);
-   if ((key == NULL) || (key->type != SLKEY_F_KEYSYM))
+   if ((key == NULL) || (key->type != SLKEY_F_KEYSYM)) {
+#ifdef __MINGW32__
+	   if ((key == NULL) && (current_sl_modifier == LKC_ISLKC)) {
+		   key = SLang_do_key (Keymap_List, myGetChar);
+		   keysym = key->f.keysym;
+		   switch (keysym) {
+			   case 'H': keysym = UPARROW; break;
+			   case 'P': keysym = DNARROW; break;
+			   case 'M': keysym = RTARROW; break;
+			   case 'K': keysym = LTARROW; break;
+			   case 'R': keysym = INSERT_KEY; break;
+			   case 'S': keysym = REMOVE_KEY; break;
+			   case 'I': keysym = PGUP; break;
+			   case 'Q': keysym = PGDOWN; break;
+			   case 'G': keysym = HOME; break;
+			   case 'O': keysym = END_KEY; break;
+			   case ';': keysym = F1; break;
+		   }
+		   return(keysym);
+	   }
+#endif
+
      return (current_sl_modifier ? 0 : DO_NOTHING);
+   }
 
    keysym = key->f.keysym;
 
diff --git a/src/LYUtils.c b/src/LYUtils.c
index db5468ee..869ebf14 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -4,6 +4,14 @@
 #include <HTAccess.h>
 #include <HTCJK.h>
 #include <HTAlert.h>
+
+#ifdef __MINGW32__
+int kbhit(void);
+#ifdef UNIX
+#undef UNIX
+#endif /* UNIX */
+#endif /* __MINGW32__ */
+
 #include <LYCurses.h>
 #include <LYHistory.h>
 #include <LYStrings.h>