Skip to content

Commit

Permalink
Use PRIsVALUE shim when not available for Ruby < 2.0 compatibility. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
simi authored and tduehr committed Apr 13, 2017
1 parent b5dcce9 commit f347116
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/ffi_c/AbstractMemory.c
Expand Up @@ -49,8 +49,13 @@
#include "Function.h"
#include "LongDouble.h"

#ifndef PRIsVALUE
#ifdef PRIsVALUE
# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
# define RB_OBJ_STRING(obj) (obj)
#else
# define PRIsVALUE "s"
# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
# define RB_OBJ_STRING(obj) StringValueCStr(obj)
#endif

static inline char* memory_address(VALUE self);
Expand Down

0 comments on commit f347116

Please sign in to comment.