Updata difftime. Add a version of difftime for the case where the platform does not support type double

This commit is contained in:
Sebastien Lorquet
2016-08-25 08:00:50 -06:00
committed by Gregory Nutt
parent c51b642f81
commit 51596dc457
3 changed files with 31 additions and 9 deletions
+5 -1
View File
@@ -41,6 +41,7 @@
********************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <sys/types.h>
#include <stdint.h>
@@ -103,6 +104,7 @@
/********************************************************************************
* Public Types
********************************************************************************/
/* Scalar types */
typedef uint32_t time_t; /* Holds time in seconds */
@@ -214,8 +216,10 @@ FAR char *ctime_r(FAR const time_t *timep, FAR char *buf);
time_t time(FAR time_t *timep);
#if defined(CONFIG_LIBC_DIFFTIME)
#ifdef CONFIG_HAVE_DOUBLE
double difftime(time_t time1, time_t time0);
#else
float difftime(time_t time1, time_t time0);
#endif
int timer_create(clockid_t clockid, FAR struct sigevent *evp,