hardware: provide temp version defines for source compatibility

This allows all the existing modules to have source level
compatibility until they are fixed to use the new field names.

Since the binary compatibility has not been altered, we do not
need to force all the implementors to rev their version numbers.

This change should be reverted when all the clients have been updated.

Change-Id: Ie543d3a972d8abe03ca5123e3000966f048d1771
Signed-off-by: Dima Zavin <dima@android.com>
diff --git a/include/hardware/hardware.h b/include/hardware/hardware.h
index db6640d..3d341c8 100644
--- a/include/hardware/hardware.h
+++ b/include/hardware/hardware.h
@@ -69,6 +69,12 @@
      * versions outside of the supplied range.
      */
     uint16_t module_api_version;
+#define version_major module_api_version
+    /**
+     * version_major/version_minor defines are supplied here for temporary
+     * source code compatibility. They will be removed in the next version.
+     * ALL clients must convert to the new version format.
+     */
 
     /**
      * The API version of the HAL module interface. This is meant to
@@ -81,6 +87,7 @@
      * Presently, 0 is the only valid value.
      */
     uint16_t hal_api_version;
+#define version_minor hal_api_version
 
     /** Identifier of module */
     const char *id;