apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: problem compiling APR 0.9.x misc/win32/rand.c
Date Mon, 21 Jan 2008 22:06:13 GMT
Guenter Knauf wrote:
> Hi,
> when I try to compile httpd 2.0.63 with MSCV6 then it breaks in apr/misc/win32/rand.c
> because in wincrypt.h the needed stuff is surrounded with:
> #if(_WIN32_WINNT >= 0x0400)
> ...
> #endif
> 
> in apr/misc/win32/rand.c we include the system headers before our apr-own;
> in apr/include/apr.h[w] I see:
> 
> #ifndef _WIN32_WINNT
> 
> /* Restrict the server to a subset of Windows NT 4.0 header files by default
>  */
> #define _WIN32_WINNT 0x0400
> #endif
> 
> now when I move wincrypt.h after the apr header includes it works:
> 
> --- apr/misc/win32/rand.c.orig	Fri Jun 01 00:53:12 2007
> +++ apr/misc/win32/rand.c	Mon Jan 21 22:21:18 2008
> @@ -14,13 +14,12 @@
>   * limitations under the License.
>   */
>  
> -#include <windows.h>
> -#include <wincrypt.h>
>  #include "apr.h"
>  #include "apr_private.h"
>  #include "apr_general.h"
>  #include "apr_portable.h"
>  #include "apr_arch_misc.h"
> +#include <wincrypt.h>
>  
>  
>  APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
> 
> also seems that the windows.h include is not needed here.
> 
> Bill, can you please check if the above patch works with your setup?

Which SDK?  Minimally from late 2002?  APR absolutely does not build
with more ancient flavors.  Including windows should default the SDK
to something of 0x400 or higher.

That's probably not a good idea for several reasons, the first of
which  is that we have been around this file a half dozen times.  APR
deliberately excludes a vast amount of junk from being compiled, very
likely including some crypt stuff.  By compiling windows.h first, we
end up with a very slow compile for one module, but overall we win
by orders of magnitude on the rest.

Each successive change has broken this file in a different way in
different environments, I'm adverse to patching if it's failing with
VC6 out-of-the-box and missing the modern (2002-2003 timeframe) sdk.

Bill


Mime
View raw message