Browse Source

Don't use strptime() in Cygwin

There's a compile warning of strptime() not being declared.  It should be
declared by <time.h> but is maybe missing a macro.  There are apparently
some limitations in strptime() too, so disable its use for now, as local
time parsing is not a mandatory feature.
v1.0-maintenance
Sami Vaarala 10 years ago
parent
commit
ca4d5198f7
  1. 18
      src/duk_features.h.in

18
src/duk_features.h.in

@ -177,12 +177,17 @@ static __inline__ unsigned long long duk_rdtsc(void) {
#define DUK_F_BSD
#endif
/* Generic Unix */
/* Generic Unix (includes Cygwin) */
#if defined(__unix) || defined(__unix__) || defined(unix) || \
defined(DUK_F_LINUX) || defined(DUK_F_BSD)
#define DUK_F_UNIX
#endif
/* Cygwin */
#if defined(__CYGWIN__)
#define DUK_F_CYGWIN
#endif
/* Windows (32-bit or above) */
#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
@ -482,6 +487,17 @@ static __inline__ unsigned long long duk_rdtsc(void) {
#include <sys/param.h>
#include <sys/time.h>
#include <time.h>
#elif defined(DUK_F_CYGWIN)
/* Cygwin -- don't use strptime() for now */
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
#define DUK_USE_DATE_TZO_GMTIME_R
#define DUK_USE_DATE_FMT_STRFTIME
#include <sys/types.h>
#include <endian.h>
#include <limits.h>
#include <sys/param.h>
#include <sys/time.h>
#include <time.h>
#else
/* Other UNIX, hopefully others */
#define DUK_USE_DATE_NOW_GETTIMEOFDAY

Loading…
Cancel
Save