mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Updata difftime. Add a version of difftime for the case where the platform does not support type double
This commit is contained in:
committed by
Gregory Nutt
parent
c51b642f81
commit
51596dc457
+5
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user