ucx/ucx.h

changeset 69
fb59270b1de3
parent 65
7b2f2cab6348
child 76
655020a30e77
     1.1 --- a/ucx/ucx.h	Thu Oct 11 16:29:30 2012 +0200
     1.2 +++ b/ucx/ucx.h	Fri Oct 12 10:54:55 2012 +0200
     1.3 @@ -13,12 +13,23 @@
     1.4  #ifdef	__cplusplus
     1.5  #ifndef _Bool
     1.6  #define _Bool bool
     1.7 +#define restrict
     1.8  #endif
     1.9  extern "C" {
    1.10  #endif
    1.11  
    1.12  #define UCX_FOREACH(type,list,elem) \
    1.13          for (type elem = list ; elem != NULL ; elem = elem->next)
    1.14 +
    1.15 +#ifdef __cplusplus
    1.16 +#define ucx_dynarray_new(type,identifier,length)\
    1.17 +    type* identifier; identifier = new type[length]
    1.18 +#define ucx_dynarray_free(identifier) delete [] identifier
    1.19 +#else
    1.20 +#define ucx_dynarray_new(type,identifier,length)\
    1.21 +    type identifier[length]
    1.22 +#define ucx_dynarray_free(identifier)
    1.23 +#endif
    1.24      
    1.25  /* element1,element2,custom data -> {-1,0,1} */
    1.26  typedef int(*cmp_func)(void*,void*,void*);

mercurial