-
Notifications
You must be signed in to change notification settings - Fork 43
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
Can't access CFString
declaration
#1548
Comments
The usual fix for this is to add a rename rule: structs:
rename:
# Removes prefix underscores
# from all structures.
'_(.*)': '$1'
member-rename:
'.*': # Matches any struct.
# Removes prefix underscores
# from members.
'_(.*)': '$1' I guess we could add a default rename rule for this, if none are specified. That might be more confusing for users though. |
More confusing that generating public APIs that use file-internal types? That seems very unlikely to me. Also, nobody writes |
Related: #1551 I decided to prepend them with a dollar sign to make these identifiers public instead. It has the advantage of not colliding with an existing identifier. |
Even if there's some more generic solution, I still think we should special-case CFString as it's a pretty common type. There shouldn't be any risk of collision, because |
If you add |
I didn't realize I hadn't replied to this; I would definitely suggest we include it in |
The underlying type of
CFStringRef
isstruct __CFString
, and that's what ffigen is using as-is. Since it starts with_
, it's private to the generated file, so it can't be used, even though it's part of the return type of some things it generates. E.g.:Maybe that should be automatically changed to
CFStringRef
by the generator?The text was updated successfully, but these errors were encountered: