title: Build Apache APR 1.7 with Visual Studio (2017), IF_NAMESIZE undefined
body: <p>Trying to build apr 1.7 on Windows with Visual Studio, tried 2017 and 2013.</p>
  
  <p>When building the project (Debug|x86) or compiling e.g. <code>dso.c</code> if get the following error message:</p>
  
  <pre><code>1&gt;dso.c
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2143: syntax error: missing ')' before '*'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2143: syntax error: missing '{' before '*'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2059: syntax error: ')'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2061: syntax error: identifier 'apr_winapi_pfn_if_indextoname'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2059: syntax error: ';'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2513: ' ': no variable declared before '='
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2065: 'apr_winapi_pfn_if_indextoname': undeclared identifier
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): warning C4047: '=': 'int' differs in levels of indirection from 'int *(__cdecl *)(NET_IFINDEX,PCHAR)'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2146: syntax error: missing ';' before identifier 'apr_load_dll_func'
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2100: illegal indirection
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2064: term does not evaluate to a function taking 1207 arguments
  1&gt;c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): warning C4033: 'apr_winapi_if_indextoname' must return a value
  </code></pre>
  
  <p>I have succesfully build version 1.65 (after apply the hint from <a href="http://letcoderock.blogspot.com/2017/09/build-log4cxx-trunk-on-windows-by.html" rel="nofollow noreferrer">http://letcoderock.blogspot.com/2017/09/build-log4cxx-trunk-on-windows-by.html</a> or <a href="https://stackoverflow.com/questions/18408400/apache-cross-compilation-error-gen-test-char-cannot-execute-binary-file">Apache Cross Compilation Error ./gen_test_char: cannot execute binary file</a>)</p>
  
  <p>Comparing <code>apr_arch_misc.h</code> of the two version, i have noticed <code>DLL_IPHLPAPI</code> was new to the enum <code>apr_dlltoken_e</code> and Intelisense was complaining about </p>
  
  <pre><code>APR_DECLARE_LATE_DLL_FUNC(DLL_IPHLPAPI, PCHAR, NETIOAPI_API_, if_indextoname, 0, (
      NET_IFINDEX InterfaceIndex,
      PCHAR       InterfaceName),
      (InterfaceIndex, InterfaceName));
  </code></pre>
  
  <p>with "expecting a ')'". 
  If have changed <code>NETIOAPI_API_</code> to <code>WINAPI</code>. Do not know if this is correct but the file could now be compiled (after running the above trick with <code>gen_test_char.exe</code>).</p>
  
  <p>But after that I ran into the next Problem:</p>
  
  <pre><code>1&gt;sockaddr.c
  1&gt;network_io\unix\sockaddr.c(144): error C2065: 'IF_NAMESIZE': undeclared identifier
  1&gt;network_io\unix\sockaddr.c(144): error C2057: expected constant expression
  1&gt;network_io\unix\sockaddr.c(144): error C2466: cannot allocate an array of constant size 0
  1&gt;network_io\unix\sockaddr.c(144): error C2133: 'scbuf': unknown size
  1&gt;network_io\unix\sockaddr.c(1274): error C2065: 'IF_NAMESIZE': undeclared identifier
  </code></pre>
  
  <p>I have succesfully build apr with gcc in linux/cygwin. I have looked into the the preprocessor substitutions for <code>IF_NAMESIZE</code> and here it is replaced by <code>44</code>. But I can not find the definiton or where this is set.</p>
  
  <p>Does anyone have an idea how to fix this? And is the above change to <code>WINAPI</code> correct?</p>