On Thu, 28 Apr 2011, Colin McCabe wrote:
> On Wed, Apr 27, 2011 at 12:28 PM, Tommi Virtanen
> <[email protected]> wrote:
> > On Wed, Apr 27, 2011 at 11:49:11AM -0700, Brian Chrisman wrote:
> >> ceph_mount_t is forward declared as a struct in libceph.h.
> >> When referencing that within libceph.h, gcc barfs:
> >> client/libceph.h:32: error: expected ?)? before ?*? token
> >>
> >> Is libceph.h intended to be used in C-programs, and if so, am I using
> >> it incorrectly?
> >> ceph_mount_t is defined as a class in libceph.cc, and I'm unclear on
> >> how that would be translated into a struct for C-programs linking to
> >> libceph.
> >
> > We talked about this on IRC, replying here for others & historical
> > records.
> >
> > The problem is this:
> >
> > struct ceph_mount_t;
> >
> > int ceph_create(ceph_mount_t **cmount, const char * const id);
> >
> > There is no ceph_mount_t. Changing the prototype to
> >
> > int ceph_create(struct ceph_mount_t **cmount, const char * const id);
> >
> > should get things going nicely (as long as you fix up the
> > implementation also).
>
> Yeah, the struct keyword needs to be added for the benefit of C
> clients. Sorry for any confusion.
I pushed a patch to master that adds this. It's now
struct ceph_mount_t;
which is sort of annoying: the _t suffix really shouldn't be there. But
if it's just ceph_mount it conflicts with int ceph_mount()... :/
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html