remove math library for time string conversion

This commit is contained in:
Sukchan Lee 2021-01-08 23:16:54 -05:00
parent 508a78d43b
commit f15d2c96fe
3 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <errno.h>
#include <arpa/inet.h>

View File

@ -345,7 +345,11 @@ bool ogs_sbi_time_from_string(ogs_time_t *timestamp, char *str)
memset(&tm, 0, sizeof(tm));
ogs_strptime(seconds, "%Y-%m-%dT%H:%M:%S%z", &tm);
#if USE_MATH
usecs = (ogs_time_t)floor(atof(subsecs) * 1000000.0 + 0.5);
#else
usecs = (ogs_time_t)((atof(subsecs) * 10000000 + 5) / 10);
#endif
rv = ogs_time_from_gmt(timestamp, &tm, usecs);
if (rv != OGS_OK) {

View File

@ -42,7 +42,6 @@ libsbi_inc = include_directories('.')
sbi_cc_flags = ['-DOGS_SBI_COMPILATION']
libm_dep = cc.find_library('m', required : true)
libgnutls_dep = cc.find_library('gnutls', required : true)
libnghttp2_dep = dependency('libnghttp2', version: '>=1.18.1')
libmicrohttpd_dep = dependency('libmicrohttpd', version: '>=0.9.40')
@ -57,7 +56,6 @@ libsbi = library('ogssbi',
libcrypt_dep,
libapp_dep,
libsbi_openapi_dep,
libm_dep,
libgnutls_dep,
libnghttp2_dep,
libmicrohttpd_dep,
@ -72,7 +70,6 @@ libsbi_dep = declare_dependency(
libcrypt_dep,
libapp_dep,
libsbi_openapi_dep,
libm_dep,
libgnutls_dep,
libnghttp2_dep,
libmicrohttpd_dep,