Module: xenomai-forge
Branch: master
Commit: cff8b790c97bdc2180a45c27c9d78496043d45f1
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=cff8b790c97bdc2180a45c27c9d78496043d45f1

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Mon Feb  3 17:51:45 2014 +0100

include/cobalt: Include next header unconditionally

Including system headers may have different effects depending on defines
set by the including file. This requires us to forward every inclusion
to the original header. Seen with pulling in stdio.h first indirectly
via wchar.h, then explicitly. Other headers may have the same
characteristics, now or in the future, so apply this pattern
consistently.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/cobalt/fcntl.h      |    4 ++--
 include/cobalt/mqueue.h     |    5 +++--
 include/cobalt/pthread.h    |    5 +++--
 include/cobalt/sched.h      |    5 +++--
 include/cobalt/semaphore.h  |    5 +++--
 include/cobalt/signal.h     |    5 +++--
 include/cobalt/stdio.h      |    5 +++--
 include/cobalt/stdlib.h     |    5 +++--
 include/cobalt/sys/ioctl.h  |    5 +++--
 include/cobalt/sys/select.h |    5 +++--
 include/cobalt/sys/socket.h |    5 +++--
 include/cobalt/sys/time.h   |    5 +++--
 include/cobalt/syslog.h     |    6 +++---
 include/cobalt/time.h       |    5 +++--
 include/cobalt/unistd.h     |    5 +++--
 15 files changed, 44 insertions(+), 31 deletions(-)

diff --git a/include/cobalt/fcntl.h b/include/cobalt/fcntl.h
index 23ea41c..ed96dd7 100644
--- a/include/cobalt/fcntl.h
+++ b/include/cobalt/fcntl.h
@@ -15,12 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <fcntl.h>
 
 #ifndef _COBALT_FCNTL_H
 #define _COBALT_FCNTL_H
 
-#pragma GCC system_header
-#include_next <fcntl.h>
 #include <cobalt/wrappers.h>
 
 #ifdef __cplusplus
diff --git a/include/cobalt/mqueue.h b/include/cobalt/mqueue.h
index 162a133..b335623 100644
--- a/include/cobalt/mqueue.h
+++ b/include/cobalt/mqueue.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <mqueue.h>
+
 #ifndef _COBALT_MQUEUE_H
 #define _COBALT_MQUEUE_H
 
-#pragma GCC system_header
-#include_next <mqueue.h>
 #include <cobalt/wrappers.h>
 
 #ifdef __cplusplus
diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h
index f4e654b..b290695 100644
--- a/include/cobalt/pthread.h
+++ b/include/cobalt/pthread.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <pthread.h>
+
 #ifndef _COBALT_PTHREAD_H
 #define _COBALT_PTHREAD_H
 
-#pragma GCC system_header
-#include_next <pthread.h>
 #include <cobalt/wrappers.h>
 #include <cobalt/uapi/thread.h>
 
diff --git a/include/cobalt/sched.h b/include/cobalt/sched.h
index bfdff69..943cb35 100644
--- a/include/cobalt/sched.h
+++ b/include/cobalt/sched.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <sched.h>
+
 #ifndef _COBALT_SCHED_H
 #define _COBALT_SCHED_H
 
-#pragma GCC system_header
-#include_next <sched.h>
 #include <sys/types.h>
 #include <cobalt/wrappers.h>
 #include <cobalt/uapi/sched.h>
diff --git a/include/cobalt/semaphore.h b/include/cobalt/semaphore.h
index 284131c..d38c7f8 100644
--- a/include/cobalt/semaphore.h
+++ b/include/cobalt/semaphore.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <semaphore.h>
+
 #ifndef _COBALT_SEMAPHORE_H
 #define _COBALT_SEMAPHORE_H
 
-#pragma GCC system_header
-#include_next <semaphore.h>
 #include <nocore/atomic.h>
 #include <cobalt/wrappers.h>
 #include <cobalt/uapi/sem.h>
diff --git a/include/cobalt/signal.h b/include/cobalt/signal.h
index 02b6c1c..02e91c6 100644
--- a/include/cobalt/signal.h
+++ b/include/cobalt/signal.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <signal.h>
+
 #ifndef _COBALT_SIGNAL_H
 #define _COBALT_SIGNAL_H
 
-#pragma GCC system_header
-#include_next <signal.h>
 /* Re-read in case we came from selective __need* block. */
 #include_next <signal.h>
 #include <cobalt/wrappers.h>
diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index c806e8e..d2c2e43 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -16,11 +16,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <stdio.h>
+
 #ifndef _COBALT_STDIO_H
 #define _COBALT_STDIO_H
 
-#pragma GCC system_header
-#include_next <stdio.h>
 #include <stddef.h>
 #include <stdarg.h>
 #include <xeno_config.h>
diff --git a/include/cobalt/stdlib.h b/include/cobalt/stdlib.h
index a3f9c57..6b664f5 100644
--- a/include/cobalt/stdlib.h
+++ b/include/cobalt/stdlib.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <stdlib.h>
+
 #ifndef _COBALT_STDLIB_H
 #define _COBALT_STDLIB_H
 
-#pragma GCC system_header
-#include_next <stdlib.h>
 /* Re-read in case we came from selective __need* block. */
 #include_next <stdlib.h>
 #include <cobalt/wrappers.h>
diff --git a/include/cobalt/sys/ioctl.h b/include/cobalt/sys/ioctl.h
index dfb8fb7..00c9735 100644
--- a/include/cobalt/sys/ioctl.h
+++ b/include/cobalt/sys/ioctl.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <sys/ioctl.h>
+
 #ifndef _COBALT_SYS_IOCTL_H
 #define _COBALT_SYS_IOCTL_H
 
-#pragma GCC system_header
-#include_next <sys/ioctl.h>
 #include <cobalt/wrappers.h>
 
 #ifdef __cplusplus
diff --git a/include/cobalt/sys/select.h b/include/cobalt/sys/select.h
index 1a1d2eb..76e8476 100644
--- a/include/cobalt/sys/select.h
+++ b/include/cobalt/sys/select.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <sys/select.h>
+
 #ifndef _COBALT_SYS_SELECT_H
 #define _COBALT_SYS_SELECT_H
 
-#pragma GCC system_header
-#include_next <sys/select.h>
 #include <cobalt/wrappers.h>
 
 #ifdef __cplusplus
diff --git a/include/cobalt/sys/socket.h b/include/cobalt/sys/socket.h
index ecfda00..273f0b5 100644
--- a/include/cobalt/sys/socket.h
+++ b/include/cobalt/sys/socket.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <sys/socket.h>
+
 #ifndef _COBALT_SYS_SOCKET_H
 #define _COBALT_SYS_SOCKET_H
 
-#pragma GCC system_header
-#include_next <sys/socket.h>
 #include <cobalt/wrappers.h>
 
 #ifdef __cplusplus
diff --git a/include/cobalt/sys/time.h b/include/cobalt/sys/time.h
index 67adbfd..38f5a34 100644
--- a/include/cobalt/sys/time.h
+++ b/include/cobalt/sys/time.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <sys/time.h>
+
 #ifndef _COBALT_SYS_TIME_H
 #define _COBALT_SYS_TIME_H
 
-#pragma GCC system_header
-#include_next <sys/time.h>
 #include <cobalt/wrappers.h>
 
 struct timezone;
diff --git a/include/cobalt/syslog.h b/include/cobalt/syslog.h
index 79de374..7f7d2c9 100644
--- a/include/cobalt/syslog.h
+++ b/include/cobalt/syslog.h
@@ -15,12 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <syslog.h>
+
 #ifndef _COBALT_SYSLOG_H
 #define _COBALT_SYSLOG_H
 
-#pragma GCC system_header
-#include <stdarg.h>
-#include_next <syslog.h>
 #include <xeno_config.h>
 #include <cobalt/wrappers.h>
 
diff --git a/include/cobalt/time.h b/include/cobalt/time.h
index 4dc9fa4..c5d7412 100644
--- a/include/cobalt/time.h
+++ b/include/cobalt/time.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <time.h>
+
 #ifndef _COBALT_TIME_H
 #define _COBALT_TIME_H
 
-#pragma GCC system_header
-#include_next <time.h>
 /* Re-read in case we came from selective __need* block. */
 #include_next <time.h>
 #include <cobalt/wrappers.h>
diff --git a/include/cobalt/unistd.h b/include/cobalt/unistd.h
index e603ae7..8ad2b40 100644
--- a/include/cobalt/unistd.h
+++ b/include/cobalt/unistd.h
@@ -15,11 +15,12 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+#pragma GCC system_header
+#include_next <unistd.h>
+
 #ifndef _COBALT_UNISTD_H
 #define _COBALT_UNISTD_H
 
-#pragma GCC system_header
-#include_next <unistd.h>
 #include <cobalt/wrappers.h>
 
 #ifdef __cplusplus


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to