Skip to content

Commit 8c2e352

Browse files
committed
Fix GCC malloc lock
The malloc lock functions were not declared as extern "C" so they are not getting linked to the standard library. Add extern "C" to fix this. This bug was introduced in the commit: d0b7b3b - Fix duplicate symbols for malloc lock and unlock
1 parent 5acdad9 commit 8c2e352

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hal/common/retarget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,22 +646,22 @@ extern "C" WEAK void __rtos_malloc_unlock( struct _reent *_r ) {}
646646
extern "C" WEAK void __rtos_env_lock( struct _reent *_r ) {}
647647
extern "C" WEAK void __rtos_env_unlock( struct _reent *_r ) {}
648648

649-
void __malloc_lock( struct _reent *_r )
649+
extern "C" void __malloc_lock( struct _reent *_r )
650650
{
651651
__rtos_malloc_lock(_r);
652652
}
653653

654-
void __malloc_unlock( struct _reent *_r )
654+
extern "C" void __malloc_unlock( struct _reent *_r )
655655
{
656656
__rtos_malloc_unlock(_r);
657657
}
658658

659-
void __env_lock( struct _reent *_r )
659+
extern "C" void __env_lock( struct _reent *_r )
660660
{
661661
__rtos_env_lock(_r);
662662
}
663663

664-
void __env_unlock( struct _reent *_r )
664+
extern "C" void __env_unlock( struct _reent *_r )
665665
{
666666
__rtos_env_unlock(_r);
667667
}

0 commit comments

Comments
 (0)