summaryrefslogtreecommitdiff
path: root/tests/headers/overloading.hpp
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2016-11-11 16:20:36 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2016-11-11 16:20:36 -0800
commit5851026f744ddf2807f3eafa8c9341134ae7f4f2 (patch)
tree1425b4eb42bfa33fc24d708226fc7f10a79bb87c /tests/headers/overloading.hpp
parentc2e7f46a326eb7e7ec99dbe9f68d8f4020223541 (diff)
Add support for bindings to overloaded functions
This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol.
Diffstat (limited to 'tests/headers/overloading.hpp')
-rw-r--r--tests/headers/overloading.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/headers/overloading.hpp b/tests/headers/overloading.hpp
new file mode 100644
index 00000000..3c2b0487
--- /dev/null
+++ b/tests/headers/overloading.hpp
@@ -0,0 +1,9 @@
+extern bool Evaluate(char r);
+extern bool Evaluate(int x, int y);
+
+namespace foo {
+ extern void MyFunction();
+}
+namespace bar {
+ extern void MyFunction();
+}