summaryrefslogtreecommitdiff
path: root/cpp/src/slice2freeze/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2freeze/Main.cpp')
-rw-r--r--cpp/src/slice2freeze/Main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index 2d2020f10a2..bc855817352 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -1454,7 +1454,11 @@ gen(const string& name, const UnitPtr& u, const vector<string>& includePaths, co
}
}
- H << "#pragma once\n";
+ string s = fileH;
+ transform(s.begin(), s.end(), s.begin(), ToIfdef());
+ H << "\n#ifndef __" << s << "__";
+ H << "\n#define __" << s << "__";
+ H << '\n';
if(dicts.size() > 0)
{
@@ -1503,7 +1507,7 @@ gen(const string& name, const UnitPtr& u, const vector<string>& includePaths, co
}
}
- H << "\n\n";
+ H << "\n\n#endif\n";
CPP << '\n';
H.close();