On Sun, Feb 13, 2011 at 2:25 AM, Bradley Jarvis < b...@pocketinnovations.com.au> wrote:
> On 02/13/11 04:01, avr-libc-dev-requ...@nongnu.org wrote: > > The new / delete operators can be put in a different namespace in order > to > > avoid any name collisions with the new/delete in the std namespace. > > the header could still be called new and then just put it in the compat > > directory (compat/new) to differentiate it from the standards compliant > new > > header. > The header file is not needed as Joerg pointed out, I have tried to > define the operators as inline in a header since they only wrap the > malloc and free functions however this does not seem to work and I end > up getting errors because of multiple instances. So I have had a look at > adding the wrappers to the stdlib library in a new file called new.c > that basically contains ... > The only problem though is the the compiler baulks at the c++ stuff > while building avr-libc. I tried encapsulating in extern "c++" {} but it > did not seem to help. I will keep playing around with it, but am open to > suggestions on what to try. > For simple programs the <new> header might not be needed but when files don't use the std namespace they will need the <new> header. I was actually only thinking of the header file being for declaring the functions. If you haven't already, you could try changing the extension of new.c to a C++ extension (new.cc, new.cpp) to try and get stdlib to compile. --John _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev