Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.4.861
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.861 (after 7.4.855)
Problem:    pango_shape_full() is not always available.
Solution:   Add a configure check.
Files:      src/configure.in, src/auto/configure, src/config.h.in,
            src/gui_gtk_x11.c


*** ../vim-7.4.860/src/configure.in	2015-06-21 13:41:02.811278596 +0200
--- src/configure.in	2015-09-08 19:50:24.985682545 +0200
***************
*** 3539,3544 ****
--- 3539,3560 ----
    AC_MSG_RESULT(yes)
  fi
  
+ if test "x$GTK_CFLAGS" != "x"; then
+   dnl pango_shape_full() is new, fall back to pango_shape().
+   AC_MSG_CHECKING(for pango_shape_full)
+   ac_save_CFLAGS="$CFLAGS"
+   ac_save_LIBS="$LIBS"
+   CFLAGS="$CFLAGS $GTK_CFLAGS"
+   LIBS="$LIBS $GTK_LIBS"
+   AC_TRY_COMPILE(
+   [#include <gtk/gtk.h>],
+   [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ],
+ 	  AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL),
+ 	  AC_MSG_RESULT(no))
+   CFLAGS="$ac_save_CFLAGS"
+   LIBS="$ac_save_LIBS"
+ fi
+ 
  AC_MSG_CHECKING(--disable-gpm argument)
  AC_ARG_ENABLE(gpm,
  	[  --disable-gpm           Don't use gpm (Linux mouse daemon).], ,
*** ../vim-7.4.860/src/auto/configure	2015-06-21 13:41:02.815278555 +0200
--- src/auto/configure	2015-09-08 19:56:12.910128272 +0200
***************
*** 12181,12186 ****
--- 12181,12217 ----
  $as_echo "yes" >&6; }
  fi
  
+ if test "x$GTK_CFLAGS" != "x"; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pango_shape_full" >&5
+ $as_echo_n "checking for pango_shape_full... " >&6; }
+   ac_save_CFLAGS="$CFLAGS"
+   ac_save_LIBS="$LIBS"
+   CFLAGS="$CFLAGS $GTK_CFLAGS"
+   LIBS="$LIBS $GTK_LIBS"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <gtk/gtk.h>
+ int
+ main ()
+ {
+  pango_shape_full(NULL, 0, NULL, 0, NULL, NULL);
+   ;
+   return 0;
+ }
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }; $as_echo "#define HAVE_PANGO_SHAPE_FULL 1" >>confdefs.h
+ 
+ else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   CFLAGS="$ac_save_CFLAGS"
+   LIBS="$ac_save_LIBS"
+ fi
+ 
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gpm argument" >&5
  $as_echo_n "checking --disable-gpm argument... " >&6; }
  # Check whether --enable-gpm was given.
*** ../vim-7.4.860/src/config.h.in	2014-10-11 14:47:22.825275547 +0200
--- src/config.h.in	2015-09-08 19:56:07.242186195 +0200
***************
*** 369,374 ****
--- 369,377 ----
  #undef HAVE_SOLARIS_ACL
  #undef HAVE_AIX_ACL
  
+ /* Define if pango_shape_full() is available. */
+ #undef HAVE_PANGO_SHAPE_FULL
+ 
  /* Define if you want to add support of GPM (Linux console mouse daemon) */
  #undef HAVE_GPM
  
*** ../vim-7.4.860/src/gui_gtk_x11.c	2015-09-08 16:31:01.673123014 +0200
--- src/gui_gtk_x11.c	2015-09-08 19:54:10.199382153 +0200
***************
*** 5063,5070 ****
--- 5063,5075 ----
  	     * done, because drawing the cursor would change the display. */
  	    item->analysis.shape_engine = default_shape_engine;
  
+ #ifdef HAVE_PANGO_SHAPE_FULL
  	    pango_shape_full((const char *)s + item->offset, item->length,
  		    (const char *)s, len, &item->analysis, glyphs);
+ #else
+ 	    pango_shape((const char *)s + item->offset, item->length,
+ 			&item->analysis, glyphs);
+ #endif
  	    /*
  	     * Fixed-width hack: iterate over the array and assign a fixed
  	     * width to each glyph, thus overriding the choice made by the
*** ../vim-7.4.860/src/version.c	2015-09-08 19:13:17.568494100 +0200
--- src/version.c	2015-09-08 19:52:12.152588060 +0200
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     861,
  /**/

-- 
Looking at Perl through Lisp glasses, Perl looks atrocious.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///