title: C/C++ namespace in header issue
body: <p>I am trying to implement a Websocket Server. I am using the <a href="http://git.warmcat.com/cgi-bin/cgit/libwebsockets" rel="nofollow">libwebsockets</a> library.</p>
  
  <p><code>ConnectionServer.c</code> file has setup code for the library and main() function (I don't see anything of importance to post here.) This file includes 1 file for the received data callback called:
  <code>dmserver_callback.cpp</code>.
  This file then includes another file (my custom parser file) called:
  <code>data_parser.cpp</code>.
  This file then includes a file called <code>definitions.h</code> (the source of the problem).</p>
  
  <p>Just bear with me; I understand that including files (daisy chaining; so to speak) probably isn't the best way to do this, and I more than likely should be using header files and such. One question I have is that is this particularly necessary?</p>
  
  <p>To clarify, everything is working as intended until I try to add my own parsing mechanism.</p>
  
  <p>The <code>definitions.h</code> file is as follows:</p>
  
  <pre><code>namespace EngineDefinitions {
  enum Version {
      Major = 1,
      Minor = 2
  }; //Version;
  
  namespace Server {
      enum enum_Server {
          MAX_PLAYERS = 200,
          MAX_TABLES = 42, // 3 tables per row.
          MAX_TABLE_PLAYERS = 10,
          GAME_PORT = 2040, //2042
          MAX_PARAMS = 10
      }; //Server;
  };
  
  namespace Login {
      enum enum_Login {
          USERNAME = 1,
          PASSWORD = 2
      }; //Login;
  };
  };
  </code></pre>
  
  <p>My error is:</p>
  
  <pre><code>definitions.h(1): error C2061: syntax error : identifier 'EngineDefinitions'
  </code></pre>
  
  <p>I loaded the exact same header in a new Win32 Console Project in Visual C++ 2010 Express and there it works. The only difference I see is the main file (where int main function resides).
  In the project that the header file works is called:
  <code>ConectionServer.cpp</code> (C++)</p>
  
  <p>and the main project file that doesn't work is named:
  <code>ConnectionServer.c</code> (C)</p>
  
  <p>Does this have something to do with the file being compiled in C vs C++?</p>
  
  <p>I think that the <code>libwebsocket</code> library is coded in C.
  I can't recall if I created the project files in exactly the same manner or not.</p>
  
  <p>P.S. Please let me know if there is any other information I can provide to help.</p>
  
  <p>EDIT: I also realize you're not supposed to define types inside a header file (eg: enums).
  I DID try to separate the source into <code>.cpp</code> and a header file using the <code>extern enum</code>
  with no difference. In fact, got more errors (redefinitions) than I bargained for when trying to use them.</p>