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
mention that PWSTR
and PSTR
are strings
#589
Comments
That probably can't be avoided. Nothing against annotating If there's an annotation to be interoduced you need to chose the semantic of being a "string-like type" very carefully for it to have any value, otherwise it provides no gain if you still have to differentiate between the different string-like types in the projection anyways. |
Right. This doesn't need to be a single piece of metadata. I think it would be useful to know information about the expected string, like whether it's null-terminated, its encoding, etc... |
Since I think these are the only 2 types the metadata uses to represent strings (i.e. pointers to null-terminated character arrays), I don't see a benefit to creating new attribute for this. Unless there are more types that would use these new attributes? Otherwise, checking for the specially named types |
@sotteson1 @kennykerr what are your thoughts on this? If WinRT is using ELEMENT_TYPE_STRING, should we be using it here? |
That is already used by WinRT to represent HSTRING so that would be incompatible with language projections that support both WinRT and Win32. What we have now is a reasonable compromise to support both. |
BSTR is one such example, right?
Ok. Is this a Won't Fix? Or is there anything we can/should do here? |
We already have types for PSTR, PWSTR, BSTR, and so on. I don't there's anything to do here. Language projections must deal with these "well-known" types. |
PWSTR
andPSTR
areuint16_t*
. Is it possible to extend the metadata with info that they are string-like?@tdakkota notes in golang/go#43838 (comment) that setting a
TypeAttribute
ofAnsiClass
/UnicodeClass
or giving itELEMENT_TYPE_STRING
are possibilities.Currently,
windows-rs
andzigwin32gen
maintain a list of well-known types to deal with these.The text was updated successfully, but these errors were encountered: