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)
Merged-In: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
Change-Id: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
(cherry picked from commit b04a4997b80c9cdad1b66e60d3d995a2598a53a4)
diff --git a/cc/library.go b/cc/library.go
index 1da65bb..bd5a914 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1317,7 +1317,7 @@
func versioningMacroName(moduleName string) string {
macroName := charsNotForMacro.ReplaceAllString(moduleName, "_")
- macroName = strings.ToUpper(moduleName)
+ macroName = strings.ToUpper(macroName)
return "__" + macroName + "_API__"
}