diff --git a/src/libdvbpsi-2-fix-no-asprintf.patch b/src/libdvbpsi-2-fix-no-asprintf.patch deleted file mode 100644 index 207dd0fe..00000000 --- a/src/libdvbpsi-2-fix-no-asprintf.patch +++ /dev/null @@ -1,155 +0,0 @@ -This file is part of MXE. See LICENSE.md for licensing information. - -Submitted to upstream at -https://mailman.videolan.org/pipermail/libdvbpsi-devel/2014-June/000738.html -https://mailman.videolan.org/pipermail/libdvbpsi-devel/2014-June/000739.html - -From ada90a3c9a5e8b1c8d214f9e9e82499b54060419 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Tue, 24 Jun 2014 14:57:31 -0700 -Subject: [PATCH 2/3] dvbpsi: fix when _GNU_SOURCE is not defined - -Based on a patch by Guilherme Lima Bernal . - -Signed-off-by: Timothy Gu ---- - src/dvbpsi.c | 22 +++++++++++++--------- - 1 file changed, 13 insertions(+), 9 deletions(-) - -diff --git a/src/dvbpsi.c b/src/dvbpsi.c -index 89d4932..141e3df 100644 ---- a/src/dvbpsi.c -+++ b/src/dvbpsi.c -@@ -529,14 +529,10 @@ void dvbpsi_message(dvbpsi_t *dvbpsi, const dvbpsi_msg_level_t level, const char - msg = malloc(DVBPSI_MSG_SIZE); - if (msg == NULL) { - va_end(ap); -- return; -- } -- if (snprintf(&msg, DVBPSI_MSG_SIZE, DVBPSI_MSG_FORMAT, ap) < 0) { -- va_end(ap); - free(msg); - return; - } -- int err = vsnprintf(&msg, DVBPSI_MSG_SIZE, fmt, ap); -+ int err = vsnprintf(msg, DVBPSI_MSG_SIZE, fmt, ap); - #endif - va_end(ap); - if (err > DVBPSI_MSG_NONE) { -@@ -575,20 +571,28 @@ void dvbpsi_message(dvbpsi_t *dvbpsi, const dvbpsi_msg_level_t level, const char - free(msg); \ - } while(0); - # else --# define DVBPSI_MSG_COMMON \ -+# define DVBPSI_MSG_COMMON(level) \ - do { \ - va_list ap; \ - va_start(ap, fmt); \ - char *msg = malloc(DVBPSI_MSG_SIZE); \ -- if (msg == NULL) { \ -+ char *tmp = malloc(DVBPSI_MSG_SIZE); \ -+ if (msg == NULL || tmp == NULL) { \ - va_end(ap); \ -+ if (msg) \ -+ free(msg); \ -+ if (tmp) \ -+ free(tmp); \ - return; \ - } \ -- if (snprintf(&msg, DVBPSI_MSG_SIZE, DVBPSI_MSG_FORMAT, src) < 0) { \ -+ if (vsnprintf(tmp, DVBPSI_MSG_SIZE, fmt, ap) < 0) { \ - va_end(ap); \ -+ free(tmp); \ -+ free(msg); \ - return; \ - } \ -- int err = vsnprintf(&msg, DVBPSI_MSG_SIZE, fmt, ap); \ -+ int err = snprintf(msg, DVBPSI_MSG_SIZE, DVBPSI_MSG_FORMAT, src, tmp); \ -+ free(tmp); \ - va_end(ap); \ - if (err > 0) { \ - if (dvbpsi->pf_message) \ --- -1.9.1 - -From a2117900002bc8f9e0f821d872f8cd70ece67634 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Thu, 26 Jun 2014 13:41:02 -0700 -Subject: [PATCH 3/3] Add a separate check for [v]asprintf() instead of - checking for _GNU_SOURCE - -Platforms like i686-pc-mingw32 defines _GNU_SOURCE but does not contain -the functions. - -Signed-off-by: Timothy Gu ---- - configure.ac | 21 +++++++++++++++++++++ - src/dvbpsi.c | 6 +++--- - 2 files changed, 24 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 2a97e5b..f95c186 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -100,6 +100,27 @@ if test "${ac_cv_cpp_variadic_macros}" != "no"; then - AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros) - fi - -+dnl Check for asprintf(). Systems with asprintf() must also have vasprintf(), -+dnl so it is not checked separately. -+AC_CACHE_CHECK([for asprintf()], -+ [ac_cv_asprintf], -+ [AC_COMPILE_IFELSE([ -+ AC_LANG_SOURCE([[ -+ #include -+ #include -+ int main(void) { -+ char *text = NULL; -+ int ret = asprintf(&text, "test"); -+ if (ret >= 0) free(text); -+ return 0; -+ } -+ ]])], -+ ac_cv_asprintf=yes, -+ ac_cv_asprintf=no)]) -+if test "${ac_cv_asprintf}" != "no"; then -+ AC_DEFINE(HAVE_ASPRINTF, 1, [Support for asprintf() and vasprintf()]) -+fi -+ - dnl - dnl Generate Makefiles and other output files - dnl -diff --git a/src/dvbpsi.c b/src/dvbpsi.c -index 141e3df..29ae2b0 100644 ---- a/src/dvbpsi.c -+++ b/src/dvbpsi.c -@@ -508,7 +508,7 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data) - * 1 is warning and errors - * 2 is debug, warning and errors - *****************************************************************************/ --#if !defined(_GNU_SOURCE) -+#if !defined(HAVE_ASPRINTF) - # define DVBPSI_MSG_SIZE 1024 - #endif - -@@ -523,7 +523,7 @@ void dvbpsi_message(dvbpsi_t *dvbpsi, const dvbpsi_msg_level_t level, const char - va_list ap; - va_start(ap, fmt); - char *msg = NULL; --#if defined(_GNU_SOURCE) -+#if defined(HAVE_ASPRINTF) - int err = vasprintf(&msg, fmt, ap); - #else - msg = malloc(DVBPSI_MSG_SIZE); -@@ -545,7 +545,7 @@ void dvbpsi_message(dvbpsi_t *dvbpsi, const dvbpsi_msg_level_t level, const char - #else - - /* Common code for printing messages */ --# if defined(_GNU_SOURCE) -+# if defined(HAVE_ASPRINTF) - # define DVBPSI_MSG_COMMON(level) \ - do { \ - va_list ap; \ --- -1.9.1 - diff --git a/src/libdvbpsi.mk b/src/libdvbpsi.mk index 9640088e..2b394329 100644 --- a/src/libdvbpsi.mk +++ b/src/libdvbpsi.mk @@ -3,25 +3,25 @@ PKG := libdvbpsi $(PKG)_WEBSITE := https://www.videolan.org/developers/libdvbpsi.html $(PKG)_IGNORE := -$(PKG)_VERSION := 1.2.0 -$(PKG)_CHECKSUM := 36d9b233306e48b58999e87864253b564e20932ed46a485e44ef7058f1f927e8 +$(PKG)_VERSION := 1.3.2 +$(PKG)_CHECKSUM := ac4e39f2b9b1e15706ad261fa175a9430344d650a940be9aaf502d4cb683c5fe $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $($(PKG)_SUBDIR).tar.bz2 $(PKG)_URL := https://download.videolan.org/pub/libdvbpsi/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := cc define $(PKG)_UPDATE - $(WGET) -q -O- 'https://www.videolan.org/developers/libdvbpsi.html' | \ - $(SED) -n 's,.*https://www.videolan.org/pub/libdvbpsi/\([0-9][^<]*\)/.*,\1,p' | \ + $(WGET) -q -O- 'https://download.videolan.org/pub/libdvbpsi/' | \ + $(SED) -n 's,.*