… | |
… | |
24 | *----------------------------------------------------------------------*/ |
24 | *----------------------------------------------------------------------*/ |
25 | |
25 | |
26 | #include "../config.h" /* NECESSARY */ |
26 | #include "../config.h" /* NECESSARY */ |
27 | #include "rxvt.h" /* NECESSARY */ |
27 | #include "rxvt.h" /* NECESSARY */ |
28 | |
28 | |
|
|
29 | #include <new> |
|
|
30 | |
|
|
31 | // alas new/delete cannot be specified as inline in C++11 (see 17.6.4.6) |
|
|
32 | void * |
|
|
33 | operator new (size_t s) |
|
|
34 | #if !ECB_CPP11 |
|
|
35 | throw (std::bad_alloc) |
|
|
36 | #endif |
|
|
37 | { |
|
|
38 | return rxvt_malloc (s); |
|
|
39 | } |
|
|
40 | |
|
|
41 | void |
|
|
42 | operator delete (void *p) |
|
|
43 | #if ECB_CPP11 |
|
|
44 | noexcept |
|
|
45 | #else |
|
|
46 | throw () |
|
|
47 | #endif |
|
|
48 | { |
|
|
49 | free (p); |
|
|
50 | } |
|
|
51 | |
29 | char * |
52 | char * |
30 | rxvt_wcstombs (const wchar_t *str, int len) |
53 | rxvt_wcstombs (const wchar_t *str, int len) |
31 | { |
54 | { |
32 | if (len < 0) len = wcslen (str); |
55 | if (len < 0) len = wcslen (str); |
33 | |
56 | |