Apply compatibility changes from MRP and Da Feng in preparation for x64 support

Description

This issue tracks the compatibility changes from Da Feng's x64 patch set as well as some wordsize fixes that I extracted from the other patches of the patch set.

We will need to search MRP's commit history for each change in order to determine who to credit.

Environment

IA32 x64

Assignee

Erik Brangs

Reporter

Erik Brangs

Labels

None

Fix versions

Affects versions

Priority

Medium
Configure