8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

cloop: put version #define for each interface in the C++ generator.

This commit is contained in:
Adriano dos Santos Fernandes 2022-10-18 21:13:02 -03:00
parent 89087e0e10
commit 5b98953343

View File

@ -21,12 +21,14 @@
#include "Generator.h"
#include "Expr.h"
#include <algorithm>
#include <deque>
#include <set>
#include <stdexcept>
#include <string>
#include <vector>
using std::transform;
using std::deque;
using std::runtime_error;
using std::set;
@ -147,6 +149,9 @@ CppGenerator::CppGenerator(const string& filename, const string& prefix, Parser*
void CppGenerator::generate()
{
string nameSpaceUpper = nameSpace;
transform(nameSpaceUpper.begin(), nameSpaceUpper.end(), nameSpaceUpper.begin(), toupper);
fprintf(out, "// %s\n\n", AUTOGEN_MSG);
fprintf(out, "#ifndef %s\n", headerGuard.c_str());
@ -415,6 +420,12 @@ void CppGenerator::generate()
}
fprintf(out, "\t};\n\n");
fprintf(out, "#define %s_%s%s_VERSION %u\n\n",
nameSpaceUpper.c_str(),
prefix.c_str(),
interface->name.c_str(),
interface->version);
}
fprintf(out, "\t// Interfaces implementations\n");