I would like to write a c++ wrapper for a C API. for this it is most convenient to just include the C-API header in my own header, but this also includes the header into the file of the outer system, that should not be exposed to the C-API.
capi.h
enum MyFlags {
MY_FLAG_A,
MY_FLAG_B,
};
void FOO_bar(int flags);
cppapi.hh
#include "capi.h"
enum class MyFlags {
A = MY_FLAG_A,
B = MY_FLAG_B
};
namespace foo {
void bar(MyFlags flags) {
FOO_bar((int)flags);
}
}
it is just to translate c naming convention into c++ language features. So when using the C++ variant of the language, I would like that the c_api is not available to my auto completion and therefore not accidently used.