ghazel-ffi_gen 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ffi_gen/java_output.rb +9 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 814f926f32ab7a8092edafb03d11e41677c4fd30
4
- data.tar.gz: 7c9df589bfc4da60582ffab234441e187445cbae
3
+ metadata.gz: 905c48454a26dbe7f5ccf7b1628ad0101f93c9a4
4
+ data.tar.gz: c56b7b4397a850020c2791d1db5fcecfcda3a6cf
5
5
  SHA512:
6
- metadata.gz: 58190d289a912053875897844067f69e4b4f6c5b9f106ebdf291784caa688c7730fdc830fd69e7c8d7f1c1846e59c77a02aacec087b5bc4bcbf1e19ba018e193
7
- data.tar.gz: 1ec94347d53eeb823c57a1bf112b23e67edf0632cc6272a0a73bdc6e6f21ec9be1f9e109e7114e932bc8ae8bcb4f757cda3ff482ec27cae0bd9b5a9e3736c2c7
6
+ metadata.gz: 5202d969e6113cfccb7eee7d5b2962b93f52a882119b0d3bbcf83e6b7cd8f20183db482484690392d1efbe6466cc576f308651c089cff3a0e976edbe9914d7ec
7
+ data.tar.gz: 68882a7d939d360f06df65c4d0b52f9e5457337576adf6fdc43615b01977d4a1cdd98ede7e8846d003ba381d4d5c89fb24abaac3dd6759361b777ace0a7fbefc
@@ -152,20 +152,22 @@ class FFIGen
152
152
 
153
153
  class FunctionOrCallback
154
154
  def write_java(writer)
155
+ return if @is_callback # static only
156
+
155
157
  jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
158
+ writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
159
+ end
160
+
161
+ def write_static_java(writer)
156
162
  if @is_callback
157
163
  writer.puts "public static interface #{java_name} extends Callback {"
158
164
  writer.indent do
165
+ jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
159
166
  writer.puts "#{@return_type.java_jna_type} invoke(#{jna_signature});"
160
167
  end
161
- writer.puts "}"
162
- else
163
- writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
168
+ writer.puts "}", ""
169
+ return
164
170
  end
165
- end
166
-
167
- def write_static_java(writer)
168
- return if @is_callback # not yet supported
169
171
 
170
172
  replace = {}
171
173
  parameters = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghazel-ffi_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Musiol