Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: pece on October 05, 2009, 09:09:59 am
-
Hello,
line 113 in macrosmanager.cpp should be:
macros[_T("CMD_NULL")] = _T("NUL");
How about adding macro for $(CMD) = "cmd /c" on windows, "sh" otherwise?
Przemek
-
macros[_T("CMD_NULL")] = _T("NUL");
Why???
How about adding macro for $(CMD) = "cmd /c" on windows, "sh" otherwise?
For what purpose?
-
macros[_T("CMD_NULL")] = _T("NUL");
Why???
Because for the rest of platforms CMD_NULL macro is defined as a file: /dev/null
See macrosmanager.cpp line 122:
macros[_T("CMD_NULL")] = _T("/dev/null");
Then it would be possible to use it for example in pre-build command:
$(CMD_CP) include.hw include.h > $(CMD_NULL)
CMD_NULL in its current state on windows platforms expands to invalid command:
cmd /c NUL
How about adding macro for $(CMD) = "cmd /c" on windows, "sh" otherwise?
For what purpose?
For purpose the macros are for: to parametrize things.
Przemek
-
Did you try it?
Does not error out for me.
See http://en.wikipedia.org/wiki//dev/null
Tim S.
-
Did you try it?
Does not error out for me.
See http://en.wikipedia.org/wiki//dev/null
Tim S.
Tim, please read the whole thread. You should test it with "dir > cmd /c NUL"
as this is what $(CMD_NULL) macro expands to, on windows, curently.
(Should expand to plain "NUL" not "cmd /c NUL").
Przemek
-
Did you try it?
Does not error out for me.
See http://en.wikipedia.org/wiki//dev/null
Tim S.
Tim, please read the whole thread. You should test it with "dir > cmd /c NUL"
as this is what $(CMD_NULL) macro expands to, on windows, curently.
(Should expand to plain "NUL" not "cmd /c NUL").
Przemek
You only stated the issue clearly in this message; I had no idea what you were saying in about 1 in 3 sentences.
Edit: And this does work. So, another possible solution.
"cmd /c > NUL dir"
Tim S.
-
He's right with his first point, though. I admit that I had difficulties understanding, too, but he's right :)
The other thing (adding sh under Unix) is not necessary, as it works fine with the default shell which is user-configurable.
-
He's right with his first point, though. I admit that I had difficulties understanding, too, but he's right :)
The other thing (adding sh under Unix) is not necessary, as it works fine with the default shell which is user-configurable.
C::B doesn't have macro for invoking command interpreter. Hence $(CMD) would be usefull.
Pre(post) build steps could benefit from this. And 'sh' is most neutral on non-windowses.
Or it could just yield the value that user has configured in default shell setting.
Przemek