]> granicus.if.org Git - vim/commitdiff
patch 8.2.2247: VMS: various smaller problems v8.2.2247
authorBram Moolenaar <Bram@vim.org>
Wed, 30 Dec 2020 12:14:45 +0000 (13:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 30 Dec 2020 12:14:45 +0000 (13:14 +0100)
Problem:    VMS: various smaller problems.
Solution:   Fix VMS building and other problems. (Zoltan Arpadffy)

src/Make_vms.mms
src/gui.h
src/gui_gtk_vms.h
src/gui_x11.c
src/macros.h
src/os_unix.h
src/os_vms_conf.h
src/term.c
src/version.c

index 4b171f7903bc962115bac27d957c45338ce1ed2f..70a87cfe2b122d604ed443b5d31e0fd0fcffcacb 100644 (file)
@@ -2,7 +2,7 @@
 # Makefile for Vim on OpenVMS
 #
 # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
-# Last change:  2020 Aug 13
+# Last change:  2020 Dec 30
 #
 # This script has been tested on VMS 6.2 to 8.4 on DEC Alpha, VAX and IA64
 # with MMS and MMK
@@ -49,7 +49,7 @@ GUI = YES
 
 # GUI/Motif with XPM
 # If you have XPM installed you might want to build Motif version with toolbar
-XPM = YES
+XPM = YES
 
 # Comment out if you want the compiler version with :ver command.
 # NOTE: This part can make some complications if you're using some
@@ -97,7 +97,7 @@ CCVER = YES
 .IFDEF MMSVAX
 .IFDEF DECC         # VAX with DECC
 CC_DEF  = cc # /decc # some versions require /decc switch but when it is not required /ver might fail
-PREFIX  = /prefix=all
+PREFIX  = /prefix=all/name=(upper,short)
 OPTIMIZE= /noopt     # do not optimize on VAX. The compiler has hard time with crypto functions
 .ELSE               # VAX with VAXC
 CC_DEF = cc
@@ -107,7 +107,7 @@ CCVER       =
 .ENDIF
 .ELSE               # AXP and IA64 with DECC
 CC_DEF  = cc
-PREFIX  = /prefix=all
+PREFIX  = /prefix=all/name=(upper,short)
 OPTIMIZE= /opt
 .ENDIF
 
@@ -165,7 +165,7 @@ GTK = ""
 GTK_DIR  = DKA0:[WORK.GTK1210.]
 DEFS     = "HAVE_CONFIG_H","FEAT_GUI_GTK"
 LIBS     = ,OS_VMS_GTK.OPT/OPT
-GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
+GUI_FLAG = /float=ieee/ieee=denorm
 GUI_SRC  = gui.c gui_gtk.c gui_gtk_f.c gui_gtk_x11.c gui_beval.c pty.c
 GUI_OBJ  = gui.obj gui_gtk.obj gui_gtk_f.obj gui_gtk_x11.obj gui_beval.obj pty.obj
 GUI_INC  = ,"/gtk_root/gtk","/gtk_root/glib"
@@ -177,6 +177,7 @@ MOTIF        = YES
 .IFDEF XPM
 DEFS     = "HAVE_CONFIG_H","FEAT_GUI_MOTIF","HAVE_XPM"
 XPM_INC  = ,[.xpm.include]
+XPM_LIB  = ,OS_VMS_XPM.OPT/OPT
 .ELSE
 DEFS     = "HAVE_CONFIG_H","FEAT_GUI_MOTIF"
 XPM_INC  = 
@@ -291,7 +292,7 @@ ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
  /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC) -
  $(TCL_INC)$(XDIFF_INC)$(XPM_INC))
 
-ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
+ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) $(XPM_LIB)\
           $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(RUBY_LIB)
 
 SRC = \
@@ -546,6 +547,7 @@ clean :
        -@ if "''F$SEARCH("pathdef.c")'" .NES. "" then delete/noconfirm/nolog pathdef.c;*
        -@ if "''F$SEARCH("if_perl.c")'" .NES. "" then delete/noconfirm/nolog if_perl.c;*
        -@ if "''F$SEARCH("*.opt")'" .NES. "" then delete/noconfirm/nolog *.opt;*
+       -@ if "''F$SEARCH("*.dmp")'" .NES. "" then delete/noconfirm/nolog *.dmp;*
 
 # Link the target
 $(TARGET) : $(OBJ)
