I'm trying to implement some functions into the Lua PMCs, but I'm having
trouble to compile them.
I want to add a clone method to the LuaNil PMC (which should extend
Null.pmc, not None.pmc, as it does currently; changed that already)
However, I get the following error:
luanil.c:343: error: conflicting types for `clone'
/usr/include/bits/sched.h:72: error: previous declaration of `clone'
compile luanil.c failed (256)
make: *** [pmcs] Error 2
It seems the compiler finds another function called "clone", which has
nothing to do with Parrot:
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
Copyright (C) 1996-1999,2001,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
regards,
klaas-jan
clone is a standardized vtable function. But it's name is never a bare
'clone', it's always prefixed by 'Parrot_<ClassName>_. This is also true
for
METHOD PMC* clone() # dunno if that works, if vtable exists
You must have some bug in your PMC code.
leo
On Linux clone() is a syscall with a wraper function in the the standard
library that is defined in sched.h. On my laptop types.h includes
pthreadtypes.h which includes sched.h. You should *probably* use a
different function name. ;)
-J
--
I got the bug already, thank! (stupid error in PMC file) Works perfectly
now.
-kj