--- rxvt-unicode/src/rxvtutil.C 2014/05/22 18:54:33 1.19 +++ rxvt-unicode/src/rxvtutil.C 2014/10/28 09:05:33 1.21 @@ -20,6 +20,14 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ +// we include emman.c here to avoid relying on a C compiler, or +// on the c++ compiler not complaining about .c, which is unlikely, +// but... +// This must be the first include, because the _GNU_SOURCE and +// _XOPEN_SOURCE macros, used by emman.c, must be defined before +// inclusion of any header. +#include "emman.c" + #include #include #include @@ -41,6 +49,19 @@ free (p); } +void * +operator new (size_t s) throw (std::bad_alloc) +{ + // TODO: use rxvt_malloc + return malloc (s); +} + +void +operator delete (void *p) throw () +{ + free (p); +} + static void *temp_buf; static uint32_t temp_len; @@ -57,8 +78,3 @@ return temp_buf; } -// we include emman.c here to avoid relying on a C compiler, or -// on the c++ compiler not complaining about .c, which is unlikely, -// but... -#include "emman.c" -