Skip to content

Commit d10ee46

Browse files
tymmejJakub Tymejczyk
and
Jakub Tymejczyk
authored
Fix GCC/Posix port compilation on FreeBSD (FreeRTOS#1239) (FreeRTOS#1240)
On FreeBSD pthread_once_t is a struct and cast is required. Otherwise there's compilation error: ../../mocks/freertos/port.c:261:23: error: expected expression hSigSetupThread = PTHREAD_ONCE_INIT; ^ PTHREAD_ONCE_INIT is defined as: { PTHREAD_NEEDS_INIT, NULL } on FreeBSD Co-authored-by: Jakub Tymejczyk <[email protected]>
1 parent ae0a591 commit d10ee46

File tree

1 file changed

+2
-2
lines changed
  • portable/ThirdParty/GCC/Posix

1 file changed

+2
-2
lines changed

portable/ThirdParty/GCC/Posix/port.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ BaseType_t xPortStartScheduler( void )
303303
memset( ( void * ) &hSigSetupThread.__opaque, 0, sizeof( hSigSetupThread.__opaque ) );
304304
memset( ( void * ) &hThreadKeyOnce.__opaque, 0, sizeof( hThreadKeyOnce.__opaque ) );
305305
#else /* Linux PTHREAD library*/
306-
hSigSetupThread = PTHREAD_ONCE_INIT;
307-
hThreadKeyOnce = PTHREAD_ONCE_INIT;
306+
hSigSetupThread = ( pthread_once_t ) PTHREAD_ONCE_INIT;
307+
hThreadKeyOnce = ( pthread_once_t ) PTHREAD_ONCE_INIT;
308308
#endif /* __APPLE__*/
309309

310310
/* Restore original signal mask. */

0 commit comments

Comments
 (0)