MCPcopy Create free account
hub / github.com/nodejs/node / _EscapeCppDefineForMSBuild

Function _EscapeCppDefineForMSBuild

tools/gyp/pylib/gyp/generator/msvs.py:881–889  ·  view source on GitHub ↗

Escapes a CPP define so that it will reach the compiler unaltered.

(s)

Source from the content-addressed store, hash-verified

879
880
881def _EscapeCppDefineForMSBuild(s):
882 """Escapes a CPP define so that it will reach the compiler unaltered."""
883 s = _EscapeEnvironmentVariableExpansion(s)
884 s = _EscapeCommandLineArgumentForMSBuild(s)
885 s = _EscapeMSBuildSpecialCharacters(s)
886 # cl.exe replaces literal # characters with = in preprocessor definitions for
887 # some reason. Octal-encode to work around that.
888 s = s.replace("#", "\\%03o" % ord("#"))
889 return s
890
891
892def _GenerateRulesForMSVS(

Callers 1

_FinalizeMSBuildSettingsFunction · 0.85

Tested by

no test coverage detected