Fix for stdbool type

This commit is contained in:
c9s 2015-11-17 21:40:21 +08:00
parent b0971e1553
commit 1f1ab15cdd
2 changed files with 6 additions and 8 deletions

View file

@ -12,8 +12,6 @@
#include <string.h>
#include <pcre.h>
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
@ -23,11 +21,11 @@
#if !defined(bool) && !defined(__cplusplus)
typedef unsigned char bool;
#endif
#ifndef FALSE
# define FALSE 0
#ifndef false
# define false 0
#endif
#ifndef TRUE
# define TRUE 1
#ifndef true
# define true 1
#endif
#endif

View file

@ -772,13 +772,13 @@ node * r3_tree_insert_pathl_ex(node *tree, const char *path, int path_len, route
}
bool r3_node_has_slug_edges(const node *n) {
bool found = FALSE;
bool found = false;
edge *e;
for ( int i = 0 ; i < n->edge_len ; i++ ) {
e = &n->edges[i];
e->has_slug = r3_path_contains_slug_char(e->pattern);
if (e->has_slug)
found = TRUE;
found = true;
}
return found;
}