Opened 12 years ago
Last modified 16 months ago
#1149 new defect
[PATCH] wcscasecmp does exist on OS X Lion
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | osx patch mac |
Cc: | historic_bruno | Patch: |
Description
Contrary to #414, wcscasecmp
is now available on OS X Lion, causing many redundant redeclaration warnings during the build process. I haven't tried Apple's wcscasecmp
to know if it will work for us, but at least we can get rid of these warnings. The same goes for strnlen
, wcsnlen
, and wcsdup
.
Attachments (1)
Change History (18)
comment:1 by , 12 years ago
Keywords: | simple added |
---|
comment:2 by , 11 years ago
Keywords: | lion removed |
---|
by , 11 years ago
Attachment: | fix-macos-wcs.patch added |
---|
comment:3 by , 11 years ago
Keywords: | patch review added; simple removed |
---|---|
Milestone: | Backlog → Alpha 15 |
Summary: | wcscasecmp does exist on OS X Lion → [PATCH] wcscasecmp does exist on OS X Lion |
comment:4 by , 11 years ago
I think it's not the correct solution even if it solves the build warning on 10.7+. The problem is the game can be built on 10.7 but run on earlier versions, which could result in a crash when it tries to call those functions, if they're not implemented. So the proper fix involves two things:
- Compile time fix: if we build against 10.6 SDK or earlier, it should use our implementation or the build would fail, the patch solves that in a hacky way, it should use OS X version macros. This way it also runs on 10.7+ with no problem.
- Run-time fix: if we build against 10.7+ SDK, it should detect if the functions are valid before calling them, if not, fall back to our own implementation. This would be the ugly part.
Honestly it seems easier to always use our own implementation on OS X and just fix the build warnings for 10.7+.
comment:5 by , 11 years ago
Keywords: | review removed |
---|
follow-up: 7 comment:6 by , 11 years ago
If we want the build to run with 10.6 we should set the deployment target accordingly. Linking to 10.7 and then check at runtime if the function exists looks like the wrong way.
(I think we should always build with the newest version, the packaged downloads can still be linked to 10.6.)
#if OS_MACOSX && !defined(AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER)
?
comment:7 by , 11 years ago
Replying to Markus:
If we want the build to run with 10.6 we should set the deployment target accordingly.
In fact, that's exactly what we do with the OS X bundle build script :)
Linking to 10.7 and then check at runtime if the function exists looks like the wrong way.
According to Apple, it's one aspect of OS X SDK-based development. But as I said it's probably overkill in this case, we could squash the build warning on 10.7+ and use our own implementation. I actually don't know what the compiler's doing now, is it undefined behavior?
comment:8 by , 10 years ago
Milestone: | Alpha 15 → Alpha 16 |
---|
comment:9 by , 10 years ago
Milestone: | Alpha 16 → Backlog |
---|
comment:10 by , 9 years ago
Milestone: | Backlog → Alpha 20 |
---|
OS 10.7 is now super old, might be time to reconsider.
comment:12 by , 5 years ago
Keywords: | mac added |
---|
comment:13 by , 5 years ago
Cc: | added |
---|
We no longer support 10.7 (SM38 requires 10.9), so older builds aren't relevant. Will revisit this as such.
comment:14 by , 3 years ago
Milestone: | Backlog → Alpha 25 |
---|
I fixed strnlen in Phab:rP24227, not the others though, gonna push this to A25.
comment:15 by , 3 years ago
Milestone: | Alpha 25 → Alpha 26 |
---|
comment:17 by , 16 months ago
Milestone: | Alpha 27 → Backlog |
---|
patch from #2005 / RedFox