* declared.sh: Allow parsing 'extern "C"' lines
@ 2021-06-20 1:23 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-06-20 1:23 UTC (permalink / raw)
To: bug-gnulib
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
}
}'
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-20 1:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-20 1:23 declared.sh: Allow parsing 'extern "C"' lines Bruno Haible
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).