Commit: patch 9.1.1832: if_perl: contains references to legacy if_perlsfio

2 views
Skip to first unread message

Christian Brabandt

unread,
Oct 6, 2025, 2:15:16 PM (21 hours ago) Oct 6
to vim...@googlegroups.com
patch 9.1.1832: if_perl: contains references to legacy if_perlsfio

Commit: https://github.com/vim/vim/commit/723f34f3dec10d13089bf0be83b0b8683ef3bc9c
Author: Hirohito Higashi <h.eas...@gmail.com>
Date: Mon Oct 6 17:59:10 2025 +0000

patch 9.1.1832: if_perl: contains references to legacy if_perlsfio

Problem: if_perl: contains references to legacy if_perlsfio.{c,pro} and
USE_SFIO
Solution: Remove those references (Hirohito Higashi)

fixes: #18496
closes: #18500

Signed-off-by: Hirohito Higashi <h.eas...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/.github/labeler.yml b/.github/labeler.yml
index 3b8ab48b8..5b884c89e 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -45,9 +45,7 @@ if_perl:
- changed-files:
- any-glob-to-any-file:
- 'src/if_perl.xs'
- - 'src/if_perlsfio.c'
- 'src/proto/if_perl.pro'
- - 'src/proto/if_perlsfio.pro'
- 'runtime/doc/if_perl.txt'

if_python:
diff --git a/Filelist b/Filelist
index ae9379d1b..bd218c3c1 100644
--- a/Filelist
+++ b/Filelist
@@ -550,7 +550,6 @@ SRC_DOS_UNIX = \
src/if_mzsch.c \
src/if_mzsch.h \
src/if_perl.xs \
- src/if_perlsfio.c \
src/if_python.c \
src/if_python3.c \
src/if_py_both.h \
@@ -561,7 +560,6 @@ SRC_DOS_UNIX = \
src/proto/if_lua.pro \
src/proto/if_mzsch.pro \
src/proto/if_perl.pro \
- src/proto/if_perlsfio.pro \
src/proto/if_python.pro \
src/proto/if_python3.pro \
src/proto/if_ruby.pro \
diff --git a/src/INSTALLvms.txt b/src/INSTALLvms.txt
index 60e13c7cd..9d9626d05 100644
--- a/src/INSTALLvms.txt
+++ b/src/INSTALLvms.txt
@@ -294,7 +294,7 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/
7.1.3 feature_OBJ = code1.obj code2.obj

Lists objects created from source codes listed in feature_SRC
- Example: PERL_OBJ = if_perlsfio.obj if_perl.obj
+ Example: PERL_OBJ = if_perl.obj

7.1.4 feature_LIB = ,OS_VMS_TCL.OPT/OPT

diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index ba0f51257..a59b083e7 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1129,7 +1129,7 @@ CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"

PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
PERL_INC = /I $(PERL_INCDIR)
-PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
+PERL_OBJ = $(OUTDIR)\if_perl.obj
XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
! IF exist($(XSUBPP))
XSUBPP = $(PERL_EXE) $(XSUBPP)
@@ -1647,9 +1647,6 @@ auto/if_perl.c: if_perl.xs typemap
$(OUTDIR)/if_perl.obj: $(OUTDIR) auto/if_perl.c $(INCL)
$(CC) $(CFLAGS_OUTDIR) $(PERL_INC) auto/if_perl.c

-$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
- $(CC) $(CFLAGS_OUTDIR) $(PERL_INC) if_perlsfio.c
-
$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(MZSCHEME_INCL) $(INCL) \
$(MZSCHEME_EXTRA_DEP)
$(CC) $(CFLAGS_OUTDIR) if_mzsch.c \
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index d452291af..8ab68e5c0 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -359,9 +359,8 @@ LIBS =
# Perl related setup.
PERL = perl
PERL_DEF = ,"FEAT_PERL"
-PERL_SRC = if_perlsfio.c if_perl.xs
+PERL_SRC = if_perl.xs
PERL_OBJ = \
-[.$(DEST)]if_perlsfio.obj \
[.$(DEST)]if_perl.obj

PERL_LIB = ,OS_VMS_PERL.OPT/OPT
@@ -1506,10 +1505,6 @@ lua_env :
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
errors.h globals.h
-[.$(DEST)]if_perlsfio.obj : if_perlsfio.c vim.h [.$(DEST)]config.h feature.h os_unix.h \
- ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
- gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
- errors.h globals.h
[.$(DEST)]if_python.obj : if_python.c vim.h [.$(DEST)]config.h feature.h os_unix.h \
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
diff --git a/src/Makefile b/src/Makefile
index 877310fe8..f5a4672aa 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1620,7 +1620,7 @@ SRC = $(BASIC_SRC) \
$(RUBY_SRC) \
$(WAYLAND_SRC)

