diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-20 15:50:21 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-20 15:50:21 +0000 |
commit | 22c4bdcd18036d830c1071a81139f8238f7f0ae8 (patch) | |
tree | 36f09b00f841b8e93df7d280bff85b2511d70ae8 /strftime.c | |
parent | fef047dfb0d0250e2c3fdab7b4a156010f9e60d1 (diff) | |
download | ruby-22c4bdcd18036d830c1071a81139f8238f7f0ae8.tar.gz |
* strftime.c: win32 support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r-- | strftime.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/strftime.c b/strftime.c index 684e1f340e..f2cfea69e6 100644 --- a/strftime.c +++ b/strftime.c @@ -57,8 +57,10 @@ #endif #if defined(TM_IN_SYS_TIME) || !defined(GAWK) && !defined(_WIN32_WCE) #include <sys/types.h> +#if HAVE_SYS_TIME_H #include <sys/time.h> #endif +#endif /* defaults: season to taste */ #define SYSV_EXT 1 /* stuff in System V ascftime routine */ @@ -94,13 +96,11 @@ #undef strchr /* avoid AIX weirdness */ -#ifndef __STDC__ +#if !defined __STDC__ && !defined _WIN32 #define const /**/ -extern void tzset(); static int weeknumber(); adddecl(static int iso8601wknum();) #else -extern void tzset(void); static int weeknumber(const struct tm *timeptr, int firstweekday); adddecl(static int iso8601wknum(const struct tm *timeptr);) #endif @@ -117,10 +117,7 @@ extern char *strchr(); #define range(low, item, hi) max(low, min(item, hi)) -#ifdef __CYGWIN__ -#define DLL_IMPORT __declspec(dllimport) -#endif -#ifdef __WIN32__ +#if defined __CYGWIN__ || defined __WIN32__ || defined _WIN32 #define DLL_IMPORT __declspec(dllimport) #endif #ifndef DLL_IMPORT @@ -191,7 +188,9 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept #ifndef HAVE_TM_ZONE #ifndef HAVE_TM_NAME struct timeval tv; +#ifdef HAVE_TIMEZONE struct timezone zone; +#endif /* HAVE_TIMEZONE */ #endif /* HAVE_TM_NAME */ #endif /* HAVE_TM_ZONE */ |