Skip to content

Commit e0874f8

Browse files
committed
patch 7.4.1169
Problem: The socket I/O is intertwined with the netbeans code. Solution: Start refactoring the netbeans communication to split off the socket I/O. Add the +channel feature.
1 parent 705ada1 commit e0874f8

22 files changed

Lines changed: 410 additions & 85 deletions

src/Make_bc5.mak

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@
8686
# (BIG for WIN32, SMALL for DOS16)
8787
# WINVER 0x0400 or 0x0500: minimum Win32 version to support (0x0400)
8888
# CSCOPE no or yes: include support for Cscope interface (yes)
89-
# NETBEANS no or yes: include support for Netbeans interface (yes if GUI
89+
# NETBEANS no or yes: include support for Netbeans interface; also
90+
# requires CHANNEL (yes if GUI
9091
# is yes)
9192
# NBDEBUG no or yes: include support for debugging Netbeans interface (no)
93+
# CHANNEL no or yes: include support for inter process communication (yes
94+
# if GUI is yes)
9295
# XPM define to path to XPM dir to get support for loading XPM images.
9396

9497
### BOR: root of the BC installation
@@ -137,6 +140,11 @@ CSCOPE = yes
137140
NETBEANS = yes
138141
!endif
139142

143+
### CHANNEL: yes to enable inter process communication, no to disable it
144+
!if ("$(CHANNEL)"=="") && ("$(GUI)"=="yes")
145+
CHANNEL = yes
146+
!endif
147+
140148
### LUA: uncomment this line if you want lua support in vim
141149
# LUA=c:\lua
142150

@@ -466,6 +474,7 @@ LINK2 = -aa
466474
RESFILE = vim.res
467475
!else
468476
!undef NETBEANS
477+
!undef CHANNEL
469478
!undef XPM
470479
!undef VIMDLL
471480
!if ("$(DEBUG)"=="yes")
@@ -488,12 +497,21 @@ RESFILE = vim.res
488497
!endif
489498

490499
!if ("$(NETBEANS)"=="yes")
500+
!if ("$(CHANNEL)"!="yes")
501+
# cannot use Netbeans without CHANNEL
502+
NETBEANS = no
503+
!else
491504
DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG
492505
!if ("$(NBDEBUG)"=="yes")
493506
DEFINES = $(DEFINES) -DNBDEBUG
494507
NBDEBUG_DEP = nbdebug.h nbdebug.c
495508
!endif
496509
!endif
510+
!endif
511+
512+
!if ("$(CHANNEL)"=="yes")
513+
DEFINES = $(DEFINES) -DFEAT_CHANNEL
514+
!endif
497515

498516
!ifdef XPM
499517
!if ("$(GUI)"=="yes")
@@ -673,6 +691,11 @@ vimobj = $(vimobj) \
673691
$(OBJDIR)\netbeans.obj
674692
!endif
675693

694+
!if ("$(CHANNEL)"=="yes")
695+
vimobj = $(vimobj) \
696+
$(OBJDIR)\channel.obj
697+
!endif
698+
676699
!ifdef XPM
677700
vimobj = $(vimobj) \
678701
$(OBJDIR)\xpm_w32.obj
@@ -748,6 +771,9 @@ MSG = $(MSG) CSCOPE
748771
!if ("$(NETBEANS)"=="yes")
749772
MSG = $(MSG) NETBEANS
750773
!endif
774+
!if ("$(CHANNEL)"=="yes")
775+
MSG = $(MSG) CHANNEL
776+
!endif
751777
!ifdef XPM
752778
MSG = $(MSG) XPM
753779
!endif
@@ -1029,6 +1055,9 @@ $(OBJDIR)\xpm_w32.obj: xpm_w32.c xpm.lib
10291055
$(OBJDIR)\netbeans.obj: netbeans.c $(NBDEBUG_DEP)
10301056
$(CC) $(CCARG) $(CC1) $(CC2)$@ netbeans.c
10311057

1058+
$(OBJDIR)\channel.obj: channel.c
1059+
$(CC) $(CCARG) $(CC1) $(CC2)$@ channel.c
1060+
10321061
$(OBJDIR)\vim.res: vim.rc version.h tools.bmp tearoff.bmp \
10331062
vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
10341063
$(BRC) -fo$(OBJDIR)\vim.res -i $(BOR)\include -w32 -r vim.rc @&&|

src/Make_cyg_ming.mak

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ WINVER = 0x0500
6464
endif
6565
# Set to yes to enable Cscope support.
6666
CSCOPE=yes
67-
# Set to yes to enable Netbeans support.
67+
# Set to yes to enable Netbeans support (requires CHANNEL).
6868
NETBEANS=$(GUI)
69+
# Set to yes to enable inter process communication.
70+
CHANNEL=$(GUI)
6971

