summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-17 17:13:30 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-17 17:13:30 +0100
commit88c86eb751de9e7e410b405084d35b32fafc2a24 (patch)
treecf0c456ba4a4f0455fdcae1452e10716ae23a53c
parent4131fd5509b283e978e8c6161f09643b64719787 (diff)
downloadvim-git-88c86eb751de9e7e410b405084d35b32fafc2a24.tar.gz
patch 8.1.0766: various problems when using Vim on VMSv8.1.0766
Problem: Various problems when using Vim on VMS. Solution: Various fixes. Define long_long_T. (Zoltan Arpadffy)
-rw-r--r--src/Make_vms.mms47
-rw-r--r--src/eval.c2
-rw-r--r--src/feature.h4
-rw-r--r--src/fileio.c4
-rw-r--r--src/gui_motif.c7
-rw-r--r--src/gui_x11.c6
-rw-r--r--src/gui_xmebw.c8
-rw-r--r--src/json.c2
-rw-r--r--src/ops.c40
-rw-r--r--src/os_vms_conf.h17
-rw-r--r--src/version.c2
-rw-r--r--src/vim.h11
-rw-r--r--src/xdiff/xdiff.h6
-rw-r--r--src/xdiff/xinclude.h6
14 files changed, 114 insertions, 48 deletions
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index 80872ad48..44c4d21b4 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -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
@@ -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
@@ -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
@@ -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 =
@@ -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.
@@ -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)
@@ -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)
@@ -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 \
@@ -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
diff --git a/src/eval.c b/src/eval.c
index b31ed351d..d8a9e4318 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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:
diff --git a/src/feature.h b/src/feature.h
index d5a685338..59fcf785e 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -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
@@ -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
diff --git a/src/fileio.c b/src/fileio.c
index 0608625a4..f6a799515 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -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);
}
}
diff --git a/src/gui_motif.c b/src/gui_motif.c
index 3f354096c..6eb618f17 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -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>
diff --git a/src/gui_x11.c b/src/gui_x11.c
index 9d8ea7e4a..1c55805d3 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -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
diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c
index b09b1e64c..cd6079418 100644
--- a/src/gui_xmebw.c
+++ b/src/gui_xmebw.c
@@ -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>
diff --git a/src/json.c b/src/json.c
index 11bb04832..ff6641126 100644
--- a/src/json.c
+++ b/src/json.c
@@ -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;
diff --git a/src/ops.c b/src/ops.c
index 8a106ebca..3818b68e5 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -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);
/*
@@ -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
{
@@ -7590,17 +7590,17 @@ 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);
}
}
@@ -7608,7 +7608,7 @@ cursor_pos_info(dict_T *dict)
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)
{
diff --git a/src/os_vms_conf.h b/src/os_vms_conf.h
index 9aa7526e7..6bc6efb34 100644
--- a/src/os_vms_conf.h
+++ b/src/os_vms_conf.h
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 */
@@ -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
diff --git a/src/version.c b/src/version.c
index 3f0e23b99..4e3c5a20d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -792,6 +792,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 766,
+/**/
765,
/**/
764,
diff --git a/src/vim.h b/src/vim.h
index 3d4094e34..b11f1ccb9 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -337,6 +337,17 @@
typedef unsigned char char_u;
typedef unsigned short short_u;
typedef unsigned int int_u;
+
+/* Older systems do not have support for long long
+ * use a typedef instead of hadcoded long long */
+#ifdef HAVE_NO_LONG_LONG
+ typedef long long_long_T;
+ typedef long unsigned long_long_u_T;
+#else
+ typedef long long long_long_T;
+ typedef long long unsigned long_long_u_T;
+#endif
+
/* Make sure long_u is big enough to hold a pointer.
* On Win64, longs are 32 bits and pointers are 64 bits.
* For printf() and scanf(), we need to take care of long_u specifically. */
diff --git a/src/xdiff/xdiff.h b/src/xdiff/xdiff.h
index a8bc1dced..783dc9df1 100644
--- a/src/xdiff/xdiff.h
+++ b/src/xdiff/xdiff.h
@@ -108,7 +108,11 @@ typedef struct s_bdiffparam {
long bsize;
} bdiffparam_t;
-#include "../vim.h"
+#ifdef VMS
+# include "[]vim.h"
+#else
+# include "../vim.h"
+#endif
#define xdl_malloc(x) lalloc((x), TRUE)
#define xdl_free(ptr) vim_free(ptr)
diff --git a/src/xdiff/xinclude.h b/src/xdiff/xinclude.h
index 46b860831..752c9f3f4 100644
--- a/src/xdiff/xinclude.h
+++ b/src/xdiff/xinclude.h
@@ -22,7 +22,11 @@
/* defines HAVE_ATTRIBUTE_UNUSED */
#ifdef HAVE_CONFIG_H
-# include "../auto/config.h"
+# ifdef VMS
+# include "[.auto]config.h"
+# else
+# include "../auto/config.h"
+# endif
#endif
/* Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter