bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: uninorm tests: Fix compilation error on Cygwin
Date: Mon, 18 Jan 2021 09:11:45 +0100	[thread overview]
Message-ID: <1665494.vnJLl2dfa7@omega> (raw)

When compiling a testdir for all of Gnulib, on Cygwin, with libunistring
preinstalled, I get compilation errors such as:

In file included from ../../gltests/uninorm/test-nfc.c:21:0:
/usr/local/cygwin64/include/uninorm.h:130:21: error: initializer element is not constant
 #define UNINORM_NFC (&uninorm_nfc)
                     ^
../../gltests/uninorm/test-nfc.c:25:15: note: in expansion of macro 'UNINORM_NFC'
 uninorm_t n = UNINORM_NFC;
               ^~~~~~~~~~~
make[4]: *** [Makefile:21689: uninorm/test-nfc.o] Error 1

This patch fixes it.


2021-01-18  Bruno Haible  <bruno@clisp.org>

	uninorm tests: Fix compilation error on Cygwin.
	* tests/uninorm/test-nfc.c (n): Don't define when using a preinstalled
	libunistring on Windows.
	* tests/uninorm/test-nfd.c (n): Likewise.
	* tests/uninorm/test-nfkc.c (n): Likewise.
	* tests/uninorm/test-nfkd.c (n): Likewise.

diff --git a/tests/uninorm/test-nfc.c b/tests/uninorm/test-nfc.c
index 0e90834..0a7d857 100644
--- a/tests/uninorm/test-nfc.c
+++ b/tests/uninorm/test-nfc.c
@@ -20,7 +20,7 @@
 
 #include "uninorm.h"
 
-#if !(WOE32DLL || defined __ANDROID__)
+#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
 /* Check that UNINORM_NFC is defined and links.  */
 uninorm_t n = UNINORM_NFC;
 #endif
diff --git a/tests/uninorm/test-nfd.c b/tests/uninorm/test-nfd.c
index 63a40f9..e5a06bc 100644
--- a/tests/uninorm/test-nfd.c
+++ b/tests/uninorm/test-nfd.c
@@ -20,7 +20,7 @@
 
 #include "uninorm.h"
 
-#if !(WOE32DLL || defined __ANDROID__)
+#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
 /* Check that UNINORM_NFD is defined and links.  */
 uninorm_t n = UNINORM_NFD;
 #endif
diff --git a/tests/uninorm/test-nfkc.c b/tests/uninorm/test-nfkc.c
index 0505319..52709d7 100644
--- a/tests/uninorm/test-nfkc.c
+++ b/tests/uninorm/test-nfkc.c
@@ -20,7 +20,7 @@
 
 #include "uninorm.h"
 
-#if !(WOE32DLL || defined __ANDROID__)
+#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
 /* Check that UNINORM_NFKC is defined and links.  */
 uninorm_t n = UNINORM_NFKC;
 #endif
diff --git a/tests/uninorm/test-nfkd.c b/tests/uninorm/test-nfkd.c
index 1e20d9a..5e374e3 100644
--- a/tests/uninorm/test-nfkd.c
+++ b/tests/uninorm/test-nfkd.c
@@ -20,7 +20,7 @@
 
 #include "uninorm.h"
 
-#if !(WOE32DLL || defined __ANDROID__)
+#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
 /* Check that UNINORM_NFKD is defined and links.  */
 uninorm_t n = UNINORM_NFKD;
 #endif



                 reply	other threads:[~2021-01-18  8:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1665494.vnJLl2dfa7@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).