[PATCH 2/3] build: find blkcnt_t size via array

Gustavo Zacarias gustavo at zacarias.com.ar
Mon Mar 31 06:31:00 MDT 2014


Using the same trick as commit 0d9bb86293c9d39298786df095c73a6251b08b7e
find blkcnt_t size via an array so that it can be determined via build
rather than running it.

Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar>
---
 source3/wscript | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 4fe49fa..a9d74a1 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -278,15 +278,15 @@ int main(int argc, char **argv)
 
     if "HAVE_BLKCNT_T" in conf.env:
 	conf.CHECK_CODE('''
-	return sizeof(blkcnt_t) == 4 ? 0 : 1''',
-		'SIZEOF_BLKCNT_T_4', execute=True,
+	static int test_array[1 - 2 * !(((long int)(sizeof(off_t))) <= 4)];''',
+		'SIZEOF_BLKCNT_T_4',
 		headers='replace.h sys/types.h sys/stat.h unistd.h',
 		msg="Checking whether blkcnt_t is 32 bit")
 
     if "HAVE_BLKCNT_T" in conf.env:
 	conf.CHECK_CODE('''
-	return sizeof(blkcnt_t) == 8 ? 0 : 1''',
-		'SIZEOF_BLKCNT_T_8', execute=True,
+	static int test_array[1 - 2 * !(((long int)(sizeof(off_t))) <= 8)];''',
+		'SIZEOF_BLKCNT_T_8',
 		headers='replace.h sys/types.h sys/stat.h unistd.h',
 		msg="Checking whether blkcnt_t is 64 bit")
 
-- 
1.8.3.2



More information about the samba-technical mailing list