• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
11#ifndef _LIBCPP_CTIME
12#define _LIBCPP_CTIME
13
14/*
15    ctime synopsis
16
17Macros:
18
19    NULL
20    CLOCKS_PER_SEC
21    TIME_UTC // C++17
22
23namespace std
24{
25
26Types:
27
28    clock_t
29    size_t
30    time_t
31    tm
32    timespec // C++17
33
34clock_t clock();
35double difftime(time_t time1, time_t time0);
36time_t mktime(tm* timeptr);
37time_t time(time_t* timer);
38char* asctime(const tm* timeptr);
39char* ctime(const time_t* timer);
40tm*    gmtime(const time_t* timer);
41tm* localtime(const time_t* timer);
42size_t strftime(char* restrict s, size_t maxsize, const char* restrict format,
43                const tm* restrict timeptr);
44int timespec_get( struct timespec *ts, int base); // C++17
45}  // std
46
47*/
48
49#include <__config>
50#include <time.h>
51
52#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
53#pragma GCC system_header
54#endif
55
56_LIBCPP_BEGIN_NAMESPACE_STD
57
58using ::clock_t;
59using ::size_t;
60using ::time_t;
61using ::tm;
62#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
63using ::timespec;
64#endif
65using ::clock;
66using ::difftime;
67using ::mktime;
68using ::time;
69#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
70using ::asctime;
71using ::ctime;
72using ::gmtime;
73using ::localtime;
74#endif
75using ::strftime;
76#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
77using ::timespec_get;
78#endif
79
80_LIBCPP_END_NAMESPACE_STD
81
82#endif  // _LIBCPP_CTIME
83