# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1288017933 -7200
# Node ID 8e173dddd183de2aaaef9365c59a097c8aac4f2c
# Parent  a5a44aa5915df61e2236f5bf4196b3654878e731
Improved compiling on 2.6.34 (thanks to Malcolm Lewis).

diff -r a5a44aa5915d -r 8e173dddd183 examples/mini/mini.c
--- a/examples/mini/mini.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/examples/mini/mini.c	Mon Oct 25 16:45:33 2010 +0200
@@ -33,6 +33,10 @@
 #include <linux/interrupt.h>
 #include <linux/err.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
+#include <linux/slab.h>
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
 #include <linux/semaphore.h>
 #else
diff -r a5a44aa5915d -r 8e173dddd183 examples/tty/serial.c
--- a/examples/tty/serial.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/examples/tty/serial.c	Mon Oct 25 16:45:33 2010 +0200
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/err.h>
 #include <linux/termios.h>
+#include <linux/slab.h>
 
 #include "../../include/ecrt.h" // EtherCAT realtime interface
 #include "../../include/ectty.h" // EtherCAT TTY interface
diff -r a5a44aa5915d -r 8e173dddd183 lib/Makefile.am
--- a/lib/Makefile.am	Mon Oct 25 16:33:41 2010 +0200
+++ b/lib/Makefile.am	Mon Oct 25 16:45:33 2010 +0200
@@ -35,7 +35,7 @@
 #------------------------------------------------------------------------------
 
 libethercat_la_LDFLAGS = -version-info 1:0:0
-libethercat_la_CFLAGS = -I$(srcdir)/..
+libethercat_la_CFLAGS = -I$(srcdir)/.. -fno-strict-aliasing
 libethercat_la_SOURCES = \
 	common.c \
 	domain.c \
diff -r a5a44aa5915d -r 8e173dddd183 lib/common.c
--- a/lib/common.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/lib/common.c	Mon Oct 25 16:45:33 2010 +0200
@@ -37,6 +37,8 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
+#include <unistd.h>
+#include <sys/socket.h>
 
 #include "master.h"
 #include "master/ioctl.h"
diff -r a5a44aa5915d -r 8e173dddd183 lib/master.c
--- a/lib/master.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/lib/master.c	Mon Oct 25 16:45:33 2010 +0200
@@ -49,6 +49,7 @@
                 strerror(errno));
         return -1;
     }
+    return 0;
 }
 
 /*****************************************************************************/
diff -r a5a44aa5915d -r 8e173dddd183 master/foe_request.c
--- a/master/foe_request.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/master/foe_request.c	Mon Oct 25 16:45:33 2010 +0200
@@ -35,6 +35,7 @@
 
 #include <linux/module.h>
 #include <linux/jiffies.h>
+#include <linux/slab.h>
 
 #include "foe_request.h"
 #include "foe.h"
diff -r a5a44aa5915d -r 8e173dddd183 master/sdo_request.c
--- a/master/sdo_request.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/master/sdo_request.c	Mon Oct 25 16:45:33 2010 +0200
@@ -35,6 +35,7 @@
 
 #include <linux/module.h>
 #include <linux/jiffies.h>
+#include <linux/slab.h>
 
 #include "sdo_request.h"
 
diff -r a5a44aa5915d -r 8e173dddd183 master/soe_request.c
--- a/master/soe_request.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/master/soe_request.c	Mon Oct 25 16:45:33 2010 +0200
@@ -35,6 +35,7 @@
 
 #include <linux/module.h>
 #include <linux/jiffies.h>
+#include <linux/slab.h>
 
 #include "soe_request.h"
 
diff -r a5a44aa5915d -r 8e173dddd183 tool/Makefile.am
--- a/tool/Makefile.am	Mon Oct 25 16:33:41 2010 +0200
+++ b/tool/Makefile.am	Mon Oct 25 16:45:33 2010 +0200
@@ -128,6 +128,7 @@
 ethercat_CXXFLAGS = \
 	-I$(top_srcdir)/include \
 	-I$(top_srcdir)/master \
-	-Wall -DREV=$(REV)
+	-Wall -DREV=$(REV) \
+	-fno-strict-aliasing
 
 #------------------------------------------------------------------------------
diff -r a5a44aa5915d -r 8e173dddd183 tty/module.c
--- a/tty/module.c	Mon Oct 25 16:33:41 2010 +0200
+++ b/tty/module.c	Mon Oct 25 16:45:33 2010 +0200
@@ -43,6 +43,7 @@
 #include <linux/version.h>
 #include <linux/serial.h>
 #include <linux/uaccess.h>
+#include <linux/slab.h>
 
 #include "../master/globals.h"
 #include "../include/ectty.h"