Module: kamailio
Branch: master
Commit: 99ca2a1b9e84d81ec966446afe3c45db5f6b7943
URL:
https://github.com/kamailio/kamailio/commit/99ca2a1b9e84d81ec966446afe3c45d…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: 2019-03-11T07:53:32-04:00
rtpengine: normalise `compat.h` handling towards bencode upstream
fixes #1885
---
Added: src/modules/rtpengine/compat.h
Modified: src/modules/rtpengine/bencode.h
---
Diff:
https://github.com/kamailio/kamailio/commit/99ca2a1b9e84d81ec966446afe3c45d…
Patch:
https://github.com/kamailio/kamailio/commit/99ca2a1b9e84d81ec966446afe3c45d…
---
diff --git a/src/modules/rtpengine/bencode.h b/src/modules/rtpengine/bencode.h
index 272e8125c7..f2efb742cc 100644
--- a/src/modules/rtpengine/bencode.h
+++ b/src/modules/rtpengine/bencode.h
@@ -4,24 +4,7 @@
#include <sys/uio.h>
#include <string.h>
-#if defined(PKG_MALLOC) || defined(pkg_malloc)
-/* kamailio */
-# include "../../core/mem/mem.h"
-# include "../../core/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/src/modules/rtpengine/compat.h b/src/modules/rtpengine/compat.h
new file mode 100644
index 0000000000..8cb87aa4bd
--- /dev/null
+++ b/src/modules/rtpengine/compat.h
@@ -0,0 +1,12 @@
+#ifndef __COMPAT__H__
+#define __COMPAT__H__
+
+#include "../../core/mem/mem.h"
+#include "../../core/str.h"
+#ifndef BENCODE_MALLOC
+#define BENCODE_MALLOC pkg_malloc
+#define BENCODE_FREE pkg_free
+#endif
+#define INLINE static inline
+
+#endif