7072

7173
# Link against the shared version of libstdc++ by default. Set
@@ -526,6 +528,10 @@ endif
526528
endif
527529
endif
528530

531+
ifeq ($(CHANNEL),yes)
532+
DEFINES += -DFEAT_CHANNEL
533+
endif
534+
529535
# DirectWrite (DirectX)
530536
ifeq ($(DIRECTX),yes)
531537
# Only allow DirectWrite for a GUI build.
@@ -667,13 +673,28 @@ endif
667673
ifeq ($(CSCOPE),yes)
668674
OBJ += $(OUTDIR)/if_cscope.o
669675
endif
676+
670677
ifeq ($(NETBEANS),yes)
678+
ifneq ($(CHANNEL),yes)
679+
# Cannot use Netbeans without CHANNEL
680+
NETBEANS=no
681+
else
671682
# Only allow NETBEANS for a GUI build.
672683
ifeq (yes, $(GUI))
673684
OBJ += $(OUTDIR)/netbeans.o
674685
LIB += -lwsock32
675686
endif
676687
endif
688+
endif
689+
690+
ifeq ($(CHANNEL),yes)
691+
OBJ += $(OUTDIR)/channel.o
692+
ifneq ($(NETBEANS),yes)
693+
LIB += -lwsock32
694+
endif
695+
endif
696+
endif
697+
677698
ifeq ($(DIRECTX),yes)
678699
# Only allow DIRECTX for a GUI build.
679700
ifeq (yes, $(GUI))
@@ -866,6 +887,9 @@ if_perl.c: if_perl.xs typemap
866887
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
867888
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
868889

