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