Chromium Code Reviews| Index: src/IceRevision.cpp |
| diff --git a/src/IceRevision.cpp b/src/IceRevision.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..36967623b2bd50690548b688e477b148a2fa4996 |
| --- /dev/null |
| +++ b/src/IceRevision.cpp |
| @@ -0,0 +1,28 @@ |
| +//===- subzero/src/IceRevision.cpp - Revision string embedding ------------===// |
| +// |
| +// The Subzero Code Generator |
| +// |
| +// This file is distributed under the University of Illinois Open Source |
| +// License. See LICENSE.TXT for details. |
| +// |
| +//===----------------------------------------------------------------------===// |
| +/// |
| +/// \file |
| +/// \brief Implements the function for returning the Subzero revision string. |
| +/// |
| +//===----------------------------------------------------------------------===// |
| + |
| +#include "IceRevision.h" |
| + |
| +#define XSTRINGIFY(x) STRINGIFY(x) |
|
John
2016/08/08 11:47:28
why the indirection? XSTRINGIFY could just #x its
Jim Stichnoth
2016/08/08 14:46:18
I think this is one of the oddities of the preproc
John
2016/08/08 14:55:36
Oh, yeah! STRINGFY(x) #x stringfies x without expa
Jim Stichnoth
2016/08/08 17:48:09
Yeah - I kind of prefer dealing with quotes in the
|
| +#define STRINGIFY(x) #x |
| + |
| +#ifndef SUBZERO_REVISION |
| +#define SUBZERO_REVISION unknown |
| +#endif // !SUBZERO_REVISION |
| + |
| +namespace Ice { |
| +const char *getSubzeroRevision() { |
| + return "Subzero_revision_" XSTRINGIFY(SUBZERO_REVISION); |
| +} |
| +} |