From b8a16cbc7f8ec0fffb5a9f3ee646ac2fbe127fc4 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 9 Jul 2025 13:18:29 +0300 Subject: [PATCH] [Build-system] Use swig 4.1 --- libs/esl/java/Makefile | 2 +- libs/esl/lua/Makefile | 2 +- libs/esl/managed/Makefile | 2 +- libs/esl/perl/Makefile.am | 2 +- libs/esl/php/Makefile.am | 2 +- libs/esl/python3/Makefile | 2 +- libs/esl/ruby/Makefile | 2 +- libs/esl/tcl/Makefile | 2 +- src/mod/languages/mod_java/Makefile.am | 2 +- src/mod/languages/mod_lua/Makefile.am | 2 +- src/mod/languages/mod_lua/hack.diff | 306 +++++++----------- src/mod/languages/mod_managed/Makefile.am | 3 +- .../languages/mod_managed/managed/hack.diff | 11 + src/mod/languages/mod_perl/Makefile.am | 2 +- src/mod/languages/mod_python3/Makefile.am | 2 +- src/mod/languages/mod_python3/hack.diff | 63 +--- 16 files changed, 161 insertions(+), 246 deletions(-) create mode 100644 src/mod/languages/mod_managed/managed/hack.diff diff --git a/libs/esl/java/Makefile b/libs/esl/java/Makefile index 48ee95acc4..8738ff93f9 100644 --- a/libs/esl/java/Makefile +++ b/libs/esl/java/Makefile @@ -5,7 +5,7 @@ CLASSES=org/freeswitch/esl/* all: esl.jar esl_wrap.cpp: - swig3.0 -module esl -java -c++ $(LOCAL_CFLAGS) -package org.freeswitch.esl -outdir org/freeswitch/esl -o esl_wrap.cpp ../ESL.i + swig -module esl -java -c++ $(LOCAL_CFLAGS) -package org.freeswitch.esl -outdir org/freeswitch/esl -o esl_wrap.cpp ../ESL.i esl_wrap.o: esl_wrap.cpp $(CXX) $(CXX_CFLAGS) $(LOCAL_CFLAGS) $(CXXFLAGS) $(GCC_WARNING_JUNK) $(PERL_INC) -c esl_wrap.cpp -o esl_wrap.o diff --git a/libs/esl/lua/Makefile b/libs/esl/lua/Makefile index a24b527ba5..55c6ae2ec0 100644 --- a/libs/esl/lua/Makefile +++ b/libs/esl/lua/Makefile @@ -5,7 +5,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-function all: ESL.so esl_wrap.cpp: - swig3.0 -module ESL -lua -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -lua -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i esl_wrap.o: esl_wrap.cpp $(CXX) $(CXX_CFLAGS) $(LUA_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o diff --git a/libs/esl/managed/Makefile b/libs/esl/managed/Makefile index fb8c36ba67..8ce9a9890e 100644 --- a/libs/esl/managed/Makefile +++ b/libs/esl/managed/Makefile @@ -5,7 +5,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-function all: ESL.so esl_wrap.cpp: - swig3.0 -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i esl_wrap.o: esl_wrap.cpp $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o diff --git a/libs/esl/perl/Makefile.am b/libs/esl/perl/Makefile.am index 7caf8ad271..ebfa460cda 100644 --- a/libs/esl/perl/Makefile.am +++ b/libs/esl/perl/Makefile.am @@ -21,7 +21,7 @@ endif $(MAKE) -C .. esl_wrap.cpp: - swig3.0 -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i perlxsi.c: $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c diff --git a/libs/esl/php/Makefile.am b/libs/esl/php/Makefile.am index bafc3f8764..e40457f294 100644 --- a/libs/esl/php/Makefile.am +++ b/libs/esl/php/Makefile.am @@ -3,7 +3,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-label -Wno-unused-function all: ESL.so esl_wrap.cpp: - swig3.0 -module ESL -php7 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -php7 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i sed -e 's/ char \*type_name;/ const char \*type_name;/' -i esl_wrap.cpp esl_wrap.o: esl_wrap.cpp diff --git a/libs/esl/python3/Makefile b/libs/esl/python3/Makefile index 1c838534fd..43c3669c56 100644 --- a/libs/esl/python3/Makefile +++ b/libs/esl/python3/Makefile @@ -5,7 +5,7 @@ SITE_DIR=$(DESTDIR)/`$(PYTHON3) -c "from distutils.sysconfig import get_python_l all: _ESL.so esl_wrap.cpp: - swig3.0 -module ESL -classic -python -c++ -DMULTIPLICITY -threads -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -classic -python -c++ -DMULTIPLICITY -threads -I../src/include -o esl_wrap.cpp ../ESL.i esl_wrap.o: esl_wrap.cpp $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o diff --git a/libs/esl/ruby/Makefile b/libs/esl/ruby/Makefile index ae3d2a10d3..8284dcda62 100644 --- a/libs/esl/ruby/Makefile +++ b/libs/esl/ruby/Makefile @@ -6,7 +6,7 @@ RUBY_GEM_DIR=$(shell $(RUBY) -e 'puts RbConfig::CONFIG["rubylibdir"]') all: ESL.so esl_wrap.cpp: - swig3.0 -module ESL -ruby -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -ruby -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i esl_wrap.o: esl_wrap.cpp $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o diff --git a/libs/esl/tcl/Makefile b/libs/esl/tcl/Makefile index 527ef03569..85b1fa1211 100644 --- a/libs/esl/tcl/Makefile +++ b/libs/esl/tcl/Makefile @@ -5,7 +5,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-function all: ESL.so esl_wrap.cpp: - swig3.0 -module ESL -tcl -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig -module ESL -tcl -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i esl_wrap.o: esl_wrap.cpp $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o diff --git a/src/mod/languages/mod_java/Makefile.am b/src/mod/languages/mod_java/Makefile.am index 9749993599..f5aaa90bb3 100644 --- a/src/mod/languages/mod_java/Makefile.am +++ b/src/mod/languages/mod_java/Makefile.am @@ -28,7 +28,7 @@ freeswitch.jar: classes reswig: rm -f switch_swig_wrap.cpp - swig3.0 -java -c++ -I../../../include -package org.freeswitch.swig -outdir src/org/freeswitch/swig -o switch_swig_wrap.cpp mod_java.i + swig -java -c++ -I../../../include -package org.freeswitch.swig -outdir src/org/freeswitch/swig -o switch_swig_wrap.cpp mod_java.i install-data-local: cp freeswitch.jar $(DESTDIR)@scriptdir@ diff --git a/src/mod/languages/mod_lua/Makefile.am b/src/mod/languages/mod_lua/Makefile.am index 663cda1677..f898c8abfa 100644 --- a/src/mod/languages/mod_lua/Makefile.am +++ b/src/mod/languages/mod_lua/Makefile.am @@ -25,7 +25,7 @@ swigclean: clean rm -f mod_lua_wrap.* mod_lua_wrap.cpp: mod_lua_extra.c - swig3.0 -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i + swig -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i echo "#include \"mod_lua_extra.c\"" >> mod_lua_wrap.cpp patch -s -p0 -i hack.diff diff --git a/src/mod/languages/mod_lua/hack.diff b/src/mod/languages/mod_lua/hack.diff index 779d4f5a8b..e3fe191aed 100644 --- a/src/mod/languages/mod_lua/hack.diff +++ b/src/mod/languages/mod_lua/hack.diff @@ -1,186 +1,122 @@ ---- mod_lua_wrap.cpp.old 2025-01-15 13:22:48.705853645 +0000 -+++ mod_lua_wrap.cpp 2025-01-15 13:23:33.161847705 +0000 -@@ -4242,7 +4242,7 @@ - } - - result = (char *)(arg1)->read(arg2); -- lua_pushstring(L,(const char *)result); SWIG_arg++; -+ lua_pushlstring(L,(const char*)result, (*arg2)); SWIG_arg++; - lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++; - return SWIG_arg; - -@@ -8336,7 +8336,7 @@ - - SWIG_check_num_args("LUA::Session::Session",0,0) - result = (LUA::Session *)new LUA::Session(); -- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; -+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); - return SWIG_arg; - - if(0) SWIG_fail; -@@ -8363,7 +8363,7 @@ - } - - result = (LUA::Session *)new LUA::Session(arg1,arg2); -- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; -+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); - return SWIG_arg; - - if(0) SWIG_fail; -@@ -8383,7 +8383,7 @@ - if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"char *"); - arg1 = (char *)lua_tostring(L, 1); - result = (LUA::Session *)new LUA::Session(arg1); -- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; -+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); - return SWIG_arg; - - if(0) SWIG_fail; -@@ -8407,7 +8407,7 @@ - } - - result = (LUA::Session *)new LUA::Session(arg1); -- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; -+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); - return SWIG_arg; - - if(0) SWIG_fail; -@@ -9517,6 +9517,7 @@ - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); - arg4 = (char *)lua_tostring(L, 4); -+ switch_assert(arg1); - result = (bool)(arg1)->test_reactive(arg2,arg3,arg4); - lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - return SWIG_arg; -@@ -9547,6 +9548,7 @@ - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); -+ switch_assert(arg1); - result = (bool)(arg1)->test_reactive(arg2,arg3); - lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - return SWIG_arg; -@@ -9574,6 +9576,7 @@ - } - - arg2 = (char *)lua_tostring(L, 2); -+ switch_assert(arg1); - result = (bool)(arg1)->test_reactive(arg2); - lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - return SWIG_arg; -@@ -9704,6 +9707,7 @@ - (&arg3)->idx = 3; +--- mod_lua_wrap.cpp.old 2025-07-09 10:36:02.165895047 +0000 ++++ mod_lua_wrap.cpp 2025-07-09 10:46:12.289624035 +0000 +@@ -9639,6 +9639,7 @@ } - } -+ switch_assert(arg1); - result = (bool)(arg1)->query(arg2,arg3); - lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - return SWIG_arg; -@@ -9733,6 +9737,7 @@ - } - - arg3 = (char *)lua_tostring(L, 2); -+ switch_assert(arg1); - result = (arg1)->query_rows(arg2,arg3); - { - SWIG_arg += result; -@@ -9758,7 +9763,7 @@ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ - SWIG_fail_ptr("Dbh_affected_rows",1,SWIGTYPE_p_LUA__Dbh); - } -- -+ switch_assert(arg1); - result = (int)(arg1)->affected_rows(); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; -@@ -9782,7 +9787,7 @@ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ - SWIG_fail_ptr("Dbh_last_error",1,SWIGTYPE_p_LUA__Dbh); - } -- -+ switch_assert(arg1); - result = (char *)(arg1)->last_error(); - lua_pushstring(L,(const char *)result); SWIG_arg++; - return SWIG_arg; -@@ -9805,7 +9810,7 @@ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ - SWIG_fail_ptr("Dbh_clear_error",1,SWIGTYPE_p_LUA__Dbh); - } -- -+ switch_assert(arg1); - (arg1)->clear_error(); - - return SWIG_arg; -@@ -9833,6 +9838,7 @@ - } - - arg2 = (char *)lua_tostring(L, 2); -+ switch_assert(arg1); - result = (int)(arg1)->load_extension((char const *)arg2); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; -@@ -9933,6 +9939,7 @@ - } - - arg2 = (char *)lua_tostring(L, 2); -+ switch_assert(arg1); - result = (cJSON *)(arg1)->decode((char const *)arg2); - { - SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result); -@@ -9966,6 +9973,7 @@ - (&arg2)->L = L; - (&arg2)->idx = 2; - } -+ switch_assert(arg1); - result = (arg1)->encode(arg2); - lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; - return SWIG_arg; -@@ -9993,6 +10001,7 @@ - } - - arg2 = (char *)lua_tostring(L, 2); -+ switch_assert(arg1); - result = (cJSON *)(arg1)->execute((char const *)arg2); - { - SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result); -@@ -10026,6 +10035,7 @@ - (&arg2)->L = L; - (&arg2)->idx = 2; - } -+ switch_assert(arg1); - result = (cJSON *)(arg1)->execute(arg2); - { - SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result); -@@ -10110,6 +10120,7 @@ - } - - arg2 = (char *)lua_tostring(L, 2); -+ switch_assert(arg1); - result = (arg1)->execute2((char const *)arg2); - lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; - return SWIG_arg; -@@ -10140,6 +10151,7 @@ - (&arg2)->L = L; - (&arg2)->idx = 2; - } -+ switch_assert(arg1); - result = (arg1)->execute2(arg2); - lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; - return SWIG_arg; -@@ -10220,6 +10232,7 @@ - } - - arg2 = (lua_toboolean(L, 2)!=0); -+ switch_assert(arg1); - (arg1)->encode_empty_table_as_object(arg2); - - return SWIG_arg; -@@ -10246,6 +10259,7 @@ - } - - arg2 = (lua_toboolean(L, 2)!=0); -+ switch_assert(arg1); - (arg1)->return_unformatted_json(arg2); - - return SWIG_arg; + + arg2 = (char *)lua_tostring(L, 2); ++ switch_assert(arg1); + result = (bool)(arg1)->test_reactive(arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; +@@ -9769,6 +9770,7 @@ + (&arg3)->idx = 3; + } + } ++ switch_assert(arg1); + result = (bool)(arg1)->query(arg2,arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; +@@ -9798,6 +9800,7 @@ + } + + arg3 = (char *)lua_tostring(L, 2); ++ switch_assert(arg1); + result = (arg1)->query_rows(arg2,arg3); + { + SWIG_arg += result; +@@ -9824,6 +9827,7 @@ + SWIG_fail_ptr("Dbh_affected_rows",1,SWIGTYPE_p_LUA__Dbh); + } + ++ switch_assert(arg1); + result = (int)(arg1)->affected_rows(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; +@@ -9848,6 +9852,7 @@ + SWIG_fail_ptr("Dbh_last_error",1,SWIGTYPE_p_LUA__Dbh); + } + ++ switch_assert(arg1); + result = (char *)(arg1)->last_error(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; +@@ -9871,6 +9876,7 @@ + SWIG_fail_ptr("Dbh_clear_error",1,SWIGTYPE_p_LUA__Dbh); + } + ++ switch_assert(arg1); + (arg1)->clear_error(); + + return SWIG_arg; +@@ -9898,6 +9904,7 @@ + } + + arg2 = (char *)lua_tostring(L, 2); ++ switch_assert(arg1); + result = (int)(arg1)->load_extension((char const *)arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; +@@ -9998,6 +10005,7 @@ + } + + arg2 = (char *)lua_tostring(L, 2); ++ switch_assert(arg1); + result = (cJSON *)(arg1)->decode((char const *)arg2); + { + SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result); +@@ -10031,6 +10039,7 @@ + (&arg2)->L = L; + (&arg2)->idx = 2; + } ++ switch_assert(arg1); + result = (arg1)->encode(arg2); + lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; + return SWIG_arg; +@@ -10058,6 +10067,7 @@ + } + + arg2 = (char *)lua_tostring(L, 2); ++ switch_assert(arg1); + result = (cJSON *)(arg1)->execute((char const *)arg2); + { + SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result); +@@ -10091,6 +10101,7 @@ + (&arg2)->L = L; + (&arg2)->idx = 2; + } ++ switch_assert(arg1); + result = (cJSON *)(arg1)->execute(arg2); + { + SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result); +@@ -10175,6 +10186,7 @@ + } + + arg2 = (char *)lua_tostring(L, 2); ++ switch_assert(arg1); + result = (arg1)->execute2((char const *)arg2); + lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; + return SWIG_arg; +@@ -10205,6 +10217,7 @@ + (&arg2)->L = L; + (&arg2)->idx = 2; + } ++ switch_assert(arg1); + result = (arg1)->execute2(arg2); + lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; + return SWIG_arg; +@@ -10285,6 +10298,7 @@ + } + + arg2 = (lua_toboolean(L, 2)!=0); ++ switch_assert(arg1); + (arg1)->encode_empty_table_as_object(arg2); + + return SWIG_arg; +@@ -10311,6 +10325,7 @@ + } + + arg2 = (lua_toboolean(L, 2)!=0); ++ switch_assert(arg1); + (arg1)->return_unformatted_json(arg2); + + return SWIG_arg; diff --git a/src/mod/languages/mod_managed/Makefile.am b/src/mod/languages/mod_managed/Makefile.am index a212a1ed1f..b6c7e4e1aa 100644 --- a/src/mod/languages/mod_managed/Makefile.am +++ b/src/mod/languages/mod_managed/Makefile.am @@ -39,7 +39,8 @@ swigclean: clean rm -f freeswitch_wrap.cxx managed/swig.cs freeswitch_wrap.cxx: - swig3.0 -I../../../include -v -O -c++ -csharp -namespace FreeSWITCH.Native -dllimport mod_managed -DSWIG_CSHARP_NO_STRING_HELPER freeswitch.i + swig -I../../../include -v -O -c++ -csharp -namespace FreeSWITCH.Native -dllimport mod_managed -DSWIG_CSHARP_NO_STRING_HELPER freeswitch.i rm -f ./managed/swig.cs + patch -s -p0 -i managed/hack.diff cat *.cs > ./managed/swig.cs rm -f *.cs diff --git a/src/mod/languages/mod_managed/managed/hack.diff b/src/mod/languages/mod_managed/managed/hack.diff new file mode 100644 index 0000000000..ffebdccc8c --- /dev/null +++ b/src/mod/languages/mod_managed/managed/hack.diff @@ -0,0 +1,11 @@ +--- switch_event.cs.old 2025-06-18 14:42:04.451534270 +0000 ++++ switch_event.cs 2025-06-18 14:43:13.731741625 +0000 +@@ -40,7 +40,7 @@ + Dispose(false); + } + +- public void Dispose() { ++ public virtual void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } diff --git a/src/mod/languages/mod_perl/Makefile.am b/src/mod/languages/mod_perl/Makefile.am index c1be5d6839..acf1d465a1 100644 --- a/src/mod/languages/mod_perl/Makefile.am +++ b/src/mod/languages/mod_perl/Makefile.am @@ -23,7 +23,7 @@ swigclean: clean rm -f mod_perl_wrap.* freeswitch.so freeswitch.pm mod_perl_wrap.cpp: - swig3.0 -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i + swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp patch -s -p0 -i hack.diff diff --git a/src/mod/languages/mod_python3/Makefile.am b/src/mod/languages/mod_python3/Makefile.am index 796f672234..17f6603497 100644 --- a/src/mod/languages/mod_python3/Makefile.am +++ b/src/mod/languages/mod_python3/Makefile.am @@ -20,7 +20,7 @@ swigclean: clean rm -f mod_python_wrap.* freeswitch.py mod_python_wrap.cpp: mod_python_extra.c hack.diff - swig3.0 -python -c++ -I../../../../src/include -oh mod_python_wrap.h -o mod_python_wrap.cpp mod_python.i + swig -python -c++ -I../../../../src/include -oh mod_python_wrap.h -o mod_python_wrap.cpp mod_python.i echo "#include \"mod_python_extra.c\"" >> mod_python_wrap.cpp patch -s -p0 -i hack.diff diff --git a/src/mod/languages/mod_python3/hack.diff b/src/mod/languages/mod_python3/hack.diff index 5732630bba..55afb23388 100644 --- a/src/mod/languages/mod_python3/hack.diff +++ b/src/mod/languages/mod_python3/hack.diff @@ -1,6 +1,6 @@ ---- mod_python_wrap.cpp.old 2015-06-16 12:56:23.868000000 -0500 -+++ mod_python_wrap.cpp 2015-06-16 12:56:32.268000000 -0500 -@@ -3500,7 +3500,9 @@ SWIG_AsCharArray(PyObject * obj, char *val, size_t size) +--- mod_python_wrap.cpp.old 2024-11-08 21:22:49.064934340 +0000 ++++ mod_python_wrap.cpp 2024-11-12 13:45:20.822756877 +0000 +@@ -3492,7 +3492,9 @@ if (csize <= size) { if (val) { if (csize) memcpy(val, cptr, csize*sizeof(char)); @@ -10,16 +10,16 @@ } if (alloc == SWIG_NEWOBJ) { delete[] cptr; -@@ -4677,7 +4677,7 @@ SWIGINTERN PyObject *_wrap_DTMF_digit_set(PyObject *SWIGUNUSEDPARM(self), PyObje +@@ -4689,7 +4691,7 @@ char arg2 ; void *argp1 = 0 ; int res1 = 0 ; - char val2 ; + char val2 = '\0'; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; -@@ -4787,7 +4787,7 @@ SWIGINTERN PyObject *_wrap_new_DTMF(PyObject *SWIGUNUSEDPARM(self), PyObject *ar + PyObject *swig_obj[2] ; + +@@ -4799,7 +4801,7 @@ PyObject *resultobj = 0; char arg1 ; uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ; @@ -28,7 +28,7 @@ int ecode1 = 0 ; void *argp2 ; int res2 = 0 ; -@@ -6198,7 +6198,9 @@ +@@ -6371,7 +6373,9 @@ } arg3 = static_cast< int >(val3); } @@ -38,31 +38,16 @@ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 ); return resultobj; fail: -@@ -9264,20 +9266,20 @@ - } - - --SWIGINTERN PyObject *_wrap_new_Session__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { -+SWIGINTERN PyObject *_wrap_new_Session__SWIG_0(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - PYTHON::Session *result = 0 ; +@@ -9779,7 +9783,7 @@ - if (!PyArg_ParseTuple(args,(char *)":new_Session")) SWIG_fail; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; result = (PYTHON::Session *)new PYTHON::Session(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 ); result->setPython(self); return resultobj; fail: return NULL; - } - - --SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { -+SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - CoreSession *arg2 = (CoreSession *) 0 ; -@@ -9302,7 +9304,7 @@ +@@ -9809,7 +9813,7 @@ } arg2 = reinterpret_cast< CoreSession * >(argp2); result = (PYTHON::Session *)new PYTHON::Session(arg1,arg2); @@ -71,16 +56,7 @@ if (alloc1 == SWIG_NEWOBJ) delete[] buf1; return resultobj; fail: -@@ -9311,7 +9313,7 @@ - } - - --SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { -+SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; -@@ -9327,7 +9329,7 @@ +@@ -9833,7 +9837,7 @@ } arg1 = reinterpret_cast< char * >(buf1); result = (PYTHON::Session *)new PYTHON::Session(arg1); @@ -89,16 +65,7 @@ if (alloc1 == SWIG_NEWOBJ) delete[] buf1; return resultobj; fail: -@@ -9336,7 +9338,7 @@ - } - - --SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { -+SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; - void *argp1 = 0 ; -@@ -9351,7 +9353,7 @@ +@@ -9856,7 +9860,7 @@ } arg1 = reinterpret_cast< switch_core_session_t * >(argp1); result = (PYTHON::Session *)new PYTHON::Session(arg1); @@ -107,11 +74,11 @@ return resultobj; fail: return NULL; -@@ -10492,6 +10492,7 @@ SWIGINTERN PyObject *_wrap_Session_setSelf(PyObject *SWIGUNUSEDPARM(self), PyObj +@@ -10520,6 +10524,7 @@ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setSelf" "', argument " "1"" of type '" "PYTHON::Session *""'"); } arg1 = reinterpret_cast< PYTHON::Session * >(argp1); + if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "Session_setSelf" "', argument " "1"" is NULL"); - arg2 = obj1; + arg2 = swig_obj[1]; (arg1)->setSelf(arg2); resultobj = SWIG_Py_Void();