Web Hosting Talk







View Full Version : Multiline #defines in gcc with wrong EOL


cperciva
01-28-2002, 10:03 PM
Does anyone know how to make multiline #defines work when the wrong (windows vs. unix) EOL character is being used?

Lawrence
01-28-2002, 10:23 PM
I suspect it's not possible without converting the line endings, although I'm not sure. Is converting them not plausible for one reason or another?

cperciva
01-28-2002, 10:32 PM
Well, it's plausible, just a nuisance. I'm writing code on my windows system and testing it on my unix system, and it's annoying to reconvert the EOLs every time I upload my code.

qslack
01-28-2002, 10:38 PM
You can just run them through a regexp. Try this for converting the files from Windows to Unix line break format:

perl -pe 's/\015\012/\012/g' FILE.C > FILE.C

It seems to work after a bit of testing, but don't hold me responsible if it does anything bad. :)