aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/TestFileOffsetBits.c
blob: 882abb4cfc665bb6ef434f840b17fafc1e45b65b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * This code was copied from http://www.gromacs.org/
 * and its toplevel COPYING file starts with:
 *
 * GROMACS is free software, distributed under the GNU General Public License
 * (GPL) Version 2.
 */

#include <sys/types.h>

/* detect failure even with -Wno-error on command line */
#pragma GCC diagnostic error "-Werror"

int main(int argc, char **argv)
{
  /* Cause a compile-time error if off_t is smaller than 64 bits */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
  /* silence unused errors */
  (void)off_t_is_large;
  (void)argc;
  (void)argv;
  return 0;
}