]> Savannah Git Hosting - gnulib.git/commitdiff
unilbrk: Don't compile unused functions outside of libunistring.
authorBruno Haible <bruno@clisp.org>
Sat, 11 Feb 2023 19:10:21 +0000 (20:10 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 11 Feb 2023 19:10:21 +0000 (20:10 +0100)
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Don't
compile outside of libunistring.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
Likewise.
* lib/unilbrk/ulc-possible-linebreaks.c (ulc_possible_linebreaks):
Likewise.
* lib/unilbrk/u8-width-linebreaks.c (u8_width_linebreaks): Likewise.
* lib/unilbrk/u16-width-linebreaks.c (u16_width_linebreaks): Likewise.
* lib/unilbrk/u32-width-linebreaks.c (u32_width_linebreaks): Likewise.
* lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks): Likewise.

ChangeLog
lib/unilbrk/u16-possible-linebreaks.c
lib/unilbrk/u16-width-linebreaks.c
lib/unilbrk/u32-possible-linebreaks.c
lib/unilbrk/u32-width-linebreaks.c
lib/unilbrk/u8-possible-linebreaks.c
lib/unilbrk/u8-width-linebreaks.c
lib/unilbrk/ulc-possible-linebreaks.c
lib/unilbrk/ulc-width-linebreaks.c

index 70763b0955844c260dba682f048bb9e004fe4295..acdd48efa559b050e7c446846952d049bd6e3639 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2023-02-11  Bruno Haible  <bruno@clisp.org>
+
+       unilbrk: Don't compile unused functions outside of libunistring.
+       * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Don't
+       compile outside of libunistring.
+       * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
+       Likewise.
+       * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
+       Likewise.
+       * lib/unilbrk/ulc-possible-linebreaks.c (ulc_possible_linebreaks):
+       Likewise.
+       * lib/unilbrk/u8-width-linebreaks.c (u8_width_linebreaks): Likewise.
+       * lib/unilbrk/u16-width-linebreaks.c (u16_width_linebreaks): Likewise.
+       * lib/unilbrk/u32-width-linebreaks.c (u32_width_linebreaks): Likewise.
+       * lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks): Likewise.
+
 2023-02-11  Bruno Haible  <bruno@clisp.org>
 
        sigsegv: Fix a compilation error on OpenBSD with clang ≥ 16.
index 75d50efc5a6fee33af3d8b25c841db6b98faa167..bbb236ae4efbf3c7bf53e8d8525151d8de5f9313 100644 (file)
@@ -216,7 +216,10 @@ u16_possible_linebreaks_loop (const uint16_t *s, size_t n, const char *encoding,
     }
 }
 
-#undef u16_possible_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef u16_possible_linebreaks
 
 void
 u16_possible_linebreaks (const uint16_t *s, size_t n, const char *encoding,
@@ -225,6 +228,8 @@ u16_possible_linebreaks (const uint16_t *s, size_t n, const char *encoding,
   u16_possible_linebreaks_loop (s, n, encoding, -1, p);
 }
 
+#endif
+
 void
 u16_possible_linebreaks_v2 (const uint16_t *s, size_t n, const char *encoding,
                             char *p)
index 44d630e7e8d7d01cc7d952dbbf37e2e33ddfebda..9299a86df4ca88bdb0bbe7a47c83652aa3b48491 100644 (file)
@@ -118,7 +118,10 @@ u16_width_linebreaks_internal (const uint16_t *s, size_t n,
   return last_column + piece_width;
 }
 
-#undef u16_width_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef u16_width_linebreaks
 
 int
 u16_width_linebreaks (const uint16_t *s, size_t n,
@@ -131,6 +134,8 @@ u16_width_linebreaks (const uint16_t *s, size_t n,
                                         o, encoding, -1, p);
 }
 
+#endif
+
 int
 u16_width_linebreaks_v2 (const uint16_t *s, size_t n,
                          int width, int start_column, int at_end_columns,
index 37215f12e43a4350d99afd359b5665a67f74b142..762342a7ebe93891f49c3f738111fba6c55e3a99 100644 (file)
@@ -210,7 +210,10 @@ u32_possible_linebreaks_loop (const uint32_t *s, size_t n, const char *encoding,
     }
 }
 
-#undef u32_possible_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef u32_possible_linebreaks
 
 void
 u32_possible_linebreaks (const uint32_t *s, size_t n, const char *encoding,
@@ -219,6 +222,8 @@ u32_possible_linebreaks (const uint32_t *s, size_t n, const char *encoding,
   u32_possible_linebreaks_loop (s, n, encoding, -1, p);
 }
 
+#endif
+
 void
 u32_possible_linebreaks_v2 (const uint32_t *s, size_t n, const char *encoding,
                             char *p)
index 2b22585c8678f587ff4e1d3fe81c0afaf411c491..524e82294d2cc4307425cfd976b22f982d8697e7 100644 (file)
@@ -116,7 +116,10 @@ u32_width_linebreaks_internal (const uint32_t *s, size_t n,
   return last_column + piece_width;
 }
 
-#undef u32_width_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef u32_width_linebreaks
 
 int
 u32_width_linebreaks (const uint32_t *s, size_t n,
@@ -129,6 +132,8 @@ u32_width_linebreaks (const uint32_t *s, size_t n,
                                         o, encoding, -1, p);
 }
 
+#endif
+
 int
 u32_width_linebreaks_v2 (const uint32_t *s, size_t n,
                          int width, int start_column, int at_end_columns,
index be282e0d0366837a48763c13ffe236ff2ba04fa8..1ac1200b3d6e95bdf8bd661ca307fb4877d27224 100644 (file)
@@ -216,7 +216,10 @@ u8_possible_linebreaks_loop (const uint8_t *s, size_t n, const char *encoding,
     }
 }
 
-#undef u8_possible_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef u8_possible_linebreaks
 
 void
 u8_possible_linebreaks (const uint8_t *s, size_t n, const char *encoding,
@@ -225,6 +228,8 @@ u8_possible_linebreaks (const uint8_t *s, size_t n, const char *encoding,
   u8_possible_linebreaks_loop (s, n, encoding, -1, p);
 }
 
+#endif
+
 void
 u8_possible_linebreaks_v2 (const uint8_t *s, size_t n, const char *encoding,
                            char *p)
index 92c061907f090af50c7af47c31c2d2ac672143d8..718e535da4a57808fb4d75a5d2c0a6dee101fc15 100644 (file)
@@ -118,7 +118,10 @@ u8_width_linebreaks_internal (const uint8_t *s, size_t n,
   return last_column + piece_width;
 }
 
-#undef u8_width_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef u8_width_linebreaks
 
 int
 u8_width_linebreaks (const uint8_t *s, size_t n,
@@ -131,6 +134,8 @@ u8_width_linebreaks (const uint8_t *s, size_t n,
                                        o, encoding, -1, p);
 }
 
+#endif
+
 int
 u8_width_linebreaks_v2 (const uint8_t *s, size_t n,
                         int width, int start_column, int at_end_columns,
index 0d180a0ad9aea9e52101ab69aea677341746c58d..8d97e51afe653ecd650f3f8b640245d4e5510583 100644 (file)
@@ -132,7 +132,10 @@ ulc_possible_linebreaks_internal (const char *s, size_t n, const char *encoding,
     }
 }
 
-#undef ulc_possible_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef ulc_possible_linebreaks
 
 void
 ulc_possible_linebreaks (const char *s, size_t n, const char *encoding,
@@ -141,6 +144,8 @@ ulc_possible_linebreaks (const char *s, size_t n, const char *encoding,
   ulc_possible_linebreaks_internal (s, n, encoding, -1, p);
 }
 
+#endif
+
 void
 ulc_possible_linebreaks_v2 (const char *s, size_t n, const char *encoding,
                             char *p)
index 1d44d440b3d9c49604c4a643a067a0865ae798cd..a8e08bc5093b5bfa346db6925257274b673945d2 100644 (file)
@@ -151,7 +151,10 @@ ulc_width_linebreaks_internal (const char *s, size_t n,
   return start_column;
 }
 
-#undef ulc_width_linebreaks
+#if defined IN_LIBUNISTRING
+/* For backward compatibility with older versions of libunistring.  */
+
+# undef ulc_width_linebreaks
 
 int
 ulc_width_linebreaks (const char *s, size_t n,
@@ -164,6 +167,8 @@ ulc_width_linebreaks (const char *s, size_t n,
                                         o, encoding, -1, p);
 }
 
+#endif
+
 int
 ulc_width_linebreaks_v2 (const char *s, size_t n,
                          int width, int start_column, int at_end_columns,