summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/add_suffix/bug.c21
-rw-r--r--ext/-test-/add_suffix/depend1
-rw-r--r--ext/-test-/add_suffix/extconf.rb4
3 files changed, 26 insertions, 0 deletions
diff --git a/ext/-test-/add_suffix/bug.c b/ext/-test-/add_suffix/bug.c
new file mode 100644
index 0000000000..882832ed34
--- /dev/null
+++ b/ext/-test-/add_suffix/bug.c
@@ -0,0 +1,21 @@
+#include "ruby.h"
+#include "ruby/defines.h"
+#ifndef HAVE_RUBY_ADD_SUFFIX
+#define _WIN32 1
+#include "util.c"
+#endif
+
+static VALUE
+add_suffix(VALUE self, VALUE path, VALUE suffix)
+{
+ StringValueCStr(path);
+ ruby_add_suffix(path, StringValueCStr(suffix));
+ return path;
+}
+
+void
+Init_bug(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ rb_define_module_function(mBug, "add_suffix", add_suffix, 2);
+}
diff --git a/ext/-test-/add_suffix/depend b/ext/-test-/add_suffix/depend
new file mode 100644
index 0000000000..943d0d9f21
--- /dev/null
+++ b/ext/-test-/add_suffix/depend
@@ -0,0 +1 @@
+bug.o: $(hdrdir)/ruby/util.h $(top_srcdir)/util.c
diff --git a/ext/-test-/add_suffix/extconf.rb b/ext/-test-/add_suffix/extconf.rb
new file mode 100644
index 0000000000..bffd1550f3
--- /dev/null
+++ b/ext/-test-/add_suffix/extconf.rb
@@ -0,0 +1,4 @@
+unless have_func("ruby_add_suffix", "ruby/util.h")
+ $INCFLAGS << " -I$(top_srcdir)"
+end
+create_makefile("-test-/add_suffix/bug")