summaryrefslogtreecommitdiff
path: root/share/swig/2.0.11/ruby/rubyfragments.swg
diff options
context:
space:
mode:
Diffstat (limited to 'share/swig/2.0.11/ruby/rubyfragments.swg')
-rw-r--r--share/swig/2.0.11/ruby/rubyfragments.swg23
1 files changed, 23 insertions, 0 deletions
diff --git a/share/swig/2.0.11/ruby/rubyfragments.swg b/share/swig/2.0.11/ruby/rubyfragments.swg
new file mode 100644
index 0000000..3c3b658
--- /dev/null
+++ b/share/swig/2.0.11/ruby/rubyfragments.swg
@@ -0,0 +1,23 @@
+/*
+
+ Create a file with this name, 'rubyfragments.swg', in your working
+ directory and add all the %fragments you want to take precedence
+ over the ones defined by default by swig.
+
+ For example, if you add:
+
+ %fragment(SWIG_AsVal_frag(int),"header") {
+ SWIGINTERNINLINE int
+ SWIG_AsVal(int)(VALUE obj, int *val)
+ {
+ <your code here>;
+ }
+ }
+
+ this will replace the code used to retrieve an integer value for all
+ the typemaps that need it, including:
+
+ int, std::vector<int>, std::list<std::pair<int,int> >, etc.
+
+
+*/