boost_has_nanosleep.ipp 680 B

123456789101112131415161718192021222324252627282930313233343536
  1. // (C) Copyright John Maddock 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. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_HAS_NANOSLEEP
  7. // TITLE: nanosleep
  8. // DESCRIPTION: The platform supports POSIX API nanosleep.
  9. #include <time.h>
  10. namespace boost_has_nanosleep{
  11. void f()
  12. {
  13. // this is never called, it just has to compile:
  14. timespec ts = {0, 0};
  15. timespec rm;
  16. int res = nanosleep(&ts, &rm);
  17. (void) &res;
  18. }
  19. int test()
  20. {
  21. return 0;
  22. }
  23. }