The original problem that caused us to have to type cast is the fact that our compiler complains about the type mismatch between void* and unsigned long. How does this resolve that issue? It still looks like I am going to get a type mismatch.
Brad Nicholes Senior Software Engineer Novell, Inc., the leading provider of Net business solutions http://www.novell.com >>> Brian Pane <[EMAIL PROTECTED]> Thursday, January 09, 2003 10:44:42 AM >>> William A. Rowe, Jr. wrote: >In that case... what about a trick (I believe) Ben Laurie taught us? >Using a typedef for clarity: > >typedef void*(*apr_atomic_casptr_fn_t)(unsigned long* mem, unsigned long cmp, unsigned long with); > >#define apr_atomic_casptr ((apr_atomic_casptr_fn_t)(atomic_cmpxchg)) > >In this way, the arguments to apr_atomic_casptr will be evaluated in terms >of the apr_atomic_casptr_fn_t declaration. > >This presumes the arguments exactly match the atomic_cmpxchg function, >with the exception of twos-compliment signedness. > >Make sense? > I like the typedef approach, but shouldn't it be typedef void*(*apr_atomic_casptr_fn_t)(void** mem, const void *cmp, const void *with); since casptr operates on pointers rather than ints? Brian
