aboutsummaryrefslogtreecommitdiff
path: root/Lib/javascript/napi/javascriptfragments.swg
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/javascript/napi/javascriptfragments.swg')
-rw-r--r--Lib/javascript/napi/javascriptfragments.swg23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/javascript/napi/javascriptfragments.swg b/Lib/javascript/napi/javascriptfragments.swg
new file mode 100644
index 000000000..4778bf033
--- /dev/null
+++ b/Lib/javascript/napi/javascriptfragments.swg
@@ -0,0 +1,23 @@
+/*
+
+ Create a file with this name, 'javascriptfragments.swg', in your working
+ directory and add all the %fragments you want to take precedence
+ over the default ones defined by swig.
+
+ For example, if you add:
+
+ %fragment(SWIG_AsVal_frag(int),"header") {
+ SWIGINTERNINLINE int
+ SWIG_AsVal(int)(PyObject *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.
+
+
+*/