devkitPro / libctru

Homebrew development library for Nintendo 3DS/Horizon OS user mode (Arm11)
https://libctru.devkitpro.org/
771 stars 170 forks source link

Standard C headers #25

Closed minexew closed 9 years ago

minexew commented 9 years ago

Will patches implementing standard C libraries (stdlib, stdio, math etc) be accepted? Is there already another project for that?

Thanks.

mtheall commented 9 years ago

We don't need that. It's part of newlib which is part of devkitARM.

minexew commented 9 years ago

So newlib has been already ported to the CTR?

mtheall commented 9 years ago

There was no change. It's the same as from what's supported for libnds.

minexew commented 9 years ago

Then I don't see how fopen, for example, could work at all.

mtheall commented 9 years ago

You can help finish this: https://github.com/smealum/ctrulib/blob/master/libctru/source/sdmc_dev.c

You just call sdmcInit() in your program then you can do like FILE *fp = fopen("sdmc:/file.txt", "r");

minexew commented 9 years ago

Alright, I'll look into that. I installed a bare-bones devkitPro (e.g. without libnds) and couldn't find std*.h anywhere, so I assumed it didn't exist at all. Thanks.

mtheall commented 9 years ago

You don't "install" devkitPro. Unless you're talking about devkitARM. That's what has the standard headers and libraries.

minexew commented 9 years ago

...aaaaand you're right. I just wasn't looking in the right subdirectory (and apparently have messed up my include paths somehow). Neat.