summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/ext/fbuffer/fbuffer.h8
-rw-r--r--ext/json/ext/generator/depend1
-rw-r--r--ext/json/ext/generator/extconf.rb1
-rw-r--r--ext/json/ext/parser/depend1
4 files changed, 11 insertions, 0 deletions
diff --git a/ext/json/ext/fbuffer/fbuffer.h b/ext/json/ext/fbuffer/fbuffer.h
index 7d1dad7..f7c2b03 100644
--- a/ext/json/ext/fbuffer/fbuffer.h
+++ b/ext/json/ext/fbuffer/fbuffer.h
@@ -35,10 +35,14 @@ static FBuffer *fbuffer_alloc(unsigned long initial_length);
static void fbuffer_free(FBuffer *fb);
static void fbuffer_clear(FBuffer *fb);
static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len);
+#ifdef JSON_GENERATOR
static void fbuffer_append_long(FBuffer *fb, long number);
+#endif
static void fbuffer_append_char(FBuffer *fb, char newchr);
+#ifdef JSON_GENERATOR
static FBuffer *fbuffer_dup(FBuffer *fb);
static VALUE fbuffer_to_s(FBuffer *fb);
+#endif
static FBuffer *fbuffer_alloc(unsigned long initial_length)
{
@@ -87,6 +91,7 @@ static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len)
}
}
+#ifdef JSON_GENERATOR
static void fbuffer_append_str(FBuffer *fb, VALUE str)
{
const char *newstr = StringValuePtr(str);
@@ -96,6 +101,7 @@ static void fbuffer_append_str(FBuffer *fb, VALUE str)
fbuffer_append(fb, newstr, len);
}
+#endif
static void fbuffer_append_char(FBuffer *fb, char newchr)
{
@@ -104,6 +110,7 @@ static void fbuffer_append_char(FBuffer *fb, char newchr)
fb->len++;
}
+#ifdef JSON_GENERATOR
static void freverse(char *start, char *end)
{
char c;
@@ -154,3 +161,4 @@ static VALUE fbuffer_to_s(FBuffer *fb)
return result;
}
#endif
+#endif
diff --git a/ext/json/ext/generator/depend b/ext/json/ext/generator/depend
new file mode 100644
index 0000000..1a042a2
--- /dev/null
+++ b/ext/json/ext/generator/depend
@@ -0,0 +1 @@
+generator.o: generator.c generator.h $(srcdir)/../fbuffer/fbuffer.h
diff --git a/ext/json/ext/generator/extconf.rb b/ext/json/ext/generator/extconf.rb
index 32aed7f..c947501 100644
--- a/ext/json/ext/generator/extconf.rb
+++ b/ext/json/ext/generator/extconf.rb
@@ -10,4 +10,5 @@ if CONFIG['CC'] =~ /gcc/
end
end
+$defs << "-DJSON_GENERATOR"
create_makefile 'json/ext/generator'
diff --git a/ext/json/ext/parser/depend b/ext/json/ext/parser/depend
new file mode 100644
index 0000000..498ffa9
--- /dev/null
+++ b/ext/json/ext/parser/depend
@@ -0,0 +1 @@
+parser.o: parser.c parser.h $(srcdir)/../fbuffer/fbuffer.h