You can just use a union for your two different structs and then pass the union:
struct AND_gate {
// ...
};
struct OR_gate {
// ...
};
union gate {
AND_gate and_gate;
OR_gate or_gate;
};
int myfunc(gate * my_gate, unsigned char param)
{
// ...
}
Alternatively, and perhaps better (hard to tell with the limited information available), it sounds like your design might benefit from using inheritance:
struct gate { // parent class
// ...
};
struct AND_gate: public gate {
// ...
};
struct OR_gate: public gate {
// ...
};
int myfunc(gate * my_gate, unsigned char param)
{
// ...
}