Skip to content

Commit 4bd38cf

Browse files
Silence the annoying warning in MSVC about undeclared bswap
..\..\src\cborparser.c(149): warning C4013: '_byteswap_ushort' undefined; assuming extern returning int ..\..\src\cborparser.c(156): warning C4013: '_byteswap_ulong' undefined; assuming extern returning int ..\..\src\cborparser.c(163): warning C4013: '_byteswap_uint64' undefined; assuming extern returning int This apparently also fixes the unit test failures. FAIL! : tst_Parser::fixed(UINT32_MAX+1) Compared values are not the same Actual (decoded) : "0_3" Expected (expected): "4294967296" .\tst_parser.cpp(233) : failure location Signed-off-by: Thiago Macieira <[email protected]>
1 parent 49c15d9 commit 4bd38cf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compilersupport_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
# include <sys/byteorder.h>
126126
#elif defined(_MSC_VER)
127127
/* MSVC, which implies Windows, which implies little-endian and sizeof(long) == 4 */
128+
# include <stdlib.h>
128129
# define cbor_ntohll _byteswap_uint64
129130
# define cbor_htonll _byteswap_uint64
130131
# define cbor_ntohl _byteswap_ulong

0 commit comments

Comments
 (0)