Escapes a CPP define so that it will reach the compiler unaltered.
(s)
| 879 | |
| 880 | |
| 881 | def _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 | |
| 892 | def _GenerateRulesForMSVS( |
no test coverage detected