Combine major, minor and build revision as the program binary version.

TRAC #22245 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1563 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent a8c42f1d
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1562 #define BUILD_REVISION 1563
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
#define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION) #define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION)
#define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(BUILD_VERSION) "." MACRO_STRINGIFY(BUILD_REVISION) #define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(BUILD_VERSION) "." MACRO_STRINGIFY(BUILD_REVISION)
#define VERSION_DWORD ((MAJOR_VERSION << 24) | (MINOR_VERSION << 16) | BUILD_REVISION)
...@@ -1648,7 +1648,7 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length) ...@@ -1648,7 +1648,7 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
int version = 0; int version = 0;
stream.read(&version); stream.read(&version);
if (version != BUILD_REVISION) if (version != VERSION_DWORD)
{ {
infoLog.append("Invalid program binary version."); infoLog.append("Invalid program binary version.");
return false; return false;
...@@ -1789,7 +1789,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length) ...@@ -1789,7 +1789,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
BinaryOutputStream stream; BinaryOutputStream stream;
stream.write(GL_PROGRAM_BINARY_ANGLE); stream.write(GL_PROGRAM_BINARY_ANGLE);
stream.write(BUILD_REVISION); stream.write(VERSION_DWORD);
for (unsigned int i = 0; i < MAX_VERTEX_ATTRIBS; ++i) for (unsigned int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment