Browse Source

Remove stdbool.h from avl_tree since MSVC doesn't like it.

tags/v0.5
Ben Kurtovic 6 years ago
parent
commit
2593675651
2 changed files with 8 additions and 2 deletions
  1. +6
    -0
      mwparserfromhell/parser/ctokenizer/avl_tree.c
  2. +2
    -2
      mwparserfromhell/parser/ctokenizer/avl_tree.h

+ 6
- 0
mwparserfromhell/parser/ctokenizer/avl_tree.c View File

@@ -3,6 +3,7 @@
* binary search tree), implementation file * binary search tree), implementation file
* *
* Written in 2014-2016 by Eric Biggers <ebiggers3@gmail.com> * Written in 2014-2016 by Eric Biggers <ebiggers3@gmail.com>
* Slight changes for compatibility by Ben Kurtovic <ben.kurtovic@gmail.com>
* *
* To the extent possible under law, the author(s) have dedicated all copyright * To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain * and related and neighboring rights to this software to the public domain
@@ -17,6 +18,11 @@
* see <http://creativecommons.org/publicdomain/zero/1.0/>. * see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/ */


#define false 0
#define true 1

typedef int bool;

#include "avl_tree.h" #include "avl_tree.h"


/* Returns the left child (sign < 0) or the right child (sign > 0) of the /* Returns the left child (sign < 0) or the right child (sign > 0) of the


+ 2
- 2
mwparserfromhell/parser/ctokenizer/avl_tree.h View File

@@ -3,6 +3,7 @@
* binary search tree), header file * binary search tree), header file
* *
* Written in 2014-2016 by Eric Biggers <ebiggers3@gmail.com> * Written in 2014-2016 by Eric Biggers <ebiggers3@gmail.com>
* Slight changes for compatibility by Ben Kurtovic <ben.kurtovic@gmail.com>
* *
* To the extent possible under law, the author(s) have dedicated all copyright * To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain * and related and neighboring rights to this software to the public domain
@@ -20,7 +21,6 @@
#ifndef _AVL_TREE_H_ #ifndef _AVL_TREE_H_
#define _AVL_TREE_H_ #define _AVL_TREE_H_


#include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <inttypes.h> /* for uintptr_t */ #include <inttypes.h> /* for uintptr_t */


@@ -78,7 +78,7 @@ avl_tree_node_set_unlinked(struct avl_tree_node *node)
/* Returns true iff the specified AVL tree node has been marked with /* Returns true iff the specified AVL tree node has been marked with
* avl_tree_node_set_unlinked() and has not subsequently been inserted into a * avl_tree_node_set_unlinked() and has not subsequently been inserted into a
* tree. */ * tree. */
static AVL_INLINE bool
static AVL_INLINE int
avl_tree_node_is_unlinked(const struct avl_tree_node *node) avl_tree_node_is_unlinked(const struct avl_tree_node *node)
{ {
return node->parent_balance == (uintptr_t)node; return node->parent_balance == (uintptr_t)node;


Loading…
Cancel
Save