blob: 8264fe33b96416d3e5d4555545c67a33cdd66fa2 [file] [log] [blame]
Howard Hinnantc51e1022010-05-11 19:42:16 +00001// -*- C++ -*-
2//===---------------------------- ctime -----------------------------------===//
3//
Howard Hinnantc566dc32010-05-11 21:36:01 +00004// The LLVM Compiler Infrastructure
Howard Hinnantc51e1022010-05-11 19:42:16 +00005//
Howard Hinnantee11c312010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantc51e1022010-05-11 19:42:16 +00008//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CTIME
12#define _LIBCPP_CTIME
13
14/*
15 ctime synopsis
16
17Macros:
18
19 NULL
20 CLOCKS_PER_SEC
Marshall Clow8e632a92018-07-31 19:25:00 +000021 TIME_UTC // C++17
22
Howard Hinnantc51e1022010-05-11 19:42:16 +000023namespace std
24{
25
26Types:
27
28 clock_t
29 size_t
30 time_t
31 tm
Marshall Clow8e632a92018-07-31 19:25:00 +000032 timespec // C++17
33
Howard Hinnantc51e1022010-05-11 19:42:16 +000034clock_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);
Marshall Clow8e632a92018-07-31 19:25:00 +000044int timespec_get( struct timespec *ts, int base); // C++17
Howard Hinnantc51e1022010-05-11 19:42:16 +000045} // std
46
47*/
48
49#include <__config>
50#include <time.h>
51
Howard Hinnantaaaa52b2011-10-17 20:05:10 +000052#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Howard Hinnantc51e1022010-05-11 19:42:16 +000053#pragma GCC system_header
Howard Hinnantaaaa52b2011-10-17 20:05:10 +000054#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000055
56_LIBCPP_BEGIN_NAMESPACE_STD
57
58using ::clock_t;
59using ::size_t;
60using ::time_t;
61using ::tm;
Marshall Clow8e632a92018-07-31 19:25:00 +000062#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
63using ::timespec;
64#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000065using ::clock;
66using ::difftime;
67using ::mktime;
68using ::time;
Ed Schouten137c8632015-06-24 08:44:38 +000069#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
Howard Hinnantc51e1022010-05-11 19:42:16 +000070using ::asctime;
71using ::ctime;
72using ::gmtime;
73using ::localtime;
Ed Schouten137c8632015-06-24 08:44:38 +000074#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000075using ::strftime;
Marshall Clowa6a55a82018-08-15 21:19:08 +000076#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
Marshall Clow8e632a92018-07-31 19:25:00 +000077using ::timespec_get;
78#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000079
80_LIBCPP_END_NAMESPACE_STD
81
82#endif // _LIBCPP_CTIME