diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-23 06:52:33 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-23 06:57:03 +0200 |
commit | 9149c87ec724ed4e3f45762e771c12f81c3f5a33 (patch) | |
tree | 3687ac319c3bf27729dc56da77541a5194ffe708 /cpukit/score/src/percpuasm.c | |
parent | arm/tms570: document BSP setup with included hardware initialization. (diff) | |
download | rtems-9149c87ec724ed4e3f45762e771c12f81c3f5a33.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.
Diffstat (limited to 'cpukit/score/src/percpuasm.c')
-rw-r--r-- | cpukit/score/src/percpuasm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/score/src/percpuasm.c b/cpukit/score/src/percpuasm.c index 15b49c72e1..53e6326abd 100644 --- a/cpukit/score/src/percpuasm.c +++ b/cpukit/score/src/percpuasm.c @@ -64,10 +64,12 @@ RTEMS_STATIC_ASSERT( ); #endif -RTEMS_STATIC_ASSERT( - sizeof( CPU_Per_CPU_control ) == CPU_PER_CPU_CONTROL_SIZE, - CPU_PER_CPU_CONTROL_SIZE -); +#if CPU_PER_CPU_CONTROL_SIZE > 0 + RTEMS_STATIC_ASSERT( + sizeof( CPU_Per_CPU_control ) == CPU_PER_CPU_CONTROL_SIZE, + CPU_PER_CPU_CONTROL_SIZE + ); +#endif #if defined( RTEMS_SMP ) RTEMS_STATIC_ASSERT( |