diff --git a/src/duk_features.h.in b/src/duk_features.h.in index 8005c720..ef226bf7 100644 --- a/src/duk_features.h.in +++ b/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 #include #include +#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 +#include +#include +#include +#include +#include #else /* Other UNIX, hopefully others */ #define DUK_USE_DATE_NOW_GETTIMEOFDAY