From 493802a6058d5522258f2d693ec2f20587d086f1 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Fri, 12 Feb 2021 23:22:42 +0000 Subject: [PATCH] Fixed osx mistype declaration and typo warnings --- src/curl_util.h | 2 +- src/s3fs_logger.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/curl_util.h b/src/curl_util.h index c6573d6..5567c1b 100644 --- a/src/curl_util.h +++ b/src/curl_util.h @@ -23,7 +23,7 @@ #include -struct sse_type_t; +class sse_type_t; //---------------------------------------------- // Functions diff --git a/src/s3fs_logger.h b/src/s3fs_logger.h index 1690361..19758a6 100644 --- a/src/s3fs_logger.h +++ b/src/s3fs_logger.h @@ -32,6 +32,12 @@ #define S3FS_CLOCK_MONOTONIC CLOCK_MONOTONIC #endif +#if defined(__APPLE__) +#define S3FSLOG_TIME_FMT "%s.%03dZ" +#else +#define S3FSLOG_TIME_FMT "%s.%03ldZ" +#endif + //------------------------------------------------------------------- // S3fsLog class //------------------------------------------------------------------- @@ -91,7 +97,7 @@ class S3fsLog gettimeofday(&now, NULL); } strftime(tmp, sizeof(tmp), "%Y-%m-%dT%H:%M:%S", gmtime_r(&now.tv_sec, &res)); - snprintf(current_time, sizeof(current_time), "%s.%03ldZ", tmp, (now.tv_usec / 1000)); + snprintf(current_time, sizeof(current_time), S3FSLOG_TIME_FMT, tmp, (now.tv_usec / 1000)); return current_time; }