We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 419

Summary: 1.2-branch iconv changes breaks compilation
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: mainAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sol11x86
Version: HG 1.2   
Hardware: x86   
OS: Linux   
Attachments: iconv compilation fix

Description Ozkan Sezer 2007-03-23 01:32:56 UTC
The const correctness change made on feb 16 (svn: 2984)
seems to have broken the compilation of the 1.2 branch,
at least on my redhat linux 9. The problem is the second
arg of library version iconv() is not const and that
causes a compile error because the const change is done
in the header only, not in the *.c file.

Proposing the attached patch as a fix.
Comment 1 Ozkan Sezer 2007-03-23 01:33:55 UTC
Created attachment 202 [details]
iconv compilation fix
Comment 2 Ryan C. Gordon 2007-03-30 13:10:17 UTC
Fixed in svn revision #3002.

Thanks!

--ryan.

Comment 3 Ryan C. Gordon 2007-04-04 03:48:09 UTC
*** Bug 407 has been marked as a duplicate of this bug. ***
Comment 4 Sam Lantinga 2007-06-27 21:58:25 UTC
Bug 407 actually has the correct fix for this bug.  They're complaining about mismatched SDL prototypes, not mismatched iconv() prototypes.
Comment 5 Sam Lantinga 2007-06-27 23:22:23 UTC
Nevermind...
There are conflicting standards on iconv(), and the current one is char **, not const char **
I'm not sure why this is, but I'm changing the SDL version to be consistent.
For reference: http://lists.debian.org/debian-glibc/2004/05/msg00006.html
Comment 6 Sam Lantinga 2007-06-27 23:29:42 UTC
On second thought, making the parameter const is what we need for SDL's purposes (see SDL_iconv_string())
For those platforms that actually require a writable inbuf, I'm going to copy the string into stack memory.  Hopefully this won't be necessary very often.