You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2023/06/16 06:02:10 UTC

[mynewt-core] 05/06: hal/sbrk: Add sbrk for pic32 newlib compatibility

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 369d8ad09d5eadebfd29459622291fa51e529741
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed May 31 23:22:10 2023 +0200

    hal/sbrk: Add sbrk for pic32 newlib compatibility
    
    xc32 compiler with newlib expects function sbrk() unlike
    arm version that expect _sbrk().
    Common way to solve this is to have one calling another
    in this case sbrk is only used for pic32 so sbrk() calls _sbrk()
---
 hw/hal/src/sbrk.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/hal/src/sbrk.c b/hw/hal/src/sbrk.c
index 3a54b5e8c..6c26004c8 100644
--- a/hw/hal/src/sbrk.c
+++ b/hw/hal/src/sbrk.c
@@ -49,4 +49,10 @@ _sbrk(int incr)
     return prev_brk;
 }
 
+void *
+sbrk(int incr)
+{
+    return _sbrk(incr);
+}
+
 #endif