changed uint and ulong to unsigned long and unsigned int because the OSX header files do not support this type