18 Jun, 2009, Karp wrote in the 1st comment:
Votes: 0
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++; \
}


#define allocfunc(a,b) \
STANDARD_ALLOCMEM(a,b) \
STANDARD_FREEMEM(a,b)

#define allocfunc_val(a,b) \
VAL_ALLOCMEM(a,b) \
VAL_FREEMEM(a,b)

#include "allocfunc.h" —— this line is the error line

#undef allocfunc
#undef allocfunc_val




Any help greatly appricated! I've searched the net already, and seen similar problems, but the suggested fixes didn't completly help.
18 Jun, 2009, Guest wrote in the 2nd comment:
Votes: 0
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
18 Jun, 2009, Omega wrote in the 3rd comment:
Votes: 0
why would anyone use the V2 series of Ivans OLC, that stuff is the buggiest stuff ever. IMO, 1.81 is the most stable. Thats my recommendation. ;)

Anything above 1.81, code yourself ;)
0.0/3