Module: kamailio
Branch: 5.2
Commit: 7aaa77e682aa7b5da011c222df393601adf278b0
URL:
https://github.com/kamailio/kamailio/commit/7aaa77e682aa7b5da011c222df39360…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: 2019-03-11T07:57:16-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/7aaa77e682aa7b5da011c222df39360…
Patch:
https://github.com/kamailio/kamailio/commit/7aaa77e682aa7b5da011c222df39360…
---
diff --git a/src/modules/rtpengine/bencode.h b/src/modules/rtpengine/bencode.h
index f5f775538f..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(SHM_MEM) || 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