From 9149c87ec724ed4e3f45762e771c12f81c3f5a33 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 23 Sep 2016 06:52:33 +0200 Subject: 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. --- cpukit/score/include/rtems/score/percpu.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cpukit/score/include/rtems/score/percpu.h') diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 8d47aaca4f..cb28cd98c4 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -260,10 +260,12 @@ typedef enum { * 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) -- cgit v1.2.3