@@ -599,6 +601,18 @@ check_ccver :
 motif_env :
 .IFDEF XPM
        -@ write sys$output "using DECW/Motif/XPM environment."
+        -@ write sys$output "creating OS_VMS_XPM.OPT file."
+       -@ open/write opt_file OS_VMS_XPM.OPT
+.IFDEF MMSVAX
+       -@ write opt_file "[.xpm.vms.vax]libxpm.olb/lib"
+.ENDIF
+.IFDEF MMSALPHA
+       -@ write opt_file "[.xpm.vms.axp]libxpm.olb/lib"
+.ENDIF
+.IFDEF MMSIA64
+       -@ write opt_file "[.xpm.vms.ia64]libxpm.olb/lib"
+.ENDIF 
+       -@ close opt_file
 .ELSE
        -@ write sys$output "using DECW/Motif environment."
 .ENDIF
index 8b8b7fb163855222e5e7b7a23f5f2f904951fb10..b7b526d0cf6489619872834dbbdba060b6e7e701 100644 (file)
--- a/src/gui.h
+++ b/src/gui.h
@@ -24,7 +24,8 @@
 #  ifdef MIN
 #   undef MIN
 #  endif
-# endif
+#  include "gui_gtk_vms.h"
+# endif // VMS
 # include <X11/Intrinsic.h>
 # include <gtk/gtk.h>
 #endif
index c86bd0a5af1ca4c5596c4eb0e6c0110bd9c5d9ba..d30872ed2bdcc2163042e0253152b3b52387e874 100644 (file)
@@ -435,6 +435,7 @@ extern void XTFREE(char*);
 #define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
 #define XmRepTypeGetId XMREPTYPEGETID
 #define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON
 #define XmRepTypeRegister XMREPTYPEREGISTER
 #define XmRepTypeValidValue XMREPTYPEVALIDVALUE
 #define XmScrollBarSetValues XMSCROLLBARSETVALUES
@@ -722,17 +723,6 @@ extern void XTFREE(char*);
 // R5 or earlier
 #define _XtRegisterWindow _XTREGISTERWINDOW
 #define _XtUnregisterWindow _XTUNREGISTERWINDOW
-// original code is fixed so we don't need this now
-#if 0
-#define XtRegisterDrawable(display,drawable,widget) \
-{  extern void _XtRegisterWindow(Window,Widget); \
-   _XtRegisterWindow(drawable,widget); \
-}
-#define XtUnregisterDrawable(display,drawable) \
-{  extern void _XtUnregisterWindow(Window,Widget); \
-   _XtUnregisterWindow(drawable,XtWindowToWidget(display,drawable)); \
-}
-#endif
 #else
 // R6 or later
 #define XtRegisterDrawable XTREGISTERDRAWABLE
index 38f85d875ea187435304058de18c1550c1e0661f..14a0b8085f0cb979fa996a52021cae7f6fa8371d 100644 (file)
@@ -95,8 +95,8 @@ static Atom   wm_atoms[2];    // Window Manager Atoms
  * normal font (current_fontset == NULL, use gui.text_gc and gui.back_gc).
  */
 static XFontSet current_fontset = NULL;
-
-#define XDrawString(dpy, win, gc, x, y, str, n) \
+# if !defined(XDrawString)
+#  define XDrawString(dpy, win, gc, x, y, str, n) \
        do \
        { \
            if (current_fontset != NULL) \
@@ -104,8 +104,9 @@ static XFontSet current_fontset = NULL;
            else \
                XDrawString(dpy, win, gc, x, y, str, n); \
        } while (0)
-
-#define XDrawString16(dpy, win, gc, x, y, str, n) \
+# endif
+# if !defined(XDrawString16)
+#  define XDrawString16(dpy, win, gc, x, y, str, n) \
        do \
        { \
            if (current_fontset != NULL) \
@@ -113,8 +114,9 @@ static XFontSet current_fontset = NULL;
            else \
                XDrawString16(dpy, win, gc, x, y, (XChar2b *)str, n); \
        } while (0)
-
-#define XDrawImageString16(dpy, win, gc, x, y, str, n) \
+# endif
+# if !defined(XDrawImageString16)
+#  define XDrawImageString16(dpy, win, gc, x, y, str, n) \
        do \
        { \
            if (current_fontset != NULL) \
@@ -122,7 +124,7 @@ static XFontSet current_fontset = NULL;
            else \
                XDrawImageString16(dpy, win, gc, x, y, (XChar2b *)str, n); \
        } while (0)
-
+# endif
 static int check_fontset_sanity(XFontSet fs);
 static int fontset_width(XFontSet fs);
 static int fontset_ascent(XFontSet fs);
index 7557b2691769d62e9e31c8f83e1758017af38ea2..366413a917945c2f17e23e83125c728ca7603031 100644 (file)
 # define mch_access(n, p)      access(vms_fixfilename(n), (p))
                                // see mch_open() comment
 # define mch_fopen(n, p)       fopen(vms_fixfilename(n), (p))
-# define mch_fstat(n, p)       fstat(vms_fixfilename(n), (p))
-       // VMS does not have lstat()
+# define mch_fstat(n, p)       fstat((n), (p))
+# undef HAVE_LSTAT             // VMS does not have lstat()
 # define mch_stat(n, p)                stat(vms_fixfilename(n), (p))
 # define mch_rmdir(n)          rmdir(vms_fixfilename(n))
 #else
index 9b7337ac19c16a70b308ea6baf329c6ae233db44..46f4bba0122ba24c1c08ac4a5c1484917f35f4ab 100644 (file)
 # include <libdef.h>
 # include <libdtdef.h>
 
-# ifdef FEAT_GUI_GTK
-#  include "gui_gtk_vms.h"
+# if defined(FEAT_GUI_MOTIF)
+#  define XFree XFREE
+#  define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON
 # endif
-#endif
+#endif // VMS
 
 #ifdef HAVE_FLOCK
 # include <sys/file.h>
index 275a2c1a2d71b492ab7d9010235ca65964a8fa41..deb7080607b0886293394619acd76adffd6e291c 100644 (file)
 #undef HAVE_SYS_POLL_H
 #undef  HAVE_FCHDIR
 #undef  HAVE_LSTAT
+#undef  HAVE_STDINT_H
+#undef  HAVE_XOS_R_H
 
 // Hardware specific
 #ifdef  VAX
 #undef  HAVE_ISNAN
 #define HAVE_NO_LONG_LONG
 #define VIM_SIZEOF_LONG 4
+#define LONG_LONG_MIN  (-2147483647-1)                                                                                                    
+#define LONG_LONG_MAX  (2147483647)                                                                                                     
+#define ULONG_LONG_MAX (4294967295U)
+#undef  XTHREADS
 #else // AXP and IA64
 #define HAVE_GETTIMEOFDAY
 #define HAVE_USLEEP
 #define HAVE_STRINGS_H
 #define HAVE_SIGSETJMP
 #define HAVE_ISNAN
+#define HAVE_NO_LONG_LONG
 #define VIM_SIZEOF_LONG 8
+#define LONG_LONG_MIN  (-9223372036854775807-1)                                                                                                    
+#define LONG_LONG_MAX  (9223372036854775807)                                                                                                     
+#define ULONG_LONG_MAX (18446744073709551615U)
+#define XTHREADS
 #endif
 
 // Compiler specific
 #define BROKEN_LOCALE
 #undef  DYNAMIC_ICONV
 #undef HAVE_STRFTIME
-#else
+#else   // DECC
 #define HAVE_SELECT
 #define HAVE_FCNTL_H
 #define HAVE_UNISTD_H 1
 
 // GUI support defines
 #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK)
+#define X_INCLUDE_GRP_H             // To use getgrgid
+#define XUSE_MTSAFE_API
 #define HAVE_X11
+#define WANT_X11
 #ifdef HAVE_XPM
 #define HAVE_X11_XPM_H
 #endif
index b55d395770cc233eaf4a29b32225ec990ba8e70b..bb4bad1c96912c9944f945feec545f2663fa6bdc 100644 (file)
@@ -38,7 +38,7 @@
  * argument for tputs().
  */
 # ifdef VMS
-#  define TPUTSFUNCAST
+#  define TPUTSFUNCAST (void (*)(unsigned int))
 # else
 #  ifdef HAVE_OUTFUNTYPE
 #   define TPUTSFUNCAST (outfuntype)
index 3894bc0e1d412e0f684c431843567a23f9ee267b..27907d721e773f1a79cfd5dcba595393e19c4133 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2247,
 /**/
     2246,
 /**/