r18593: try to get the same socket_wrapper file building in samba3 and samba4
authorStefan Metzmacher <metze@samba.org>
Sun, 17 Sep 2006 05:11:57 +0000 (05:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:18:54 +0000 (14:18 -0500)
this is preparation of adding libreplace to samba3 later.

metze
(This used to be commit 26228e4b2e8debd84caebe84bb34bfbbf2ad405c)

source4/lib/replace/system/network.h
source4/lib/socket_wrapper/socket_wrapper.c
source4/lib/util/dlinklist.h

index 9b7346692469ce7c86ee4bc90c0517bfc9c5af4f..615fcab5c849377c660258eca1b98930313a942c 100644 (file)
@@ -67,7 +67,9 @@
 #endif
 
 #ifdef SOCKET_WRAPPER
+#ifndef SOCKET_WRAPPER_NOT_REPLACE
 #define SOCKET_WRAPPER_REPLACE
+#endif
 #include "lib/socket_wrapper/socket_wrapper.h"
 #endif
 
index fe0b4dfe76b8a86dfb8a08a89e525a397441bcbd..5417f70a068b98d09937da968ed39bf12bfbac53 100644 (file)
 */
 
 #ifdef _SAMBA_BUILD_
+
+#define SOCKET_WRAPPER_NOT_REPLACE
 #include "includes.h"
-#undef SOCKET_WRAPPER
 #include "system/network.h"
 #include "system/filesys.h"
-#else
+
+#ifndef _DLINKLIST_H
+#include "lib/util/dlinklist.h"
+#endif
+
+#ifdef malloc
+#undef malloc
+#endif
+#ifdef calloc
+#undef calloc
+#endif
+#ifdef strdup
+#undef strdup
+#endif
+
+#else /* _SAMBA_BUILD_ */
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
+
+#error "dlinklist.h missing"
+
 #endif
-#include "lib/util/dlinklist.h"
 
 /* LD_PRELOAD doesn't work yet, so REWRITE_CALLS is all we support
  * for now */
index 527b211cd34b21a66c7813197eeb0b1bf4dfe63f..f267e77ea6dee174a4b917bccfd8127be2335757 100644 (file)
@@ -21,6 +21,9 @@
 /* To use these macros you must have a structure containing a next and
    prev pointer */
 
+#ifndef _DLINKLIST_H
+#define _DLINKLIST_H
+
 
 /* hook into the front of the list */
 #define DLIST_ADD(list, p) \
@@ -107,3 +110,5 @@ do { \
                        } \
                } \
 } while (0)
+
+#endif /* _DLINKLIST_H */