From b8a1bf274969d3b58c58ddd9af2ac9481ff9a8d8 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 4 Jan 2012 16:24:33 +0000 Subject: QPID-3718 - Added Ruby typemaps for uint8_t and int8_t. Applied patch from Darryl Pierce. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1227208 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/swig_ruby_typemaps.i | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpp/bindings') diff --git a/cpp/bindings/swig_ruby_typemaps.i b/cpp/bindings/swig_ruby_typemaps.i index 326d607c8d..1a07cc86b0 100644 --- a/cpp/bindings/swig_ruby_typemaps.i +++ b/cpp/bindings/swig_ruby_typemaps.i @@ -168,6 +168,26 @@ $result = (VALUE) $1; } +%typemap (in) uint8_t +{ + $1 = NUM2UINT ($input); +} + +%typemap (out) uint8_t +{ + $result = UINT2NUM((uint8_t) $1); +} + +%typemap (in) int8_t +{ + $1 = NUM2INT ($input); +} + +%typemap (out) int8_t +{ + $result = INT2NUM((int8_t) $1); +} + %typemap (in) uint16_t { $1 = NUM2UINT ($input); -- cgit v1.2.1