| 1 |
#include <boost/filesystem.hpp> |
| 2 |
#include <boost/thread.hpp> |
| 3 |
|
| 4 |
namespace { |
| 5 |
|
| 6 |
boost::mutex m1; |
| 7 |
boost::recursive_mutex m2; |
| 8 |
|
| 9 |
void threadmain() |
| 10 |
{ |
| 11 |
boost::lock_guard<boost::mutex> lock1(m1); |
| 12 |
boost::lock_guard<boost::recursive_mutex> lock2(m2); |
| 13 |
|
| 14 |
boost::filesystem::path p(boost::filesystem::current_path()); |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
int main() |
| 19 |
{ |
| 20 |
boost::thread foo(threadmain); |
| 21 |
foo.join(); |
| 22 |
|
| 23 |
int version = BOOST_VERSION; |
| 24 |
int major = version / 100000; |
| 25 |
int minor = version / 100 % 1000; |
| 26 |
int patch = version % 100; |
| 27 |
char version_string[100]; |
| 28 |
snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor, |
| 29 |
patch); |
| 30 |
printf("Found Boost version %s, expected version %s\n", version_string, |
| 31 |
CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS); |
| 32 |
int ret = strcmp(version_string, CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS); |
| 33 |
char raw_version_string[100]; |
| 34 |
snprintf(raw_version_string, sizeof(raw_version_string), "%d", |
| 35 |
BOOST_VERSION); |
| 36 |
printf("Found Boost version %s, expected version %s\n", raw_version_string, |
| 37 |
CMAKE_EXPECTED_BOOST_VERSION); |
| 38 |
return ret | strcmp(raw_version_string, CMAKE_EXPECTED_BOOST_VERSION); |
| 39 |
} |