Move inlined code in .h to portability.c, fix performances issues in system_call, suppress #define madness for now