lib/ffi/clang/file.rb in ffi-clang-0.3.0 vs lib/ffi/clang/file.rb in ffi-clang-0.5.0
- old
+ new
@@ -16,26 +16,23 @@
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require 'ffi/clang/lib/file'
-require 'ffi/clang/utils'
+require_relative 'lib/file'
module FFI
module Clang
class File < Pointer
attr_reader :translation_unit
- def initialize(pointer, tu)
+ def initialize(pointer, translation_unit)
super pointer
- @translation_unit = tu
+ @translation_unit = translation_unit
- if FFI::Clang::Utils.satisfy_version?('3.3')
- pointer = MemoryPointer.new(Lib::CXFileUniqueID)
- Lib.get_file_unique_id(self, pointer)
- @unique_id = Lib::CXFileUniqueID.new(pointer)
- end
+ pointer = MemoryPointer.new(Lib::CXFileUniqueID)
+ Lib.get_file_unique_id(self, pointer)
+ @unique_id = Lib::CXFileUniqueID.new(pointer)
end
def to_s
name
end