librb: rb_dictionary: temporary hack to shut up gcc on windows

This commit is contained in:
William Pitcock 2016-03-20 01:46:00 -05:00
parent 85368a13d3
commit e0dc28c59f

View file

@ -153,6 +153,8 @@ extern unsigned int rb_dictionary_size(struct Dictionary *dtree);
void rb_dictionary_stats(struct Dictionary *dict, void (*cb)(const char *line, void *privdata), void *privdata);
void rb_dictionary_stats_walk(void (*cb)(const char *line, void *privdata), void *privdata);
#ifndef _WIN32
#define RB_POINTER_TO_INT(x) ((int32_t) (long) (x))
#define RB_INT_TO_POINTER(x) ((void *) (long) (int32_t) (x))
@ -165,6 +167,22 @@ void rb_dictionary_stats_walk(void (*cb)(const char *line, void *privdata), void
#define RB_POINTER_TO_ULONG(x) ((uint64_t) (unsigned long long) (x))
#define RB_ULONG_TO_POINTER(x) ((void *) (unsigned long long) (uint64_t) (x))
#else
#define RB_POINTER_TO_INT(x) ((int32_t) (unsigned long long) (x))
#define RB_INT_TO_POINTER(x) ((void *) (unsigned long long) (int32_t) (x))
#define RB_POINTER_TO_UINT(x) ((uint32_t) (unsigned long long) (x))
#define RB_UINT_TO_POINTER(x) ((void *) (unsigned long long) (uint32_t) (x))
#define RB_POINTER_TO_LONG(x) ((int64_t) (unsigned long long) (x))
#define RB_LONG_TO_POINTER(x) ((void *) (unsigned long long) (int64_t) (x))
#define RB_POINTER_TO_ULONG(x) ((uint64_t) (unsigned long long) (x))
#define RB_ULONG_TO_POINTER(x) ((void *) (unsigned long long) (uint64_t) (x))
#endif
static inline int rb_int32cmp(const void *a, const void *b)
{
return RB_POINTER_TO_INT(b) - RB_POINTER_TO_INT(a);