Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/thread/src/mac/os.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 967 bytes
Line 
1// (C) Copyright Mac Murrett 2001.
2// Use, modification and distribution are subject to the
3// Boost Software License, Version 1.0. (See accompanying file
4// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6// See http://www.boost.org for most recent version.
7
8#include "os.hpp"
9
10
11#include <cassert>
12
13#include <Gestalt.h>
14
15
16namespace boost {
17
18namespace threads {
19
20namespace mac {
21
22namespace os {
23
24
25// read the OS version from Gestalt
26static inline long get_version()
27{
28    long lVersion;
29    OSErr nErr = Gestalt(gestaltSystemVersion, &lVersion);
30    assert(nErr == noErr);
31    return(lVersion);
32}
33
34
35// check if we're running under Mac OS X and cache that information
36bool x()
37{
38    static bool bX = (version() >= 0x1000);
39    return(bX);
40}
41
42
43// read the OS version and cache it
44long version()
45{
46    static long lVersion = get_version();
47    return(lVersion);
48}
49
50
51} // namespace os
52
53} // namespace mac
54
55} // namespace threads
56
57} // namespace boost
Note: See TracBrowser for help on using the repository browser.