I have 4 files:
a.h:
typedef struct {
int a;
} A;
b.h:
#include "a.h"
typedef struct {
A a;
int b;
} B;
c.h:
#include "a.h"
typedef struct {
A a;
double c;
} C;
d.c:
#include "b.h"
#include "c.h"
//Here I want to use types A, B and C
int and double are only examples, the real problem I have is far more complex.
The point is that it should be possible to convert types B and C to A by simply casting to it.
The issue I´m fighting is that it says type A is included multiple times, which is comprehensible because d.c includes b.h which includes a.h, but a.h is also included by c.h.
Is there a way to do that?
a.h
b.h
c.h
d.c