title: Preprocessor: generate functions with dynamic name. Multiple definition issues
body: <p>I got a preprocessor macro that is generating functions and variables based on a macro parameter. </p>
  
  <p>Calling the macro sequently with A, B the macro would generate something like</p>
  
  <pre><code>Inst* AActivate() { ... }
  bool Atemp;
  
  Inst* BActivate() { ... }
  bool Btemp;
  </code></pre>
  
  <p>As the macro is defined within a header file, I get linker errors informing me about already defined symbols.
  I'm using #pragma once but I guess the problem lies in implementing the functions within the header.</p>
  
  <p>Here's the macro:</p>
  
  <pre><code>    #define REGISTER(ns, id, type) \
          Inst* type##Activate() { return new type(); }\
          bool type##temp = RegisterType(ns &lt;&lt; 8 | id, &amp;type##Activate);
  </code></pre>
  
  <p>Now I wondered how to deal with such issues.
  My first idea was the usage of some #define-Guards but obviously this would require nested #defines, which is not possible in C++.
  I read about a possible solution with boost but unfortunaetly, I'm not able to use these libraries.</p>
  
  <p>Any idea?</p>
  
  <p>Thank you in advance...</p>