On Tue, Oct 30, 2007 at 03:05:37PM -0700, David Miller wrote:
Something like this..
I like it - much better than adding string.h to unidef-y.
PS - had not pulled latest -linus - so you must update Kbuild.
PPS - tipc.h should be exported too as I understood Stephen.
Sam
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index b0c916d..30ddf1e 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -38,7 +38,6 @@
#define _LINUX_TIPC_CONFIG_H_
#include <linux/types.h>
-#include <linux/string.h>
#include <asm/byteorder.h>
/*
@@ -390,7 +389,8 @@ struct tipc_cfg_msg_hdr
#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
#define TCM_SPACE(datalen) (TCM_ALIGN(TCM_LENGTH(datalen)))
#define TCM_DATA(tcm_hdr) ((void *)((char *)(tcm_hdr) + TCM_LENGTH(0)))
-
+#ifndef __KERNEL__
+#include <string.h>
static inline int TCM_SET(void *msg, __u16 cmd, __u16 flags,
void *data, __u16 data_len)
{
@@ -406,5 +406,5 @@ static inline int TCM_SET(void *msg, __u16 cmd, __u16 flags,
memcpy(TCM_DATA(msg), data, data_len);
return TCM_SPACE(data_len);
}
-
+#endif /* ifndef __KERNEL__ */
#endif
-