Skip to content

Conversation

@MichaelChirico
Copy link
Contributor

R-exts: https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Creating-shared-objects-1

Follows r-lib/xml2#473 and Rdatatable/data.table#7607.

As noted there, it's not clear this is really needed, but it does follow the practice of other packages like {Matrix}, and signals clear intent.


I got here looking around at r-lib repos with $(C_VISIBILITY) declarations; I would add the equivalent file to all those repos if we think it's not a waste of time :)

https://github.com/search?q=org%3Ar-lib+%2F%5B%24%5D%5B%28%5DC_VISIBILITY%2F&type=code

@lionel-
Copy link
Member

lionel- commented Jan 26, 2026

So the presence of the .def file allows proper visibility handling (e.g. hidden by default except for explicit exports) without setting the visibility flags?

@MichaelChirico
Copy link
Contributor Author

Per Ivan's comment, it seems the visibility flags don't WAI on Windows?

Rdatatable/data.table#7607 (comment)

I also don't have a Windows machine to test, but if you have one, examine objdump.exe on the rlang.dll, my inference is it will show many objects, whereas the intent of the code as written was to only show one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants