]> Savannah Git Hosting - gnulib.git/commitdiff
unicase/special-casing: Fix incompatibility with gperf-3.0.4.
authorBruno Haible <bruno@clisp.org>
Thu, 18 May 2017 10:54:51 +0000 (12:54 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 18 May 2017 10:54:51 +0000 (12:54 +0200)
* 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.

26 files changed:
ChangeLog
lib/unicase/special-casing.c
lib/unicase/special-casing.h [deleted file]
lib/unicase/special-casing.in.h [new file with mode: 0644]
lib/unicase/u16-casemap.c
lib/unicase/u16-ct-casefold.c
lib/unicase/u16-ct-tolower.c
lib/unicase/u16-ct-totitle.c
lib/unicase/u16-ct-toupper.c
lib/unicase/u16-tolower.c
lib/unicase/u16-toupper.c
lib/unicase/u32-casemap.c
lib/unicase/u32-ct-casefold.c
lib/unicase/u32-ct-tolower.c
lib/unicase/u32-ct-totitle.c
lib/unicase/u32-ct-toupper.c
lib/unicase/u32-tolower.c
lib/unicase/u32-toupper.c
lib/unicase/u8-casemap.c
lib/unicase/u8-ct-casefold.c
lib/unicase/u8-ct-tolower.c
lib/unicase/u8-ct-totitle.c
lib/unicase/u8-ct-toupper.c
lib/unicase/u8-tolower.c
lib/unicase/u8-toupper.c
modules/unicase/special-casing

index 92ced6d93b056287df112c19b71e4c1f2e1d70e7..01e99d9d692828a4083c477c0a0bd5d29415edce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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.
index 029c5782d72382640f40ef1964c18bb962131fff..384bb712d9b1b51562ab1896174f41f2bb239ce6 100644 (file)
@@ -18,7 +18,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "special-casing.h"
+#include "unicase/special-casing.h"
 
 #include <string.h>
 
diff --git a/lib/unicase/special-casing.h b/lib/unicase/special-casing.h
deleted file mode 100644 (file)
index fc57523..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* 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);
diff --git a/lib/unicase/special-casing.in.h b/lib/unicase/special-casing.in.h
new file mode 100644 (file)
index 0000000..fc57523
--- /dev/null
@@ -0,0 +1,61 @@
+/* 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);
index aec4dd698d1889bc8482752c312408c6f89f467d..3ab53883d62fad72f41fc5e8727de50bc77f364b 100644 (file)
@@ -29,7 +29,7 @@
 #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
index 1e01d7550543213b4f7ca91ba5748e35bff055e9..71cbf5582d39e8c70594ff8cfc198aaffcfa2fc0 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 
 #include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
 #include "casefold.h"
 
 #define FUNC u16_ct_casefold
index 76f4be2ea96df5478d309865080b64fdd8f93c50..9eea5e703cc40e38f00b96085470cc582ab69823 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index e369462c3b15b011333bf3031b551084b63107cb..158295f0cfea03fa1c0683ca22b47a03b110d8de 100644 (file)
@@ -31,7 +31,7 @@
 #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
index b7f188d8b93ef19372689acce47015cd36de476b..40441a101934a3578adc23647440e6b93c9ac19c 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index a59c3ed110606d1f4bb344d85b8acf459edaae67..1477c182d35f95336f3f3834e8fd2ec5925f875c 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index ccc9df78b72816139e8532c3b77ef175bc6457fb..87ad89d2d49805efebb836bea0e9581061aee74f 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 2a03ac32996f45b07baf79d272d9e4b1d357cc91..b2411eb2d2244d0b0ef56f105fa7c9fe3a14c337 100644 (file)
@@ -29,7 +29,7 @@
 #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
index 75fab2ed28a85c39bdca89695c786fb4aa528943..7d58aa52e66cdb1e4732470b97e1e8d654671b09 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 
 #include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
 #include "casefold.h"
 
 #define FUNC u32_ct_casefold
index a89a9e6f06914f56fecd8f59a63947da779d8cec..8daf165ccf491844e5932d92385b3cf0074905c7 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 1b5fc4276509223e90d9d205bab08893daecd5c1..a9ea73f17e3a8f3e26e6e15a9d7ad95260ee03a7 100644 (file)
@@ -31,7 +31,7 @@
 #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
index ce26da9ba6f6500fe11537efb70775a0d4247e9e..4411dbafc4cdf22cc17b2842c4cd03b54837f06d 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 3a105e3542a45655d43daf41693b504f5b7a4257..7d2aced87c60e3618ca90e8050cd69dd5fda4d8e 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index f5832db4fd2953f4166a07a90aaa1dd3bf3ee3bb..d93291da7f0779263933cd0732dd9553203078e0 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 7f1133342b8df7318a363bdca4412ffced2436f7..ca1b18a64b52fe9f7d1650f2a041f519c75fcf20 100644 (file)
@@ -29,7 +29,7 @@
 #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
index b22f245ae4fb66ce6fd289d56a63a2002ea1b926..5b64cf04c80d12a6441bfd040dd6c8b112d311b5 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 
 #include "unicasemap.h"
-#include "special-casing.h"
+#include "unicase/special-casing.h"
 #include "casefold.h"
 
 #define FUNC u8_ct_casefold
index 169dc91ea878114d57be67d779f0cc0173918417..aff70dd9ce562c539b1a99b2dbb7ac29dd087a67 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index cdee074c9076890202c266b92d0749a897d8942d..b74cc27d0b6e4f8b03e16eca50abaceca4c8133d 100644 (file)
@@ -31,7 +31,7 @@
 #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
index f6d9d76262517e44ca5e0d8a96a35c3e4c9abf45..7ddb046ebeafa3b27c34c2029a040b86d30ea2af 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 0e383792a68f0bac0ebbdedef6b43a91801c1a0a..9681bd591e7e37d3a269a1068fada02ddc07d121 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 18b899d4cbcd1a9275ed766a65ef7f2c659e1324..6ddad4493ab680095426f9867f19ee82b1ba1d2b 100644 (file)
@@ -23,7 +23,7 @@
 #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,
index 0f863a363de534ef726db054afc70e3e63efe6c8..a4a7fcf4c139a6de22d6a46987228929d80b5898 100644 (file)
@@ -2,7 +2,7 @@ Description:
 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
 
@@ -22,6 +22,17 @@ MOSTLYCLEANFILES     += unicase/special-casing-table.h-t
 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"