-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix copy# for Microsoft C compiler #353
Conversation
src/path.ml
Outdated
let l = String.length t' in | ||
String.sub t ~pos:l ~len:(String.length t - l) | ||
with Not_found -> | ||
"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use Filename.extension
from Import
here instead of writing your own function. Or just not have a wrapper at all. Your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hackathon wine had clearly got to me by that point, and I forgot that Filename
is extended in import.ml
. I've renamed it to extension
as an alias (I prefer to have the extra function, because then you don't have to cast the path itself to a string in order to use Filename.extension
)
Also, would you mind updating the copy-files blackbox tests with this? I don't think you have to build any C stubs btw, just depend on the target C source and make sure that the directives are correct. |
That seems to exercise it - how does that look to you @rgrinberg? |
Microsoft CL doesn't support #n and requires the more strictly correct directive #line Signed-off-by: David Allsopp <[email protected]>
Tests that the the directive emits #line instead of #n. Signed-off-by: David Allsopp <[email protected]>
@dra27 Almost. I've improved the test further so that we actually track that the copied file has the necessary line. Feel free to merge if you find this acceptable. |
Good change, thanks! |
Microsoft CL doesn't support
#n
and requires the more strictly correct directive#line
. I've done this by changing the behaviour ofcopy#
depending on the file extension.