lib/replace: move MAXHOSTNAMELEN to system/network.h
authorStefan Metzmacher <metze@samba.org>
Sat, 31 Jan 2009 08:32:14 +0000 (09:32 +0100)
committerStefan Metzmacher <metze@samba.org>
Sat, 31 Jan 2009 08:32:14 +0000 (09:32 +0100)
Some platforms define it in netdb.h, so we should
define the replace after including metdb.h.

metze

lib/replace/replace.h
lib/replace/system/network.h

index 688a7466c3d89babb58d36b5e24306ce3cc8de51..c5b8676acfa6e8baadc9ca9e87547cfba7577e6c 100644 (file)
@@ -503,18 +503,6 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
                              ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
 #define _TYPE_MAXIMUM(t) ((t) (~ (t) 0 - _TYPE_MINIMUM (t)))
 
-#ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 255
-#endif
-
-/*
- * Some older systems seem not to have MAXHOSTNAMELEN
- * defined.
- */
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN HOST_NAME_MAX
-#endif
-
 #ifndef UINT16_MAX
 #define UINT16_MAX 65535
 #endif
index 473d79b5f2997835e9a6c426d0f63a721ece9feb..40d20db2d4a4ac7fc3504f8e092cf7a80d47c5d9 100644 (file)
@@ -271,7 +271,11 @@ int rep_socketpair(int d, int type, int protocol, int sv[2]);
 #endif
 
 #ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 256
+#define HOST_NAME_MAX 255
+#endif
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN HOST_NAME_MAX
 #endif
 
 #ifndef HAVE_SA_FAMILY_T