* strftime.c: win32 support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fef047dfb0
commit
22c4bdcd18
@ -1,3 +1,7 @@
|
|||||||
|
Thu Aug 21 00:49:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* strftime.c: win32 support.
|
||||||
|
|
||||||
Thu Aug 21 00:20:05 2008 Shugo Maeda <shugo@ruby-lang.org>
|
Thu Aug 21 00:20:05 2008 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* strftime.c: new file.
|
* strftime.c: new file.
|
||||||
|
13
strftime.c
13
strftime.c
@ -57,8 +57,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#if defined(TM_IN_SYS_TIME) || !defined(GAWK) && !defined(_WIN32_WCE)
|
#if defined(TM_IN_SYS_TIME) || !defined(GAWK) && !defined(_WIN32_WCE)
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#if HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* defaults: season to taste */
|
/* defaults: season to taste */
|
||||||
#define SYSV_EXT 1 /* stuff in System V ascftime routine */
|
#define SYSV_EXT 1 /* stuff in System V ascftime routine */
|
||||||
@ -94,13 +96,11 @@
|
|||||||
|
|
||||||
#undef strchr /* avoid AIX weirdness */
|
#undef strchr /* avoid AIX weirdness */
|
||||||
|
|
||||||
#ifndef __STDC__
|
#if !defined __STDC__ && !defined _WIN32
|
||||||
#define const /**/
|
#define const /**/
|
||||||
extern void tzset();
|
|
||||||
static int weeknumber();
|
static int weeknumber();
|
||||||
adddecl(static int iso8601wknum();)
|
adddecl(static int iso8601wknum();)
|
||||||
#else
|
#else
|
||||||
extern void tzset(void);
|
|
||||||
static int weeknumber(const struct tm *timeptr, int firstweekday);
|
static int weeknumber(const struct tm *timeptr, int firstweekday);
|
||||||
adddecl(static int iso8601wknum(const struct tm *timeptr);)
|
adddecl(static int iso8601wknum(const struct tm *timeptr);)
|
||||||
#endif
|
#endif
|
||||||
@ -117,10 +117,7 @@ extern char *strchr();
|
|||||||
|
|
||||||
#define range(low, item, hi) max(low, min(item, hi))
|
#define range(low, item, hi) max(low, min(item, hi))
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#if defined __CYGWIN__ || defined __WIN32__ || defined _WIN32
|
||||||
#define DLL_IMPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
#ifdef __WIN32__
|
|
||||||
#define DLL_IMPORT __declspec(dllimport)
|
#define DLL_IMPORT __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
#ifndef DLL_IMPORT
|
#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_ZONE
|
||||||
#ifndef HAVE_TM_NAME
|
#ifndef HAVE_TM_NAME
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
#ifdef HAVE_TIMEZONE
|
||||||
struct timezone zone;
|
struct timezone zone;
|
||||||
|
#endif /* HAVE_TIMEZONE */
|
||||||
#endif /* HAVE_TM_NAME */
|
#endif /* HAVE_TM_NAME */
|
||||||
#endif /* HAVE_TM_ZONE */
|
#endif /* HAVE_TM_ZONE */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user