+2005-10-04 Bruno Haible <bruno@clisp.org>
+
+ * verify.h (verify_true): Provide alternative definition for C++.
+
2005-10-04 Simon Josefsson <jas@extundo.com>
* getaddrinfo.h: Move sys/types.h include first, reported by "Mark
/* Verify requirement R at compile-time, as an integer constant expression.
Return true. */
-# define verify_true(R) \
- (!!sizeof \
- (struct { unsigned int verify_error_if_negative_size__ : (R) ? 1 : -1; }))
+# ifdef __cplusplus
+template <int w>
+ struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
+# define verify_true(R) \
+ (!!sizeof (verify_type__<(R) ? 1 : -1>))
+# else
+# define verify_true(R) \
+ (!!sizeof \
+ (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
+# endif
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. */