aboutsummaryrefslogtreecommitdiff
path: root/src/api/helpers.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-12 21:44:33 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-13 14:11:32 -0300
commitf0f4ab55002bc9a024b36a6d2c3472ae8583500a (patch)
treea9340effbf418046cea45801909bfd9d6ee444c1 /src/api/helpers.c
parentf69b0a1dc768f94d8087bfae6cb5f9841d6e0068 (diff)
downloadrneovim-f0f4ab55002bc9a024b36a6d2c3472ae8583500a.tar.gz
rneovim-f0f4ab55002bc9a024b36a6d2c3472ae8583500a.tar.bz2
rneovim-f0f4ab55002bc9a024b36a6d2c3472ae8583500a.zip
Use platform check for correct selection of khash type in helpers.c
Diffstat (limited to 'src/api/helpers.c')
-rw-r--r--src/api/helpers.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/helpers.c b/src/api/helpers.c
index 585ad493d5..51b1dcb754 100644
--- a/src/api/helpers.c
+++ b/src/api/helpers.c
@@ -14,7 +14,13 @@
#include "lib/khash.h"
+#if defined(ARCH_64)
+typedef uint64_t ptr_int_t;
KHASH_SET_INIT_INT64(Lookup)
+#elif defined(ARCH_32)
+typedef uint32_t ptr_int_t;
+KHASH_SET_INIT_INT(Lookup)
+#endif
/// Recursion helper for the `vim_to_object`. This uses a pointer table
/// to avoid infinite recursion due to cyclic references
@@ -406,7 +412,7 @@ static Object vim_to_object_rec(typval_T *obj, khash_t(Lookup) *lookup)
if (obj->v_type == VAR_LIST || obj->v_type == VAR_DICT) {
int ret;
// Container object, add it to the lookup table
- kh_put(Lookup, lookup, (uint64_t)obj, &ret);
+ kh_put(Lookup, lookup, (ptr_int_t)obj, &ret);
if (!ret) {
// It's already present, meaning we alredy processed it so just return
// nil instead.