Hi,

At Tue, 27 Dec 2005 16:37:37 +0900,
U.Nakamura wrote in [ruby-core:07001]:
> | +!if $(MSC_VER) >= 1400
> | +/* Prevents VC++ 2005 (cl ver 14) warnings */
> | +#define _CRT_SECURE_NO_DEPRECATE 1
> | +#define _CRT_NONSTDC_NO_DEPRECATE 1
> | +!endif
> 
> Defining these macros in config.h is not good idea because
> some .c files include standard headers before including ruby.h.
> I think we should define them in CPPFLAGS.

Right, I found missing/file.h included from file.c causes a
problem, and couldn't make miniruby with -debug linker option.


Index: win32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/win32/Makefile.sub,v retrieving revision 1.105 diff -U2 -p -u -r1.105 Makefile.sub --- win32/Makefile.sub 25 Oct 2005 16:59:17 -0000 1.105 +++ win32/Makefile.sub 27 Dec 2005 08:15:23 -0000 @@ -64,5 +64,7 @@ PROCESSOR_LEVEL = 5 PROCESSOR_LEVEL = 6 !endif +!if $(MSC_VER) < 1400 PROCESSOR_FLAG = -G$(PROCESSOR_LEVEL) +!endif CPU = i$(PROCESSOR_LEVEL)86 ARCH = i386 @@ -71,9 +73,9 @@ CPU = $(PROCESSOR_ARCHITECTURE) ARCH = $(PROCESSOR_ARCHITECTURE) !endif -!if !defined(DEBUGFLAGS) +!if !defined(DEBUGFLAGS) && $(MSC_VER) < 1400 DEBUGFLAGS = -Zi !endif !if !defined(OPTFLAGS) -OPTFLAGS = -O2b2xg- +OPTFLAGS = -O2b2xty- !endif !if !defined(OS) @@ -143,4 +145,9 @@ LD = $(CC) LDSHARED = $(LD) -LD XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing +!if $(MSC_VER) >= 1400 +# Prevents VC++ 2005 (cl ver 14) warnings +CPPFLAGS = $(CPPFLAGS) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE +!endif + DLDFLAGS = $(LDFLAGS) -dll SOLIBS = @@ -202,4 +209,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/ !endif @$(srcdir:/=\)\win32\ifchange.bat config.h << +#if _MSC_VER != $(MSC_VER) +#error MSC version unmatch +#endif #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1
-- Nobu Nakada