Giter Club home page Giter Club logo

Comments (7)

yuyichao avatar yuyichao commented on June 5, 2024 1

static aren't private in that the function isn't intended to be used by the user. It just mean that the function won't be part of the ABI of the library but is otherwise fully usable by the user.

Using that, however, always require the equivalence of a C compiler, and that's not in the current scope of Clang.jl.

from clang.jl.

victorsndvg avatar victorsndvg commented on June 5, 2024

HI @ihnorton ,

any news on this?

I would like to automatically wrap some headers that contain static inline functions and I don't know where to start. Now I'm checked if isinlined() to ignore them ... but is not what I want.

How can I deal with static inline functions? are currently supported?

Thanks in advance!

from clang.jl.

Gnimuc avatar Gnimuc commented on June 5, 2024

@victorsndvg wrapping C++ libraries are not supported, please try Cxx.jl(only support Julia-v1.3- for now) instead.

from clang.jl.

victorsndvg avatar victorsndvg commented on June 5, 2024

@Gnimuc , in thiscase I'm dealing with a C library with inlined functions, not C++ library.

Such functions are inlined and implemented in headers, see the example hear:
https://github.com/cburstedde/libsc/blob/7089d44934f34b60d6f63dded2cf774eebbfe1c9/src/sc_containers.h#L458

The compiled library does not contain those symbols. How can I call them or wrapp them from julia? is it possible?

from clang.jl.

Gnimuc avatar Gnimuc commented on June 5, 2024

In C, static marks that function to be "private", which means the library author doesn't allow users to use it intentionally. If you'd like to walk around that, I think you could always add a wrapper C function with the same signature and recompile.

For this particular function, it looks like it just does some basic pointer arithmetics, maybe you could use Julia's unsafe_load/unsafe_wrap to implement the same functionality.

from clang.jl.

victorsndvg avatar victorsndvg commented on June 5, 2024

Ok @Gnimuc , I think I caught how to deal with it.

Thanks for your quick response. It has been very helpful!

from clang.jl.

victorsndvg avatar victorsndvg commented on June 5, 2024

Yeah, I understand @yuyichao .

Then I would like to know whether a declaration is static or not from Clang.jl, is this possible?
I can check if it isinlined, but I don't see any function similar to isstatic.

Very helpful.
Thanks in advance!

from clang.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.