]> code.delx.au - gnu-emacs/blobdiff - src/macmenu.c
[TARGET_API_MAC_CARBON]: Don't include headers that are included via
[gnu-emacs] / src / macmenu.c
index 740bda261d86f5a6ff32ca65e3eca57fb910a958..35615cc3796885aa5e49448e6da8ae5b6a5458db 100644 (file)
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA.  */
 #include "charset.h"
 #include "coding.h"
 
-#ifndef MAC_OSX
+#if !TARGET_API_MAC_CARBON
 #include <MacTypes.h>
 #include <Menus.h>
 #include <QuickDraw.h>
@@ -47,7 +47,7 @@ Boston, MA 02111-1307, USA.  */
 #if defined (__MRC__) || (__MSL__ >= 0x6000)
 #include <ControlDefinitions.h>
 #endif
-#endif /* not MAC_OSX */
+#endif /* not TARGET_API_MAC_CARBON */
 
 /* This may include sys/types.h, and that somehow loses
    if this is not done before the other system files.  */
@@ -1322,7 +1322,7 @@ update_submenu_strings (first_wv)
 
   for (wv = first_wv; wv; wv = wv->next)
     {
-      if (wv->lname && ! NILP (wv->lname))
+      if (STRINGP (wv->lname))
         {
           wv->name = SDATA (wv->lname);
 
@@ -1336,7 +1336,7 @@ update_submenu_strings (first_wv)
             }
         }
 
-      if (wv->lkey && ! NILP (wv->lkey))
+      if (STRINGP (wv->lkey))
         wv->key = SDATA (wv->lkey);
 
       if (wv->contents)
@@ -2264,8 +2264,7 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu,
       item_name[255] = 0;
 #if TARGET_API_MAC_CARBON
       {
-       CFStringRef string =
-         CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8);
+       CFStringRef string = cfstring_create_with_utf8_cstring (item_name);
 
        SetMenuItemTextWithCFString (menu, pos, string);
        CFRelease (string);