提交修改
This commit is contained in:
co-authored by
changyunjia
parent
d4442fc21f
commit
3ac4fe0cd0
Regular → Executable
+12
-12
@@ -1,12 +1,12 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
extern "C" {
|
||||
__attribute__((visibility("default")))
|
||||
const char* _GetDeviceCountryCode() {
|
||||
@autoreleasepool {
|
||||
NSLocale *currentLocale = [NSLocale currentLocale];
|
||||
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
|
||||
return strdup([countryCode UTF8String]); // 使用strdup确保内存安全
|
||||
}
|
||||
}
|
||||
}
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
extern "C" {
|
||||
__attribute__((visibility("default")))
|
||||
const char* _GetDeviceCountryCode() {
|
||||
@autoreleasepool {
|
||||
NSLocale *currentLocale = [NSLocale currentLocale];
|
||||
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
|
||||
return strdup([countryCode UTF8String]); // 使用strdup确保内存安全
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user