[ovs-dev] [PATCH 1/5] lib/util.c: add ovs_windows_only() cpp macro
Nithin Raju
nithin at vmware.com
Wed Oct 22 16:06:35 UTC 2014
On Oct 22, 2014, at 8:58 AM, Ben Pfaff <blp at nicira.com>
wrote:
> I'm not sure I'm happy about this.
>
> For the only uses of this macro introduced in this patch series, which
> are assertions on variables that are always present, the code does not
> have to be Windows-only after the preprocessor. One could simply write:
>
> #ifdef _WIN32
> enum { WINDOWS = 1 };
> #else
> enum { WINDOWS = 0 };
> #endif
>
> and then add "WINDOWS &&" to the assertions.
hi Ben,
That is a good suggestion. All I want to do is to avoid peppering the code with #ifdef _WIN32 for one line code.
I'll add the enum you suggested to dpif-netlink.c since that is where we primarily need it. We can move it to util.h when/if we need to.
I'll incorporate your comments in v2.
Thanks,
-- Nithin
More information about the dev
mailing list