cc: fix a utility to make C macro name

Use the result of regex.ReplaceAllString()

Bug: 149591522 (not directly related to this)
Test: m (with new unit test)
Change-Id: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
This commit is contained in:
Jooyung Han
2020-03-13 18:57:35 +09:00
parent 4f65ea2992
commit b04a4997b8
2 changed files with 24 additions and 1 deletions

View File

@@ -1329,7 +1329,7 @@ var charsNotForMacro = regexp.MustCompile("[^a-zA-Z0-9_]+")
func versioningMacroName(moduleName string) string {
macroName := charsNotForMacro.ReplaceAllString(moduleName, "_")
macroName = strings.ToUpper(moduleName)
macroName = strings.ToUpper(macroName)
return "__" + macroName + "_API__"
}