From aa81c64488ba4642b6f9edd0c23ba98a3d705183 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 11 Jan 2006 05:51:32 +0000 Subject: [PATCH] Build cleanups (mostly for warnings) for VC8. * Mkfiles/vc8/config.h: Define _CRT_SECURE_NO_DEPRECATE to avoid most warnings about *_s functions. Also use _stricmp directly instead of stricmp to avoid warnings. * libyasm/strcasecmp.c: Support _stricmp usage. * util.h: Likewise. * tools/re2c/actions.c: Include ctype.h to define toupper/tolower. * Mkfiles/vc8/modules/modules.vcproj: Don't include nasm-macros.c directly; this file is included into another file and has no public variables. * Mkfiles/vc8/yasm.sln: Allow x64 cross-builds from Win32 by building genmacro, genmodule, and re2c for Win32 target. svn path=/trunk/yasm/; revision=1328 --- Mkfiles/vc8/config.h | 8 ++++---- Mkfiles/vc8/modules/modules.vcproj | 4 ---- Mkfiles/vc8/yasm.sln | 21 +++++++++++---------- libyasm/strcasecmp.c | 4 ++++ tools/re2c/actions.c | 1 + util.h | 3 +++ 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index b127bc47..ed266c55 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -1,5 +1,7 @@ /* $Id: config.h 1137 2004-09-04 01:24:57Z peter $ */ +#define _CRT_SECURE_NO_DEPRECATE 1 + /* */ /* #undef ENABLE_NLS */ @@ -179,15 +181,13 @@ #define HAVE_STRCMP 1 /* Define if you have the `strcmpi' function. */ -#define HAVE_STRCMPI 1 -#define strcmpi _strcmpi +/* #undef HAVE_STRCMPI */ /* Define if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define if you have the `stricmp' function. */ -#define HAVE_STRICMP 1 -#define stricmp _stricmp +#define HAVE__STRICMP 1 /* Define if you have the header file. */ /* #undef HAVE_STRINGS_H */ diff --git a/Mkfiles/vc8/modules/modules.vcproj b/Mkfiles/vc8/modules/modules.vcproj index 9bbc8999..f11b7e0b 100644 --- a/Mkfiles/vc8/modules/modules.vcproj +++ b/Mkfiles/vc8/modules/modules.vcproj @@ -1113,10 +1113,6 @@ RelativePath="..\..\..\modules\preprocs\nasm\nasm-eval.h" > - - diff --git a/Mkfiles/vc8/yasm.sln b/Mkfiles/vc8/yasm.sln index 29cdb84f..6fb44f4d 100644 --- a/Mkfiles/vc8/yasm.sln +++ b/Mkfiles/vc8/yasm.sln @@ -63,27 +63,28 @@ Global {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/libyasm/strcasecmp.c b/libyasm/strcasecmp.c index 32a914fc..441d0456 100644 --- a/libyasm/strcasecmp.c +++ b/libyasm/strcasecmp.c @@ -52,6 +52,8 @@ yasm__strcasecmp(const char *s1, const char *s2) return strcasecmp(s1, s2); #elif HAVE_STRICMP return stricmp(s1, s2); +#elif HAVE__STRICMP + return _stricmp(s1, s2); #elif HAVE_STRCMPI return strcmpi(s1, s2); #else @@ -73,6 +75,8 @@ yasm__strncasecmp(const char *s1, const char *s2, size_t n) return strncasecmp(s1, s2, n); #elif HAVE_STRICMP return strnicmp(s1, s2, n); +#elif HAVE__STRNICMP + return _strnicmp(s1, s2, n); #elif HAVE_STRCMPI return strncmpi(s1, s2, n); #else diff --git a/tools/re2c/actions.c b/tools/re2c/actions.c index 578291ab..3eaade00 100644 --- a/tools/re2c/actions.c +++ b/tools/re2c/actions.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "tools/re2c/globals.h" #include "tools/re2c/parse.h" diff --git a/util.h b/util.h index 5e0db54a..6a9ebddc 100644 --- a/util.h +++ b/util.h @@ -102,6 +102,9 @@ #elif HAVE_STRICMP # define yasm__strcasecmp(x, y) stricmp(x, y) # define yasm__strncasecmp(x, y, n) strnicmp(x, y, n) +#elif HAVE__STRICMP +# define yasm__strcasecmp(x, y) _stricmp(x, y) +# define yasm__strncasecmp(x, y, n) _strnicmp(x, y, n) #elif HAVE_STRCMPI # define yasm__strcasecmp(x, y) strcmpi(x, y) # define yasm__strncasecmp(x, y, n) strncmpi(x, y, n) -- 2.40.0