Re: DOS path separators - more info
Re: DOS path separators - more info
- Subject: Re: DOS path separators - more info
- From: Andrew White <email@hidden>
- Date: Wed, 10 Aug 2005 15:32:33 +1000
Brad,
One suggestion that might be helpful:
http://gcc.gnu.org/onlinedocs/cpp/Computed-Includes.html#Computed-Includes
This only applies if you're using the same paths multiple times, but it
means that you can have a smaller number of (perhaps one) headers that
define the paths either in Unix friendly or DOS friendly format and then
#include those defines rather than the raw text.
Actually building this list isn't too hard. Use grep to pull out all the
#include lines with path characters in them, then sort and filter them.
Then use your editor to change each #include "blah.h" to #define LABEL
blah.h. Admittedly, you've still got to give each a name, but it helps as
a long term fix.
For a simpler fix:
BBEdit can do multi-file searching. Using grep settings, do two
search/replace operations.
For the first your search, the patterns are:
find: ^([ \t]*#include .*\\.*)$
replace: #ifdef MAC_PORT\r\1\r#else\r\1\r#endif // MAC_PORT\r// BO 10 Aug 2005
For the second, the patterns are:
find: ^(#ifdef MAC_PORT\r[ \t]*#include .*)\\
replace: \1/
Repeat this until nothing gets changed.
This will bracket each suspect #include with its own #ifdef / #endif
header. Doing them in blocks is a lot trickier.
You might want to test it on a single file to make sure it works before
inflicting it on the entire project. It worked on a single file for me.
--
Andrew White
--------------------------------------------------------------------------
This email and any attachments may be confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
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