Make RenderScript constants variables instead of macros.

Implement the RenderScript constants as extern const variables
instead of macros. This allows lldb to inspect the RenderScript
constants, because their symbols will appear in the final shared
object. Old behaviour is retained for RS_VERSION < UNRELEASED.

Change-Id: I05d59a8560f264e82fdf84a92eeeec1d7db5a7a4

Signed-off-by: Verena Beckham <verena@codeplay.com>
diff --git a/api/GenerateHeaderFiles.cpp b/api/GenerateHeaderFiles.cpp
index ce778b3..9f40d3d 100644
--- a/api/GenerateHeaderFiles.cpp
+++ b/api/GenerateHeaderFiles.cpp
@@ -120,7 +120,13 @@
     const Constant* constant = spec.getConstant();
     VersionInfo info = spec.getVersionInfo();
     writeVersionGuardStart(file, info, constant->getFinalVersion());
-    *file << "#define " << constant->getName() << " " << spec.getValue() << "\n\n";
+
+    *file << "#if (defined(RS_VERSION) && (RS_VERSION >= UNRELEASED))\n";
+    *file << "extern const " << spec.getType() << " " << constant->getName() << ";\n";
+    *file << "#else\n";
+    *file << "#define " << constant->getName() << " " << spec.getValue() << "\n";
+    *file << "#endif\n\n";
+
     writeVersionGuardEnd(file, info);
 }