title: How to avoid namespace collision in C and C++
body: <p>I can use <code>using namespace</code> directive to avoid identifier/variable name collision, but what happens when file names or library names collision happens in large projects.</p>
  
  <p>In <code>C</code> the conventional approach is to add files recursively using <code>#include_next</code> directive. How can I achieve the same in <code>C++</code> without using the <code>#include_next</code> directive and address the issue of duplicate file names among applications and shared libraries. An example, a work around the class() function in AIX math.h clashing with identifiers named "class".</p>
  
  <pre><code>/* GNU Lesser GPLv2.1 or later */
  #ifndef FFMPEG_COMPAT_AIX_MATH_H
  #define FFMPEG_COMPAT_AIX_MATH_H
  
  #define class some_text
  
  #include_next &lt;math.h&gt;
  
  #undef class
  
  #endif /* FFMPEG_COMPAT_AIX_MATH_H */
  </code></pre>
  
  <p><strong>EDIT:</strong>
  Can I use, for example <code>class machine-instruction-set</code> where the binary has to run on multiple platforms? Can there be namespace collision in such case?</p>