From 88fce9020b3018bb54665a80739f60921f933fd7 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Fri, 11 Mar 2011 12:51:56 +0000 Subject: [PATCH] - Fix build on 7.X Submitted by: maintainer --- multimedia/libva/Makefile | 5 +++++ .../libva/files/extra-patch-va-va_trace.c | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 multimedia/libva/files/extra-patch-va-va_trace.c diff --git a/multimedia/libva/Makefile b/multimedia/libva/Makefile index 9a997fb41c1d..50da94f59dbd 100644 --- a/multimedia/libva/Makefile +++ b/multimedia/libva/Makefile @@ -36,6 +36,11 @@ CFLAGS+= -DHAVE_LINUX_INTEGER_TYPES .include +# add strnlen(3) from head/lib/libc/string/strnlen.c +.if ${OSVERSION} < 800067 +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-va-va_trace.c +.endif + .if !defined(WITH_DEBUG) CFLAGS+= -DNDEBUG .else diff --git a/multimedia/libva/files/extra-patch-va-va_trace.c b/multimedia/libva/files/extra-patch-va-va_trace.c new file mode 100644 index 000000000000..072b905167b3 --- /dev/null +++ b/multimedia/libva/files/extra-patch-va-va_trace.c @@ -0,0 +1,20 @@ +--- va/va_trace.c~ ++++ va/va_trace.c +@@ -140,6 +140,17 @@ VAStatus vaUnlockSurface(VADisplay dpy, + VASurfaceID surface + ); + ++static size_t ++strnlen(const char *s, size_t maxlen) ++{ ++ size_t len; ++ ++ for (len = 0; len < maxlen; len++, s++) { ++ if (!*s) ++ break; ++ } ++ return (len); ++} + + void va_TraceInit(VADisplay dpy) + {