diff -ur global-5.8.1/libdb/bt_open.c global-5.8-1/libdb/bt_open.c --- global-5.8.1/libdb/bt_open.c Sat Mar 06 21:08:14 2010 +++ global-5.8-1/libdb/bt_open.c Fri Mar 12 17:08:11 2010 @@ -67,7 +67,8 @@ #endif #if (defined(_WIN32) && !defined(__CYGWIN__)) -#define mkstemp(p) open(_mktemp(p), _O_CREAT | _O_SHORT_LIVED | _O_EXCL) +#include +#define mkstemp(p) open(_mktemp(p), _O_CREAT | _O_RDWR | _O_BINARY | _O_TEMPORARY, _S_IWRITE | _SH_DENYRW) #endif #include "db.h" diff -ur global-5.8.1/libutil/conf.c global-5.8-1/libutil/conf.c --- global-5.8.1/libutil/conf.c Sat Mar 06 21:08:14 2010 +++ global-5.8-1/libutil/conf.c Fri Mar 12 10:51:00 2010 @@ -417,7 +417,22 @@ strbuf_puts(sb, BINDIR); exist = 1; } else if (!strcmp(name, "datadir")) { +#if defined(_WIN32) && !defined(__CYGWIN__) + /* + * Test if this directory exists, and if not, take the + * directory relative to the binary. + */ + if (test("d", DATADIR)) + strbuf_puts(sb, DATADIR); + else { + const char *name = strrchr(_pgmptr, '\\'); + if (name) + strbuf_nputs(sb, _pgmptr, name+1 - _pgmptr); + strbuf_puts(sb, "..\\share"); + } +#else strbuf_puts(sb, DATADIR); +#endif exist = 1; } } diff -ur global-5.8.1/plugin-example/exuberant-ctags.c global-5.8-1/plugin-example/exuberant-ctags.c --- global-5.8.1/plugin-example/exuberant-ctags.c Sat Mar 06 21:08:14 2010 +++ global-5.8-1/plugin-example/exuberant-ctags.c Mon Mar 08 17:27:24 2010 @@ -22,7 +22,9 @@ #include #endif #include +#if !defined(_WIN32) || defined(__CYGWIN__) #include +#endif #include #include #include