diff options
author | Gustavo Zacarias <gustavo@zacarias.com.ar> | 2014-01-31 06:53:44 -0300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-02-18 23:18:32 +0100 |
commit | 0d9bb86293c9d39298786df095c73a6251b08b7e (patch) | |
tree | eb86aee83d4458722b10dc2f1757201ec13fb9e6 /source3/libsmb/libsmb_setget.c | |
parent | cd655715b8ee0a4e681d67b3996f71017b941401 (diff) | |
download | samba-0d9bb86293c9d39298786df095c73a6251b08b7e.tar.gz samba-0d9bb86293c9d39298786df095c73a6251b08b7e.tar.xz samba-0d9bb86293c9d39298786df095c73a6251b08b7e.zip |
build: find FILE_OFFSET_BITS via array
This makes cross-compiling happy, use a trick similar to autoconf's
AC_CHECK_SIZEOF macro.
Basically we make an array:
static int array[1 - 2 * !(((long int)(sizeof(off_t))) < 8)];
This gives -1 multiplied by the negation of the condition
(sizeof(off_t) < 8) cast to a long int.
So if the condition is true it gives array[(-1 * 0)] (remember the
condition is cast and negated) thus passing a build test with a 0-sized
array.
If it's false it gives array[(-1 * 1)] thus failing with a
negative-sized array.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Feb 18 23:18:32 CET 2014 on sn-devel-104
Diffstat (limited to 'source3/libsmb/libsmb_setget.c')
0 files changed, 0 insertions, 0 deletions