source: gsdl/trunk/trunk/mg/lib/longlong.h@ 16583

Last change on this file since 16583 was 16583, checked in by davidb, 16 years ago

Undoing change commited in r16582

  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/**************************************************************************
2 *
3 * longlong.h -- Use of GCC's long long integer types
4 * Copyright (C) 1999 Tim A.H. Bell
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 **************************************************************************/
21
22#ifndef H_LONGLONG
23#define H_LONGLONG
24
25#ifndef __WIN32__
26#include "config.h"
27#endif
28
29/*
30 Use GCC's "long long" integer types for certain variables, to avoid
31 overflowing 32 bit integers.
32
33 Other files affected:
34
35 lib:
36 bitio_random.c
37 bitio_random.h
38
39 src/text:
40 ivf.pass1.c
41 ivf.pass2.c
42 build.h
43 mg_passes.c
44 text.h
45 mgstat.c
46*/
47
48/*#define TESTING_OVERFLOW*/
49
50#ifdef TESTING_OVERFLOW
51
52/* Test the overflow detection by using tiny (16-bit) types */
53typedef unsigned short int mg_ullong;
54typedef short int mg_llong;
55
56#define ULL_FS "u"
57#define LL_FS "d"
58
59#elif defined __GNUC__ && ! defined DISABLE_LONG_LONG
60
61/* We're using GCC, so it's okay to use "long long" (64-bit) types */
62#define USE_LONG_LONG
63
64typedef unsigned long long int mg_ullong;
65typedef long long int mg_llong;
66
67#define ULL_FS "llu"
68#define LL_FS "lld"
69
70#else
71
72/* Not using GCC, so fall back on plain "long" (32-bit) types */
73typedef unsigned long int mg_ullong;
74typedef long int mg_llong;
75
76#define ULL_FS "lu"
77#define LL_FS "ld"
78
79#endif /* __GNUC__ */
80
81#endif
Note: See TracBrowser for help on using the repository browser.