summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-09-20 09:11:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:06:59 -0500
commitd4f0d738f1ca3c4884a831a31bdd7c6de34b0961 (patch)
tree85038347ec0a0d1f804d3afe4af902f8b085e1ae /source4
parentafb0849afe58e1ba43e84c342342d924c502001d (diff)
downloadsamba-d4f0d738f1ca3c4884a831a31bdd7c6de34b0961.tar.gz
samba-d4f0d738f1ca3c4884a831a31bdd7c6de34b0961.tar.bz2
samba-d4f0d738f1ca3c4884a831a31bdd7c6de34b0961.zip
r25251: move macro defines to the end of replace.h
and move the include location sys/param.h before we redefine missing macros metze (This used to be commit 87559febdf887940ca85571d301269b734906401)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/replace/replace.h67
1 files changed, 35 insertions, 32 deletions
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
index 90d65931e7..af05516e8c 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -44,13 +44,6 @@
#include "win32_replace.h"
#endif
-#ifdef __COMPAR_FN_T
-#define QSORT_CAST (__compar_fn_t)
-#endif
-
-#ifndef QSORT_CAST
-#define QSORT_CAST (int (*)(const void *, const void *))
-#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
@@ -78,28 +71,6 @@
#include <stddef.h>
#endif
-/**
- this is a warning hack. The idea is to use this everywhere that we
- get the "discarding const" warning from gcc. That doesn't actually
- fix the problem of course, but it means that when we do get to
- cleaning them up we can do it by searching the code for
- discard_const.
-
- It also means that other error types aren't as swamped by the noise
- of hundreds of const warnings, so we are more likely to notice when
- we get new errors.
-
- Please only add more uses of this macro when you find it
- _really_ hard to fix const warnings. Our aim is to eventually use
- this function in only a very few places.
-
- Also, please call this via the discard_const_p() macro interface, as that
- makes the return type safe.
-*/
-#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-
-/** Type-safe version of discard_const */
-#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
@@ -363,6 +334,10 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
#include <limits.h>
#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
/* The extra casts work around common compiler bugs. */
#define _TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
@@ -458,9 +433,6 @@ typedef int bool;
#endif
#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
@@ -470,6 +442,29 @@ typedef int bool;
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
+/**
+ this is a warning hack. The idea is to use this everywhere that we
+ get the "discarding const" warning from gcc. That doesn't actually
+ fix the problem of course, but it means that when we do get to
+ cleaning them up we can do it by searching the code for
+ discard_const.
+
+ It also means that other error types aren't as swamped by the noise
+ of hundreds of const warnings, so we are more likely to notice when
+ we get new errors.
+
+ Please only add more uses of this macro when you find it
+ _really_ hard to fix const warnings. Our aim is to eventually use
+ this function in only a very few places.
+
+ Also, please call this via the discard_const_p() macro interface, as that
+ makes the return type safe.
+*/
+#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+
+/** Type-safe version of discard_const */
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+
#ifndef __STRING
#define __STRING(x) #x
#endif
@@ -519,4 +514,12 @@ typedef int bool;
#undef HAVE_MMAP
#endif
+#ifdef __COMPAR_FN_T
+#define QSORT_CAST (__compar_fn_t)
+#endif
+
+#ifndef QSORT_CAST
+#define QSORT_CAST (int (*)(const void *, const void *))
+#endif
+
#endif /* _LIBREPLACE_REPLACE_H */