From 57fdd584dc099006a4f919183bba58b3064e4c4f Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 13 Mar 2014 10:48:30 +0800 Subject: [PATCH] Move DllMain() to atkprivate.c Since the HMODULE that is initialized by DllMain() is to be used to for get_atk_locale_dir(), which was recently moved to atk/atkprivate.c, move DllMain() and its related items to atk/atkprivate.c as well. This will fix the ATK build on Windows. https://bugzilla.gnome.org/show_bug.cgi?id=726216 --- atk/atkobject.c | 29 ----------------------------- atk/atkprivate.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/atk/atkobject.c b/atk/atkobject.c index 8ef8967..f381df1 100755 --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -25,14 +25,6 @@ #include #include -#ifdef G_OS_WIN32 -#define STRICT -#include -#undef STRICT -#undef FOCUS_EVENT /* pollutes the namespace - * like a six hundred pound gorilla */ -#endif - #include "atk.h" #include "atkmarshal.h" #include "atkprivate.h" @@ -280,27 +272,6 @@ static const gchar* const atk_object_name_property_table_summary = "accessible-t static const gchar* const atk_object_name_property_table_caption_object = "accessible-table-caption-object"; static const gchar* const atk_object_name_property_hypertext_num_links = "accessible-hypertext-nlinks"; -#ifdef G_OS_WIN32 - -static HMODULE atk_dll; - -BOOL WINAPI -DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - atk_dll = (HMODULE) hinstDLL; - break; - } - - return TRUE; -} - -#endif - static void initialize_role_names () { diff --git a/atk/atkprivate.c b/atk/atkprivate.c index de60c2f..17e8d62 100644 --- a/atk/atkprivate.c +++ b/atk/atkprivate.c @@ -32,6 +32,27 @@ #ifdef G_OS_WIN32 +#define STRICT +#include +#undef STRICT + +static HMODULE atk_dll; + +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, +DWORD fdwReason, +LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + atk_dll = (HMODULE)hinstDLL; + break; + } + + return TRUE; +} + static const char * get_atk_locale_dir (void) { -- 2.7.4