mirror of https://github.com/OpenTTD/OpenTTD
(svn r13893) -Fix: [OSX] solved a deprecated warning specific to 10.5
parent
53fc140db4
commit
61799786d5
|
@ -171,18 +171,23 @@ const char *GetCurrentLocale(const char *)
|
||||||
NSString* preferredLang = [languages objectAtIndex:0];
|
NSString* preferredLang = [languages objectAtIndex:0];
|
||||||
/* preferredLang is either 2 or 5 characters long ("xx" or "xx_YY"). */
|
/* preferredLang is either 2 or 5 characters long ("xx" or "xx_YY"). */
|
||||||
|
|
||||||
/* MacOS 10.3.9 can't handle encoding:NSASCIIStringEncoding
|
/* Since Apple introduced encoding to CString in OSX 10.4 we have to make a few conditions
|
||||||
* we will completely disable compiling it for such old targets to avoid a warning */
|
* to get the right code for the used version of OSX. */
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_3)
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_4)
|
||||||
/* Note: MAC_OS_X_VERSION_MAX_ALLOWED is the current OSX version/SDK by default */
|
/* 10.4 can compile both versions just fine and will select the correct version at runtime based
|
||||||
|
* on the version of OSX at execution time. */
|
||||||
if (MacOSVersionIsAtLeast(10, 4, 0)) {
|
if (MacOSVersionIsAtLeast(10, 4, 0)) {
|
||||||
[ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ];
|
[ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ];
|
||||||
} else {
|
} else
|
||||||
#else
|
|
||||||
/* 10.3.9 needs to start the { too */
|
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
[ preferredLang getCString:retbuf maxLength:32 ];
|
{
|
||||||
|
[ preferredLang getCString:retbuf maxLength:32
|
||||||
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||||
|
/* If 10.5+ is used to compile then encoding is needed here.
|
||||||
|
* If 10.3 or 10.4 is used for compiling then this line is used by 10.3 and encoding should not be present here. */
|
||||||
|
encoding:NSASCIIStringEncoding
|
||||||
|
#endif
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return retbuf;
|
return retbuf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue