From 3c8ff8b00a9e4b844f6245990ed91f9bcb7ec211 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sun, 12 Sep 2004 15:22:51 +0000 Subject: [PATCH] Minor changes for MSVC --- src/getopt_win32.c | 7 +++++-- src/localtime.c | 10 ++++++++-- src/private.h | 13 ++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/getopt_win32.c b/src/getopt_win32.c index 5adc39a7..d53b278e 100644 --- a/src/getopt_win32.c +++ b/src/getopt_win32.c @@ -28,9 +28,12 @@ #pragma alloca #endif - #ifdef HAVE_CONFIG_H -#include "config.h" +# include +#else +# ifdef _MSC_VER +# include +# endif #endif #ifdef __GNUC__ diff --git a/src/localtime.c b/src/localtime.c index 12d533ca..31ac0047 100644 --- a/src/localtime.c +++ b/src/localtime.c @@ -1,9 +1,15 @@ /*! @file localtime.c @brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/ - @version $Name: $ $Revision: 1.1 $ + @version $Name: $ $Revision: 1.2 $ */ -#include +#ifdef HAVE_CONFIG_H +# include +#else +# ifdef _MSC_VER +# include +# endif +#endif #include "timegm.h" /* diff --git a/src/private.h b/src/private.h index 8589adf1..022a21fc 100644 --- a/src/private.h +++ b/src/private.h @@ -1,7 +1,7 @@ /*! @file private.h @brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/ - @version $Name: $ $Revision: 1.2 $ + @version $Name: $ $Revision: 1.3 $ */ #ifndef PRIVATE_H @@ -32,6 +32,12 @@ static char privatehid[] = "@(#)private.h 7.53"; /* ahu: moved required preprocessor symbols to config.h */ +/* ahu: disable warnings */ +#ifdef _MSC_VER +// disable warning 'uses old-style declarator' C4131 +#pragma warning (disable: 4131) +#endif + /* ** Nested includes */ @@ -44,6 +50,11 @@ static char privatehid[] = "@(#)private.h 7.53"; #include "time.h" #include "stdlib.h" +/* ahu: added io.h for MSVC */ +#ifdef _MSC_VER +# include "io.h" +#endif + /* ahu: deleted include libintl.h */ /* ahu: deleted include sys/wait.h and WIFEXITED, WEXITSTATUS macros */