title: Determine #defined string length at compile time
body: <p>I have a <a href="https://github.com/afarber/mod-socket-policy/blob/master/mod_socket_policy.c" rel="noreferrer">C-program</a> (an Apache module, i.e. the program runs often), which is going to <code>write()</code> a 0-terminated string over a socket, so I need to know its length.</p>
  
  <p>The string is #defined as:</p>
  
  <pre><code>#define POLICY "&lt;?xml version=\"1.0\"?&gt;\n" \
     "&lt;!DOCTYPE cross-domain-policy SYSTEM\n" \
     "\"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\"&gt;\n" \
     "&lt;cross-domain-policy&gt;\n" \
     "&lt;allow-access-from domain=\"*\" to-ports=\"8080\"/&gt;\n" \
     "&lt;/cross-domain-policy&gt;\0"
  </code></pre>
  
  <p>Is there please a way, better than using <code>strlen(POLICY)+1</code> at the runtime (and thus calculating the length again and again)?</p>
  
  <p>A preprocessor directive, which would allow setting <code>POLICY_LENGTH</code> already at compile time?</p>