It have to convert to C99/C11 before PellesC can compile it
This gives lots of errors with gcc:
gcc.exe -std=c11
EDIT:some fixes for PellesC with option
-Zx#ifdef __POCC__
#define typeof __typeof__
ptr_list create_list_size(size_t item_size);
//#define create_list(type)({create_list_size(sizeof(type));})
#define create_list(type) create_list_size(sizeof(type))
void list_add_ptr(ptr_list this_list, void* value);
void list_add_ptr_at(ptr_list this_list, void* value, int index);
#define list_add(list, value) {typeof(value) VAL = value; list_add_ptr(list, &VAL);}
void list_set_ptr(ptr_list this_list, int index, void* value);
#undef list_set
//#define list_set(list, index, value) ({typeof(value) VAL = value; list_set_ptr(list, index, &VAL);})
#define list_set(list, index, value) {typeof(value) _VAL; _VAL = value; list_set_ptr(list, index, &_VAL);}
#endif
and for list.h
//typedef struct list_options list_options, *ptr_list_options;
typedef struct _list_options
{
...
} list_options, *ptr_list_options;
...
//typedef struct _list _list, *ptr_list;
typedef struct _list
...
} _list, *ptr_list;
and for list.c
...
void* _list_index_ptr(ptr_list this_list, int index)
{
// return ((void**)(this_list->_heap_ptr + (this_list->_item_size * index)));
return ((void**)((unsigned char*)this_list->_heap_ptr + (this_list->_item_size * index)));
}
...
Can't fix this:
#define list_last_index_of(list, value) ({typeof(value) VAL = value; int index; index = list_last_index_of_ptr(list, &VAL); index;})