aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2018-03-06 18:39:35 -0800
committerYifan Hong <elsk@google.com>2018-03-07 13:16:18 -0800
commit0b496529524468f8e324d0d7c8a362a4e1f3b302 (patch)
tree278c4a7620e8c2c9f2b77c2981c7a25c6aeb4900 /utils
parente1b157e4e7dcf3ebdcb9ebef79df13cb76ee76c9 (diff)
downloadhidl-0b496529524468f8e324d0d7c8a362a4e1f3b302.tar.gz
Fix indirect linkage to gIBaseFqName globals
Do not create a static variable in each sources. This fix a linkage error for FQName(string) when libhidl-gen-utils is not used directly, but FQName.h is included in sources. Test: links Change-Id: Ie154d7c6e07d4d1143d67b05aeaa85521836c0eb
Diffstat (limited to 'utils')
-rw-r--r--utils/FQName.cpp3
-rw-r--r--utils/include/hidl-util/FQName.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/utils/FQName.cpp b/utils/FQName.cpp
index 5aaa385b..d4579905 100644
--- a/utils/FQName.cpp
+++ b/utils/FQName.cpp
@@ -536,5 +536,8 @@ FQName FQName::downRev() const {
return ret;
}
+const FQName gIBaseFqName = FQName("android.hidl.base", "1.0", "IBase");
+const FQName gIManagerFqName = FQName("android.hidl.manager", "1.0", "IServiceManager");
+
} // namespace android
diff --git a/utils/include/hidl-util/FQName.h b/utils/include/hidl-util/FQName.h
index 17d25fc1..14b0d624 100644
--- a/utils/include/hidl-util/FQName.h
+++ b/utils/include/hidl-util/FQName.h
@@ -242,8 +242,8 @@ struct FQName {
void clearVersion();
};
-static const FQName gIBaseFqName = FQName("android.hidl.base", "1.0", "IBase");
-static const FQName gIManagerFqName = FQName("android.hidl.manager", "1.0", "IServiceManager");
+extern const FQName gIBaseFqName;
+extern const FQName gIManagerFqName;
} // namespace android