[sr-dev] git:master:63127b26: erlang: fix build on squeeze and precise

Seudin Kasumovic seudin.kasumovic at gmail.com
Thu May 28 18:27:18 CEST 2015


Module: kamailio
Branch: master
Commit: 63127b261668e0efdea5b0ddb5f16a03dd9f02bc
URL: https://github.com/kamailio/kamailio/commit/63127b261668e0efdea5b0ddb5f16a03dd9f02bc

Author: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Date: 2015-05-28T18:26:34+02:00

erlang: fix build on squeeze and precise

Check if defined decode of unicode atoms type.

---

Modified: modules/erlang/handle_emsg.c
Modified: modules/erlang/pv_xbuff.c

---

Diff:  https://github.com/kamailio/kamailio/commit/63127b261668e0efdea5b0ddb5f16a03dd9f02bc.diff
Patch: https://github.com/kamailio/kamailio/commit/63127b261668e0efdea5b0ddb5f16a03dd9f02bc.patch

---

diff --git a/modules/erlang/handle_emsg.c b/modules/erlang/handle_emsg.c
index a599f9f..e43bb1f 100644
--- a/modules/erlang/handle_emsg.c
+++ b/modules/erlang/handle_emsg.c
@@ -460,9 +460,13 @@ int handle_rex_call(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid *
 	 */
 
 	ei_get_type(request->buff,&request->index,&type,&size);
-
+#ifdef ERL_SMALL_ATOM_EXT
 	if (type == ERL_ATOM_EXT || type == ERL_SMALL_ATOM_EXT)
 	{
+#else
+	if (type == ERL_ATOM_EXT)
+	{
+#endif
 		if (ei_decode_atom(request->buff,&request->index,module))
 		{
 			encode_error_msg(response, ref, "error", "Failed to decode module name");
@@ -477,8 +481,13 @@ int handle_rex_call(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid *
 
 	ei_get_type(request->buff,&request->index,&type,&size);
 
+#ifdef ERL_SMALL_ATOM_EXT
 	if (type == ERL_ATOM_EXT || type == ERL_SMALL_ATOM_EXT)
 	{
+#else
+	if (type == ERL_ATOM_EXT)
+	{
+#endif
 		if (ei_decode_atom(request->buff,&request->index,method))
 		{
 			encode_error_msg(response, ref, "error", "Failed to decode method name");
diff --git a/modules/erlang/pv_xbuff.c b/modules/erlang/pv_xbuff.c
index 7e80e92..cdfbd58 100644
--- a/modules/erlang/pv_xbuff.c
+++ b/modules/erlang/pv_xbuff.c
@@ -977,7 +977,9 @@ int xavp_decode(ei_x_buff *xbuff, int *index, sr_xavp_t **xavp,int level)
 
 	switch (type) {
 	case ERL_ATOM_EXT:
-
+#ifdef ERL_SMALL_ATOM_EXT
+	case ERL_SMALL_ATOM_EXT:
+#endif
 		name.len = snprintf(_s,sizeof(_s),"a%d",counter++);
 		pbuf = (char*)pkg_realloc(pbuf,size+1);
 




More information about the sr-dev mailing list