A piece of code needed for compilation on Linux was missing; this patch replaces it. Also, there were some compiler warnings and declarations that were missing that are now fixed.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740366
13f79535-47bb-0310-9956-
ffa450edef68
#include <ruby.h>
#include <stdbool.h>
+#include <stdint.h>
#include <constants.h>
#include <struct.h>
VALUE method_table_object = Data_Wrap_Struct(rb_cObject, 0, free, npmt);
rb_const_set(bpa_class, rb_intern("@native_method_table"), method_table_object);
-}
\ No newline at end of file
+}
-
-void Init_binary_protocol_accelerated();
\ No newline at end of file
+void Init_binary_protocol_accelerated();
extern VALUE thrift_module;
extern VALUE thrift_types_module;
extern VALUE class_thrift_protocol;
-extern VALUE protocol_exception_class;
\ No newline at end of file
+extern VALUE protocol_exception_class;
slice_method_id = rb_intern("slice");
GARBAGE_BUFFER_SIZE = FIX2INT(rb_const_get(thrift_memory_buffer_class, rb_intern("GARBAGE_BUFFER_SIZE")));
-}
\ No newline at end of file
+}
-
-void Init_memory_buffer();
\ No newline at end of file
+void Init_memory_buffer();
//
// VALUE method_table_object = Data_Wrap_Struct(rb_cObject, 0, free, npmt);
// rb_const_set(c_protocol, rb_intern("@native_method_table"), method_table_object);
-}
\ No newline at end of file
+}
-
-void Init_protocol();
\ No newline at end of file
+void Init_protocol();
-
#include <struct.h>
#include <constants.h>
+#ifndef HAVE_STRLCPY
+
+static
+size_t
+strlcpy (char *dst, const char *src, size_t dst_sz)
+{
+ size_t n;
+
+ for (n = 0; n < dst_sz; n++) {
+ if ((*dst++ = *src++) == '\0')
+ break;
+ }
+
+ if (n < dst_sz)
+ return n;
+ if (n > 0)
+ *(dst - 1) = '\0';
+ return n + strlen (src);
+}
+
+#endif
+
static native_proto_method_table *mt;
#define IS_CONTAINER(ttype) ((ttype) == TTYPE_MAP || (ttype) == TTYPE_LIST || (ttype) == TTYPE_SET)
} native_proto_method_table;
-void Init_struct();
\ No newline at end of file
+void Init_struct();
Init_struct();
Init_binary_protocol_accelerated();
Init_memory_buffer();
-}
\ No newline at end of file
+}