Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

CMD_NULL macro (macrosmanager.cpp)

(1/2) > >>

pece:
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

MortenMacFly:

--- Quote from: pece on October 05, 2009, 09:09:59 am ---macros[_T("CMD_NULL")]  = _T("NUL");

--- End quote ---
Why???


--- Quote from: pece on October 05, 2009, 09:09:59 am ---How about adding macro for $(CMD) = "cmd /c" on windows, "sh" otherwise?

--- End quote ---
For what purpose?

pece:

--- Quote from: MortenMacFly on October 05, 2009, 09:49:45 am ---
--- Quote from: pece on October 05, 2009, 09:09:59 am ---macros[_T("CMD_NULL")]  = _T("NUL");

--- End quote ---
Why???

--- End quote ---

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


--- Quote from: MortenMacFly on October 05, 2009, 09:49:45 am ---
--- Quote from: pece on October 05, 2009, 09:09:59 am ---How about adding macro for $(CMD) = "cmd /c" on windows, "sh" otherwise?

--- End quote ---
For what purpose?

--- End quote ---

For purpose the macros are for: to parametrize things.

Przemek

stahta01:
Did you try it?


--- Code: ---dir > NUL
--- End code ---

Does not error out for me.

See http://en.wikipedia.org/wiki//dev/null

Tim S.


pece:

--- Quote from: stahta01 on October 05, 2009, 02:27:17 pm ---Did you try it?


--- Code: ---dir > NUL
--- End code ---

Does not error out for me.

See http://en.wikipedia.org/wiki//dev/null

Tim S.


--- End quote ---

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

Navigation

[0] Message Index

[#] Next page

Go to full version