I am looking for a way to automatically create a header file. This file is the public interface of the library, and I want to "fill in" some structures and materials before compilation.
For example, in a closed header, I have a structure with useful fields:
typedef struct mystuff_attr_t {
int _detachstate;
mystuff_scope_t _scope;
cpu_set_t _cpuset;
size_t _stacksize;
void* _stackaddr;
} mystuff_attr_t;
And I would like to have this structure in a public header with no fields, but with the same size (currently executed manually) as follows:
typedef struct mystuff_attr_t {
char _opaque[ 20 ];
} mystuff_attr_t;
I would like this to be automatically generated by CMake when creating the build system in order to avoid the poor size structure in the open interface when I change the structure in the closed header.
source
share