890+
$(OUTDIR)/channel.o: channel.c $(INCL)
891+
$(CC) -c $(CFLAGS) channel.c -o $(OUTDIR)/channel.o
892+
869893
$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
870894
$(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
871895

src/Make_mvc.mak

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@
9696
# PostScript printing: POSTSCRIPT=yes (default is no)
9797
#
9898
# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
99+
# Requires CHANNEL.
100+
#
101+
# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
102+
# doesn't work)
103+
#
104+
# Inter process communication: CHANNEL=[yes or no] (default is yes if GUI
105+
# is yes)
99106
#
100107
# XPM Image Support: XPM=[path to XPM directory]
101108
# Default is "xpm", using the files included in the distribution.
@@ -114,9 +121,6 @@
114121
# yes: Write a normal mapfile.
115122
# lines: Write a mapfile with line numbers (only for VC6 and later)
116123
#
117-
# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
118-
# doesn't work)
119-
#
120124
# Static Code Analysis: ANALYZE=yes (works with VS2012 only)
121125
#
122126
# You can combine any of these interfaces
@@ -290,9 +294,13 @@ CSCOPE_DEFS = -DFEAT_CSCOPE
290294
NETBEANS = $(GUI)
291295
!endif
292296

293-
# Only allow NETBEANS and XPM for a GUI build.
297+
!ifndef CHANNEL
298+
CHANNEL = $(GUI)
299+
!endif
300+
301+
# Only allow NETBEANS and XPM for a GUI build and CHANNEL.
294302
!if "$(GUI)" == "yes"
295-
!if "$(NETBEANS)" == "yes"
303+
!if "$(NETBEANS)" == "yes" && "$(CHANNEL)" == "yes"
296304
# NETBEANS - Include support for Netbeans integration
297305
NETBEANS_PRO = proto/netbeans.pro
298306
NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
@@ -333,6 +341,14 @@ XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
333341
!endif
334342
!endif
335343

344+
!if "$(CHANNEL)" == "yes"
345+
CHANNEL_PRO = proto/channel.pro
346+
CHANNEL_OBJ = $(OBJDIR)/channel.obj
347+
CHANNEL_DEFS = -DFEAT_CHANNEL
348+
349+
NETBEANS_LIB = WSock32.lib
350+
!endif
351+
336352
# Set which version of the CRT to use
337353
!if defined(USE_MSVCRT)
338354
# CVARS = $(cvarsdll)
@@ -365,7 +381,7 @@ WINVER = 0x0400
365381
#VIMRUNTIMEDIR = somewhere
366382

367383
CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
368-
$(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
384+
$(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
369385
$(NBDEBUG_DEFS) $(XPM_DEFS) \
370386
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
371387
/Fo$(OUTDIR)/
@@ -1005,12 +1021,12 @@ all: $(VIM).exe \
10051021

10061022
$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
10071023
$(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
1008-
$(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
1024+
$(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
10091025
version.c version.h
10101026
$(CC) $(CFLAGS) version.c
10111027
$(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
10121028
$(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
1013-
$(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
1029+
$(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
10141030
$(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
10151031
if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
10161032

@@ -1227,6 +1243,8 @@ $(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
12271243

12281244
$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
12291245

1246+
$(OUTDIR)/channel.obj: $(OUTDIR) channel.c $(INCL)
1247+
12301248
$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
12311249

12321250
$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
@@ -1362,7 +1380,8 @@ proto.h: \
13621380
proto/ui.pro \
13631381
proto/undo.pro \
13641382
proto/window.pro \
1365-
$(NETBEANS_PRO)
1383+
$(NETBEANS_PRO) \
1384+
$(CHANNEL_PRO)
13661385

13671386
.SUFFIXES: .cod .i
13681387

src/auto/configure

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ XMKMF
656656
xmkmfpath
657657
SNIFF_OBJ
658658
SNIFF_SRC
659+
CHANNEL_OBJ
660+
CHANNEL_SRC
659661
NETBEANS_OBJ
660662
NETBEANS_SRC
661663
WORKSHOP_OBJ
@@ -810,6 +812,7 @@ with_ruby_command
810812
enable_cscope
811813
enable_workshop
812814
enable_netbeans
815+
enable_channel
813816
enable_sniff
814817
enable_multibyte
815818
enable_hangulinput
@@ -1473,6 +1476,7 @@ Optional Features:
14731476
--enable-cscope Include cscope interface.
14741477
--enable-workshop Include Sun Visual Workshop support.
14751478
--disable-netbeans Disable NetBeans integration support.
1479+
--disable-channel Disable process communication support.
14761480
--enable-sniff Include Sniff interface.
14771481
--enable-multibyte Include multibyte editing support.
14781482
--enable-hangulinput Include Hangul input support.
@@ -7227,6 +7231,29 @@ fi
72277231
if test "$enable_netbeans" = "yes"; then
72287232
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
72297233
$as_echo "no" >&6; }
7234+
else
7235+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7236+
$as_echo "yes" >&6; }
7237+
fi
7238+
7239+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-channel argument" >&5
7240+
$as_echo_n "checking --disable-channel argument... " >&6; }
7241+
# Check whether --enable-channel was given.
7242+
if test "${enable_channel+set}" = set; then :
7243+
enableval=$enable_channel;
7244+
else
7245+
enable_channel="yes"
7246+
fi
7247+
7248+
if test "$enable_channel" = "yes"; then
7249+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7250+
$as_echo "no" >&6; }
7251+
else
7252+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7253+
$as_echo "yes" >&6; }
7254+
fi
7255+
7256+
if test "$enable_netbeans" = "yes" -o "$enable_channel" = "yes"; then
72307257
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
72317258
$as_echo_n "checking for socket in -lsocket... " >&6; }
72327259
if ${ac_cv_lib_socket_socket+:} false; then :
@@ -7317,8 +7344,8 @@ _ACEOF
73177344

73187345
fi
73197346

7320-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling netbeans integration is possible" >&5
7321-
$as_echo_n "checking whether compiling netbeans integration is possible... " >&6; }
7347+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with process communication is possible" >&5
7348+
$as_echo_n "checking whether compiling with process communication is possible... " >&6; }
73227349
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73237350
/* end confdefs.h. */
73247351
@@ -7358,13 +7385,10 @@ if ac_fn_c_try_link "$LINENO"; then :
73587385
$as_echo "yes" >&6; }
73597386
else
73607387
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7361-
$as_echo "no" >&6; }; enable_netbeans="no"
7388+
$as_echo "no" >&6; }; enable_netbeans="no"; enable_channel="no"
73627389
fi
73637390
rm -f core conftest.err conftest.$ac_objext \
73647391
conftest$ac_exeext conftest.$ac_ext
7365-
else
7366-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7367-
$as_echo "yes" >&6; }
73687392
fi
73697393
if test "$enable_netbeans" = "yes"; then
73707394
$as_echo "#define FEAT_NETBEANS_INTG 1" >>confdefs.h
@@ -7373,6 +7397,14 @@ if test "$enable_netbeans" = "yes"; then
73737397

73747398
NETBEANS_OBJ="objects/netbeans.o"
73757399

7400+
fi
7401+
if test "$enable_channel" = "yes"; then
7402+
$as_echo "#define FEAT_CHANNEL 1" >>confdefs.h
7403+
7404+
CHANNEL_SRC="channel.c"
7405+
7406+
CHANNEL_OBJ="objects/channel.o"
7407+
73767408
fi
73777409

73787410
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-sniff argument" >&5

0 commit comments

Comments
 (0)