Fix "error: #268: declaration may not appear after executable statement in block", when C99 is disabled.
We do have other errors when C99 is disabled, namely the struct initialization and type casting. I'm not fixing those here, since: - struct init is consistent within this lib. - type casting is needed in this design, to hide FreeRTOS symbols.
This commit is contained in:
parent
fd8dae8a25
commit
52b1a0f80d
@ -132,6 +132,7 @@ int sem_timedwait( sem_t * sem,
|
|||||||
int iStatus = 0;
|
int iStatus = 0;
|
||||||
sem_internal_t * pxSem = ( sem_internal_t * ) ( sem );
|
sem_internal_t * pxSem = ( sem_internal_t * ) ( sem );
|
||||||
TickType_t xDelay = portMAX_DELAY;
|
TickType_t xDelay = portMAX_DELAY;
|
||||||
|
int iPreviousValue = Atomic_Decrement_u32( ( uint32_t * ) &pxSem->value );
|
||||||
|
|
||||||
if( abstime != NULL )
|
if( abstime != NULL )
|
||||||
{
|
{
|
||||||
@ -165,8 +166,6 @@ int sem_timedwait( sem_t * sem,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int iPreviousValue = Atomic_Decrement_u32( ( uint32_t * ) &pxSem->value );
|
|
||||||
|
|
||||||
/* If previous semaphore value is larger than zero, the thread entering this function call
|
/* If previous semaphore value is larger than zero, the thread entering this function call
|
||||||
* can take the semaphore without yielding. Else (<=0), calling into FreeRTOS API to yield.
|
* can take the semaphore without yielding. Else (<=0), calling into FreeRTOS API to yield.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user