Don't disable Unicode menus on Windows NT and later due to random errors.
authorEli Zaretskii <eliz@gnu.org>
Thu, 26 Apr 2012 10:07:35 +0000 (13:07 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 26 Apr 2012 10:07:35 +0000 (13:07 +0300)
 src/w32menu.c: Include w32heap.h.
 (add_menu_item): If the call to AppendMenuW (via
 unicode_append_menu) fails, disable Unicode menus only if we are
 running on Windows 9X/Me.

src/ChangeLog
src/w32menu.c

index 06d65c7..8b23806 100644 (file)
@@ -1,3 +1,10 @@
+2012-04-26  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32menu.c: Include w32heap.h.
+       (add_menu_item): If the call to AppendMenuW (via
+       unicode_append_menu) fails, disable Unicode menus only if we are
+       running on Windows 9X/Me.
+
 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
 
        * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
index 9091cb8..5b95a08 100644 (file)
@@ -48,6 +48,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "dispextern.h"
 
+#include "w32heap.h"   /* for osinfo_cache */
+
 #undef HAVE_DIALOGS /* TODO: Implement native dialogs.  */
 
 #ifndef TRUE
@@ -1498,8 +1500,11 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
            AppendMenu (menu, fuFlags,
                        item != NULL ? (UINT) item: (UINT) wv->call_data,
                        out_string);
-         /* Don't use Unicode menus in future.  */
-         unicode_append_menu = NULL;
+         /* Don't use Unicode menus in future, unless this is Windows
+            NT or later, where a failure of AppendMenuW does NOT mean
+            Unicode menus are unsupported.  */
+         if (osinfo_cache.dwPlatformId != VER_PLATFORM_WIN32_NT)
+           unicode_append_menu = NULL;
        }
 
       if (unicode_append_menu && (fuFlags & MF_OWNERDRAW))