apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: apr_dbd: a generic SQL wrapper
Date Fri, 10 Dec 2004 06:04:20 GMT
On Fri, 10 Dec 2004, Branko ^Libej wrote:

> >The #ifndef is because *drivers* have to declare them before
> >#including apr_dbd.h.
> >
> >
> They don't have to declare them before including the header. This
> sequence is completely valid:
>
>     typedef struct foo foo;
>
>     struct foo {
>        int bar;
>     };

To take a real example from the existing drivers, that works with

    typedef struct apr_dbd_prepared apr_dbd_prepared;

    struct apr_dbd_prepared {
        const char *name;
        int prepared;
    };

but fails with

    typedef struct apr_dbd_prepared apr_dbd_prepared;

    typedef MYSQL_STMT apr_dbd_prepared;

IOW, removing the #ifdefs would force drivers to wrap everything,
even if they have no good reason to do so.  KISS!


-- 
Nick Kew

Mime
View raw message