Just to go sure, your source implemented in mine above...
should look like this:
#define clone_struct( source, type ) memcpy( sys_alloc( sizeof( type ) ), source, sizeof( type ) )
function demonstration(ANY_STRUCT* temp_my_own_struct) {
ANY_STRUCT* temp_my_own_struct = sys_alloc( sizeof( ANY_STRUCT ) );
ANY_STRUCT* my_own_struct = clone_struct( temp_my_own_struct, ANY_STRUCT );
...
my_own_struct.x = 37; // do whatever I want with it, nobody cares!
...
}
...
ANY_STRUCT struct_for_everyone;
struct_for_everyone.x = 1;
demonstration(struct_for_everyone);
...
Okay, I'm going to test it... even I'm still not happy about that quite long solution... maybe I'll write a specific function/define for the struct.
Or does anybody know a more professional way?