[FFmpeg-devel,2/2] lavf/tls_gnutls: fix warnings from version check

Submitted by Moritz Barsnick on Sept. 26, 2017, 11:25 a.m.

Details

Message ID 202fa89b7957dafd4c25dfb265ff753250a19f6b.1506421345.git.barsnick@gmx.net
State Accepted
Commit 6bf48c4805cbb9754aa5a7bcb5f46df6bda95447
Headers show

Commit Message

Moritz Barsnick Sept. 26, 2017, 11:25 a.m.
The GnuTLS version is checked through the macro GNUTLS_VERSION_NUMBER,
but this wasn't introduced before 2.7.2. Building with older versions
of GnuTLS (using icc) warns:

src/libavformat/tls_gnutls.c(38): warning #193: zero used for undefined preprocessing identifier "GNUTLS_VERSION_NUMBER"
  #if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00

This adds a fallback to the older, deprecated LIBGNUTLS_VERSION_NUMBER
macro.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
---
 libavformat/tls_gnutls.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 7174dfd..5ce6c3d 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -35,6 +35,10 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
 
+#ifndef GNUTLS_VERSION_NUMBER
+#define GNUTLS_VERSION_NUMBER LIBGNUTLS_VERSION_NUMBER
+#endif
+
 #if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
 #include <gcrypt.h>
 #include "libavutil/thread.h"