Changeset - r9757:7a4c577a7782
[Not reviewed]
master
0 1 0
bjarni - 16 years ago 2008-07-31 14:00:01
bjarni@openttd.org
(svn r13893) -Fix: [OSX] solved a deprecated warning specific to 10.5
1 file changed with 13 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/os/macosx/macos.mm
Show inline comments
 
@@ -171,18 +171,23 @@ const char *GetCurrentLocale(const char 
 
	NSString* preferredLang = [languages objectAtIndex:0];
 
	/* preferredLang is either 2 or 5 characters long ("xx" or "xx_YY"). */
 

	
 
	/* MacOS 10.3.9 can't handle encoding:NSASCIIStringEncoding
 
	 * we will completely disable compiling it for such old targets to avoid a warning */
 
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_3)
 
	/* Note: MAC_OS_X_VERSION_MAX_ALLOWED is the current OSX version/SDK by default */
 
	/* 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 (MacOSVersionIsAtLeast(10, 4, 0)) {
 
		[ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ];
 
	} else {
 
#else
 
	/* 10.3.9 needs to start the { too */
 
	} 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
 
#endif
 
		[ preferredLang getCString:retbuf maxLength:32 ];
 
		];
 
	}
 
	return retbuf;
 
}
0 comments (0 inline, 0 general)