Escapes a CPP define so that it will reach the compiler unaltered.
(s)
| 840 | |
| 841 | |
| 842 | def _EscapeCppDefineForMSVS(s): |
| 843 | """Escapes a CPP define so that it will reach the compiler unaltered.""" |
| 844 | s = _EscapeEnvironmentVariableExpansion(s) |
| 845 | s = _EscapeCommandLineArgumentForMSVS(s) |
| 846 | s = _EscapeVCProjCommandLineArgListItem(s) |
| 847 | # cl.exe replaces literal # characters with = in preprocessor definitions for |
| 848 | # some reason. Octal-encode to work around that. |
| 849 | s = s.replace("#", "\\%03o" % ord("#")) |
| 850 | return s |
| 851 | |
| 852 | |
| 853 | quote_replacer_regex2 = re.compile(r'(\\+)"') |
no test coverage detected