+2017-05-18 Bruno Haible <bruno@clisp.org>
+
+ unicase/special-casing: Fix incompatibility with gperf-3.0.4
+ (regression from 2017-02-13).
+ * lib/unicase/special-casing.in.h: Renamed from
+ lib/unicase/special-casing.h.
+ * modules/unicase/special-casing (Files): Add
+ lib/unicase/special-casing.in.h. Remove lib/unicase/special-casing.h.
+ (Makefile.am): Add rule for generating unicase/special-casing.h.
+ Update BUILT_SOURCES and MOSTLYCLEANFILES accordingly.
+ * lib/unicase/special-casing.c: Include "unicase/special-casing.h",
+ not "special-casing.h".
+ * lib/unicase/u*.c: Likewise.
+
2017-05-17 Bruno Haible <bruno@clisp.org>
README: Don't ask people to read a TeXinfo file.
#include <config.h>
/* Specification. */
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#include <string.h>
+++ /dev/null
-/* Special casing table.
- Copyright (C) 2009-2017 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2009.
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include <stddef.h>
-
-/* A special casing context.
- A context is negated through x -> -x. */
-enum
-{
- SCC_ALWAYS = 0,
- SCC_FINAL_SIGMA = 1,
- SCC_AFTER_SOFT_DOTTED = 2,
- SCC_MORE_ABOVE = 3,
- SCC_BEFORE_DOT = 4,
- SCC_AFTER_I = 5
-};
-
-struct special_casing_rule
-{
- /* The first two bytes are the code, in big-endian order. The third byte
- only distinguishes different rules pertaining to the same code. */
- /*unsigned*/ char code[3];
-
- /* True when this rule is not the last one for the given code. */
- /*bool*/ unsigned int has_next : 1;
-
- /* Context. */
- signed int context : 7;
-
- /* Language, or an empty string. */
- char language[2];
-
- /* Mapping to upper case. Between 0 and 3 characters. Filled with 0s. */
- unsigned short upper[3];
-
- /* Mapping to lower case. Between 0 and 3 characters. Filled with 0s. */
- unsigned short lower[3];
-
- /* Mapping to title case. Between 0 and 3 characters. Filled with 0s. */
- unsigned short title[3];
-
- /* Casefolding mapping. Between 0 and 3 characters. Filled with 0s. */
- unsigned short casefold[3];
-};
-
-extern const struct special_casing_rule *
- gl_unicase_special_lookup (const char *str, size_t len);
--- /dev/null
+/* Special casing table.
+ Copyright (C) 2009-2017 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stddef.h>
+
+/* A special casing context.
+ A context is negated through x -> -x. */
+enum
+{
+ SCC_ALWAYS = 0,
+ SCC_FINAL_SIGMA = 1,
+ SCC_AFTER_SOFT_DOTTED = 2,
+ SCC_MORE_ABOVE = 3,
+ SCC_BEFORE_DOT = 4,
+ SCC_AFTER_I = 5
+};
+
+struct special_casing_rule
+{
+ /* The first two bytes are the code, in big-endian order. The third byte
+ only distinguishes different rules pertaining to the same code. */
+ /*unsigned*/ char code[3];
+
+ /* True when this rule is not the last one for the given code. */
+ /*bool*/ unsigned int has_next : 1;
+
+ /* Context. */
+ signed int context : 7;
+
+ /* Language, or an empty string. */
+ char language[2];
+
+ /* Mapping to upper case. Between 0 and 3 characters. Filled with 0s. */
+ unsigned short upper[3];
+
+ /* Mapping to lower case. Between 0 and 3 characters. Filled with 0s. */
+ unsigned short lower[3];
+
+ /* Mapping to title case. Between 0 and 3 characters. Filled with 0s. */
+ unsigned short title[3];
+
+ /* Casefolding mapping. Between 0 and 3 characters. Filled with 0s. */
+ unsigned short casefold[3];
+};
+
+extern const struct special_casing_rule *
+ gl_unicase_special_lookup (const char *str, size_t len);
#include "uninorm.h"
#include "caseprop.h"
#include "context.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#define FUNC u16_casemap
#define UNIT uint16_t
#include <stdlib.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#include "casefold.h"
#define FUNC u16_ct_casefold
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint16_t *
u16_ct_tolower (const uint16_t *s, size_t n,
#include "uninorm.h"
#include "caseprop.h"
#include "context.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#define FUNC u16_ct_totitle
#define UNIT uint16_t
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint16_t *
u16_ct_toupper (const uint16_t *s, size_t n,
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint16_t *
u16_tolower (const uint16_t *s, size_t n, const char *iso639_language,
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint16_t *
u16_toupper (const uint16_t *s, size_t n, const char *iso639_language,
#include "uninorm.h"
#include "caseprop.h"
#include "context.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#define FUNC u32_casemap
#define UNIT uint32_t
#include <stdlib.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#include "casefold.h"
#define FUNC u32_ct_casefold
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint32_t *
u32_ct_tolower (const uint32_t *s, size_t n,
#include "uninorm.h"
#include "caseprop.h"
#include "context.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#define FUNC u32_ct_totitle
#define UNIT uint32_t
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint32_t *
u32_ct_toupper (const uint32_t *s, size_t n,
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint32_t *
u32_tolower (const uint32_t *s, size_t n, const char *iso639_language,
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint32_t *
u32_toupper (const uint32_t *s, size_t n, const char *iso639_language,
#include "uninorm.h"
#include "caseprop.h"
#include "context.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#define FUNC u8_casemap
#define UNIT uint8_t
#include <stdlib.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#include "casefold.h"
#define FUNC u8_ct_casefold
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint8_t *
u8_ct_tolower (const uint8_t *s, size_t n,
#include "uninorm.h"
#include "caseprop.h"
#include "context.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
#define FUNC u8_ct_totitle
#define UNIT uint8_t
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint8_t *
u8_ct_toupper (const uint8_t *s, size_t n,
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint8_t *
u8_tolower (const uint8_t *s, size_t n, const char *iso639_language,
#include <stddef.h>
#include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
uint8_t *
u8_toupper (const uint8_t *s, size_t n, const char *iso639_language,
Special casing table.
Files:
-lib/unicase/special-casing.h
+lib/unicase/special-casing.in.h
lib/unicase/special-casing.c
lib/unicase/special-casing-table.gperf
MAINTAINERCLEANFILES += unicase/special-casing-table.h
EXTRA_DIST += unicase/special-casing-table.h
+# Generate special-casing.h with a declaration that depends on the gperf version.
+unicase/special-casing.h: unicase/special-casing.in.h unicase/special-casing-table.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ declaration=`grep '^gl_unicase_special_lookup' $(srcdir)/unicase/special-casing-table.h | sed -e 's/register //g'` && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e "/gl_unicase_special_lookup/s/gl_unicase_special_lookup.*/$${declaration};/" $(srcdir)/unicase/special-casing.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+BUILT_SOURCES += unicase/special-casing.h
+MOSTLYCLEANFILES += unicase/special-casing.h unicase/special-casing.h-t
+
Include:
"unicase/special-casing.h"