]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_properties.c
Implement LC_NUMERIC handling for non-glibc and non-Darwin OS.
[mlt] / src / framework / mlt_properties.c
index 3b42ceebbbd8200e99bfb7a56be7370a0b167701..887562c3467fee9dff0de058e5e04d885497f054 100644 (file)
@@ -144,12 +144,15 @@ int mlt_properties_set_lcnumeric( mlt_properties self, const char *locale )
        {
                property_list *list = self->local;
 
-#if defined(__linux__) || defined(__DARWIN__)
+#if defined(__GLIBC__) || defined(__DARWIN__)
                if ( list->locale )
                        freelocale( list->locale );
                list->locale = newlocale( LC_NUMERIC_MASK, locale, NULL );
+#else
+               if ( list->locale )
+                       free( list->locale );
+               list->locale = strdup( locale );
 #endif
-               error = list->locale == NULL;
        }
        else
                error = 1;
@@ -173,13 +176,13 @@ const char* mlt_properties_get_lcnumeric( mlt_properties self )
        if ( list->locale )
        {
 #if defined(__DARWIN__)
-               result = querylocale( LC_NUMERIC, list->locale );
-#elif defined(__linux__)
-               result = list->locale->__names[ LC_NUMERIC ];
+        result = querylocale( LC_NUMERIC, list->locale );
+#elif defined(__GLIBC__)
+        result = list->locale->__names[ LC_NUMERIC ];
 #else
-               // TODO: not yet sure what to do on other platforms
+               result = list->locale;
 #endif
-       }
+    }
        return result;
 }
 
@@ -1394,10 +1397,13 @@ void mlt_properties_close( mlt_properties self )
                                free( list->name[ index ] );
                        }
 
-#if defined(__linux__) || defined(__DARWIN__)
+#if defined(__GLIBC__) || defined(__DARWIN__)
                        // Cleanup locale
                        if ( list->locale )
                                freelocale( list->locale );
+#else
+                       if ( list->locale )
+                               free( list->locale );
 #endif
 
                        // Clear up the list