# HG changeset patch # User Jacob Carlborg # Date 1247174468 -7200 # Node ID 3592b41928fe085e07d9616036e8f2352fafa1cf # Parent 2c0fd7bb4de6e2158fa5014fcceaef8fc32e46ed Fixed: bindings were not generated diff -r 2c0fd7bb4de6 -r 3592b41928fe scripts/dgen.rb --- a/scripts/dgen.rb Thu Jul 09 22:16:40 2009 +0200 +++ b/scripts/dgen.rb Thu Jul 09 23:21:08 2009 +0200 @@ -309,8 +309,8 @@ file << copyright file << "module #{mod};" file << header.imports - file << "\n" unless @d_constants.length > 0 || @function_wrappers.length > 0 - file << "import bindings = #{mod}_bindings".nl.nl(false) if @d_constants.length > 0 || @function_wrappers.length > 0 + file << "\n" if header.d_constants.nil? || header.function_wrappers.nil? + file << "import bindings = #{mod}_bindings".nl.nl(false) unless header.d_constants.nil? || header.function_wrappers.nil? file << header.defines file << header.typedefs file << header.cftypes @@ -359,7 +359,7 @@ file << header.imports.nl(false) file << header.constants file << header.functions - end if @d_constants.length > 0 || @function_wrappers.length > 0 + end unless header.d_constants.nil? || header.function_wrappers.nil? end end @@ -376,8 +376,8 @@ file << copyright file << "module #{mod};" file << header.imports - file << "\n" unless @d_constants.length > 0 || @function_wrappers.length > 0 - file << "import bindings = #{mod}_bindings".nl.nl(false) if @d_constants.length > 0 || @function_wrappers.length > 0 + file << "\n" if header.d_constants.nil? || header.function_wrappers.nil? + file << "import bindings = #{mod}_bindings".nl.nl(false) unless header.d_constants.nil? || header.function_wrappers.nil? file << header.defines file << header.typedefs file << header.cftypes @@ -426,7 +426,7 @@ file << header.imports.nl(false) file << header.constants file << header.functions - end if @d_constants.length > 0 || @function_wrappers.length > 0 + end unless header.d_constants.nil? || header.function_wrappers.nil? end @classes.each do |clazz, value| @@ -1069,6 +1069,7 @@ index = 0 declaration = build_function(method, true, static)[0 ... -2].indent.nl(false) index = declaration.index_of(" ", index) + index = declaration.index_of(" ", index + 1) if static str << ((declaration[0 .. index] + get_method_name(method["selector"]) + declaration[index .. -1]).gsub(/ +/, " "))[0 .. -2] str << ";\n" end @@ -1196,6 +1197,7 @@ # def get_type (type, type64, declared_type) declared_type = "I" + $1 if declared_type =~ /\w+\s*<(.+)>/ + declared_type.gsub!(/\(|\)/, "") return get_identifier(declared_type) if type.nil? && type64.nil?