(svn r17702) -Change: [OSX] Assure that the minimal OSX version is defined in all cases.
-Codechange: [OSX] Improve conditional defines for OS version dependant code.
This commit is contained in:
@@ -182,21 +182,16 @@ const char *GetCurrentLocale(const char *)
|
||||
|
||||
/* Since Apple introduced encoding to CString in OSX 10.4 we have to make a few conditions
|
||||
* to get the right code for the used version of OSX. */
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_4)
|
||||
/* 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 (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
|
||||
if (MacOSVersionIsAtLeast(10, 4, 0)) {
|
||||
[ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ];
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
[ 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
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4)
|
||||
/* maxLength does not include the \0 char in contrast to the call above. */
|
||||
[ preferredLang getCString:retbuf maxLength:31 ];
|
||||
#endif
|
||||
];
|
||||
}
|
||||
return retbuf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user