How do I typedef an implementation-defined struct in a generic header?
问题 I have a C project that is designed to be portable to various (PC and embedded) platforms. Application code will use various calls that will have platform-specific implementations, but share a common (generic) API to aid in portability. I'm trying to settle on the most appropriate way to declare the function prototypes and structures. Here's what I've come up with so far: main.c: #include "generic.h" int main (int argc, char *argv[]) { int ret; gen_t *data; ret = foo(data); ... } generic.h: