Move DllMain() to atkprivate.c
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 13 Mar 2014 02:48:30 +0000 (10:48 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 13 Mar 2014 11:08:36 +0000 (19:08 +0800)
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
atk/atkprivate.c

index 8ef8967..f381df1 100755 (executable)
 #include <glib-object.h>
 #include <glib/gi18n-lib.h>
 
-#ifdef G_OS_WIN32
-#define STRICT
-#include <windows.h>
-#undef STRICT
-#undef FOCUS_EVENT             /* <windows.h> 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 ()
 {
index de60c2f..17e8d62 100644 (file)
 
 #ifdef G_OS_WIN32
 
+#define STRICT
+#include <windows.h>
+#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)
 {