The Samba-Bugzilla – Attachment 11863 Details for
Bug 11621
Failed to compile on AIX 7.1.3 time.h
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-libbreplace-compatibility-fix-for-aix.patch (text/plain), 2.08 KB, created by
Guillaume Xavier Taillon (mail address dead)
on 2016-02-22 20:09:33 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Guillaume Xavier Taillon (mail address dead)
Created:
2016-02-22 20:09:33 UTC
Size:
2.08 KB
patch
obsolete
>From f01d4670b91a9f794e764b646930ce1f4e029d53 Mon Sep 17 00:00:00 2001 >From: Guillaume Xavier Taillon <gtaillon@ca.ibm.com> >Date: Mon, 22 Feb 2016 14:46:24 -0500 >Subject: [PATCH] libbreplace: compatibility fix for aix > >Adds macros for preprocessor compares and replaces an incomptatible > compare with one of the new macros. >This fixes a comptability bug on aix. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11621 >Signed-off-by: Guillaume Xavier Taillon <gtaillon@ca.ibm.com> >--- > lib/replace/system/time.h | 10 +++++++++- > lib/util/time.c | 2 +- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/lib/replace/system/time.h b/lib/replace/system/time.h >index b6d2609..00f0d7f 100644 >--- a/lib/replace/system/time.h >+++ b/lib/replace/system/time.h >@@ -79,13 +79,21 @@ int rep_utimes(const char *filename, const struct timeval tv[2]); > typedef int clockid_t; > int rep_clock_gettime(clockid_t clk_id, struct timespec *tp); > #endif >-/* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on */ >+/* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on. >+ * >+ * on AIX the values of CLOCK_* are cast expressions, not integer constants, >+ * this prevents them from being compared against in a preprocessor directive. >+ * The following ...IS_* macros can be used to check which clock is in use. >+ */ > #if defined(CLOCK_MONOTONIC) > #define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC >+#define CUSTOM_CLOCK_MONOTONIC_IS_MONOTONIC > #elif defined(CLOCK_HIGHRES) > #define CUSTOM_CLOCK_MONOTONIC CLOCK_HIGHRES >+#define CUSTOM_CLOCK_MONOTONIC_IS_HIGHRES > #else > #define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME >+#define CUSTOM_CLOCK_MONOTONIC_IS_REALTIME > #endif > > #endif >diff --git a/lib/util/time.c b/lib/util/time.c >index 3c709af..f9b58d8 100644 >--- a/lib/util/time.c >+++ b/lib/util/time.c >@@ -60,7 +60,7 @@ _PUBLIC_ void clock_gettime_mono(struct timespec *tp) > } > #endif > /* then try the monotonic clock: */ >-#if CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME >+#ifndef CUSTOM_CLOCK_MONOTONIC_IS_REALTIME > if (clock_gettime(CUSTOM_CLOCK_MONOTONIC,tp) == 0) { > return; > } >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11621
:
11624
| 11863