… | |
… | |
6 | #else |
6 | #else |
7 | # define is_constant(c) 0 |
7 | # define is_constant(c) 0 |
8 | #endif |
8 | #endif |
9 | |
9 | |
10 | #include <cstddef> |
10 | #include <cstddef> |
|
|
11 | #include <new> |
|
|
12 | #include <vector> |
11 | |
13 | |
12 | #include <glib.h> |
14 | #include <glib.h> |
|
|
15 | |
|
|
16 | #include <shstr.h> |
|
|
17 | #include <traits.h> |
13 | |
18 | |
14 | // use a gcc extension for auto declarations until ISO C++ sanctifies them |
19 | // use a gcc extension for auto declarations until ISO C++ sanctifies them |
15 | #define AUTODECL(var,expr) typeof(expr) var = (expr) |
20 | #define AUTODECL(var,expr) typeof(expr) var = (expr) |
16 | |
21 | |
17 | // makes dynamically allocated objects zero-initialised |
22 | // makes dynamically allocated objects zero-initialised |
… | |
… | |
191 | { |
196 | { |
192 | return !strcmp (a, b); |
197 | return !strcmp (a, b); |
193 | } |
198 | } |
194 | }; |
199 | }; |
195 | |
200 | |
196 | #include <vector> |
|
|
197 | |
|
|
198 | template<class obj> |
201 | template<class obj> |
199 | struct unordered_vector : std::vector<obj, slice_allocator<obj> > |
202 | struct unordered_vector : std::vector<obj, slice_allocator<obj> > |
200 | { |
203 | { |
201 | typedef typename unordered_vector::iterator iterator; |
204 | typedef typename unordered_vector::iterator iterator; |
202 | |
205 | |
… | |
… | |
233 | typedef double tstamp; |
236 | typedef double tstamp; |
234 | |
237 | |
235 | // return current time as timestampe |
238 | // return current time as timestampe |
236 | tstamp now (); |
239 | tstamp now (); |
237 | |
240 | |
|
|
241 | int similar_direction (int a, int b); |
|
|
242 | |
238 | #endif |
243 | #endif |
239 | |
244 | |