summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerica mann <erica@tiledb.com>2020-10-08 14:58:51 +0000
committerDaniel Black <daniel@mariadb.org>2021-04-15 11:48:37 +1000
commita07609610640151a37d11fabe4217c943117ec72 (patch)
tree3ec9bcd065fe8d39cf764543619057aceb07bad4
parent1715fef107b2b0fab2b1e2dbac062b3ac7a9c6b2 (diff)
downloadmariadb-git-bb-10.5-danielblack-osx-build-warnings-pr1676.tar.gz
Fix macOS-10.14 compiler warnings for loss of precision and overridesbb-10.5-danielblack-osx-build-warnings-pr1676
Fixes multiple clang++ compiler warnings in macOS related to loss of precision in timeval Closes #1676
-rw-r--r--sql/structs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/structs.h b/sql/structs.h
index bcd38ffbdd6..fc9a1ef761e 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -880,7 +880,12 @@ public:
integer precision.
*/
DBUG_ASSERT(usec < 1000000);
+/* apple timeval tv_usec is __darwin_suseconds_t aka int */
+#ifdef __APPLE__
+ tv_usec= static_cast<int>(usec);
+#else
tv_usec= (uint)usec;
+#endif
}
explicit Timeval(const timeval &tv)
:timeval(tv)