ctime 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // -*- C++ -*-
  2. //===---------------------------- ctime -----------------------------------===//
  3. //
  4. // The LLVM Compiler Infrastructure
  5. //
  6. // This file is dual licensed under the MIT and the University of Illinois Open
  7. // Source Licenses. See LICENSE.TXT for details.
  8. //
  9. //===----------------------------------------------------------------------===//
  10. #ifndef _LIBCPP_CTIME
  11. #define _LIBCPP_CTIME
  12. /*
  13. ctime synopsis
  14. Macros:
  15. NULL
  16. CLOCKS_PER_SEC
  17. namespace std
  18. {
  19. Types:
  20. clock_t
  21. size_t
  22. time_t
  23. tm
  24. clock_t clock();
  25. double difftime(time_t time1, time_t time0);
  26. time_t mktime(tm* timeptr);
  27. time_t time(time_t* timer);
  28. char* asctime(const tm* timeptr);
  29. char* ctime(const time_t* timer);
  30. tm* gmtime(const time_t* timer);
  31. tm* localtime(const time_t* timer);
  32. size_t strftime(char* restrict s, size_t maxsize, const char* restrict format,
  33. const tm* restrict timeptr);
  34. } // std
  35. */
  36. #include <__config>
  37. #include <time.h>
  38. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  39. #pragma GCC system_header
  40. #endif
  41. _LIBCPP_BEGIN_NAMESPACE_STD
  42. using ::clock_t;
  43. using ::size_t;
  44. using ::time_t;
  45. using ::tm;
  46. #if !defined(_LIBCPP_SGX_CONFIG)
  47. using ::clock;
  48. #endif // !defined(_LIBCPP_SGX_CONFIG)
  49. using ::difftime;
  50. #if !defined(_LIBCPP_SGX_CONFIG)
  51. using ::mktime;
  52. using ::time;
  53. #endif // !defined(_LIBCPP_SGX_CONFIG)
  54. #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
  55. using ::asctime;
  56. #if !defined(_LIBCPP_SGX_CONFIG)
  57. using ::ctime;
  58. using ::gmtime;
  59. using ::localtime;
  60. #endif // !defined(_LIBCPP_SGX_CONFIG)
  61. #endif
  62. using ::strftime;
  63. _LIBCPP_END_NAMESPACE_STD
  64. #endif // _LIBCPP_CTIME