From d7b3293ba3e13e1ce970eabd68d6bbc3d2b009a9 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 7 Aug 2015 09:41:48 -0500 Subject: [PATCH] libCom: Use MSVC's struct timespec when available --- src/libCom/osi/os/WIN32/osdTime.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/libCom/osi/os/WIN32/osdTime.h b/src/libCom/osi/os/WIN32/osdTime.h index 899eeb46a..5875c0e7e 100644 --- a/src/libCom/osi/os/WIN32/osdTime.h +++ b/src/libCom/osi/os/WIN32/osdTime.h @@ -3,9 +3,8 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -14,15 +13,22 @@ * Author: Jeff Hill */ -#ifndef osdTimeh -#define osdTimeh +#ifndef INC_osdTime_H +#define INC_osdTime_H #if ! defined(_MINGW) || ! defined(_TIMESPEC_DEFINED) +# if _MSC_VER >= 1900 +# include +# else + +#define _TIMESPEC_DEFINED 1 struct timespec { - time_t tv_sec; /* seconds since some epoch */ - long tv_nsec; /* nanoseconds within the second */ + time_t tv_sec; /* seconds since some epoch */ + long tv_nsec; /* nanoseconds within the second */ }; + +# endif /* _MSC_VER */ #endif /* ! defined(_MINGW) || ! defined(_TIMESPEC_DEFINED) */ -#endif /* ifndef osdTimeh */ +#endif /* ifndef INC_osdTime_H */