Re: porting endlines
Re: porting endlines
- Subject: Re: porting endlines
- From: Greg Guerin <email@hidden>
- Date: Wed, 28 Mar 2007 11:52:18 -0700
Denis Osadchy wrote:
>Now to make our Xcode ported application similar to Codewarrior built
>application we can unset this setting in CW and change all \r to \n and \n to
>\r. But our library is really large and I hope there is another more
>simple and fast solution.
If I understand this, you want your library to write CR (0x0D), not LF
(0x0A). I don't understand why CR is appropriate on Mac OS X, but I'll
take your word that it's exactly what you want.
The best way to make that happen is to change all your literals to use
defined constants instead of literal \r or \n. If you'd done this when you
wrote the library, rather than relying on a quirk or setting of MPW or CW
interpretation, the problem would already be solved.
If I had hundreds or thousands of source files to convert, I'd write a
program that automated the process. It wouldn't have to be perfect, it
just has to cover MOST cases. If there are a few cases it doesn't handle,
you can correct those manually (have the tool insert a compiler error).
The tool is throw-away, after all, and you shouldn't spend more time on it
than you would in manually changing the source.
First, though, I'd write a test program that exercised the library, to
confirm that it generates identical CR-terminated lines regardless of which
source base or compiler was used.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden