Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NameError: uninitialized constant Fiddle::CParser::TYPE_SIZE_T #5955

@ankane

Description

@ankane

Hi, I'm running into an error with fiddle with the latest JRuby on MacOS 10.14.6 (may affect other platforms as well).

Environment

  • jruby 9.2.8.0 (2.5.3) 2019-08-12 a1ac7ff Java HotSpot(TM) 64-Bit Server VM 25.192-b12 on 1.8.0_192-b12 +jit [darwin-x86_64]

Expected Behavior

No error when size_t is used. Here's a simple script to reproduce:

require "fiddle/import"

module Hello
  extend Fiddle::Importer
  dlload "libc.dylib" # change extension on other platforms
  extern "size_t puts(char* str)"
end

(this is not the actual interface for puts but works for demonstration)

Actual Behavior

Raises

NameError: uninitialized constant Fiddle::CParser::TYPE_SIZE_T
Did you mean?  Fiddle::TYPE_INT
    const_missing at org/jruby/RubyModule.java:3746
      parse_ctype at /Users/andrew/.rbenv/versions/jruby-9.2.8.0/lib/ruby/stdlib/fiddle/cparser.rb:164
  parse_signature at /Users/andrew/.rbenv/versions/jruby-9.2.8.0/lib/ruby/stdlib/fiddle/cparser.rb:92
           extern at /Users/andrew/.rbenv/versions/jruby-9.2.8.0/lib/ruby/stdlib/fiddle/import.rb:166
    <class:Hello> at repro.rb:6
           <main> at repro.rb:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions