]> git.draconx.ca Git - upkg.git/commitdiff
Use gnulib flexmember module.
authorNick Bowler <nbowler@draconx.ca>
Sun, 27 Feb 2022 19:39:52 +0000 (14:39 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 27 Feb 2022 19:39:52 +0000 (14:39 -0500)
For increased portability to older C compilers.

m4/.gitignore
m4/gnulib-cache.m4
src/engine/texture.gob
src/uobject/vfs.c

index 9454b32f0977f1eda8583f603025046c45bebab3..f49561a7dda415e4b8ed4af1839d653e73577047 100644 (file)
@@ -6,6 +6,7 @@ exponentf.m4
 exponentl.m4
 extensions.m4
 extern-inline.m4
+flexmember.m4
 float_h.m4
 fpieee.m4
 getopt.m4
@@ -13,6 +14,7 @@ gnulib-common.m4
 gnulib-comp.m4
 gnulib-tool.m4
 include_next.m4
+inline.m4
 isnand.m4
 isnanf.m4
 isnanl.m4
index 988fa8e19f47cbe81349f54058dabf12abec41a8..5a3ed85aab51d77bea4f5167aa29f66400b9438a 100644 (file)
@@ -40,7 +40,9 @@
 #  --macro-prefix=gl \
 #  --no-vc-files \
 #  copysignf \
+#  flexmember \
 #  getopt-gnu \
+#  inline \
 #  ldexpf \
 #  strcase
 
@@ -48,7 +50,9 @@
 gl_LOCAL_DIR([])
 gl_MODULES([
   copysignf
+  flexmember
   getopt-gnu
+  inline
   ldexpf
   strcase
 ])
index 165f48a440ef589ef90ed9256e1cbe9eaf8ff884..cc6b2712f776f89e63a576f05b4f532608ca474e 100644 (file)
@@ -40,7 +40,7 @@ struct engine_texture_data {
        unsigned long width, height;
 
        unsigned long datalen;
-       unsigned char data[];
+       unsigned char data[FLEXIBLE_ARRAY_MEMBER];
 };
 
 %}
index 819dbc2e410b8df7c9b04c449beb067f08b7782f..ac73ca4c9d89abb33f5d9a25fd600b0c559eca4d 100644 (file)
@@ -1,19 +1,19 @@
 /*
- *  Functions for handling UObject package search paths.
- *  Copyright © 2009-2011 Nick Bowler
+ * Functions for handling UObject package search paths.
+ * Copyright © 2009-2011, 2022 Nick Bowler
  *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <config.h>
@@ -187,7 +187,7 @@ struct foreach_state {
        const char *name;
        struct upkg *f;
        size_t sz;
-       char buf[];
+       char buf[FLEXIBLE_ARRAY_MEMBER];
 };
 
 static int foreachfile(const char *filename, void *_st)