Proposed change to the vfs.h to simplify call_xxx routines

Richard Sharpe realrichardsharpe at
Sun Dec 11 10:56:05 MST 2011

On Sun, Dec 11, 2011 at 9:44 AM, Stefan (metze) Metzmacher
<metze at> wrote:
> Hi Richard,
>> here is a change I am proposing:
>> diff --git a/source3/include/vfs.h b/source3/include/vfs.h
>> index d32aafd..7a7030a 100644
>> --- a/source3/include/vfs.h
>> +++ b/source3/include/vfs.h
>> @@ -164,6 +164,11 @@ struct dfs_GetDFSReferral;
>>                                 handle = handle->next; \
>>                          }
>> +#define VFS_FIND_CALL(__fn__, ...) while (handle->fns->__fn__##_fn==NULL) {\
>> +                                       handle=handle->next; \
>> +                                  } \
>> +                                  return handle->fns->__fn__##_fn(__VA_ARGS__);
>> +
> Not all compilers (with basic c99 support, also) support var args.
> We need to think about that and decide that we don't want to drop
> for such compilers.

Yes, that is an issue. I am not sure that the code churn is worth the
simplification given that developers would quickly find any
misspellings caused by having to type the same name twice or
forgetting to change every name after cutting and pasting.

However, can you tell me the compilers that do not support variadic
macro args. This site: seems to
suggest that Microsoft's VC++ is one such compiler, but surely we do
not care about it.

I have mostly completed the change to the VFS function names so that
they are consistent now, and am just waiting on a resolution of the
above issue before pushing the change ... although I will send a patch
around for review again (with the issues Volker identified fixed now.)

Richard Sharpe

More information about the samba-technical mailing list