diff options
author | fcolin | 2005-08-10 09:52:18 +0000 |
---|---|---|
committer | fcolin | 2005-08-10 09:52:18 +0000 |
commit | c271c5a2383450c2a39e126ebef38d8dd2e2f8e6 (patch) | |
tree | 46eaf3e4a9fc79a47bfd9e8942cef981908f304f /src/list.h | |
parent | b0954d7461dc709cd1a43097c260c8e8b0183cee (diff) | |
download | ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.zip ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.gz ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.bz2 ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.xz |
remplacement argc argv par IvyArgument
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -13,11 +13,15 @@ * Please refer to file version.h for the * copyright notice regarding this software */ -#if (__GNUC__ >= 3) +#ifdef WIN32 +#define TYPEOF(p) void* +#else +#if (__GNUC__ >= 2) #define TYPEOF(p) typeof (p) #else #define TYPEOF(p) void * #endif +#endif #define IVY_LIST_ITER( list, p, cond ) \ p = list; \ @@ -57,7 +61,23 @@ memset( p, 0 , sizeof( *p ));\ p->next = list; \ list = p; \ - } + } + +#define IVY_LIST_ADD_END(list, p ) \ + if ((p = (TYPEOF(p)) (malloc( sizeof( *p ))))) \ + { \ + TYPEOF(p) list_end; \ + memset( p, 0 , sizeof( *p ));\ + p->next = 0; \ + if ( list ) \ + {\ + list_end = list; \ + while ( list_end && list_end->next ) \ + list_end = list_end->next;\ + list_end->next = p; \ + } \ + else list = p; \ + } #define IVY_LIST_EACH( list, p ) \ for ( p = list ; p ; p = p -> next ) |