summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-07-28 12:00:52 +0100
committerRichard Hughes <richard@hughsie.com>2016-07-28 12:00:52 +0100
commitef0f9b6cb3e3ff5f34e710f7c83f9dc991b47e5d (patch)
tree8306a397c8ff9ff792b1e55788b7c0e31757d0b8
parent90baa547a4a6268ae8750ece581a0ef432aca090 (diff)
downloadappstream-glib-ef0f9b6cb3e3ff5f34e710f7c83f9dc991b47e5d.tar.gz
Don't change ABI when built with/without gperf (#123)
* Prefix as_tag_from_gperf() with an underscore to make it private Otherwise, the library's exported ABI changes depending on whether gperf was present at compile-time, which should just be an optimization. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> * Don't distribute generated as-tag-private.h in tarballs Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--libappstream-glib/Makefile.am3
-rw-r--r--libappstream-glib/as-tag.c4
-rw-r--r--libappstream-glib/as-tag.gperf4
3 files changed, 6 insertions, 5 deletions
diff --git a/libappstream-glib/Makefile.am b/libappstream-glib/Makefile.am
index 39a2637..8f6bb7c 100644
--- a/libappstream-glib/Makefile.am
+++ b/libappstream-glib/Makefile.am
@@ -91,6 +91,7 @@ libappstream_glib_include_HEADERS = \
as-utils.h \
as-version.h
+nodist_libappstream_glib_la_SOURCES =
libappstream_glib_la_SOURCES = \
as-app.c \
as-app-desktop.c \
@@ -149,7 +150,7 @@ libappstream_glib_la_SOURCES += \
endif
if HAVE_GPERF
-libappstream_glib_la_SOURCES += as-tag-private.h
+nodist_libappstream_glib_la_SOURCES += as-tag-private.h
BUILT_SOURCES += as-tag-private.h
endif
diff --git a/libappstream-glib/as-tag.c b/libappstream-glib/as-tag.c
index 820eddd..56192c8 100644
--- a/libappstream-glib/as-tag.c
+++ b/libappstream-glib/as-tag.c
@@ -37,7 +37,7 @@
#ifdef HAVE_GPERF
/* we need to define this now as gperf just writes a big header file */
- const struct tag_data *as_tag_from_gperf (const char *tag, guint etag);
+ const struct tag_data *_as_tag_from_gperf (const char *tag, guint etag);
#include "as-tag-private.h"
#endif
@@ -85,7 +85,7 @@ as_tag_from_string_full (const gchar *tag, AsTagFlags flags)
#ifdef HAVE_GPERF
/* use a perfect hash */
- ky = as_tag_from_gperf (tag, (guint) strlen (tag));
+ ky = _as_tag_from_gperf (tag, (guint) strlen (tag));
if (ky != NULL)
etag = ky->etag;
#else
diff --git a/libappstream-glib/as-tag.gperf b/libappstream-glib/as-tag.gperf
index 5508e65..a6455c1 100644
--- a/libappstream-glib/as-tag.gperf
+++ b/libappstream-glib/as-tag.gperf
@@ -1,7 +1,7 @@
%language=ANSI-C
%struct-type
-%define hash-function-name as_tag_hash
-%define lookup-function-name as_tag_from_gperf
+%define hash-function-name _as_tag_hash
+%define lookup-function-name _as_tag_from_gperf
%readonly-tables
%includes
%pic