Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
213 dhylands 1
/****************************************************************************
2
*
3
*   The following code snippet came from a post on AVR Freaks
4
*
5
*   http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453&start=all&postdays=0&postorder=asc
6
*
7
****************************************************************************/
8
 
9
#include <stdlib.h>
10
 
11
void * operator new(size_t size)
12
{
13
  return malloc(size);
14
}
15
 
16
void operator delete(void * ptr)
17
{
18
  free(ptr);
19
}
20
 
21
__extension__ typedef int __guard __attribute__((mode (__DI__)));
22
 
23
extern "C" int __cxa_guard_acquire(__guard *);
24
extern "C" void __cxa_guard_release (__guard *);
25
extern "C" void __cxa_guard_abort (__guard *);
26
 
27
int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);};
28
void __cxa_guard_release (__guard *g) {*(char *)g = 1;};
29
void __cxa_guard_abort (__guard *) {};
30
 
31
extern "C" void __cxa_pure_virtual(void);
32
void __cxa_pure_virtual(void) {};
33