Skip to content

Comments

Fix FFIGenerate#7

Open
davispuh wants to merge 1 commit intoMVV90:mainfrom
davispuh:fix
Open

Fix FFIGenerate#7
davispuh wants to merge 1 commit intoMVV90:mainfrom
davispuh:fix

Conversation

@davispuh
Copy link

@davispuh davispuh commented Feb 2, 2026

Currently FFIGenerate doesn't work.
There's 3 issues:

  1. ffi_generator.gemspec adds lib/ffi_generator/empty.h file but it's not present
  2. lib/ffi_generator/clang/translation_unit.rb tries to use lib/ffi_generator/clang/empty.h which doesn't exist
  3. ffi_generator/clang/c is imported first which tries to create FFIGenerate::Clang::C before FFIGenerate::Clang has been created.

This PR fixes all these issues.

Copilot AI review requested due to automatic review settings February 2, 2026 12:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes three critical bugs preventing FFIGenerate from working: a missing empty.h file, an incorrect file path, and a module loading order issue.

Changes:

  • Added the missing lib/ffi_generator/empty.h file that was referenced in the gemspec
  • Fixed the path to empty.h in translation_unit.rb from ./empty.h to ../empty.h
  • Pre-defined FFIGenerate::Clang module to prevent NameError when loading nested module FFIGenerate::Clang::C

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
lib/ffi_generator/empty.h Added missing empty header file required by gemspec and translation unit parser
lib/ffi_generator/clang/translation_unit.rb Corrected path to empty.h from clang subdirectory to parent directory
lib/ffi_generator.rb Pre-defined module hierarchy to prevent loading errors with nested module syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant