Move pool definitions to hb-static.cc
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 24 May 2018 22:58:26 +0000 (15:58 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 24 May 2018 22:58:26 +0000 (15:58 -0700)
src/Makefile.sources
src/dump-emoji.cc
src/dump-fon.cc
src/hb-ot-layout.cc
src/hb-static.cc [new file with mode: 0644]
src/hb-subset.cc
src/main.cc

index 9fbb71e..2304f30 100644 (file)
@@ -44,6 +44,7 @@ HB_BASE_sources = \
        hb-shaper-impl-private.hh \
        hb-shaper-private.hh \
        hb-shaper.cc \
+       hb-static.cc \
        hb-string-array.hh \
        hb-unicode-private.hh \
        hb-unicode.cc \
index dc8f83d..99e8ef9 100644 (file)
@@ -22,8 +22,7 @@
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  */
 
-#include "hb.h"
-#include "hb-private.hh"
+#include "hb-static.cc"
 #include "hb-ot-color-cbdt-table.hh"
 #include "hb-ot-color-colr-table.hh"
 #include "hb-ot-color-cpal-table.hh"
 #include <stdlib.h>
 #include <stdio.h>
 
-#ifndef HB_NO_VISIBILITY
-void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-#endif
-
 void cbdt_callback (const uint8_t* data, unsigned int length,
                     unsigned int group, unsigned int gid)
 {
index db96790..43d0ab0 100644 (file)
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  */
 
+#include "hb-static.cc"
 #include <stdio.h>
 #include <stdlib.h>
 #include "hb-open-type-private.hh"
 
-#ifndef HB_NO_VISIBILITY
-void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-#endif
-
 template <typename Type, int Bytes> struct LEInt;
 
 template <typename Type>
index 6cb24ea..e3b80b2 100644 (file)
 #include "hb-ot-name-table.hh"
 
 
-#ifndef HB_NO_VISIBILITY
-void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-#endif
-
-
 hb_ot_layout_t *
 _hb_ot_layout_create (hb_face_t *face)
 {
diff --git a/src/hb-static.cc b/src/hb-static.cc
new file mode 100644 (file)
index 0000000..e60121d
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2018  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#include "hb-private.hh"
+
+#ifndef HB_NO_VISIBILITY
+void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
+thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
+#endif
index 94d6515..2bbc4bf 100644 (file)
@@ -44,9 +44,8 @@
 #include "hb-ot-post-table.hh"
 
 
-#if !defined(HB_NO_VISIBILITY) && !defined(HB_SUBSET_BUILTIN)
-void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
+#if !defined(HB_SUBSET_BUILTIN)
+#include "hb-static.cc"
 #endif
 
 
index 88625b4..514e34d 100644 (file)
@@ -24,6 +24,7 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
+#include "hb-static.cc"
 #include "hb-open-file-private.hh"
 #include "hb-ot-layout-gdef-table.hh"
 #include "hb-ot-layout-gsubgpos-private.hh"
 
 using namespace OT;
 
-#ifndef HB_NO_VISIBILITY
-void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
-#endif
-
 int
 main (int argc, char **argv)
 {