/*
 * Copyright (C) 2009-2010, Gostai S.A.S.
 *
 * This software is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the
 * implied warranties of fitness for a particular purpose.
 *
 * See the LICENSE file for more information.
 */

#ifndef LIBPORT_CTIME
# define LIBPORT_CTIME

# include <ctime>

# include <libport/detect-win32.h>
# include <libport/export.hh>

# if defined WIN32
#  include <libport/windows.hh>

#  define CLOCK_REALTIME 0

struct timespec
{
  time_t tv_sec;
  long tv_nsec;
};

LIBPORT_API
int clock_gettime(int, struct timespec* t);

// Warning: this implementation is not thread safe.
LIBPORT_API
struct tm *
localtime_r(const time_t *clock, struct tm *result);

# endif

#endif // ! LIBPORT_CTIME

// Local Variables:
// mode: C++
// End:
