bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

declared.sh: Allow parsing 'extern "C"' lines


From: Bruno Haible
Subject: declared.sh: Allow parsing 'extern "C"' lines
Date: Sun, 20 Jun 2021 03:23:15 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; )

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 via email to

[Prev in Thread] Current Thread [Next in Thread]