unaligned: Make get_unaligned_be64() compatible on GCC and non-GCC.
authorBen Pfaff <blp@nicira.com>
Thu, 9 Oct 2014 05:13:31 +0000 (22:13 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 9 Oct 2014 15:33:25 +0000 (08:33 -0700)
commit79461d20a8d5b7aba6cae5f6fa0fad5e8ac49235
tree2f076f3b8443eae4f458b4f96ed87cc6a122d13b
parentc47bb4350110a9b3aeb39b1c122c13b8914a7233
unaligned: Make get_unaligned_be64() compatible on GCC and non-GCC.

Until now, with GCC, get_unaligned_be64() had an interface that accepted
a "ovs_be64 *", and with other compilers its accepted any
pointer-to-64-bit type, but not void *.  This commit fixes the problem,
making the interface the same in both cases.

This fixes a build error on MSVC:

    lib/nx-match.c(320) : error C2100: illegal indirection
    lib/nx-match.c(320) : error C2034: 'build_assert_failed' : type of bit
        field too small for number of bits
    lib/nx-match.c(320) : error C2296: '%' : illegal, left operand has
        type 'void *'
    lib/nx-match.c(320) : error C2198: 'ntohll' : too few arguments for call

It might appear that this patch changes get_unaligned_u64() but in fact
it onloy moves it earlier in the file (since it is now called from the
non-GCC fork of the #if).

Reported-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/unaligned.h