> > > > Then write apr_file_get_pool(). Not a cast and an assumption. > > > > > > That also means that we have to write apr_socket_get_pool and > > > apr_lock_get_pool and apr_mmap_get_pool, etc. > > > > Yup. > > That is ugly and just plain wrong.
It is also standard design practice for use of incomplete types. You should be following it or not using incomplete types. I personally find it ugly and don't use incomplete types. > If I understand your problem with this, you are afraid that somebody will > use this macro on a variable that is either not an APR variable, or is an > APR type but is not one of the incomplete types. Well, this can be fixed > multiple ways. Just require that every APR structure has a pool at the > beginning of the structure, whether it is complete or not. I would argue that none of the APR types should have a pool, but I don't have that much time on my hands. ....Roy
