]> Savannah Git Hosting - gnulib.git/commitdiff
dfa.h: support inclusion from C++
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Nov 2020 18:53:08 +0000 (10:53 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Nov 2020 18:53:30 +0000 (10:53 -0800)
* lib/dfa.h: Allow multiple inclusion, and inclusion from
C++ code.  The latter was suggested by Arnold Robbins.

ChangeLog
lib/dfa.h

index 2068ce6d2477b362dbbb92d3e64106123bec9cf4..bb30fcf1ec6cb61fc646255748afa54377249bb8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-11-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       dfa.h: support inclusion from C++
+       * lib/dfa.h: Allow multiple inclusion, and inclusion from
+       C++ code.  The latter was suggested by Arnold Robbins.
+
 2020-11-01  Bruno Haible  <bruno@clisp.org>
 
        ssfmalloc tests: Portability to Linux/PowerPC and Linux/SPARC.
index 2f77f2638ac4883cd78ff4da83d022bef9d4a746..65477897201caafd287ed446c7bbe273c75b3573 100644 (file)
--- a/lib/dfa.h
+++ b/lib/dfa.h
 
 /* Written June, 1988 by Mike Haertel */
 
+#ifndef DFA_H_
+#define DFA_H_
+
 #include <regex.h>
 #include <stdbool.h>
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct localeinfo; /* See localeinfo.h.  */
 
 /* Element of a list of strings, at least one of which is known to
@@ -131,3 +138,9 @@ extern void dfawarn (const char *);
    takes a single argument, a NUL-terminated string describing the error.
    The user must supply a dfaerror.  */
 extern _Noreturn void dfaerror (const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* dfa.h */