소스 검색

rtpengine: normalise `compat.h` handling towards bencode upstream

fixes #1885
Richard Fuchs 6 년 전
부모
커밋
99ca2a1b9e
2개의 변경된 파일13개의 추가작업 그리고 18개의 파일을 삭제
  1. 1 18
      src/modules/rtpengine/bencode.h
  2. 12 0
      src/modules/rtpengine/compat.h

+ 1 - 18
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;

+ 12 - 0
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