blender/intern/locale/osx_user_locale.mm
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00

23 lines
532 B
Plaintext

#include "boost_locale_wrapper.h"
#import <Cocoa/Cocoa.h>
#include <cstdlib>
static char *user_locale = NULL;
// get current locale
const char *osx_user_locale()
{
::free(user_locale);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
NSLocale *myNSLocale = (NSLocale *)myCFLocale;
[myNSLocale autorelease];
NSString *nsIdentifier = [myNSLocale localeIdentifier];
user_locale = ::strdup([nsIdentifier UTF8String]);
[pool drain];
return user_locale;
}