libaudiohal: Factorize more between version
Use macro in include to avoid duplicating all the headers.
That will be useful when a third version is added.
Bug: 118203066
Test: compile
Change-Id: I8972b9ac9d098b32c9e7de48ff0544440c29adbf
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/media/libaudiohal/impl/VersionMacro.h b/media/libaudiohal/impl/VersionMacro.h
index 98e9c07..68fc9f6 100644
--- a/media/libaudiohal/impl/VersionMacro.h
+++ b/media/libaudiohal/impl/VersionMacro.h
@@ -21,6 +21,15 @@
#error "MAJOR_VERSION and MINOR_VERSION must be defined"
#endif
+/** Allows macro expansion for x and add surrounding `<>`.
+ * Is intended to be used for version dependant includes as
+ * `#include` do not macro expand if starting with < or "
+ * Example usage:
+ * #include PATH(path/to/FILE_VERSION/file)
+ * @note: uses the implementation-define "Computed Includes" feature.
+ */
+#define PATH(x) <x>
+
#define CONCAT_3(a,b,c) a##b##c
#define EXPAND_CONCAT_3(a,b,c) CONCAT_3(a,b,c)
/** The directory name of the version: <major>.<minor> */