Add some missing files (OUCH!), and initial cross-building support.
Also, use Windows' types for Windows builds, and better pointer to int conversion.