portability: multiple typedefs

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
commit 0a5bfb4fda7654bfda701f825c796e54150545a1
Author: Akim Demaille <[email protected]>
Date:   Mon Aug 3 06:26:34 2020 +0200

    portability: multiple typedefs
    
    Older versions of GCC (4.1.2 here) don't like repeated typedefs.
    
          CC       src/bison-parse-simulation.o
        src/parse-simulation.c:61: error: redefinition of typedef 'parse_state'
        src/parse-simulation.h:74: error: previous declaration of 'parse_state' was here
        make: *** [Makefile:7876: src/bison-parse-simulation.o] Error 1
    
    Reported by Nelson H. F. Beebe.
    
    * src/parse-simulation.c (parse_state): Don't typedef,
    parse-simulation.h did it already.

diff --git a/src/parse-simulation.c b/src/parse-simulation.c
index ba09c44c..70bfb177 100644
--- a/src/parse-simulation.c
+++ b/src/parse-simulation.c
@@ -28,7 +28,7 @@
 #include "lssi.h"
 #include "nullable.h"
 
-typedef struct parse_state
+struct parse_state
 {
   // Path of state-items the parser has traversed.
   struct si_chunk
@@ -58,7 +58,7 @@ typedef struct parse_state
   // Causes chunk contents to be freed when the reference count is
   // one. Used when only the chunk metadata will be needed.
   bool free_contents_early;
-} parse_state;
+};
 
 
 static void
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.