
Submitted by chemdog (Sun Feb 08 07:02:33 UTC 2004)
As a specific example, an OpenGL extension for Ruby has a straightforward mapping from it's C header files to its Ruby-in-C implementation file. The translated header file must be the same header file with which the extension will be compiled. An implementation might find the wrong header file of the right name.
def find_header(header, path = nil)
checking_for "Path of #{header}" do
path = (path || HEADER_SEARCH_PATH)
file = nil
path.each do |dir|
return file if FileTest.exists?(file = File.join(dir, header))
end
nil
end
end

| Comments | Current voting | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|


RCRchive copyright © David Alan Black, 2003-2005.
Powered by .
"find_header" will be merged in the CVS HEAD.
I think this kind of change request should be post to comp.lang.ruby, or ruby-talk mailing list. not to RCR, since this is not the language change.
-- matz.
Specifically for my machine here (WinXP), the HEADER_SEARCH_PATH should be, abbreviated,
Also, the same machine (cygwin), the HEADER_SEARCH_PATH should be, abbreviated,
Am I not sure how one would correct these situations. In neither case is the ENV perfectly accurate. In the former, everything in the DXSDK and OpenAL directories would be ignored, which would be devastating to anyone making a DirectX or OpenAL extension for Ruby. The PlatformSDK also contains previous versions of DirectX headers, bearing the same header file name as the DXSDK. Can the interpreter do any snooping to fix this?
-chemdog