summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-02-12 08:45:25 -0500
committerShyamsundar Ranganathan <srangana@redhat.com>2018-03-16 13:41:47 +0000
commit0ec2e903a4e2b9bd9e544bd807ed45af5898e2ab (patch)
tree5f514ed93d836a8cead41092e5fa1999da8c944e
parent721ba8f8075a6a5696f165282f1ef5742c1f4a46 (diff)
libglusterfs: move compat RPC/XDR #defines to eliminate warnings
Building with libtirpc (versus legacy glibc rpc) results in many warnings about xdr macros that are redefined in libtirpc headers because of the way compat.h and glusterfs.h are usually #included. And these xdr macros in libglusterfs/src/compat.h - which were copied from legacy glibc's rpc headers - are different than the same-name macros in libtirpc. I haven't checked to see that any of the macros are expanded (incorrectly) between the definition in compat.h and the redefinition in tirpc/rpc/xdr.h; the risk seems pretty minimal. Regardless it seems better, from a truth-and-beauty perspective to not have the old, incorrect definitions in the first place. Not to mention that any file that #includes compat.h and not glusterfs.h does not need these xdr macro definitions at all. They're really only needed when using really old glibc rpc, which would only be evident if including glusterfs.h and/or glusterfs-fops.h. (Which by the way, nothing currently #includes glusterfs-fops.h by itself. And maybe nothing ever should?) Change-Id: Ic11e4407d6ab7c498a8745a99379cbf4788a24e8 BUG: 1555309 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
-rw-r--r--libglusterfs/src/compat.h20
-rw-r--r--libglusterfs/src/glusterfs.h13
2 files changed, 13 insertions, 20 deletions
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index af192f3c73f..fe8efd7153e 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -494,26 +494,6 @@ int gf_mkostemp (char *tmpl, int suffixlen, int flags);
#define CLOCK_REALTIME_COARSE CLOCK_REALTIME
#endif
-#ifndef IPV6_DEFAULT
-
-#ifndef IXDR_GET_LONG
-#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
-#endif
-
-#ifndef IXDR_PUT_LONG
-#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
-#endif
-
-#ifndef IXDR_GET_U_LONG
-#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
-#endif
-
-#ifndef IXDR_PUT_U_LONG
-#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
-#endif
-
-#endif /* IPV6_DEFAULT */
-
#if defined(__GNUC__) && !defined(RELAX_POISONING)
/* Use run API, see run.h */
#include <stdlib.h> /* system(), mkostemp() */
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 56be7487ce7..89a421416fa 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -32,6 +32,19 @@
#include "glusterfs-fops.h" /* generated XDR values for FOPs */
+#ifndef IXDR_GET_LONG
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#endif
+#ifndef IXDR_PUT_LONG
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
+#endif
+#ifndef IXDR_GET_U_LONG
+#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
+#endif
+#ifndef IXDR_PUT_U_LONG
+#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#endif
+
#include "list.h"
#include "locking.h"
#include "logging.h"