Skip to content

Commit

Permalink
fix up rubygem
Browse files Browse the repository at this point in the history
  • Loading branch information
wmorgan authored and twilliam committed Apr 1, 2012
1 parent 7ec9326 commit 5a527f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ruby/ext/whistlepig/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'mkmf'

$CFLAGS = "-g -O3 -std=c99 $(cflags) -D_ANSI_SOURCE"
$CFLAGS= "-std=c99 -D_ANSI_SOURCE -D_XOPEN_SOURCE=600 $(cflags)"

create_header
create_makefile "whistlepig/whistlepig"
6 changes: 5 additions & 1 deletion ruby/ext/whistlepig/whistlepig.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ static VALUE index_delete(VALUE class, VALUE v_pathname_base) {
static VALUE index_size(VALUE self) {
wp_index* index;
Data_Get_Struct(self, wp_index, index);
return INT2NUM(wp_index_num_docs(index));

uint64_t num_docs;
wp_error* e = wp_index_num_docs(index, &num_docs);
RAISE_IF_NECESSARY(e);
return INT2NUM(num_docs);
}

static VALUE index_init(VALUE self, VALUE v_pathname_base) {
Expand Down

0 comments on commit 5a527f0

Please sign in to comment.