Skip to content

Commit

Permalink
patch 8.1.0766: various problems when using Vim on VMS
Browse files Browse the repository at this point in the history
Problem:    Various problems when using Vim on VMS.
Solution:   Various fixes. Define long_long_T. (Zoltan Arpadffy)
  • Loading branch information
brammool committed Jan 17, 2019
1 parent 4131fd5 commit 88c86eb
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 48 deletions.
47 changes: 35 additions & 12 deletions src/Make_vms.mms
Expand Up @@ -2,7 +2,7 @@
# Makefile for Vim on OpenVMS
#
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
# Last change: 2017 Nov 18
# Last change: 2019 Jan 17
#
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
# with MMS and MMK
Expand Down Expand Up @@ -43,6 +43,8 @@ GUI = YES
# GUI with GTK
# If you have GTK installed you might want to enable this option.
# NOTE: you will need to properly define GTK_DIR below
# NOTE: since Vim 7.3 GTK 2+ is used that is not ported to VMS,
# therefore this option should not be used
# GTK = YES

# GUI/Motif with XPM
Expand Down Expand Up @@ -164,7 +166,7 @@ GTK = ""
# unique on every system - logicals are not accepted
# please note: directory should end with . in order to /trans=conc work
# This value for GTK_DIR is an example.
GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
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
Expand All @@ -178,8 +180,10 @@ GUI_INC_VER= ,\""/gtk_root/gtk\"",\""/gtk_root/glib\""
MOTIF = YES
.IFDEF XPM
DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF","HAVE_XPM"
XPM_INC = ,[.xpm.include]
.ELSE
DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF"
XPM_INC =
.ENDIF
LIBS = ,OS_VMS_MOTIF.OPT/OPT
GUI_FLAG =
Expand Down Expand Up @@ -269,6 +273,11 @@ MZSCH_OBJ = if_mzsch.obj
ICONV_DEF = ,"USE_ICONV"
.ENDIF

# XDIFF related setup.
XDIFF_SRC = xdiffi.c,xemit.c,xprepare.c,xutils.c,xhistogram.c,xpatience.c
XDIFF_OBJ = xdiffi.obj,xemit.obj,xprepare.obj,xutils.obj,xhistogram.obj,xpatience.obj
XDIFF_INC = ,[.xdiff]

######################################################################
# End of configuration section.
# Please, do not change anything below without programming experience.
Expand All @@ -283,18 +292,22 @@ VIMHOST = "''F$TRNLNM("SYS$NODE")'''F$TRNLNM("UCX$INET_HOST")'.''F$TRNLNM("UCX$I
.SUFFIXES : .obj .c

ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
$(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
$(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF) -
$(ICONV_DEF)) -
$(CFLAGS)$(GUI_FLAG) -
/include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
/include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC) -
$(TCL_INC)$(XDIFF_INC)$(XPM_INC))

# CFLAGS displayed in :ver information
# It is specially formated for correct display of unix like includes
# as $(GUI_INC) - replaced with $(GUI_INC_VER)
# Otherwise should not be any other difference.
ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
$(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
$(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF) -
$(ICONV_DEF)) -
$(CFLAGS)$(GUI_FLAG) -
/include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
/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) \
$(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(RUBY_LIB)
Expand All @@ -303,21 +316,21 @@ SRC = arabic.c beval.obj blowfish.c buffer.c charset.c crypt.c crypt_zip.c dict.
ex_cmds.c ex_cmds2.c ex_docmd.c ex_eval.c ex_getln.c if_cscope.c if_xcmdsrv.c farsi.c fileio.c fold.c getchar.c \
hardcopy.c hashtab.c json.c list.c main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \
misc2.c move.c normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c sha256.c sign.c \
spell.c spellfile.c syntax.c tag.c term.c termlib.c ui.c undo.c userfunc.c version.c screen.c \
spell.c spellfile.c syntax.c tag.c term.c termlib.c textprop.c ui.c undo.c userfunc.c version.c screen.c \
window.c os_unix.c os_vms.c pathdef.c \
$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) \
$(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC)
$(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC) $(XDIFF_SRC)

OBJ = arabic.obj beval.obj blowfish.obj buffer.obj charset.obj crypt.obj crypt_zip.obj dict.obj diff.obj digraph.obj edit.obj eval.obj \
evalfunc.obj ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj if_cscope.obj \
if_xcmdsrv.obj farsi.obj fileio.obj fold.obj getchar.obj hardcopy.obj hashtab.obj json.obj list.obj main.obj mark.obj \
menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
move.obj mbyte.obj normal.obj ops.obj option.obj popupmnu.obj quickfix.obj \
regexp.obj search.obj sha256.obj sign.obj spell.obj spellfile.obj syntax.obj tag.obj term.obj termlib.obj \
regexp.obj search.obj sha256.obj sign.obj spell.obj spellfile.obj syntax.obj tag.obj term.obj termlib.obj textprop.obj \
ui.obj undo.obj userfunc.obj screen.obj version.obj window.obj os_unix.obj \
os_vms.obj pathdef.obj if_mzsch.obj\
$(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) \
$(RUBY_OBJ) $(HANGULIN_OBJ) $(MZSCH_OBJ)
$(RUBY_OBJ) $(HANGULIN_OBJ) $(MZSCH_OBJ) $(XDIFF_OBJ)

# Default target is making the executable
all : [.auto]config.h mmk_compat motif_env gtk_env perl_env python_env tcl_env ruby_env $(TARGET)
Expand Down Expand Up @@ -705,6 +718,10 @@ termlib.obj : termlib.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \
[.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \
arabic.h
textprop.obj : textprop.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \
[.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \
arabic.h
ui.obj : ui.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \
[.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \
Expand Down Expand Up @@ -828,5 +845,11 @@ netbeans.obj : netbeans.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
globals.h farsi.h arabic.h version.h
gui_xmdlg.obj : gui_xmdlg.c
gui_xmebw.obj : gui_xmebw.c
gui_xmdlg.obj : gui_xmdlg.c [.auto]config.h vim.h feature.h os_unix.h
gui_xmebw.obj : gui_xmebw.c [.auto]config.h vim.h feature.h os_unix.h
xdiffi.obj : [.xdiff]xdiffi.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h
xemit.obj : [.xdiff]xemit.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h
xprepare.obj : [.xdiff]xprepare.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h
xutils.obj : [.xdiff]xutils.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h
xhistogram.obj : [.xdiff]xhistogram.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h
xpatience.obj : [.xdiff]xpatience.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h
2 changes: 1 addition & 1 deletion src/eval.c
Expand Up @@ -7414,7 +7414,7 @@ tv_get_string_buf_chk(typval_T *varp, char_u *buf)
{
case VAR_NUMBER:
vim_snprintf((char *)buf, NUMBUFLEN, "%lld",
(long long)varp->vval.v_number);
(long_long_T)varp->vval.v_number);
return buf;
case VAR_FUNC:
case VAR_PARTIAL:
Expand Down
4 changes: 2 additions & 2 deletions src/feature.h
Expand Up @@ -380,7 +380,7 @@
/*
* +timers timer_start()
*/
#if defined(FEAT_RELTIME) && (defined(UNIX) || defined(WIN32))
#if defined(FEAT_RELTIME) && (defined(UNIX) || defined(WIN32) || defined(VMS) )
# define FEAT_TIMERS
#endif

Expand Down Expand Up @@ -1306,7 +1306,7 @@
* +balloon_eval_term Allow balloon expression evaluation in the terminal.
*/
#if defined(FEAT_HUGE) && defined(FEAT_TIMERS) && \
(defined(UNIX) || (defined(WIN32) && !defined(FEAT_GUI_W32)))
(defined(UNIX) || defined(VMS) || (defined(WIN32) && !defined(FEAT_GUI_W32)))
# define FEAT_BEVAL_TERM
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/fileio.c
Expand Up @@ -5334,14 +5334,14 @@ msg_add_lines(
*p++ = ' ';
if (shortmess(SHM_LINES))
vim_snprintf((char *)p, IOSIZE - (p - IObuff),
"%ldL, %lldC", lnum, (long long)nchars);
"%ldL, %lldC", lnum, (long_long_T)nchars);
else
{
sprintf((char *)p, NGETTEXT("%ld line, ", "%ld lines, ", lnum), lnum);
p += STRLEN(p);
vim_snprintf((char *)p, IOSIZE - (p - IObuff),
NGETTEXT("%lld character", "%lld characters", nchars),
(long long)nchars);
(long_long_T)nchars);
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/gui_motif.c
Expand Up @@ -34,9 +34,12 @@
#include <X11/Xatom.h>
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>

#ifdef HAVE_X11_XPM_H
# include <X11/xpm.h>
# if defined(VMS)
# include <xpm.h>
# else
# include <X11/xpm.h>
# endif
#else
# ifdef HAVE_XM_XPMP_H
# include <Xm/XpmP.h>
Expand Down
6 changes: 5 additions & 1 deletion src/gui_x11.c
Expand Up @@ -30,7 +30,11 @@
# include <Xm/XpmP.h>
#else
# ifdef HAVE_X11_XPM_H
# include <X11/xpm.h>
# ifdef VMS
# include <xpm.h>
# else
# include <X11/xpm.h>
# endif
# endif
#endif

Expand Down
8 changes: 7 additions & 1 deletion src/gui_xmebw.c
Expand Up @@ -35,7 +35,13 @@
# include <Xm/XpmP.h>
# define UNHIGHLIGHTT
#else
# include <X11/xpm.h>
# ifdef HAVE_X11_XPM_H
# ifdef VMS
# include <xpm.h>
# else
# include <X11/xpm.h>
# endif
# endif
#endif
#include <Xm/ManagerP.h>
#include <Xm/Display.h>
Expand Down
2 changes: 1 addition & 1 deletion src/json.c
Expand Up @@ -218,7 +218,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)

case VAR_NUMBER:
vim_snprintf((char *)numbuf, NUMBUFLEN, "%lld",
(long long)val->vval.v_number);
(long_long_T)val->vval.v_number);
ga_concat(gap, numbuf);
break;

Expand Down
40 changes: 20 additions & 20 deletions src/ops.c
Expand Up @@ -6036,16 +6036,16 @@ do_addsub(
}
else if (pre == 0)
vim_snprintf((char *)buf2, NUMBUFLEN, "%llu",
(long long unsigned)n);
(long_long_u_T)n);
else if (pre == '0')
vim_snprintf((char *)buf2, NUMBUFLEN, "%llo",
(long long unsigned)n);
(long_long_u_T)n);
else if (pre && hexupper)
vim_snprintf((char *)buf2, NUMBUFLEN, "%llX",
(long long unsigned)n);
(long_long_u_T)n);
else
vim_snprintf((char *)buf2, NUMBUFLEN, "%llx",
(long long unsigned)n);
(long_long_u_T)n);
length -= (int)STRLEN(buf2);

