summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/nsurl.c6
-rw-r--r--utils/utils.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c
index be7cf2c05..8b1b05fc9 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -156,11 +156,7 @@ struct nsurl {
int count; /* Number of references to NetSurf URL object */
size_t length; /* Length of string */
- char string[
-#if defined(__GNUC__) && (__GNUC__ < 3)
- 0
-#endif
- ]; /* Full URL as a string */
+ char string[FLEX_ARRAY_LEN_DECL]; /* Full URL as a string */
};
diff --git a/utils/utils.h b/utils/utils.h
index f00ea286a..02bf75fea 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -52,6 +52,12 @@
#define PRId64 "lld"
#endif
+#if defined(__GNUC__) && (__GNUC__ < 3)
+#define FLEX_ARRAY_LEN_DECL 0
+#else
+#define FLEX_ARRAY_LEN_DECL
+#endif
+
#if defined(__HAIKU__) || defined(__BEOS__)
#define strtof(s,p) ((float)(strtod((s),(p))))
#endif