Skip to content
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 samples/winsamp.d so it compiles #6698

Merged
merged 1 commit into from Apr 14, 2017

Conversation

WalterBright
Copy link
Member

Changed it to use all 'W' functions.

@WalterBright
Copy link
Member Author

@rainers
Copy link
Member

rainers commented Apr 14, 2017

Technically correct, but using wstring.ptr might not be the best for an example that needs zero-terminated strings (these exist here as only literals are assigned). toUTF16z might be added in another pass.

@dlang-bot dlang-bot merged commit 1767fab into dlang:master Apr 14, 2017
@WalterBright
Copy link
Member Author

String literals are guaranteed to be 0-terminated, I think it would confuse things if an extra allocate-copy was inserted.

That said, much of the sample code is old fashioned and/or inefficient. Rethinking what is there would be useful. But this pass was only about fixing the regression.

Also, this little sample is only about "how do I make a Windows GUI app with D" with as small a program as practical, because it is more about the mechanics of that than about what is good D code.

What broke it was the windows import files changed the default from 'A' to 'W'.

@WalterBright WalterBright deleted the fix-winsamp branch April 14, 2017 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants