What you are doing here is a similar approach as the ACE/TAO people 
have done. I just talk about the 'throw' without actually using
exceptions.
You may want to take a look it. It is a free CORBA ORB. But 
If you need more info about a link I may find it again.

> Hello,
> 
> I try to get the same c++ source to compile in user and kernel space.
> This is
> due to the same code. The exceptions do I emulate using a global flag,
> so I can
> use a macro THROW(e) which expands inside kernelspace to 
> struct XCeption {
>   bool here;
>   char* what_str;
> };
> 
> XCeption.here = true;
> XCeption.what_str = e.what();
> 
> and in user space to 
> 
> throw e;
> 
> So I can use THROW(std::bad_alloc()). Further more I have rewritten
> new/delete
> so that I can use new(nothrow) for user space - in kernel is ignored. So
> the
> sucess is controled like the old c++ std:
> 
> char *p = new(nothrow) char[29];
> if(!p) {
>       // no mem - no fun
> }
> 
> No I have problems by insmod:
> # insmod no_xception_test.o
> no_xception_test.o: unresolved symbol __vt_9bad_alloc
> no_xception_test.o: unresolved symbol _._9bad_alloc
> no_xception_test.o: unresolved symbol __9exception
> no_xception_test.o: unresolved symbol __vn__FUiRC9nothrow_t
> no_xception_test.o: unresolved symbol nothrow          
> 
> nothrow seems is declared inside new header to
> extern const nothrow_t nothrow; 
> 
> What about bad_alloc and exception ? A simple 
> #define nothrow nothrow_t()
> doesn't help.
> 
> Any help and experience here ?
> It's interesting to compile the c++ module and to get the error similar
> to "can
> not find version for compiled for". What's going on here ?. As a result
> I have
> to write a main.c file with init/cleanup_module.
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> ---
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
> 

-- 
Sent through GMX FreeMail - http://www.gmx.net
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to