diff --git a/build/Helpers.lua b/build/Helpers.lua index e2f3d278..bf9db600 100644 --- a/build/Helpers.lua +++ b/build/Helpers.lua @@ -24,13 +24,11 @@ gcc_buildflags = { "-std=c++11" } msvc_cpp_defines = { } function os.is_osx() - local version = os.getversion() - return string.find(version.description, "Mac OS X") ~= nil + return os.is("macosx") end function os.is_windows() - local version = os.getversion() - return string.find(version.description, "Windows") ~= nil + return os.is("windows") end function string.starts(str, start) @@ -95,4 +93,4 @@ function IncludeDir(dir) include(dep) end end -end \ No newline at end of file +end diff --git a/src/Generator/Passes/CheckDuplicatedNamesPass.cs b/src/Generator/Passes/CheckDuplicatedNamesPass.cs index 9683fb82..0e626b55 100644 --- a/src/Generator/Passes/CheckDuplicatedNamesPass.cs +++ b/src/Generator/Passes/CheckDuplicatedNamesPass.cs @@ -50,7 +50,14 @@ namespace CppSharp.Passes { var @params = function.Parameters.Where(p => p.Kind != ParameterKind.IndirectReturnType) .Select(p => p.QualifiedType.ToString()); - var signature = string.Format("{0}({1})", Name,string.Join( ", ", @params)); + // Include the conversion type in case of conversion operators + var method = function as Method; + if (method != null && + method.IsOperator && + (method.OperatorKind == CXXOperatorKind.Conversion || + method.OperatorKind == CXXOperatorKind.ExplicitConversion)) + @params = @params.Concat(new[] { method.ConversionType.ToString() }); + var signature = string.Format("{0}({1})", Name, string.Join( ", ", @params)); if (Count == 0) Count++; @@ -66,8 +73,6 @@ namespace CppSharp.Passes if (Count < methodCount+1) Count = methodCount+1; - var method = function as Method; - if (function.IsOperator) { // TODO: turn into a method; append the original type (say, "signed long") of the last parameter to the type so that the user knows which overload is called