summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/replace/system/network.h2
-rw-r--r--source4/lib/socket_wrapper/socket_wrapper.c25
-rw-r--r--source4/lib/util/dlinklist.h5
3 files changed, 29 insertions, 3 deletions
diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h
index 9b73466924..615fcab5c8 100644
--- a/source4/lib/replace/system/network.h
+++ b/source4/lib/replace/system/network.h
@@ -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
diff --git a/source4/lib/socket_wrapper/socket_wrapper.c b/source4/lib/socket_wrapper/socket_wrapper.c
index fe0b4dfe76..5417f70a06 100644
--- a/source4/lib/socket_wrapper/socket_wrapper.c
+++ b/source4/lib/socket_wrapper/socket_wrapper.c
@@ -21,11 +21,28 @@
*/
#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>
@@ -37,8 +54,10 @@
#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 */
diff --git a/source4/lib/util/dlinklist.h b/source4/lib/util/dlinklist.h
index 527b211cd3..f267e77ea6 100644
--- a/source4/lib/util/dlinklist.h
+++ b/source4/lib/util/dlinklist.h
@@ -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 */