Don't use fast enumeration in old version of Mac OS.

Signed-off-by: William Hua <william@attente.ca>
This commit is contained in:
Jeremy Huddleston 2012-04-11 02:05:00 -04:00 committed by William Hua
parent 51a2661da6
commit 5739d896f8

View File

@ -340,7 +340,12 @@ g_nextstep_settings_backend_get_g_variant (id object,
g_variant_builder_init (&builder, type);
for (key in object)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
for(key in object)
#else
NSEnumerator *enumerator = [object objectEnumerator];
while((key = [enumerator nextObject]))
#endif
{
GVariant *name;
id value;
@ -376,7 +381,12 @@ g_nextstep_settings_backend_get_g_variant (id object,
value_type = g_variant_type_element (type);
g_variant_builder_init (&builder, type);
for (value in object)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
for(value in object)
#else
NSEnumerator *enumerator = [object objectEnumerator];
while((value = [enumerator nextObject]))
#endif
{
GVariant *variant = g_nextstep_settings_backend_get_g_variant (value, value_type);