The easiest solution is not to use a struct to send data. Now that you've reminded me of some past work, one more excellent reason for not doing this is that you may not be sending the data which you think you are sending - for example:
Code:
struct blah{
int a;
char *a_string;
};
Now you allocate some memory, put in the string "blah blah blah - this won't work!" and assign that to 'a_string'. When you send the struct, you send the value of 'a' and the value (pointer) of 'a_string' when you probably really meant to send the string "blah blah blah - this won't work!"
So my opinion is that the *only* sensible way to avoid issues with compiler versions, padding, variable order, and so on is to write a routine which stuffs the data into an array of unsigned chars (or reads data out of such a string). It is up to you whether you consider the Endian order or not.