]> git.draconx.ca Git - liblbx.git/commitdiff
Use gnulib flexmember module.
authorNick Bowler <nbowler@draconx.ca>
Sun, 26 Sep 2021 06:06:47 +0000 (02:06 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sun, 26 Sep 2021 06:06:47 +0000 (02:06 -0400)
For increased portability to older C compilers.

m4/gnulib-cache.m4
src/image.c
src/lbx.c

index 3626eadf643c085967dbf9c2f44e44698027c5d3..7fd3466eb4b0f000597347d7f5a5dce6b0e91eb9 100644 (file)
 #  --libtool \
 #  --macro-prefix=gl \
 #  --no-vc-files \
+#  flexmember \
 #  fnmatch \
 #  getopt-gnu
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
 gl_MODULES([
+  flexmember
   fnmatch
   getopt-gnu
 ])
index 24dce999504f62f25bba270066cd7ab8a0646542..ed80565439f65329875c831f200efd2645ec2213 100644 (file)
@@ -62,7 +62,7 @@ struct lbx_image_priv {
        unsigned currentx, currenty, currentn;
        int read_state;
 
-       unsigned long offsets[];
+       unsigned long offsets[FLEXIBLE_ARRAY_MEMBER];
 };
 
 static struct lbx_image_priv *lbx_img_init(unsigned char *hdr)
index 17c68b15b63a75c7158aace0adfb325f2f9d2781..8080b67f3f74c3b747a76c205e107fe5c7ff51c3 100644 (file)
--- a/src/lbx.c
+++ b/src/lbx.c
@@ -42,7 +42,7 @@ struct lbx_priv {
 
        struct lbx_file_state *last_file;
 
-       unsigned long offsets[];
+       unsigned long offsets[FLEXIBLE_ARRAY_MEMBER];
 };
 
 struct lbx_file_state {