From 3d4bc8bea6b45893bd4b49f44df26bd602b4cba5 Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 7 Apr 2005 15:17:29 +0000 Subject: Update to use relayfs. --- runtime/map.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'runtime/map.h') diff --git a/runtime/map.h b/runtime/map.h index 9e30a926..65ed0674 100644 --- a/runtime/map.h +++ b/runtime/map.h @@ -150,12 +150,14 @@ typedef struct map_root *MAP; * type of the argument. * @note May cause compiler warning on some GCCs */ -#define _stp_map_set(map, val) \ +#define _stp_map_set(map, val) \ ({ \ - if (__builtin_types_compatible_p (typeof (val), char[])) \ + if (__builtin_types_compatible_p (typeof (val), char[])) \ _stp_map_set_str (map, (char *)(val)); \ - else \ - _stp_map_set_int64 (map, (int64_t)(val)); \ + else if (__builtin_types_compatible_p (typeof (val), String)) \ + _stp_map_set_string (map, (String)(val)); \ + else \ + _stp_map_set_int64 (map, (int64_t)(val)); \ }) /** Loop through all elements of a map or list. @@ -178,11 +180,13 @@ typedef struct map_root *MAP; * * @note May cause compiler warning on some GCCs */ -#define _stp_list_add(map, val) \ - ({ \ - if (__builtin_types_compatible_p (typeof (val), char[])) \ +#define _stp_list_add(map, val) \ + ({ \ + if (__builtin_types_compatible_p (typeof (val), char[])) \ _stp_list_add_str (map, (char *)(val)); \ - else \ + else if (__builtin_types_compatible_p (typeof (val), String)) \ + _stp_list_add_string (map, (String)(val)); \ + else \ _stp_list_add_int64 (map, (int64_t)(val)); \ }) -- cgit