Skip to content

Commit

Permalink
[mod_verto] Add hack.diff to mcast's swig
Browse files Browse the repository at this point in the history
  • Loading branch information
andywolk committed Oct 19, 2021
1 parent bd7b76b commit f21da28
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mod/endpoints/mod_verto/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MCAST_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PERL_LDFLAGS
endif

mcast/mcast_wrap.cpp:
cd mcast && swig -module MCAST -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o mcast_wrap.cpp MCAST.i
cd mcast && swig -module MCAST -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o mcast_wrap.cpp MCAST.i && patch -s -p0 -i hack.diff

mcast/perlxsi.c:
$(PERL) -MExtUtils::Embed -e xsinit -- -o mcast/perlxsi.c
Expand Down
29 changes: 29 additions & 0 deletions src/mod/endpoints/mod_verto/mcast/hack.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- mcast_wrap.cpp.old 2015-06-16 12:27:19.024000000 -0500
+++ mcast_wrap.cpp 2015-06-16 12:34:51.540000000 -0500
@@ -1965,7 +1965,7 @@ XS(_wrap_McastHandle_send) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "McastHandle_send" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
- assert(arg1);
+ if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "McastHandle_send" "', argument " "1"" is NULL");
result = (int)(arg1)->send((char const *)arg2);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;

@@ -2006,7 +2006,7 @@ XS(_wrap_McastHandle_recv) {
}
arg2 = static_cast< int >(val2);
}
- assert(arg1);
+ if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "McastHandle_recv" "', argument " "1"" is NULL");
result = (char *)(arg1)->recv(arg2);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;

@@ -2037,7 +2037,7 @@ XS(_wrap_McastHandle_filenum) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_filenum" "', argument " "1"" of type '" "McastHandle *""'");
}
arg1 = reinterpret_cast< McastHandle * >(argp1);
- assert(arg1);
+ if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "McastHandle_filenum" "', argument " "1"" is NULL");
result = (arg1)->filenum();
ST(argvi) = SWIG_NewPointerObj((new mcast_socket_t(static_cast< const mcast_socket_t& >(result))), SWIGTYPE_p_mcast_socket_t, SWIG_POINTER_OWN | 0); argvi++ ;

3 changes: 3 additions & 0 deletions src/mod/endpoints/mod_verto/mcast/mcast_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1965,6 +1965,7 @@ XS(_wrap_McastHandle_send) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "McastHandle_send" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "McastHandle_send" "', argument " "1"" is NULL");
result = (int)(arg1)->send((char const *)arg2);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;

Expand Down Expand Up @@ -2005,6 +2006,7 @@ XS(_wrap_McastHandle_recv) {
}
arg2 = static_cast< int >(val2);
}
if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "McastHandle_recv" "', argument " "1"" is NULL");
result = (char *)(arg1)->recv(arg2);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;

Expand Down Expand Up @@ -2035,6 +2037,7 @@ XS(_wrap_McastHandle_filenum) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_filenum" "', argument " "1"" of type '" "McastHandle *""'");
}
arg1 = reinterpret_cast< McastHandle * >(argp1);
if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "McastHandle_filenum" "', argument " "1"" is NULL");
result = (arg1)->filenum();
ST(argvi) = SWIG_NewPointerObj((new mcast_socket_t(static_cast< const mcast_socket_t& >(result))), SWIGTYPE_p_mcast_socket_t, SWIG_POINTER_OWN | 0); argvi++ ;

Expand Down

0 comments on commit f21da28

Please sign in to comment.