From 5851026f744ddf2807f3eafa8c9341134ae7f4f2 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Fri, 11 Nov 2016 16:20:36 -0800 Subject: 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. --- tests/headers/overloading.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/headers/overloading.hpp (limited to 'tests/headers/overloading.hpp') 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(); +} -- cgit v1.2.3