"static const" instead of "#define" for script API M_* constants.
This makes referenced script API M_* constants visible in the debugger.
Modify rs lldb test for the constants so that it references them.
Adapted from https://android-review.googlesource.com/#/c/210789/
Test: aosp_arm64-eng on emulator
- run slang/tests, slang/lit-tests
- run rs lldb test suite
- run RsTest (32-bit, 64-bit)
- run cts -m RenderscriptTest (32-bit)
- confirmed that omitting type: or value: from constant: causes
script_api/generate.sh to fail with an error
Change-Id: I9cc89771ad5d90432c0ea0a1885aae8d9003dafe
diff --git a/script_api/GenerateHeaderFiles.cpp b/script_api/GenerateHeaderFiles.cpp
index ce778b3..1ea5e11 100644
--- a/script_api/GenerateHeaderFiles.cpp
+++ b/script_api/GenerateHeaderFiles.cpp
@@ -120,7 +120,8 @@
const Constant* constant = spec.getConstant();
VersionInfo info = spec.getVersionInfo();
writeVersionGuardStart(file, info, constant->getFinalVersion());
- *file << "#define " << constant->getName() << " " << spec.getValue() << "\n\n";
+ *file << "static const " << spec.getType() << " " << constant->getName()
+ << " = " << spec.getValue() << ";\n\n";
writeVersionGuardEnd(file, info);
}