title: C equivalent to C++ decltype
body: <p>In my C project, there is a struct, created by another colleague, containing some function pointers:<br></p>
  
  <pre><code>struct tools {  
      int (*tool_a) (int, int, int);
      ...
  };
  </code></pre>
  
  <p>I have no right to change this struct and relative files.<br></p>
  
  <p>Now I'm coding with the struct.<br>
  I have to define a function, whose return type and list of arguments must be the same with the <code>tools.tool_a</code>.<br>
  Meaning that my function must be as below:<br></p>
  
  <pre><code>int my_func(int, int, int);
  </code></pre>
  
  <p>The problem is that the struct changes a lot, especially the return types, for example <code>int</code> is replaced by <code>size_t</code> today, so I have to change my code a lot.<br></p>
  
  <p>I know that <code>decltype</code> in C++ can help me so I just want to know if C has something equivalent?<br></p>
  
  <p>I'm thinking I may use macro but I don't know how, I even don't know if it's possible or not.<br>
  <br></p>
  
  <h1>REAL CASE</h1>
  
  <p>I'm developing some testing tools for linux-kernel with C.<br>
  There have been many versions of custom kernels coming from other groups in my company. For historical reasons, some of them used <code>int</code>, others used <code>size_t</code> or <code>ssize_t</code> and so on.<br></p>
  
  <p>Now when I code, I have to do like this:<br></p>
  
  <pre><code>// int my_func(int a, int b, int c)
  size_t my_func(int a, int b, int c)
  // ssize_t my_func(int a, int b, int c)
  {}
  struct tools my_tool = {
      .tool_a = my_func;
  }
  </code></pre>
  
  <p>I have to keep commenting and uncommenting...</p>