After 3 days of line-by-line adding and fixing errors, I've got all but 2 files to compile.
In file included from recycle.c:133: allocfunc.h: In function 'new_skhash': allocfunc.h:1: error: dereferencing pointer to incomplete type allocfunc.h:1: error: dereferencing pointer to incomplete type allocfunc.h:1: error: dereferencing pointer to incomplete type allocfunc.h: In function 'free_skhash': allocfunc.h:1: error: dereferencing pointer to incomplete type *** Error code 1
allocfunc.h is only one line, but that seems to be the problem. allocfunc(struct skhash,skhash)
If it helps, here is what is in recycle.c also.
#define STANDARD_ALLOCMEM(type, name) \ type * name ## _free; \ int name ## _created; \ int name ## _allocated; \ \ type * new_ ## name( void ) \ { \ static type * tZero; \ type * temp; \ \ if ( name ## _free ) \ { \ temp = name ## _free; \ name ## _free = name ## _free->next; \ } \ else \ { \ temp = (type*)alloc_mem( sizeof(*temp) ); \ name ## _allocated++; \ } \ \ *temp = tZero; \ \ name ## _created++; \ \ return temp; \ }
#define STANDARD_FREEMEM(type, name) \ int name ## _freed; \ \ void free_ ## name( type * temp ) \ { \ temp->next = name ## _free; \ name ## _free = temp; \ name ## _freed++; \ }
#define VAL_ALLOCMEM(type, name) \ type * name ## _free; \ int name ## _created; \ int name ## _allocated; \ \ type * new_ ## name( void ) \ { \ static type * tZero; \ type * temp; \ \ if ( name ## _free ) \ { \ temp = name ## _free; \ name ## _free = name ## _free->next; \ } \ else \ { \ temp = (type*)alloc_mem( sizeof(*temp) ); \ name ## _allocated++; \ } \ \ *temp = tZero; \ \ VALIDATE(temp); \ \ name ## _created++; \ \ return temp; \ }
#define VAL_FREEMEM(type, name) \ int name ## _freed; \ \ void free_ ## name( type * temp ) \ { \ if (!IS_VALID(temp)) \ return; \ \ INVALIDATE(temp); \ temp->next = name ## _free; \ name ## _free = temp; \ name ## _freed++; \ }
For the sake of everyone's sanity, I enclosed your code in code tags :)
That should make it easier for someone to see what the problem is, though it's pretty clear from the error message that something in allocfunc.h is actually at fault, not something in recycle.c
In file included from recycle.c:133:
allocfunc.h: In function 'new_skhash':
allocfunc.h:1: error: dereferencing pointer to incomplete type
allocfunc.h:1: error: dereferencing pointer to incomplete type
allocfunc.h:1: error: dereferencing pointer to incomplete type
allocfunc.h: In function 'free_skhash':
allocfunc.h:1: error: dereferencing pointer to incomplete type
*** Error code 1
allocfunc.h is only one line, but that seems to be the problem.
allocfunc(struct skhash,skhash)
If it helps, here is what is in recycle.c also.
Any help greatly appricated! I've searched the net already, and seen similar problems, but the suggested fixes didn't completly help.