-EXTRA_SRC = if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
+EXTRA_SRC = if_lua.c if_mzsch.c auto/if_perl.c \
if_python.c if_python3.c if_tcl.c if_ruby.c \
gui_beval.c netbeans.c job.c channel.c \
$(GRESOURCE_SRC)
@@ -3397,9 +3397,6 @@ mzscheme_base.c:
objects/if_perl.o: auto/if_perl.c
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) $(PERL_CFLAGS_EXTRA) -o $@ auto/if_perl.c

-objects/if_perlsfio.o: if_perlsfio.c
- $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) $(PERL_CFLAGS_EXTRA) -o $@ if_perlsfio.c
-
objects/if_python.o: if_python.c if_py_both.h
$(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c

@@ -4513,11 +4510,6 @@ objects/if_perl.o: auto/if_perl.c vim.h protodef.h auto/config.h feature.h \
beval.h proto/gui_beval.pro structs.h regexp.h gui.h \
libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \
ex_cmds.h spell.h proto.h globals.h errors.h
-objects/if_perlsfio.o: if_perlsfio.c vim.h protodef.h auto/config.h feature.h \
- os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \
- beval.h proto/gui_beval.pro structs.h regexp.h gui.h \
- libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \
- ex_cmds.h spell.h proto.h globals.h errors.h
objects/if_python.o: if_python.c vim.h protodef.h auto/config.h feature.h \
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \
beval.h proto/gui_beval.pro structs.h regexp.h gui.h \
diff --git a/src/auto/configure b/src/auto/configure
index d3aa017fc..6b88ea9dd 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -6967,9 +6967,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
fi
fi
PERL_LIBS=$perllibs
- PERL_SRC="auto/if_perl.c if_perlsfio.c"
- PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
- PERL_PRO="if_perl.pro if_perlsfio.pro"
+ PERL_SRC="auto/if_perl.c"
+ PERL_OBJ="objects/if_perl.o"
+ PERL_PRO="if_perl.pro"
printf "%s
" "#define FEAT_PERL 1" >>confdefs.h

fi
@@ -6995,7 +6995,7 @@ printf "%s
" ">>> too old; need Perl version 5.003_01 or later <<<" >&6; }
if test -n "$PERL"; then
PERL_DIR="$dir"
PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
- PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
+ PERL_OBJ="objects/if_perl.o $darwindir/auto/DynaLoader/DynaLoader.a"
PERL_LIBS="-L$darwindir/CORE -lperl"
fi
PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
diff --git a/src/configure.ac b/src/configure.ac
index aacb45d11..9755029cf 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -1246,9 +1246,9 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
fi
fi
PERL_LIBS=$perllibs
- PERL_SRC="auto/if_perl.c if_perlsfio.c"
- PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
- PERL_PRO="if_perl.pro if_perlsfio.pro"
+ PERL_SRC="auto/if_perl.c"
+ PERL_OBJ="objects/if_perl.o"
+ PERL_PRO="if_perl.pro"
AC_DEFINE(FEAT_PERL)
fi
fi
@@ -1274,7 +1274,7 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
if test -n "$PERL"; then
PERL_DIR="$dir"
PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
- PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
+ PERL_OBJ="objects/if_perl.o $darwindir/auto/DynaLoader/DynaLoader.a"
PERL_LIBS="-L$darwindir/CORE -lperl"
fi
dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only
diff --git a/src/if_perl.xs b/src/if_perl.xs
index cdac145ad..34feb3a96 100644
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -48,7 +48,7 @@
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
-#if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
+#if defined(PERLIO_LAYERS)
# include <perliol.h>
#endif

@@ -80,7 +80,6 @@ const char PL_memory_wrap[] = "panic: memory wrap";
#ifndef PROTO
# ifndef __MINGW32__
# include "proto/if_perl.pro"
-# include "proto/if_perlsfio.pro"
# endif
#endif

@@ -324,7 +323,7 @@ typedef int perl_key;
# define Perl_av_fetch dll_Perl_av_fetch
# define Perl_av_len dll_Perl_av_len
# define Perl_sv_2nv_flags dll_Perl_sv_2nv_flags
-# if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
+# if defined(PERLIO_LAYERS)
# define PerlIOBase_pushed dll_PerlIOBase_pushed
# define PerlIO_define_layer dll_PerlIO_define_layer
# endif
@@ -497,7 +496,7 @@ static SV * (*Perl_hv_iterval)(pTHX_ HV *, HE *);
static SV** (*Perl_av_fetch)(pTHX_ AV *, SSize_t, I32);
static SSize_t (*Perl_av_len)(pTHX_ AV *);
static NV (*Perl_sv_2nv_flags)(pTHX_ SV *const, const I32);
-# if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
+# if defined(PERLIO_LAYERS)
static IV (*PerlIOBase_pushed)(pTHX_ PerlIO *, const char *, SV *, PerlIO_funcs *);
static void (*PerlIO_define_layer)(pTHX_ PerlIO_funcs *);
# endif
@@ -655,7 +654,7 @@ static struct {
{"Perl_av_fetch", (PERL_PROC*)&Perl_av_fetch},
{"Perl_av_len", (PERL_PROC*)&Perl_av_len},
{"Perl_sv_2nv_flags", (PERL_PROC*)&Perl_sv_2nv_flags},
-# if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
+# if defined(PERLIO_LAYERS)
{"PerlIOBase_pushed", (PERL_PROC*)&PerlIOBase_pushed},
{"PerlIO_define_layer", (PERL_PROC*)&PerlIO_define_layer},
# endif
@@ -721,7 +720,7 @@ perl_enabled(int verbose)
}
#endif /* DYNAMIC_PERL */

-#if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
+#if defined(PERLIO_LAYERS)
static void vim_IOLayer_init(void);
#endif

@@ -745,12 +744,7 @@ perl_init(void)
perl_parse(perl_interp, xs_init, argc, argv, 0);
perl_call_argv("VIM::bootstrap", (long)G_DISCARD, bootargs);
VIM_init();
-#ifdef USE_SFIO
- sfdisc(PerlIO_stdout(), sfdcnewvim());
- sfdisc(PerlIO_stderr(), sfdcnewvim());
- sfsetbuf(PerlIO_stdout(), NULL, 0);
- sfsetbuf(PerlIO_stderr(), NULL, 0);
-#elif defined(PERLIO_LAYERS)
+#if defined(PERLIO_LAYERS)
vim_IOLayer_init();
#endif
}
@@ -1399,7 +1393,7 @@ err:
}
}

