Wed Jun 26 21:59:10 2013 UTC ()
Fix locale usage on NetBSD/current.
(joerg)
diff -r1.4 -r1.5 pkgsrc/multimedia/mlt/distinfo
diff -r0 -r1.1 pkgsrc/multimedia/mlt/patches/patch-src_framework_mlt__properties.c
diff -r0 -r1.1 pkgsrc/multimedia/mlt/patches/patch-src_framework_mlt__property.c
diff -r0 -r1.1 pkgsrc/multimedia/mlt/patches/patch-src_framework_mlt__property.h
--- pkgsrc/multimedia/mlt/distinfo 2012/11/21 22:24:27 1.4
+++ pkgsrc/multimedia/mlt/distinfo 2013/06/26 21:59:10 1.5
$NetBSD: patch-src_framework_mlt__properties.c,v 1.1 2013/06/26 21:59:10 joerg Exp $
--- src/framework/mlt_properties.c.orig 2013-06-26 21:38:59.000000000 +0000
+++ src/framework/mlt_properties.c
@@ -138,7 +138,7 @@ int mlt_properties_set_lcnumeric( mlt_pr
{
property_list *list = self->local;
-#if defined(__linux__) || defined(__DARWIN__)
+#if defined(__linux__) || defined(__DARWIN__) || (defined(__NetBSD__) && defined(LC_C_LOCALE))
if ( list->locale )
freelocale( list->locale );
list->locale = newlocale( LC_NUMERIC_MASK, locale, NULL );
@@ -1332,7 +1332,7 @@ void mlt_properties_close( mlt_propertie
free( list->name[ index ] );
}
-#if defined(__linux__) || defined(__DARWIN__)
+#if defined(__linux__) || defined(__DARWIN__) || (defined(__NetBSD__) && defined(LC_C_LOCALE))
// Cleanup locale
if ( list->locale )
freelocale( list->locale );
$NetBSD: patch-src_framework_mlt__property.c,v 1.1 2013/06/26 21:59:10 joerg Exp $
--- src/framework/mlt_property.c.orig 2013-06-26 21:38:25.000000000 +0000
+++ src/framework/mlt_property.c
@@ -282,7 +282,7 @@ static int time_clock_to_frames( const c
s = copy;
pos = strrchr( s, ':' );
if ( pos ) {
-#if defined(__GLIBC__) || defined(__DARWIN__)
+#if defined(__GLIBC__) || defined(__DARWIN__) || (defined(__NetBSD__) && defined(LC_C_LOCALE))
if ( locale )
seconds = strtod_l( pos + 1, NULL, locale );
else
@@ -300,7 +300,7 @@ static int time_clock_to_frames( const c
}
}
else {
-#if defined(__GLIBC__) || defined(__DARWIN__)
+#if defined(__GLIBC__) || defined(__DARWIN__) || (defined(__NetBSD__) && defined(LC_C_LOCALE))
if ( locale )
seconds = strtod_l( s, NULL, locale );
else
@@ -455,7 +455,7 @@ static double mlt_property_atof( const c
}
else
{
-#if defined(__GLIBC__) || defined(__DARWIN__)
+#if defined(__GLIBC__) || defined(__DARWIN__) || (defined(__NetBSD__) && defined(LC_C_LOCALE))
if ( locale )
return strtod_l( value, NULL, locale );
#endif
$NetBSD: patch-src_framework_mlt__property.h,v 1.1 2013/06/26 21:59:10 joerg Exp $
--- src/framework/mlt_property.h.orig 2013-06-26 21:36:42.000000000 +0000
+++ src/framework/mlt_property.h
@@ -31,8 +31,10 @@
#include <sys/param.h>
#endif
+#include <locale.h>
#if defined(__GLIBC__) || defined(__DARWIN__) || (__FreeBSD_version >= 900506)
#include <xlocale.h>
+#elif defined(__NetBSD__) && defined(LC_C_LOCALE)
#else
typedef void* locale_t;
#endif