Reworked r13532 in a cleaner way. The FLEX_ARRAY_LEN_DECL macro from utils.h should be used when declaring an empty array at end of struct.

svn path=/trunk/netsurf/; revision=13535
This commit is contained in:
François Revel 2012-03-19 18:24:43 +00:00
parent 18b3ae0dec
commit 57676ad1c0
2 changed files with 7 additions and 5 deletions

View File

@ -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 */
};

View File

@ -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