+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.
+ * tests/unilbrk/test-u8-possible-linebreaks.c (main): Outside of
+ libunistring, don't test the backward compatibility function.
+ * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
+ * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
+ * tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise.
+ * tests/unilbrk/test-u8-width-linebreaks.c (main): Likewise.
+ * tests/unilbrk/test-u16-width-linebreaks.c (main): Likewise.
+ * tests/unilbrk/test-u32-width-linebreaks.c (main): Likewise.
+ * tests/unilbrk/test-ulc-width-linebreaks.c (main): Likewise.
+
2023-02-11 Bruno Haible <bruno@clisp.org>
sigsegv: Fix a compilation error on OpenBSD with clang ≥ 16.
/* Line breaking of UTF-16 strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
}
}
-#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,
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)
/* Line breaking of UTF-16 strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
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,
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,
/* Line breaking of UTF-32 strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
}
}
-#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,
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)
/* Line breaking of UTF-32 strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
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,
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,
/* Line breaking of UTF-8 strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
}
}
-#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,
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)
/* Line breaking of UTF-8 strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
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,
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,
/* Line breaking of strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
}
}
-#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,
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)
/* Line breaking of strings.
- Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
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,
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,
/* Test of line breaking of UTF-16 strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (u16_possible_linebreaks, 2);
-#undef u16_possible_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef u16_possible_linebreaks
test_function (u16_possible_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of UTF-16 strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (u16_width_linebreaks, 2);
-#undef u16_width_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef u16_width_linebreaks
test_function (u16_width_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of UTF-32 strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (u32_possible_linebreaks, 2);
-#undef u32_possible_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef u32_possible_linebreaks
test_function (u32_possible_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of UTF-32 strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (u32_width_linebreaks, 2);
-#undef u32_width_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef u32_width_linebreaks
test_function (u32_width_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of UTF-8 strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (u8_possible_linebreaks, 2);
-#undef u8_possible_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef u8_possible_linebreaks
test_function (u8_possible_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of UTF-8 strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (u8_width_linebreaks, 2);
-#undef u8_width_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef u8_width_linebreaks
test_function (u8_width_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (ulc_possible_linebreaks, 2);
-#undef ulc_possible_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef ulc_possible_linebreaks
test_function (ulc_possible_linebreaks, 1);
+#endif
return 0;
}
/* Test of line breaking of strings.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main ()
{
test_function (ulc_width_linebreaks, 2);
-#undef ulc_width_linebreaks
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# undef ulc_width_linebreaks
test_function (ulc_width_linebreaks, 1);
+#endif
return 0;
}