summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-08-17 18:08:30 -0700
committerjimw@mysql.com <>2005-08-17 18:08:30 -0700
commita3ae4e0fc7a2a1b556e4e2ac6ae4231c1d0a505e (patch)
tree51589f63e54893a9f9c948dcb891006fcd783d71 /include/my_global.h
parent054e78943e6a85cff68daaa7630b907da1e8f10f (diff)
downloadmariadb-git-a3ae4e0fc7a2a1b556e4e2ac6ae4231c1d0a505e.tar.gz
Fix up definition of new set_timespec_nsec() macro. (Related to bug #12582)
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 2627ea8e821..2546dde754d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -927,7 +927,17 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#ifndef set_timespec
#ifdef HAVE_TIMESPEC_TS_SEC
-#define set_timespec(ABSTIME,SEC) { (ABSTIME).ts_sec=time(0) + (time_t) (SEC); (ABSTIME).ts_nsec=0; }
+#define set_timespec(ABSTIME,SEC) \
+{ \
+ (ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
+ (ABSTIME).ts_nsec=0; \
+}
+#define set_timespec_nsec(ABSTIME,NSEC) \
+{\
+ ulonglong now= my_getsystime(); \
+ (ABSTIME).ts_sec= (now / ULL(10000000)) + (NSEC / ULL(1000000000)); \
+ (ABSTIME).ts_nsec= (now % ULL(10000000)) * 100 + (NSEC % ULL(1000000000)); \
+}
#else
#define set_timespec(ABSTIME,SEC) \
{\
@@ -936,15 +946,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
-#endif /* HAVE_TIMESPEC_TS_SEC */
-#endif /* set_timespec */
-
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime(); \
(ABSTIME).tv_sec= (now / ULL(10000000)) + (NSEC / ULL(1000000000)); \
(ABSTIME).tv_nsec= (now % ULL(10000000)) * 100 + (NSEC % ULL(1000000000)); \
}
+#endif /* HAVE_TIMESPEC_TS_SEC */
+#endif /* set_timespec */
/*
Define-funktions for reading and storing in machine independent format