www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - ImportC, Dub and Static inline

reply Sergey <kornburn yandex.ru> writes:
Any automatic way to make C library with "static inline" 
functions working automatically within dub library?
Feb 22
next sibling parent Anton Pastukhov <mail anton9.com> writes:
On Sunday, 22 February 2026 at 22:37:13 UTC, Sergey wrote:
 Any automatic way to make C library with "static inline" 
 functions working automatically within dub library?
Also curious. Tried it with Chipmunk2D, but it won't work without special massage, which feels like... writing bindings. The thing ImportC is ought to solve
Mar 05
prev sibling parent reply libxmoc <libxmoc gmail.com> writes:
On Sunday, 22 February 2026 at 22:37:13 UTC, Sergey wrote:
 Any automatic way to make C library with "static inline" 
 functions working automatically within dub library?
Have you tried "sourceLibrary" target type as workaround?
Mar 05
parent reply Serg Gini <kornburn yandex.ru> writes:
On Thursday, 5 March 2026 at 19:07:05 UTC, libxmoc wrote:
 On Sunday, 22 February 2026 at 22:37:13 UTC, Sergey wrote:
 Any automatic way to make C library with "static inline" 
 functions working automatically within dub library?
Have you tried "sourceLibrary" target type as workaround?
Yes, and cSourceLibrary. The issue is that in the final .so/.dylib such methods are not presented For my case I had to do this semi-manually now: I've extracted all such functions and run `ctod` for them and then fix some small parts manually.
Mar 06
parent Jean-Philippe <davidjenkins7473 gmail.com> writes:
On Friday, 6 March 2026 at 08:48:43 UTC, Serg Gini wrote:
 On Thursday, 5 March 2026 at 19:07:05 UTC, libxmoc wrote:
 On Sunday, 22 February 2026 at 22:37:13 UTC, Sergey wrote:
 Any automatic way to make C library with "static inline" 
 functions working automatically within dub library?
Have you tried "sourceLibrary" target type as workaround?
Yes, and cSourceLibrary. The issue is that in the final .so/.dylib such methods are not presented For my case I had to do this semi-manually now: I've extracted all such functions and run `ctod` for them and then fix some small parts manually.
Yes, that makes sense. If the methods aren’t exposed in the final .so/.dylib, handling them semi-manually is often the only practical workaround. Extracting the functions, running ctod, and then fixing the remaining parts manually sounds like a reasonable approach for now.
Mar 09