/*
Expand Down Expand Up @@ -7558,21 +7558,21 @@ cursor_pos_info(dict_T *dict)
_("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Bytes"),
buf1, line_count_selected,
(long)curbuf->b_ml.ml_line_count,
(long long)word_count_cursor,
(long long)word_count,
(long long)byte_count_cursor,
(long long)byte_count);
(long_long_T)word_count_cursor,
(long_long_T)word_count,
(long_long_T)byte_count_cursor,
(long_long_T)byte_count);
else
vim_snprintf((char *)IObuff, IOSIZE,
_("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Chars; %lld of %lld Bytes"),
buf1, line_count_selected,
(long)curbuf->b_ml.ml_line_count,
(long long)word_count_cursor,
(long long)word_count,
(long long)char_count_cursor,
(long long)char_count,
(long long)byte_count_cursor,
(long long)byte_count);
(long_long_T)word_count_cursor,
(long_long_T)word_count,
(long_long_T)char_count_cursor,
(long_long_T)char_count,
(long_long_T)byte_count_cursor,
(long_long_T)byte_count);
}
else
{
Expand All @@ -7590,25 +7590,25 @@ cursor_pos_info(dict_T *dict)
(char *)buf1, (char *)buf2,
(long)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count,
(long long)word_count_cursor, (long long)word_count,
(long long)byte_count_cursor, (long long)byte_count);
(long_long_T)word_count_cursor, (long_long_T)word_count,
(long_long_T)byte_count_cursor, (long_long_T)byte_count);
else
vim_snprintf((char *)IObuff, IOSIZE,
_("Col %s of %s; Line %ld of %ld; Word %lld of %lld; Char %lld of %lld; Byte %lld of %lld"),
(char *)buf1, (char *)buf2,
(long)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count,
(long long)word_count_cursor, (long long)word_count,
(long long)char_count_cursor, (long long)char_count,
(long long)byte_count_cursor, (long long)byte_count);
(long_long_T)word_count_cursor, (long_long_T)word_count,
(long_long_T)char_count_cursor, (long_long_T)char_count,
(long_long_T)byte_count_cursor, (long_long_T)byte_count);
}
}

#ifdef FEAT_MBYTE
bom_count = bomb_size();
if (bom_count > 0)
vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE,
_("(+%lld for BOM)"), (long long)bom_count);
_("(+%lld for BOM)"), (long_long_T)bom_count);
#endif
if (dict == NULL)
{
Expand Down
17 changes: 13 additions & 4 deletions src/os_vms_conf.h
Expand Up @@ -6,6 +6,7 @@
#define BINARY_FILE_IO /* Use binary fileio */
#define USE_GETCWD
#define USE_SYSTEM
#define XPMATTRIBUTES_TYPE XpmAttributes

/* Define when terminfo support found */
#undef TERMINFO
Expand All @@ -23,7 +24,7 @@
#define HAVE_DATE_TIME

/* Defined to the size of an int */
#define VIM_SIZEOF_INT 4
#define VIM_SIZEOF_INT 4

/* #undef USEBCOPY */
#define USEMEMMOVE
Expand Down Expand Up @@ -117,8 +118,11 @@
#define HAVE_SETJMP_H
#define HAVE_MATH_H
#define HAVE_FLOAT_FUNCS
#define HAVE_GETTIMEOFDAY
#define HAVE_PWD_H
#define HAVE_NETDB_H
#define HAVE_DIRENT_H

#undef HAVE_DIRENT_H
#undef HAVE_SYS_NDIR_H
#undef HAVE_SYS_DIR_H
#undef HAVE_NDIR_H
Expand All @@ -138,7 +142,6 @@
#undef HAVE_LIBC_H
#undef HAVE_SYS_STATFS_H
#undef HAVE_SYS_POLL_H
#undef HAVE_PWD_H
#undef HAVE_FCHDIR
#undef HAVE_LSTAT

Expand All @@ -150,13 +153,16 @@
#undef HAVE_STRINGS_H
#undef HAVE_SIGSETJMP
#undef HAVE_ISNAN
#else
#define HAVE_NO_LONG_LONG
#define VIM_SIZEOF_LONG 4
#else /* AXP and IA64 */
#define HAVE_GETTIMEOFDAY
#define HAVE_USLEEP
#define HAVE_STRCASECMP
#define HAVE_STRINGS_H
#define HAVE_SIGSETJMP
#define HAVE_ISNAN
#define VIM_SIZEOF_LONG 8
#endif

/* Compiler specific */
Expand Down Expand Up @@ -191,6 +197,9 @@
/* GUI support defines */
#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK)
#define HAVE_X11
#ifdef HAVE_XPM
#define HAVE_X11_XPM_H
#endif
#define USE_FONTSET
#undef X_LOCALE
#endif
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -791,6 +791,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
766,
/**/
765,
/**/
Expand Down

0 comments on commit 88c86eb

Please sign in to comment.