Files
textmate/Shared/include/oak/compat.h
Allan Odgaard 398e55cdbe Add helper functions to get OS version
We need this in a few places and while calling Gestalt() isn’t that much code, that function is deprecated in 10.8 and the alternative is a lot more code, so we don’t want to repeat that once we update the code.
2013-03-17 15:44:06 +01:00

25 lines
573 B
C++

#ifndef COMPAT_H_RD1Z6YZA
#define COMPAT_H_RD1Z6YZA
namespace oak
{
inline void set_thread_name (char const* threadName)
{
pthread_setname_np(threadName);
}
inline size_t get_gestalt (OSType selector)
{
SInt32 res;
Gestalt(selector, &res);
return res;
}
inline size_t os_major () { return get_gestalt(gestaltSystemVersionMajor); }
inline size_t os_minor () { return get_gestalt(gestaltSystemVersionMinor); }
inline size_t os_patch () { return get_gestalt(gestaltSystemVersionBugFix); }
} /* oak */
#endif /* end of include guard: COMPAT_H_RD1Z6YZA */