--- gdate.c.eml Fri Sep 29 09:37:00 2000 +++ gdate.c Thu Nov 30 13:31:31 2000 @@ -737,9 +737,11 @@ ++i; ++j; } - - - if (pt.num_ints == 3 && !g_date_valid_dmy (day, m, y)) + if (pt.num_ints == 2 && pt.month != G_DATE_BAD_MONTH) + { + m = pt.month; + } + else if (pt.num_ints == 3 && !g_date_valid_dmy (day, m, y)) { /* Try YYYY MM DD */ y = pt.n[0]; --- gmarkup.c.eml Thu Nov 30 13:59:30 2000 +++ gmarkup.c Thu Nov 30 13:56:48 2000 @@ -761,7 +761,7 @@ static const gchar* current_element (GMarkupParseContext *context) { - return context->tag_stack->data; + return (context->tag_stack?context->tag_stack->data:0); } static const gchar* --- gstrfuncs.c.eml Thu Nov 30 12:33:25 2000 +++ gstrfuncs.c Thu Nov 30 12:33:46 2000 @@ -676,7 +676,7 @@ char *msg; #ifdef HAVE_STRSIGNAL -#ifdef G_OS_BEOS +#if defined(G_OS_BEOS) || defined(__CYGWIN__) extern const char * strsignal(int); #else /* !G_OS_BEOS */ /* this is declared differently (const) in string.h on BeOS */ --- gmodule/gmodule-dl.c.eml Fri Dec 1 07:11:28 2000 +++ gmodule/gmodule-dl.c Fri Dec 1 04:30:03 2000 @@ -68,6 +68,120 @@ #define RTLD_NOW 0 #endif /* RTLD_NOW */ +#if defined(__CYGWIN__) +#include +#include +static gpointer +find_in_any_module_using_toolhelp (const gchar *symbol_name) +{ + typedef HANDLE (WINAPI *PFNCREATETOOLHELP32SNAPSHOT)(DWORD, DWORD); + static PFNCREATETOOLHELP32SNAPSHOT pfnCreateToolhelp32Snapshot = NULL; + + typedef BOOL (WINAPI *PFNMODULE32FIRST)(HANDLE, MODULEENTRY32*); + static PFNMODULE32FIRST pfnModule32First= NULL; + + typedef BOOL (WINAPI *PFNMODULE32NEXT)(HANDLE, MODULEENTRY32*); + static PFNMODULE32NEXT pfnModule32Next = NULL; + + static HMODULE kernel32; + + HANDLE snapshot; + MODULEENTRY32 me32; + + gpointer p; + + if (!pfnCreateToolhelp32Snapshot || !pfnModule32First || !pfnModule32Next) + { + if (!kernel32) + if (!(kernel32 = GetModuleHandle ("kernel32.dll"))) + return NULL; + + if (!(pfnCreateToolhelp32Snapshot = (PFNCREATETOOLHELP32SNAPSHOT) GetProcAddress (kernel32, "CreateToolhelp32Snapshot")) + || !(pfnModule32First = (PFNMODULE32FIRST) GetProcAddress (kernel32, "Module32First")) + || !(pfnModule32Next = (PFNMODULE32NEXT) GetProcAddress (kernel32, "Module32Next"))) + return NULL; + } + + if ((snapshot = (*pfnCreateToolhelp32Snapshot) (TH32CS_SNAPMODULE, 0)) == (HANDLE) -1) + return NULL; + + me32.dwSize = sizeof (me32); + p = NULL; + if ((*pfnModule32First) (snapshot, &me32)) + { + do { + if ((p = GetProcAddress (me32.hModule, symbol_name)) != NULL) + break; + } while ((*pfnModule32Next) (snapshot, &me32)); + } + + CloseHandle (snapshot); + + return p; +} + +static gpointer +find_in_any_module_using_psapi (const gchar *symbol_name) +{ + static HMODULE psapi = NULL; + + typedef BOOL (WINAPI *PFNENUMPROCESSMODULES) (HANDLE, HMODULE *, DWORD, LPDWORD) ; + static PFNENUMPROCESSMODULES pfnEnumProcessModules = NULL; + + HMODULE *modules; + HMODULE dummy; + gint i, size; + DWORD needed; + + gpointer p; + + if (!pfnEnumProcessModules) + { + if (!psapi) + if ((psapi = LoadLibrary ("psapi.dll")) == NULL) + return NULL; + + if (!(pfnEnumProcessModules = (PFNENUMPROCESSMODULES) GetProcAddress (psapi, "EnumProcessModules"))) + return NULL; + } + + if (!(*pfnEnumProcessModules) (GetCurrentProcess (), &dummy, + sizeof (HMODULE), &needed)) + return NULL; + + size = needed + 10 * sizeof (HMODULE); + modules = g_malloc (size); + + if (!(*pfnEnumProcessModules) (GetCurrentProcess (), modules, + size, &needed) + || needed > size) + { + g_free (modules); + return NULL; + } + + p = NULL; + for (i = 0; i < needed / sizeof (HMODULE); i++) + if ((p = GetProcAddress (modules[i], symbol_name)) != NULL) + break; + + g_free (modules); + + return p; +} + +static gpointer +find_in_any_module (const gchar *symbol_name) +{ + gpointer result; + + if ((result = find_in_any_module_using_toolhelp (symbol_name)) == NULL + && (result = find_in_any_module_using_psapi (symbol_name)) == NULL) + return NULL; + else + return result; +} +#endif /* --- functions --- */ static gchar* @@ -93,6 +207,10 @@ return handle; } +#if defined(__CYGWIN__) +static gpointer null_module_handle = 0; +#endif + static gpointer _g_module_self (void) { @@ -105,7 +223,9 @@ handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY); if (!handle) g_module_set_error (fetch_dlerror ()); - +#if defined(__CYGWIN__) + null_module_handle = handle; +#endif return handle; } @@ -132,6 +252,11 @@ gpointer p; p = dlsym (handle, symbol_name); +#if defined(__CYGWIN__) + if (p == NULL && handle == null_module_handle) { + p = find_in_any_module(symbol_name); + } +#endif if (!p) g_module_set_error (fetch_dlerror ()); @@ -142,13 +267,18 @@ _g_module_build_path (const gchar *directory, const gchar *module_name) { +#if defined(__CYGWIN__) +#define DLL_EXT ".dll" +#else +#define DLL_EXT ".so" +#endif if (directory && *directory) { if (strncmp (module_name, "lib", 3) == 0) return g_strconcat (directory, "/", module_name, NULL); else - return g_strconcat (directory, "/lib", module_name, ".so", NULL); + return g_strconcat (directory, "/lib", module_name, DLL_EXT, NULL); } else if (strncmp (module_name, "lib", 3) == 0) return g_strdup (module_name); else - return g_strconcat ("lib", module_name, ".so", NULL); + return g_strconcat ("lib", module_name, DLL_EXT, NULL); } --- gmodule/testgmodule.c.eml Fri Dec 1 07:11:49 2000 +++ gmodule/testgmodule.c Fri Dec 1 04:26:34 2000 @@ -61,8 +61,13 @@ plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.sl", NULL); plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.sl", NULL); #else /* neither DLD nor WIN32 */ +#if defined(__CYGWIN__) + plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.dll", NULL); + plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.dll", NULL); +#else plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.so", NULL); plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.so", NULL); +#endif #endif g_free (string);