Skip to content

Commit 236a11d

Browse files
committed
Define FLEXIBLE_ARRAY_MEMBER for MSVC.
1 parent bfcb932 commit 236a11d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/include/pg_config.h.win32

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@
4646
/* Define to the default TCP port number as a string constant. */
4747
#define DEF_PGPORT_STR "5432"
4848

49+
/* Define to nothing if C supports flexible array members, and to 1 if it does
50+
not. That way, with a declaration like `struct s { int n; double
51+
d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
52+
compilers. When computing the size of such an object, don't use 'sizeof
53+
(struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
54+
instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
55+
MSVC and with C++ compilers. */
56+
#define FLEXIBLE_ARRAY_MEMBER 1
57+
4958
/* Define to 1 if you want National Language Support. (--enable-nls) */
5059
/* #undef ENABLE_NLS */
5160

0 commit comments

Comments
 (0)