[PATCH] libosmo-abis[master]: osmo_ortp.c: Fix warning: check ortp API in rtp_session_sign...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Jun 22 11:26:15 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2990

to look at the new patch set (#2).

osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connect

Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding
ortp 0.24, the API is fixed and requests a pointer instead of an
unsigned long.

As we now require at least ortp 0.22 since libosmo-abis
15d9b7929d449e4138bcb003c614035bceadc3d1, we need to support both old
and new version of the API to continue having support for 0.22 but still
supporting new versions of the library.

Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb
---
M configure.ac
M src/trau/osmo_ortp.c
2 files changed, 41 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/90/2990/2

diff --git a/configure.ac b/configure.ac
index 9b2f189..ea61abf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,20 @@
 		[ortp_set_log_level_mask has no domain parameter])])
 CFLAGS=$_cflags_save
 
+_cflags_save=$CFLAGS
+CFLAGS="$CFLAGS $ORTP_CFLAGS"
+AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM(
+		[[#include <ortp/ortp.h>]],
+		[[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]]
+	)],
+	[AC_DEFINE([HAVE_SIGNAL_CONNECT_PTR_TYPE], [1],
+		[rtp_session_signal_connect requires pointer parameter])],
+	[AC_DEFINE([HAVE_SIGNAL_CONNECT_PTR_TYPE], [0],
+		[rtp_session_signal_connect requires ulong parameter])])
+CFLAGS=$_cflags_save
+
+
 AC_OUTPUT(
 	libosmoabis.pc
 	libosmotrau.pc
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index c4e9d53..eed70d9 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -350,16 +350,39 @@
 
 	rtp_session_signal_connect(rs->sess, "ssrc_changed",
 				   (RtpCallback) ortp_sig_cb_ssrc,
-				   (unsigned long) rs);
+				#if HAVE_SIGNAL_CONNECT_PTR_TYPE
+				   (void*)
+				#else
+				   (unsigned long)
+				#endif
+				   rs);
+
 	rtp_session_signal_connect(rs->sess, "payload_type_changed",
 				   (RtpCallback) ortp_sig_cb_pt,
-				   (unsigned long) rs);
+				#if HAVE_SIGNAL_CONNECT_PTR_TYPE
+				   (void*)
+				#else
+				   (unsigned long)
+				#endif
+				   rs);
+
 	rtp_session_signal_connect(rs->sess, "network_error",
 				   (RtpCallback) ortp_sig_cb_net,
-				   (unsigned long) rs);
+				#if HAVE_SIGNAL_CONNECT_PTR_TYPE
+				   (void*)
+				#else
+				   (unsigned long)
+				#endif
+				   rs);
+
 	rtp_session_signal_connect(rs->sess, "timestamp_jump",
 				   (RtpCallback) ortp_sig_cb_ts,
-				   (unsigned long) rs);
+				#if HAVE_SIGNAL_CONNECT_PTR_TYPE
+				   (void*)
+				#else
+				   (unsigned long)
+				#endif
+				   rs);
 
 	/* initialize according to the RFC */
 	rtp_session_set_seq_number(rs->sess, random());

-- 
To view, visit https://gerrit.osmocom.org/2990
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list