Improved compiling on 2.6.34 (thanks to Malcolm Lewis).
authorFlorian Pose <fp@igh-essen.com>
Mon, 25 Oct 2010 16:45:33 +0200
changeset 1975 8e173dddd183
parent 1974 a5a44aa5915d
child 1976 ffeab8c18590
Improved compiling on 2.6.34 (thanks to Malcolm Lewis).
examples/mini/mini.c
examples/tty/serial.c
lib/Makefile.am
lib/common.c
lib/master.c
master/foe_request.c
master/sdo_request.c
master/soe_request.c
tool/Makefile.am
tty/module.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
--- 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
--- 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 \
--- 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"
--- 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;
 }
 
 /*****************************************************************************/
--- 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"
--- 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"
 
--- 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"
 
--- 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
 
 #------------------------------------------------------------------------------
--- 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"