Use normal talloc instead of libosmocore copy
diff mbox

Message ID 1413293368-32353-1-git-send-email-max.suraev@fairwaves.co
State Not Applicable
Headers show

Commit Message

Max Oct. 14, 2014, 1:29 p.m. UTC
Signed-off-by: Max Suraev <max.suraev@fairwaves.co>
---
 configure.ac                |  1 +
 src/Makefile.am             |  2 ++
 src/bitvector.cpp           |  4 +---
 src/bts.cpp                 |  2 +-
 src/gprs_bssgp_pcu.h        |  2 +-
 src/gprs_debug.cpp          |  2 +-
 src/openbts_sock.cpp        |  2 +-
 src/pcu_l1_if.cpp           |  3 ++-
 src/sba.cpp                 |  5 +----
 src/sysmo_l1_fwd.c          |  2 +-
 src/sysmo_l1_hw.c           |  2 +-
 src/sysmo_l1_if.c           |  2 +-
 src/sysmo_sock.cpp          |  3 ++-
 src/ta.cpp                  |  5 +----
 src/tbf.cpp                 |  2 +-
 src/tbf_dl.cpp              |  2 +-
 src/tbf_ul.cpp              |  2 +-
 tests/Makefile.am           | 13 +++++++++----
 tests/alloc/AllocTest.cpp   |  2 +-
 tests/emu/pcu_emu.cpp       |  2 +-
 tests/rlcmac/RLCMACTest.cpp |  2 ++
 tests/tbf/TbfTest.cpp       |  2 +-
 tests/types/TypesTest.cpp   |  3 ++-
 23 files changed, 36 insertions(+), 31 deletions(-)

Comments

Max Oct. 14, 2014, 1:33 p.m. UTC | #1
This is a v2 of the osmo-pcu patch - this time talloc.h is outside of extern C
declarations.
I've tested compilation with it and it works fine: I mean the 3 out of 4 tests fails
exactly the same way as it fails for me with master branch :)

Patch
diff mbox

diff --git a/configure.ac b/configure.ac
index 3b2f380..c72cb4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@  PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore  >= 0.3.9)
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty)
 PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3)
 PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.1.4)
