You might want to consider writing wrapper routines (that accept string values and pass references).
When I look out of the window, I see a long row of programmers, all volunteering to write wrappers for 268 units with 245991 lines of declarations.
Ignoring Adriaan's misplaced sarcasm, it is not practical to write wrappers for interface functions like this. Interface functions are by definition interfaces on to existing routines, and have no code associated with them (even the initialization code required by GPC causes us problems). Not upgrading GPC would be a preferable solution to writing wrappers around all these routines with all the code changes and implementation code issues that would require.
At 10:10 PM +0100 28/2/05, Frank Heckenbach wrote:
These numbers are quite pointless, as I suppose not each line contains such a problematic declaration. (And we didn't write the Mac ABI, BTW.)
You're quite right, and this discussion is pointless for that reason. Despite the claims in GPC to the contrary, "const" array parameters must be passed by reference according to the ABI anyway, and there is no way for the compiler to optimize it out since in these cases it can never have any access to the code behind the declaration since it is in the system.
So the net result of this change is that we can stop using the "protected var" parameters and go back to using the "const" parameters like (which is what Metrowerks uses anyway) and we can all be happy as long as no one reads the documentation line that says the "const" might not be passed by reference.
Adriaan/Gale - I'll sort out converting the "protected var" parameters back to "const" parameters when I get a chance (remind me if I haven't done it in a couple weeks or you need it sooner).
Enjoy, Peter.