summaryrefslogtreecommitdiff
path: root/src/strptime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/strptime.cc')
-rw-r--r--src/strptime.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/strptime.cc b/src/strptime.cc
index b9d485d2..c0aed41c 100644
--- a/src/strptime.cc
+++ b/src/strptime.cc
@@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
// Implement strptime under windows
#include "strptime.h"
@@ -22,6 +21,20 @@
#include <ctype.h>
#include <string.h>
+// Define strnicmp for Cygwin.
+#ifndef strcmpi
+#define strcmpi strcasecmp
+#endif
+#ifndef stricmp
+#define stricmp strcasecmp
+#endif
+#ifndef strncmpi
+#define strncmpi strncasecmp
+#endif
+#ifndef strnicmp
+#define strnicmp strncasecmp
+#endif
+
static const char* kWeekFull[] = {
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"