[pango/harfbuzz-ng: 16/57] [HB] Remove glib dependency



commit 0ae1b78e7694204cb973c633d665d1f3e3d20dc4
Author: Behdad Esfahbod <behdad behdad org>
Date:   Sat Aug 1 21:06:11 2009 -0400

    [HB] Remove glib dependency

 pango/opentype/Makefile.am  |    7 ++-----
 pango/opentype/hb-buffer.c  |    2 +-
 pango/opentype/hb-private.h |   30 ++++++++++++++++++------------
 pango/opentype/main.cc      |    1 +
 4 files changed, 22 insertions(+), 18 deletions(-)
---
diff --git a/pango/opentype/Makefile.am b/pango/opentype/Makefile.am
index f941046..5998fcd 100644
--- a/pango/opentype/Makefile.am
+++ b/pango/opentype/Makefile.am
@@ -2,10 +2,6 @@
 
 NULL =
 
-INCLUDES = 					\
-	-I $(srcdir)				\
-	$(FREETYPE_CFLAGS)			\
-	$(GLIB_CFLAGS)
 CXX = gcc -g -O2 -fno-rtti -fno-exceptions -Wabi -Wpadded -Wcast-align
 
 noinst_LTLIBRARIES = libharfbuzz-1.la
@@ -37,11 +33,12 @@ HBHEADERS = \
 	$(NULL)
 
 libharfbuzz_1_la_SOURCES = $(HBSOURCES) $(HBHEADERS)
-libharfbuzz_1_la_LIBADD = $(FREETYPE_LIBS)
+libharfbuzz_1_la_LIBADD =
 
 noinst_PROGRAMS = main
 
 main_SOURCES = main.cc
+main_CXXFLAGS = $(GLIB_CFLAGS)
 main_LDADD = $(GLIB_LIBS)
 
 EXTRA_DIST = README COPYING
diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c
index f596c09..89887fc 100644
--- a/pango/opentype/hb-buffer.c
+++ b/pango/opentype/hb-buffer.c
@@ -269,7 +269,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
   for (i = 0; i < num_out; i++)
   {
     hb_glyph_info_t *info = &buffer->out_string[buffer->out_pos + i];
-    info->gindex = hb_be_uint16_t (glyph_data_be[i]);
+    info->gindex = hb_be_uint16 (glyph_data_be[i]);
     info->properties = properties;
     info->cluster = cluster;
     info->component = component;
diff --git a/pango/opentype/hb-private.h b/pango/opentype/hb-private.h
index 2190b78..e04930b 100644
--- a/pango/opentype/hb-private.h
+++ b/pango/opentype/hb-private.h
@@ -38,18 +38,6 @@
 
 #include "hb-common.h"
 
-#include <glib.h>
-
-/* Macros to convert to/from BigEndian */
-#define hb_be_uint8
-#define hb_be_int8
-#define hb_be_uint16	GUINT16_TO_BE
-#define hb_be_int16	GINT16_TO_BE
-#define hb_be_uint32	GUINT32_TO_BE
-#define hb_be_int32	GINT32_TO_BE
-#define hb_be_uint64	GUINT64_TO_BE
-#define hb_be_int64	GINT64_TO_BE
-
 /* Basics */
 
 #undef MIN
@@ -150,6 +138,24 @@ _hb_popcount32 (uint32_t mask)
 #endif
 }
 
+static HB_GNUC_UNUSED inline uint16_t
+_hb_be_uint16 (uint16_t v)
+{
+  return (v>>8) + (v<<8);
+}
+static HB_GNUC_UNUSED inline uint32_t
+_hb_be_uint32 (uint32_t v)
+{
+  return _hb_be_uint16 (v>>16) + (_hb_be_uint16 (v) <<16);
+}
+
+/* Macros to convert to/from BigEndian */
+#define hb_be_uint8
+#define hb_be_int8
+#define hb_be_uint16(v)	_hb_be_uint16 (v)
+#define hb_be_int16(v)	((int16_t) hb_be_uint16 (v))
+#define hb_be_uint32(v)	_hb_be_uint32 (v)
+#define hb_be_int32(v)	((int32_t) hb_be_uint32 (v))
 
 
 #include "hb-object-private.h"
diff --git a/pango/opentype/main.cc b/pango/opentype/main.cc
index 1347cdf..775251f 100644
--- a/pango/opentype/main.cc
+++ b/pango/opentype/main.cc
@@ -29,6 +29,7 @@
 #include "hb-ot-layout-gdef-private.h"
 #include "hb-ot-layout-gsub-private.h"
 
+#include <glib.h>
 #include <stdlib.h>
 #include <stdio.h>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]