title: constexpr in C (or equivalent)
body: <p>I am trying to get a string-based switch expression to work in C using a hash function. I've been able to get it to work with clean syntax using 'constexpr' with Clang/LLVM turned to C++, even though the code is C. </p>
  
  <p>However, there are of course odd side effects of having it compile as C++, like lack of void* implicit casting which becomes really awkward.</p>
  
  <p>So the question is how to solve this dilemma (without slapping the C11 committee upside their head for why this wasn't added to the C spec)</p>
  
  <ol>
  <li>Is there a way to get constexpr option turned on with C?</li>
  <li>Is there a way to get implicit void* casting turned on with C++?</li>
  <li>Is there another clean way to code this in C11/C99 that doesn't require recalculating hashes?</li>
  </ol>
  
  <p>Here is my current example code:</p>
  
  <pre><code>constexpr uint64 cHash(char const* text, uint64 last_value = basis)
  {
      return *str ? cHash(text+1, (*text ^ last_value) * prime) : last_value;
  }
  
  void SwitchFunction(char const* text)
  {
      switch(Hash(text))
      {
          case cHash("first"):
              break;
          case cHash("second"):
              break;
          case cHash("third"):
              break;
          default:
              break;
      }
  }
  </code></pre>