blob: cb8474f8f0b5c81495f6575c5fb36453cdafbc9c [file] [log] [blame]
Howard Hinnantc51e1022010-05-11 19:42:16 +00001// -*- C++ -*-
2//===---------------------------- ctime -----------------------------------===//
3//
Chandler Carruthd2012102019-01-19 10:56:40 +00004// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Howard Hinnantc51e1022010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_CTIME
11#define _LIBCPP_CTIME
12
13/*
14 ctime synopsis
15
16Macros:
17
18 NULL
19 CLOCKS_PER_SEC
Marshall Clow8e632a92018-07-31 19:25:00 +000020 TIME_UTC // C++17
21
Howard Hinnantc51e1022010-05-11 19:42:16 +000022namespace std
23{
24
25Types:
26
27 clock_t
28 size_t
29 time_t
30 tm
Marshall Clow8e632a92018-07-31 19:25:00 +000031 timespec // C++17
32
Howard Hinnantc51e1022010-05-11 19:42:16 +000033clock_t clock();
34double difftime(time_t time1, time_t time0);
35time_t mktime(tm* timeptr);
36time_t time(time_t* timer);
37char* asctime(const tm* timeptr);
38char* ctime(const time_t* timer);
39tm* gmtime(const time_t* timer);
40tm* localtime(const time_t* timer);
41size_t strftime(char* restrict s, size_t maxsize, const char* restrict format,
42 const tm* restrict timeptr);
Marshall Clow8e632a92018-07-31 19:25:00 +000043int timespec_get( struct timespec *ts, int base); // C++17
Howard Hinnantc51e1022010-05-11 19:42:16 +000044} // std
45
46*/
47
48#include <__config>
49#include <time.h>
50
Howard Hinnantaaaa52b2011-10-17 20:05:10 +000051#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Howard Hinnantc51e1022010-05-11 19:42:16 +000052#pragma GCC system_header
Howard Hinnantaaaa52b2011-10-17 20:05:10 +000053#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000054
55_LIBCPP_BEGIN_NAMESPACE_STD
56
57using ::clock_t;
58using ::size_t;
59using ::time_t;
60using ::tm;
Marshall Clow8e632a92018-07-31 19:25:00 +000061#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
62using ::timespec;
63#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000064using ::clock;
65using ::difftime;
66using ::mktime;
67using ::time;
Ed Schouten137c8632015-06-24 08:44:38 +000068#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
Howard Hinnantc51e1022010-05-11 19:42:16 +000069using ::asctime;
70using ::ctime;
71using ::gmtime;
72using ::localtime;
Ed Schouten137c8632015-06-24 08:44:38 +000073#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000074using ::strftime;
Marshall Clowa6a55a82018-08-15 21:19:08 +000075#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
Marshall Clow8e632a92018-07-31 19:25:00 +000076using ::timespec_get;
77#endif
Howard Hinnantc51e1022010-05-11 19:42:16 +000078
79_LIBCPP_END_NAMESPACE_STD
80
81#endif // _LIBCPP_CTIME