aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-03-26 15:56:15 +0100
committerpespin <pespin@sysmocom.de>2020-03-27 15:06:41 +0000
commita0cbde700a53bbc804552bbbd1243fe9c6510443 (patch)
treeeb8f92c6490d476aac57d0a84957610349cd395d
parentce160147f46a4f3024768da755d142e76b557fdb (diff)
tbf.cpp: Include c++ <new> header required for new operator's replacement type
Including the <new> header is required as explained by the c++ specs [1] osmo-pcu/src/tbf.cpp: In function ‘gprs_rlcmac_ul_tbf* tbf_alloc_ul_tbf(gprs_rlcmac_bts*, GprsMs*, int8_t, uint8_t, uint8_t, bool)’: osmo-pcu/src/tbf.cpp:1002:39: error: no matching function for call to ‘operator new(sizetype, gprs_rlcmac_ul_tbf*&)’ 1002 | new (tbf) gprs_rlcmac_ul_tbf(bts->bts); | ^ Most of the times this issue is not detected because other STL headers are already including <new>. [1] http://www.cplusplus.com/reference/new/operator%20new/ Change-Id: Ie5fb536ae29dcf40e2a0dbe67432bebd61b8c7aa
-rw-r--r--src/tbf.cpp2
-rw-r--r--tests/ms/MsTest.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 444cec0..9cba354 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -19,6 +19,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <new>
+
#include <bts.h>
#include <tbf.h>
#include <tbf_dl.h>
diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp
index 0c5ab9e..b5e30fb 100644
--- a/tests/ms/MsTest.cpp
+++ b/tests/ms/MsTest.cpp
@@ -40,6 +40,8 @@ extern "C" {
#include <errno.h>
#include <unistd.h>
+#include <new>
+
void *tall_pcu_ctx;
int16_t spoof_mnc = 0, spoof_mcc = 0;
bool spoof_mnc_3_digits = false;