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

Reply via email to