bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: declared.sh: Allow parsing 'extern "C"' lines
Date: Sun, 20 Jun 2021 03:23:15 +0200	[thread overview]
Message-ID: <4104549.e3xb1KOkY4@omega> (raw)

The declared.sh file has a problem extracting the first 'extern ...'
declaration within an  'extern "C" {' ... '}' block. The line
concatenation step produces this intermediate result:

 ---------------------------------------------------------------------
#if defined _WIN32 && ! defined __CYGWIN__

# include <io.h>

# ifdef __cplusplus
extern "C" { # endif  # if !((defined isatty && defined _GL_UNISTD_H) || defined GNULIB_overrides_isatty)   extern int libtextstyle_isatty (int fd);
#  undef isatty
#  define isatty libtextstyle_isatty
# endif

# ifdef __cplusplus
}
# endif

#endif
 ---------------------------------------------------------------------

and the next step does not find the declaration of libtextstyle_isatty
in this mess. This patch fixes it.


2021-06-19  Bruno Haible  <bruno@clisp.org>

	declared.sh: Allow parsing 'extern "C"' lines.
	* build-aux/declared.sh: Don't concatenate lines to an 'extern "C" {'
	line.

diff --git a/build-aux/declared.sh b/build-aux/declared.sh
index 204e628..0d3e70d 100755
--- a/build-aux/declared.sh
+++ b/build-aux/declared.sh
@@ -120,11 +120,11 @@ test "$sed_result" = 'aaa' \
 # A sed expression that joins 'extern' declarations that are broken over
 # several lines.
 sed_join_multiline_externs='
-/^extern [^;]*$/{
+/^extern [^;"]*$/{
   :a
   N
   s/\n/ /g
-  /^extern [^;]*$/{
+  /^extern [^;"]*$/{
     ba
   }
 }'



                 reply	other threads:[~2021-06-20  1:23 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=4104549.e3xb1KOkY4@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).