title: problem wrapping extern "C" library in a namespace
body: <p>I am using a C library (libgretl) from C++ and some of its functions conflict with my code, so I wanted to wrap it in a namespace, like this:</p>
  
  <pre><code>namespace libgretl {
  extern "C" {
      #include &lt;gretl/libgretl.h&gt;
  }}
  </code></pre>
  
  <p>However, this does not compile, I get "undefined" errors from gcc files (using mingw32 with gcc 4.5.2 on Windows).
  The first errors come from the following code block of file c++/cstddef:</p>
  
  <pre><code>_GLIBCXX_BEGIN_NAMESPACE(std)
    using ::ptrdiff_t;
    using ::size_t;
  _GLIBCXX_END_NAMESPACE
  </code></pre>
  
  <p>where the macros expand respectively to <code>namespace std {</code> and <code>}</code>. There are more errors after these.</p>
  
  <p>Omitting the <code>extern "C"</code> directive does not help. Using an anonymous namespace reduces the amount of errors, but it still won't compile.</p>
  
  <p>My question is therefore if there is some way to include such a C library and place its functions into a namespace, without changing the gcc or the library's source files?</p>
  
  <p>Thanks.</p>
  
  <p>Michal</p>