From 99ce86742401eea5550e0fb89b86ff9d52bd648a Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 7 Dec 2017 04:41:51 +0100 Subject: [PATCH] src: polyfill the 'include' keyword for Visual Studio 2013 --- src/queue.c | 1 + src/tree.c | 1 + src/util.h | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/queue.c b/src/queue.c index 3ad927e..f52cb3d 100644 --- a/src/queue.c +++ b/src/queue.c @@ -2,6 +2,7 @@ #include #include "queue.h" +#include "util.h" void queue_init(queue_t* queue) { queue_node_init(&queue->head); diff --git a/src/tree.c b/src/tree.c index 743814b..d742b95 100644 --- a/src/tree.c +++ b/src/tree.c @@ -3,6 +3,7 @@ #include "error.h" #include "rb.h" #include "tree.h" +#include "util.h" static inline int _tree_compare(tree_node_t* a, tree_node_t* b) { if (a->key < b->key) diff --git a/src/util.h b/src/util.h index e59de48..eb42632 100644 --- a/src/util.h +++ b/src/util.h @@ -20,6 +20,11 @@ typedef intptr_t ssize_t; #define unused(v) ((void) (v)) +#if defined(_MSC_VER) && _MSC_VER < 1900 +/* Polyfill `inline` for msvc 12 (Visual Studio 2013) */ +#define inline __inline +#endif + #ifdef __clang__ /* Polyfill static_assert() because clang doesn't support it. */ #define static_assert(condition, message) typedef __attribute__( \