Browse Source

Merge remote-tracking branch 'origin/HEAD' into fix_linking_with_clang_libs

* origin/HEAD:
  Fixed the duplicated names pass check for conversion operators.
  Fix osx detection, we do not parse result of os.getversion() in premake (seems it return something strange). Instead use internal os detection in premake.
pull/235/head
Vladimir Timofeev 12 years ago
parent
commit
6573e1d6b2
  1. 6
      build/Helpers.lua
  2. 9
      src/Generator/Passes/CheckDuplicatedNamesPass.cs

6
build/Helpers.lua

@ -24,13 +24,11 @@ gcc_buildflags = { "-std=c++11" } @@ -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)

9
src/Generator/Passes/CheckDuplicatedNamesPass.cs

@ -50,6 +50,13 @@ namespace CppSharp.Passes @@ -50,6 +50,13 @@ namespace CppSharp.Passes
{
var @params = function.Parameters.Where(p => p.Kind != ParameterKind.IndirectReturnType)
.Select(p => p.QualifiedType.ToString());
// 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)
@ -66,8 +73,6 @@ namespace CppSharp.Passes @@ -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

Loading…
Cancel
Save