2010-05-12 03:42:16 +08:00
|
|
|
// -*- C++ -*-
|
|
|
|
//===---------------------------- ctime -----------------------------------===//
|
|
|
|
//
|
2010-05-12 05:36:01 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-12 03:42:16 +08:00
|
|
|
//
|
2010-11-17 06:09:02 +08:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-12 03:42:16 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef _LIBCPP_CTIME
|
|
|
|
#define _LIBCPP_CTIME
|
|
|
|
|
|
|
|
/*
|
|
|
|
ctime synopsis
|
|
|
|
|
|
|
|
Macros:
|
|
|
|
|
|
|
|
NULL
|
|
|
|
CLOCKS_PER_SEC
|
2018-08-01 03:25:00 +08:00
|
|
|
TIME_UTC // C++17
|
|
|
|
|
2010-05-12 03:42:16 +08:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
|
|
|
|
Types:
|
|
|
|
|
|
|
|
clock_t
|
|
|
|
size_t
|
|
|
|
time_t
|
|
|
|
tm
|
2018-08-01 03:25:00 +08:00
|
|
|
timespec // C++17
|
|
|
|
|
2010-05-12 03:42:16 +08:00
|
|
|
clock_t clock();
|
|
|
|
double difftime(time_t time1, time_t time0);
|
|
|
|
time_t mktime(tm* timeptr);
|
|
|
|
time_t time(time_t* timer);
|
|
|
|
char* asctime(const tm* timeptr);
|
|
|
|
char* ctime(const time_t* timer);
|
|
|
|
tm* gmtime(const time_t* timer);
|
|
|
|
tm* localtime(const time_t* timer);
|
|
|
|
size_t strftime(char* restrict s, size_t maxsize, const char* restrict format,
|
|
|
|
const tm* restrict timeptr);
|
2018-08-01 03:25:00 +08:00
|
|
|
int timespec_get( struct timespec *ts, int base); // C++17
|
2010-05-12 03:42:16 +08:00
|
|
|
} // std
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <__config>
|
|
|
|
#include <time.h>
|
|
|
|
|
2011-10-18 04:05:10 +08:00
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
2010-05-12 03:42:16 +08:00
|
|
|
#pragma GCC system_header
|
2011-10-18 04:05:10 +08:00
|
|
|
#endif
|
2010-05-12 03:42:16 +08:00
|
|
|
|
|
|
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
|
|
|
|
|
|
using ::clock_t;
|
|
|
|
using ::size_t;
|
|
|
|
using ::time_t;
|
|
|
|
using ::tm;
|
2018-08-01 03:25:00 +08:00
|
|
|
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
|
|
|
|
using ::timespec;
|
|
|
|
#endif
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::clock;
|
|
|
|
using ::difftime;
|
|
|
|
using ::mktime;
|
|
|
|
using ::time;
|
2015-06-24 16:44:38 +08:00
|
|
|
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::asctime;
|
|
|
|
using ::ctime;
|
|
|
|
using ::gmtime;
|
|
|
|
using ::localtime;
|
2015-06-24 16:44:38 +08:00
|
|
|
#endif
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::strftime;
|
2018-08-16 05:19:08 +08:00
|
|
|
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
|
2018-08-01 03:25:00 +08:00
|
|
|
using ::timespec_get;
|
|
|
|
#endif
|
2010-05-12 03:42:16 +08:00
|
|
|
|
|
|
|
_LIBCPP_END_NAMESPACE_STD
|
|
|
|
|
|
|
|
#endif // _LIBCPP_CTIME
|