summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-23 06:52:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-23 06:59:59 +0200
commit75a6584a43a9ab4170376d31fe4041bbaaa7f547 (patch)
treef8e7d7dede0664a23e7c559125ca3196241e2335 /cpukit/score/include/rtems/score/percpu.h
parentlibdl: Fix cache corruption bugs. (diff)
downloadrtems-75a6584a43a9ab4170376d31fe4041bbaaa7f547.tar.bz2
score: Fix C/C++ compatibility issue
Only use CPU_Per_CPU_control if it contains at least one filed. In GNU C empty structures have a size of zero. In C++ structures have a non-zero size. In case CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not used anymore. Close #2789.
Diffstat (limited to 'cpukit/score/include/rtems/score/percpu.h')
-rw-r--r--cpukit/score/include/rtems/score/percpu.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 9ce68ef7b1..5ab2567a2b 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -231,10 +231,12 @@ typedef struct {
* This structure is used to hold per core state information.
*/
typedef struct Per_CPU_Control {
- /**
- * @brief CPU port specific control.
- */
- CPU_Per_CPU_control cpu_per_cpu;
+ #if CPU_PER_CPU_CONTROL_SIZE > 0
+ /**
+ * @brief CPU port specific control.
+ */
+ CPU_Per_CPU_control cpu_per_cpu;
+ #endif
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) || \
(CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)