From 85afccce2282ac5f75411c76a1723e1a263e4be2 Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Mon, 10 Jan 2022 18:02:29 +0100 Subject: [PATCH] improve compatibility for _MSC_VER copy from lexxmark/winflexbison@2a7586a by @yjh-styx - partial work on #367 --- src/tables.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tables.c b/src/tables.c index 182ab6379..63f35a71e 100644 --- a/src/tables.c +++ b/src/tables.c @@ -36,6 +36,11 @@ #include "flexdef.h" #include "tables.h" +#ifdef _MSC_VER +#define htonl(n) _byteswap_ulong(n) +#define htons(n) _byteswap_ushort(n) +#endif + /** Convert size_t to t_flag. * @param n in {1,2,4} * @return YYTD_DATA*.