Giter Site home page Giter Site logo

va_list missing import about dstep HOT 3 OPEN

jamesmahler avatar jamesmahler commented on July 21, 2024
va_list missing import

from dstep.

Comments (3)

jacob-carlborg avatar jacob-carlborg commented on July 21, 2024

Currently there's a hardcoded list of C header files that dstep knows how to map to D files. The problem is there's a big chance a given symbol is not actually defined in any of these files but instead is defined in an internal header file, which will be different for different compilers and platforms. Then the internal files is included in one of the standard C header files.

I can take a look at this particular case. Do you have a code example I can use?

from dstep.

jamesmahler avatar jamesmahler commented on July 21, 2024

I don't seem to be able to recreate it with simple cases. Both of these work.

#include <stdarg.h>

void function(va_list args);

and

#include <stdarg.h>

struct Example {
        int (*Ex)(va_list args);
};

When running either of the above, I get the correct import

import core.stdc.stdarg;

however when running on a real file, I do not get that import.

The actual file I'm trying to do is jni.h. Not sure if that's the exact same file. Mine is from OpenJDK 1.7.0_65. If you look at the JNINativeInterface_ struct, that is where all the va_list references are.

from dstep.

jacob-carlborg avatar jacob-carlborg commented on July 21, 2024

I noticed that if I use an old version of libclang it will not have the file information of where va_list is declared. Then I tried a later version and the would properly include import core.stdc.stdarg; when running dub on jni.h.

So I guess it depends on which version of libclang you're using. Then one which worked for me was the one included in Xcode 6.1.1. That is libclang.dylib (compatibility version 1.0.0, current version 600.0.56). I guess this is an Apple version, I'm not sure which version of standard libclang this corresponds to.

from dstep.

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.