I’m not C programmer, and I’m trying to apply patch to project that compiles fine with MSVC, but patch is provided for *nix. When I try to compile patched project with nmake I get this error:
error C2054: expected '(' to follow '__private'
Code that raises this error is this:
private drawlist *
drawlist_append(p2mem *mem, drawlist_head *head)
{
drawlist *d = p2mem_alloc(mem, sizeof(drawlist));
if (!d) return 0;
memset(d, 0, sizeof(drawlist));
d->color = gx_no_color_index;
d->next = 0;
d->prev = head->last;
head->last = d;
(d->prev) ? (d->prev->next = d) : (head->first = d);
return d;
}
By googling, I suspect that MSVC doesn’t accept this kind of declaration, but I have no idea how to change the code, because as mentioned I’m not C/C++ programmer. Can anyone assist how to change this private function call so that it is valid for MSVC?
if
drawlist_appendis a member function declared insideclass,you could try:
If drawlist_append is a standalone function, you just remove
private, you could try this:The other possibility is that patch provider meant
staticinstead ofprivate.You could try add below macro for *nix C: