• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: porting endlines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: porting endlines


  • Subject: Re: porting endlines
  • From: Laurence Harris <email@hidden>
  • Date: Wed, 28 Mar 2007 04:35:46 -0400


On Mar 28, 2007, at 4:17 AM, Denis Osadchy wrote:

Hi,

we are porting application from CodeWarrior to Xcode and encountered
problem:
Application built with CodeWarrior writes \r (0x0D) as end of line
while ported to Xcode Application writes \n (0x0A).

I don't see this in my application. If I use \r I get 0x0D in both CW and Xcode.


For example line endings are written by strcat(str, "\n"). As I understand this
string should add 0x0A to the end of string regardless of platform.


But when I debug code in CW I see that \r is really added to str
instead of \n. I tried to write strcat(str, "\r") - in this
case \n is really added to new_item. I also tried to write 0x0A - \n
is added to new_item which is correct. Seems that \r and \n
are preprocessed or specially handled by compiler.

http://web.mit.edu/macdev/Development/Documentation/www/devdoc/ portPPC.html says that
MPW swaps the ASCII value of '\r' and '\n'. It does this because the
Mac uses '\r' to break lines but '\n' is commonly used for new lines
in standard C library routines such as printf....


So the question is how such swapping can be switched on in Xcode
build?

Why do you need this? Somehow this doesn't sound like the right solution to whatever you're seeing.


Larry

_______________________________________________
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


  • Follow-Ups:
    • Re[2]: porting endlines
      • From: Denis Osadchy <email@hidden>
References: 
 >porting endlines (From: Denis Osadchy <email@hidden>)

  • Prev by Date: porting endlines
  • Next by Date: Re[2]: porting endlines
  • Previous by thread: porting endlines
  • Next by thread: Re[2]: porting endlines
  • Index(es):
    • Date
    • Thread