gnu: kio: Search 'smbd' on $PATH.
[jackhill/guix/guix.git] / gnu / packages / patches / emacs-pdf-tools-poppler.patch
1 Fix build issue with recent Poppler:
2 <https://github.com/politza/pdf-tools/issues/372>.
3
4 This combines upstream commits
5 6cd76dec9aece2a8daa90f17ab77fbf773157a1d..50a5297b82e26cfd52f6c00645ddc1057099d6a7
6 for this file.
7
8 diff --git a/server/poppler-hack.cc b/server/poppler-hack.cc
9 index 0c62f73..427f9df 100644
10 --- a/server/poppler-hack.cc
11 +++ b/server/poppler-hack.cc
12 @@ -51,7 +51,10 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST;
13 double y2;
14 };
15
16 - char *_xpoppler_goo_string_to_utf8(GooString *s)
17 + // This function does not modify its argument s, but for
18 + // compatibility reasons (e.g. getLength in GooString.h before 2015)
19 + // with older poppler code, it can't be declared as such.
20 + char *_xpoppler_goo_string_to_utf8(/* const */ GooString *s)
21 {
22 char *result;
23
24 @@ -85,7 +88,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST;
25 // Set the rectangle of an annotation. It was first added in v0.26.
26 void xpoppler_annot_set_rectangle (PopplerAnnot *a, PopplerRectangle *rectangle)
27 {
28 - GooString *state = a->annot->getAppearState ();
29 + GooString *state = (GooString*) a->annot->getAppearState ();
30 char *ustate = _xpoppler_goo_string_to_utf8 (state);
31
32 a->annot->setRect (rectangle->x1, rectangle->y1,
33 @@ -105,7 +108,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST;
34 g_return_val_if_fail (POPPLER_IS_ANNOT_MARKUP (poppler_annot), NULL);
35
36 annot = static_cast<AnnotMarkup *>(POPPLER_ANNOT (poppler_annot)->annot);
37 - text = annot->getDate ();
38 + text = (GooString*) annot->getDate ();
39
40 return text ? _xpoppler_goo_string_to_utf8 (text) : NULL;
41 }