Log Message: Fix build under Mac OS X: - Properly instantiate required templates. - Properly detect some functions (such as strtoul). - Do not use unavailable Mach threads.