boost_has_clock_gettime.ipp 694 B

1234567891011121314151617181920212223242526272829303132333435
  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_CLOCK_GETTIME
  7. // TITLE: clock_gettime
  8. // DESCRIPTION: The platform supports POSIX standard API clock_gettime.
  9. #include <time.h>
  10. namespace boost_has_clock_gettime{
  11. void f()
  12. {
  13. // this is never called, it just has to compile:
  14. timespec tp;
  15. int res = clock_gettime(CLOCK_REALTIME, &tp);
  16. (void) &res;
  17. }
  18. int test()
  19. {
  20. return 0;
  21. }
  22. }