From 41cddcc293086be8190c1184dd9b4a4590089a59 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 11 Mar 2019 07:58:51 -0400 Subject: [PATCH] normalise compat.h handling towards kamailio tree Change-Id: Ia22a603c11b216969f4c0a854af42600a99a2819 --- include/bencode.h | 19 +------------------ lib/compat.h | 8 ++++++++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/include/bencode.h b/include/bencode.h index 70eb1f4a1..583d905d6 100644 --- a/include/bencode.h +++ b/include/bencode.h @@ -4,24 +4,7 @@ #include #include -#if defined(SHM_MEM) || defined(PKG_MALLOC) || defined(pkg_malloc) -/* kamailio */ -# include "../../mem/mem.h" -# include "../../str.h" -# ifndef BENCODE_MALLOC -# define BENCODE_MALLOC pkg_malloc -# define BENCODE_FREE pkg_free -# endif -# define INLINE static inline -#else -/* rtpengine */ -# include "compat.h" -# include "str.h" -# ifndef BENCODE_MALLOC -# define BENCODE_MALLOC malloc -# define BENCODE_FREE free -# endif -#endif +#include "compat.h" struct bencode_buffer; enum bencode_type; diff --git a/lib/compat.h b/lib/compat.h index 54841e552..1c59b1e3e 100644 --- a/lib/compat.h +++ b/lib/compat.h @@ -7,4 +7,12 @@ # define INLINE static inline __attribute__((always_inline)) #endif + +#ifndef BENCODE_MALLOC +#define BENCODE_MALLOC malloc +#define BENCODE_FREE free +#endif + +#include "str.h" + #endif