I'm trying to build a 3rd party library which has a function defined in the public header as such
void reset(void* instance);
And in the implementation
void reset(instance_type* instance) {
...
}
And I'm getting a conflicting types compiler error. Now this seems obvious why to me on the surface. The author was using MSVC and I'm using gcc set to C99 standard - maybe that's why it worked on the authors machine? What's the minimal modification I can make to get this to build under the constraint that I don't want to expose the instance_type
through the public interface?
What's the minimal modification I can make to get this to build under the constraint that I don't want to expose the
instance_type
through the public interface?
It is necessary for the definition to agree with the declaration in the header. If you don't want to expose instance_type
in the public API, then that means modifying the definition to match the header:
void reset(void* _instance) {
instance_type* instance = _instance;
...
}
Cool - that was my suggestion to @ThomasJager in the thread under the original question