title: using stdint with swig and numpy.i
body: <p>I'm developing a module for using <code>c inline</code> in Python code based on <code>swig</code>.
  For that I would like to make <code>numpy</code> arrays accessible in <code>C</code>. Until now I used C types like <code>unsigned short</code> but I would like to use types like <code>uint16_t</code> from <code>stdint.h</code> to be save whatever compiler my module encounters.</p>
  
  <p>Unfortunately the <code>c++</code>-functions do not get wrapped correctly when using <code>stdint.h</code>types. The Error given is: <code>_setc() takes exactly 2 arguments (1 given)</code>. That means, the function is not wrapped to accept <code>numpy</code> arrays. The error does not occur, when I use e.g. <code>unsigned short</code>.</p>
  
  <p>Do you have any ideas, how I can make swig map <code>numpy</code> arrays into <code>stdint-types</code>?</p>
  
  <p><code>interface.i</code> NOT working:</p>
  
  <pre><code>/* interface.i */
  extern int __g();
  %}
  %include "stdint.i"
  %include "numpy.i"
  
  %init %{
  import_array();
  %}
  %apply (uint16_t* INPLACE_ARRAY3, int DIM1) {(uint16_t* seq, int n1)};
  extern int __g();
  </code></pre>
  
  <p><code>c++</code> function NOT working:</p>
  
  <pre><code>#include "Python.h"
  #include &lt;stdio.h&gt;
  #include &lt;stdint.h&gt;
  extern uint16_t* c;
  extern int Dc;
  extern int Nc[4];
  void _setc(uint16_t *seq, int n1, int n2, int n3)
  {
      c = seq;
      Nc[0] = n1;
      Nc[1] = n2;
      Nc[2] = n3;
  }
  </code></pre>
  
  <p><code>interface.i</code> working: </p>
  
  <pre><code>/* interface.i */
  extern int __g();
  %}
  %include "stdint.i"
  %include "numpy.i"
  
  %init %{
  import_array();
  %}
  %apply (unsigned short* INPLACE_ARRAY3, int DIM1) {(unsigned short* seq, int n1)};
  extern int __g();
  </code></pre>
  
  <p><code>c++</code> function working:</p>
  
  <pre><code>#include "Python.h"
  #include &lt;stdio.h&gt;
  #include &lt;stdint.h&gt;
  extern unsigned short* c;
  extern int Dc;
  extern int Nc[4];
  void _setc(unsigned short *seq, int n1, int n2, int n3)
  {
      c = seq;
      Nc[0] = n1;
      Nc[1] = n2;
      Nc[2] = n3;
  }
  </code></pre>