-#if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
+#if defined(PERLIO_LAYERS)
typedef struct {
struct _PerlIO base;
int attr;
@@ -1470,7 +1464,7 @@ vim_IOLayer_init(void)
(void)eval_pv( "binmode(STDOUT, ':Vim')"
" && binmode(STDERR, ':Vim(ErrorMsg)');", 0);
}
-#endif /* PERLIO_LAYERS && !USE_SFIO */
+#endif /* PERLIO_LAYERS */

#ifdef DYNAMIC_PERL

diff --git a/src/if_perlsfio.c b/src/if_perlsfio.c
deleted file mode 100644
index af15d3e8f..000000000
--- a/src/if_perlsfio.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* vi:set ts=8 sts=4 sw=4 noet:
- *
- * VIM - Vi IMproved by Bram Moolenaar
- *
- * Do ":help uganda" in Vim to read copying and usage conditions.
- * Do ":help credits" in Vim to see a list of people who contributed.
- * See README.txt for an overview of the Vim source code.
- */
-/*
- * if_perlsfio.c: Special I/O functions for Perl interface.
- */
-
-#define _memory_h // avoid memset redeclaration
-#define IN_PERL_FILE // don't include if_perl.pro from prot.h
-
-#include "vim.h"
-
-#if defined(USE_SFIO) || defined(PROTO)
-
-#ifndef USE_SFIO // just generating prototypes
-# define Sfio_t int
-# define Sfdisc_t int
-#endif
-
-#define NIL(type) ((type)0)
-
- static int
-sfvimwrite(
- Sfio_t *f, // stream involved
- char *buf, // buffer to read from
- int n, // number of bytes to write
- Sfdisc_t *disc) // discipline
-{
- char_u *str;
-
- str = vim_strnsave((char_u *)buf, n);
- if (str == NULL)
- return 0;
- msg_split((char *)str);
- vim_free(str);
-
- return n;
-}
-
-/*
- * sfdcnewnvi --
- * Create Vim discipline
- */
- Sfdisc_t *
-sfdcnewvim(void)
-{
- Sfdisc_t *disc;
-
- disc = ALLOC_ONE(Sfdisc_t);
- if (disc == NULL)
- return NULL;
-
- disc->readf = (Sfread_f)NULL;
- disc->writef = sfvimwrite;
- disc->seekf = (Sfseek_f)NULL;
- disc->exceptf = (Sfexcept_f)NULL;
-
- return disc;
-}
-
-#endif // USE_SFIO
diff --git a/src/proto.h b/src/proto.h
index e9e5efcbc..d7390c079 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -337,7 +337,6 @@ extern char_u *vimpty_getenv(const char_u *string); // in misc2.c
# if defined(FEAT_PERL) && !defined(IN_PERL_FILE)
# define CV void
# include "if_perl.pro"
-# include "if_perlsfio.pro"
# endif

# ifdef MACOS_CONVERT
diff --git a/src/proto/if_perlsfio.pro b/src/proto/if_perlsfio.pro
deleted file mode 100644
index df8e43887..000000000
--- a/src/proto/if_perlsfio.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-/* if_perlsfio.c */
-int *sfdcnewvim(void);
-/* vim: set ft=c : */
diff --git a/src/version.c b/src/version.c
index 27edfb16c..0b342a2b1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1832,
/**/
1831,
/**/
Reply all
Reply to author
Forward
0 new messages