[ovs-dev] [PATCH 4/4] ofp-actions: Add compare to offsetof need for MSVC 2015/17

Ben Pfaff blp at ovn.org
Fri Nov 3 18:40:15 UTC 2017


On Wed, Nov 01, 2017 at 07:19:07PM +0200, Alin Gabriel Serdean wrote:
> Unfortunately starting from VS 2015, the "C" definition for `offsetof`
> has been changed. Please see:
> https://stackoverflow.com/questions/42725929/using-offsetof-with-enum-does-not-compile-in-visual-studio-2015/42726424
> 
> Several people reported the bug for 2015 and also 2017 (i.e. :
> https://developercommunity.visualstudio.com/content/problem/22196/static-assert-cannot-compile-constexprs-method-tha.html
> ), but we don't have a fix yet.
> 
> This patch adds an explicit compare, although we could redefine the macro
> for the same effect.
> 
> Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>

That's super weird.

If this solves the problem, it's fine with me.

Acked-by: Ben Pfaff <blp at ovn.org>


More information about the dev mailing list