When KermM started making progress with Graph3DP and issues kept popping up about the math engine (it was made for 16KB of RAM and ROM ), I decided I should go looking for something more powerful. I settled on giac, however when looking at the requirements, STL containers and other C++ features made me want to port libstdc++.
Thanks to the progress on libc functions and loads of gcc poking, I now have libsupc++ and libgcc compiled (using sjlj exception handler code, DWARF2 is broken on the prizm for whatever reason), which let me compile uClibc++ as a drop-in replacement for gcc's libstdc++.
Let me just give you an example of what you can do now:
Code:
The Prizm happily prints out the intended exception message. It seems most things in libuClibc++ work. STL containers work, as you can already see. cout (and probably other file access) doesn't work as it having buffering issues. I will run tests on the rest of the container types, fix file IO, give cout more control, and move on.
Thanks to the progress on libc functions and loads of gcc poking, I now have libsupc++ and libgcc compiled (using sjlj exception handler code, DWARF2 is broken on the prizm for whatever reason), which let me compile uClibc++ as a drop-in replacement for gcc's libstdc++.
Let me just give you an example of what you can do now:
Code:
#include <iostream>
#include <fxcg/display.h>
#include <fxcg/keyboard.h>
using namespace std;
void test(int x)
{
if(x == 0)
throw string("Zero found!");
}
int main()
{
int i = 3;
try
{
while(1)
{
test(i);
i--;
}
}
catch(string e)
{
PrintXY(1,1," Caught exception:", 0, 0);
PrintXY(1,2,string(" ").append(e).c_str(), 0, 0); // Fun fun fun!
int key;
while(1) GetKey(&key);
}
catch(...)
{
PrintXY(1,1," Bad exception!", 0, 0); // Doesn't execute, as expected!
int key;
while(1) GetKey(&key);
}
}
The Prizm happily prints out the intended exception message. It seems most things in libuClibc++ work. STL containers work, as you can already see. cout (and probably other file access) doesn't work as it having buffering issues. I will run tests on the rest of the container types, fix file IO, give cout more control, and move on.