Get rid of header1.h
and do
#pragma pack(push, 4)
struct my_struct
{
unsigned int a;
double b;
};
#pragma pack(pop)
Without this, having the packing done via a separate header will lead to confusions, when it's added in one TU while not in another TU.