+PKG_CHECK_MODULES(LIBTALLOC, talloc >= 2.0.1)
 
 AC_MSG_CHECKING([whether to enable sysmocom-bts hardware support])
 AC_ARG_ENABLE(sysmocom-bts,
diff --git a/src/Makefile.am b/src/Makefile.am
index d1ed701..8c625ed 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -112,6 +112,7 @@  osmo_pcu_LDADD = \
 	$(LIBOSMOGB_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
+	$(LIBTALLOC_LIBS) \
 	$(COMMON_LA)
 
 if ENABLE_SYSMODSP
@@ -120,6 +121,7 @@  osmo_pcu_remote_LDADD = \
 	$(LIBOSMOGB_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
+	$(LIBTALLOC_LIBS) \
 	$(COMMON_LA)
 endif
 
diff --git a/src/bitvector.cpp b/src/bitvector.cpp
index 43feebc..05a0781 100644
--- a/src/bitvector.cpp
+++ b/src/bitvector.cpp
@@ -26,9 +26,7 @@ 
  */
 
 #include <bitvector.h>
-extern "C" {
-#include <osmocom/core/talloc.h>
-}
+#include <talloc.h>
 
 void *bv_tall_ctx;
 
diff --git a/src/bts.cpp b/src/bts.cpp
index b660014..ac41384 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -30,11 +30,11 @@ 
 #include <gprs_debug.h>
 
 extern "C" {
-	#include <osmocom/core/talloc.h>
 	#include <osmocom/core/msgb.h>
 }
 
 #include <arpa/inet.h>
+#include <talloc.h>
 
 #include <errno.h>
 #include <string.h>
diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h
index 32b6728..cbe6ef8 100644
--- a/src/gprs_bssgp_pcu.h
+++ b/src/gprs_bssgp_pcu.h
@@ -23,7 +23,6 @@ 
 
 
 extern "C" {
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/core/logging.h>
 #include <osmocom/core/signal.h>
@@ -36,6 +35,7 @@  extern "C" {
 struct bssgp_bvc_ctx *btsctx_alloc(uint16_t bvci, uint16_t nsei);
 }
 #include <gprs_debug.h>
+#include <talloc.h>
 
 #define QOS_PROFILE 4
 #define BSSGP_HDR_LEN 53
diff --git a/src/gprs_debug.cpp b/src/gprs_debug.cpp
index 6f9e310..aa8864e 100644
--- a/src/gprs_debug.cpp
+++ b/src/gprs_debug.cpp
@@ -25,7 +25,7 @@ 
 #include <time.h>
 #include <errno.h>
 
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/logging.h>
 #include <gprs_debug.h>
diff --git a/src/openbts_sock.cpp b/src/openbts_sock.cpp
index 2d9cae4..a19097b 100644
--- a/src/openbts_sock.cpp
+++ b/src/openbts_sock.cpp
@@ -26,8 +26,8 @@ 
 #include <bitvector.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
+#include <talloc.h>
 extern "C" {
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/write_queue.h>
 #include <osmocom/core/socket.h>
 #include <osmocom/core/timer.h>
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 0cb79eb..de6549b 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -26,8 +26,9 @@ 
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <arpa/inet.h>
+#include <talloc.h>
+
 extern "C" {
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/msgb.h>
 }
diff --git a/src/sba.cpp b/src/sba.cpp
index 6eec235..b09b5cb 100644
--- a/src/sba.cpp
+++ b/src/sba.cpp
@@ -24,10 +24,7 @@ 
 #include <gprs_debug.h>
 #include <bts.h>
 
-extern "C" {
-#include <osmocom/core/talloc.h>
-}
-
+#include <talloc.h>
 #include <errno.h>
 
 extern void *tall_pcu_ctx;
diff --git a/src/sysmo_l1_fwd.c b/src/sysmo_l1_fwd.c
index 535a7f0..0336889 100644
--- a/src/sysmo_l1_fwd.c
+++ b/src/sysmo_l1_fwd.c
@@ -32,7 +32,7 @@ 
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/write_queue.h>
diff --git a/src/sysmo_l1_hw.c b/src/sysmo_l1_hw.c
index 8351d68..9190a51 100644
--- a/src/sysmo_l1_hw.c
+++ b/src/sysmo_l1_hw.c
@@ -29,7 +29,7 @@ 
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/write_queue.h>
diff --git a/src/sysmo_l1_if.c b/src/sysmo_l1_if.c
index 4274e77..fa3a983 100644
--- a/src/sysmo_l1_if.c
+++ b/src/sysmo_l1_if.c
@@ -1,6 +1,7 @@ 
 
 #include <string.h>
 #include <errno.h>
+#include <talloc.h>
 
 #include <sysmocom/femtobts/superfemto.h>
 #include <sysmocom/femtobts/gsml1prim.h>
@@ -8,7 +9,6 @@ 
 #include <sysmocom/femtobts/gsml1types.h>
 
 #include <osmocom/core/gsmtap.h>
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/timer.h>
 #include <sysmo_l1_if.h>
 #include <gprs_debug.h>
diff --git a/src/sysmo_sock.cpp b/src/sysmo_sock.cpp
index 951653e..10eb2d7 100644
--- a/src/sysmo_sock.cpp
+++ b/src/sysmo_sock.cpp
@@ -25,8 +25,9 @@ 
 #include <assert.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#include <talloc.h>
+
 extern "C" {
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/msgb.h>
 }
diff --git a/src/ta.cpp b/src/ta.cpp
index 0bc1d66..5b0bcd8 100644
--- a/src/ta.cpp
+++ b/src/ta.cpp
@@ -22,10 +22,7 @@ 
 #include <ta.h>
 #include <gprs_rlcmac.h>
 
-extern "C" {
-	#include <osmocom/core/talloc.h>
-}
-
+#include <talloc.h>
 #include <errno.h>
 
 extern void *tall_pcu_ctx;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 2afe257..4d95f15 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -30,9 +30,9 @@ 
 
 extern "C" {
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
 }
 
+#include <talloc.h>
 #include <errno.h>
 #include <string.h>
 
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 8de3b2b..8113e49 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -29,9 +29,9 @@ 
 
 extern "C" {
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
 }
 
+#include <talloc.h>
 #include <errno.h>
 #include <string.h>
 
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 3ab71f0..35581ac 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -30,9 +30,9 @@ 
 
 extern "C" {
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
 }
 
+#include <talloc.h>
 #include <errno.h>
 #include <string.h>
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e84f17d..84039a2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,6 +7,7 @@  rlcmac_RLCMACTest_SOURCES = rlcmac/RLCMACTest.cpp
 rlcmac_RLCMACTest_LDADD = \
 	$(top_builddir)/src/libgprs.la \
 	$(LIBOSMOCORE_LIBS) \
+	$(LIBTALLOC_LIBS) \
 	$(COMMON_LA)
 
 alloc_AllocTest_SOURCES = alloc/AllocTest.cpp
@@ -15,15 +16,17 @@  alloc_AllocTest_LDADD = \
 	$(LIBOSMOGB_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
+	$(LIBTALLOC_LIBS) \
 	$(COMMON_LA)
 
 tbf_TbfTest_SOURCES = tbf/TbfTest.cpp
 tbf_TbfTest_LDADD = \
+	$(top_builddir)/src/libgprs.la \
 	$(LIBOSMOGB_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
-	$(COMMON_LA) \
-	$(top_builddir)/src/libgprs.la
+	$(LIBTALLOC_LIBS) \
+	$(COMMON_LA)
 
 emu_pcu_emu_SOURCES = emu/pcu_emu.cpp emu/test_replay_gprs_attach.cpp \
 	emu/openbsc_clone.c emu/openbsc_clone.h emu/gprs_tests.h \
@@ -33,15 +36,17 @@  emu_pcu_emu_LDADD = \
 	$(LIBOSMOGB_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
+	$(LIBTALLOC_LIBS) \
 	$(COMMON_LA)
 
 types_TypesTest_SOURCES = types/TypesTest.cpp
 types_TypesTest_LDADD = \
+	$(top_builddir)/src/libgprs.la \
 	$(LIBOSMOGB_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
-	$(COMMON_LA) \
-	$(top_builddir)/src/libgprs.la
+	$(LIBTALLOC_LIBS) \
+	$(COMMON_LA)
 
 
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index d711ad8..be57f18 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -24,11 +24,11 @@ 
 
 #include <string.h>
 #include <stdio.h>
+#include <talloc.h>
 
 extern "C" {
 #include <osmocom/core/application.h>
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 }
 
diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp
index ed0abbe..45e49ee 100644
--- a/tests/emu/pcu_emu.cpp
+++ b/tests/emu/pcu_emu.cpp
@@ -20,7 +20,6 @@ 
  */
 
 extern "C" {
-#include <osmocom/core/talloc.h>
 #include <pcu_vty.h>
 }
 
@@ -31,6 +30,7 @@  extern "C" {
 #include <gprs_rlcmac.h>
 #include <bts.h>
 
+#include <talloc.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp
index 66bc53c..30a38a7 100644
--- a/tests/rlcmac/RLCMACTest.cpp
+++ b/tests/rlcmac/RLCMACTest.cpp
@@ -23,6 +23,8 @@ 
 #include <iostream>
 #include <cstdlib>
 #include <cstring>
+#include <talloc.h>
+
 #include "csn1.h"
 #include "gsm_rlcmac.h"
 extern "C" {
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 0811520..662be73 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -19,6 +19,7 @@ 
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+#include <talloc.h>
 
 #include "bts.h"
 #include "tbf.h"
@@ -27,7 +28,6 @@ 
 extern "C" {
 #include <osmocom/core/application.h>
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 }
 
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 8a464b1..eb6824a 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -19,6 +19,8 @@ 
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+#include <talloc.h>
+
 #include "bts.h"
 #include "tbf.h"
 #include "gprs_debug.h"
@@ -28,7 +30,6 @@ 
 extern "C" {
 #include <osmocom/core/application.h>
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 }