Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fix to support old version of crtdefs.h

Maxim Dounin
August 02, 2012 04:54AM
Hello!

On Thu, Aug 02, 2012 at 12:31:59PM +0900, HAYASHI Kentaro wrote:

>
> Hi,
>
> I attached a patch for fixing build problem (_CRT_SECURE_NO_DEPRECATE)
> with Visual Studio 2005 Express.
>
> The problem is that old version of crtdefs.h uses _CRT_SECURE_NO_DEPRECATE
> (instead of _CRT_SECURE_NO_WARNINGS) for eliminating the warnings.
>
> see: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/3373dd77-ed73-44a6-a52c-53dfd95099ac/
>
> The purpose of this patch is supporting old version of crtdefs.h
> by adding definition about _CRT_SECURE_NO_DEPRECATE.
>
> As a result, nmake build process succeeds with Visual Studio 2005 Express under Wine.
>
> NOTE:
> * I used Wine to setup old version of crtdefs.h.
> * I confirmed that VS2005 Express and VS2005 Express SP1 uses old version of crtdefs.h.
> (It seems that VS2005 Express SP1 with latest hotfix use newer version of crtdefs.h)
> * I confirmed that this patch does not affects build process
> even if newer version of crtdefs.h is used.
>
> I hope that this patch will be applied to nginx mainstream.
>
>
> Index: src/os/win32/ngx_win32_config.h
> ===================================================================
> --- src/os/win32/ngx_win32_config.h (revision 4778)
> +++ src/os/win32/ngx_win32_config.h (working copy)
> @@ -19,6 +19,11 @@
> /* enable getenv() and gmtime() in msvc8 */
> #define _CRT_SECURE_NO_WARNINGS
>
> +/* support old version of crtdefs.h in msvc8 */
> +#if (_MSC_VER == 1400)
> +#define _CRT_SECURE_NO_DEPRECATE
> +#endif
> +

Thanks for your report.

Any specific reason to explicitly check msvc version? I tend to
think that just

--- a/src/os/win32/ngx_win32_config.h
+++ b/src/os/win32/ngx_win32_config.h
@@ -18,6 +18,7 @@

/* enable getenv() and gmtime() in msvc8 */
#define _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_DEPRECATE

/*
* we need to include <windows.h> explicitly before <winsock2.h> because

should be enough.

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Fix to support old version of crtdefs.h

HAYASHI Kentaro 1995 August 01, 2012 11:34PM

Re: [PATCH] Fix to support old version of crtdefs.h

Maxim Dounin 744 August 02, 2012 04:54AM

Re: [PATCH] Fix to support old version of crtdefs.h

HAYASHI Kentaro 962 August 02, 2012 05:42AM

Re: [PATCH] Fix to support old version of crtdefs.h

Maxim Dounin 714 August 02, 2012 08:56AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready